@arc-ui/components 11.5.0 → 11.6.0
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/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -61
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +9 -641
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -61
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +8 -640
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +2 -1
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +2 -1
- package/dist/Card/Card.cjs.d.ts +1 -130
- package/dist/Card/Card.cjs.js +12 -119
- package/dist/Card/Card.esm.d.ts +1 -130
- package/dist/Card/Card.esm.js +11 -118
- package/dist/Checkbox/Checkbox.cjs.d.ts +1 -64
- package/dist/Checkbox/Checkbox.cjs.js +10 -59
- package/dist/Checkbox/Checkbox.esm.d.ts +1 -64
- package/dist/Checkbox/Checkbox.esm.js +9 -58
- package/dist/Columns/Columns.cjs.d.ts +1 -76
- package/dist/Columns/Columns.cjs.js +6 -52
- package/dist/Columns/Columns.esm.d.ts +1 -76
- package/dist/Columns/Columns.esm.js +5 -51
- package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.cjs.js +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.js +1 -1
- package/dist/Filter/Filter.cjs.d.ts +1 -0
- package/dist/Filter/Filter.cjs.js +13 -0
- package/dist/Filter/Filter.esm.d.ts +1 -0
- package/dist/Filter/Filter.esm.js +5 -0
- package/dist/Filter/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +2 -3
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +2 -3
- package/dist/Group/Group.cjs.d.ts +1 -46
- package/dist/Group/Group.cjs.js +6 -43
- package/dist/Group/Group.esm.d.ts +1 -46
- package/dist/Group/Group.esm.js +5 -42
- package/dist/Pagination/Pagination.cjs.d.ts +20 -0
- package/dist/Pagination/Pagination.cjs.js +87 -0
- package/dist/Pagination/Pagination.esm.d.ts +20 -0
- package/dist/Pagination/Pagination.esm.js +79 -0
- package/dist/Pagination/package.json +7 -0
- package/dist/PaginationSimple/PaginationSimple.cjs.d.ts +28 -0
- package/dist/PaginationSimple/PaginationSimple.cjs.js +47 -0
- package/dist/PaginationSimple/PaginationSimple.esm.d.ts +28 -0
- package/dist/PaginationSimple/PaginationSimple.esm.js +39 -0
- package/dist/PaginationSimple/package.json +7 -0
- package/dist/Poster/Poster.cjs.d.ts +1 -81
- package/dist/Poster/Poster.cjs.js +8 -45
- package/dist/Poster/Poster.esm.d.ts +1 -81
- package/dist/Poster/Poster.esm.js +7 -44
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -85
- package/dist/RadioGroup/RadioGroup.cjs.js +8 -67
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -85
- package/dist/RadioGroup/RadioGroup.esm.js +7 -66
- package/dist/ScrollToTop/ScrollToTop.cjs.d.ts +25 -0
- package/dist/ScrollToTop/ScrollToTop.cjs.js +68 -0
- package/dist/ScrollToTop/ScrollToTop.esm.d.ts +25 -0
- package/dist/ScrollToTop/ScrollToTop.esm.js +60 -0
- package/dist/ScrollToTop/package.json +7 -0
- package/dist/Select/Select.cjs.d.ts +2 -2
- package/dist/Select/Select.cjs.js +2 -3
- package/dist/Select/Select.esm.d.ts +2 -2
- package/dist/Select/Select.esm.js +2 -3
- package/dist/SiteFooter/SiteFooter.cjs.d.ts +2 -62
- package/dist/SiteFooter/SiteFooter.cjs.js +10 -65
- package/dist/SiteFooter/SiteFooter.esm.d.ts +2 -62
- package/dist/SiteFooter/SiteFooter.esm.js +12 -66
- package/dist/SiteHeader/SiteHeader.cjs.d.ts +2 -260
- package/dist/SiteHeader/SiteHeader.cjs.js +16 -668
- package/dist/SiteHeader/SiteHeader.esm.d.ts +2 -260
- package/dist/SiteHeader/SiteHeader.esm.js +14 -666
- package/dist/Switch/Switch.cjs.d.ts +2 -2
- package/dist/Switch/Switch.cjs.js +2 -2
- package/dist/Switch/Switch.esm.d.ts +2 -2
- package/dist/Switch/Switch.esm.js +2 -2
- package/dist/TextArea/TextArea.cjs.d.ts +61 -0
- package/dist/TextArea/TextArea.cjs.js +87 -0
- package/dist/TextArea/TextArea.esm.d.ts +61 -0
- package/dist/TextArea/TextArea.esm.js +79 -0
- package/dist/TextArea/package.json +7 -0
- package/dist/TextInput/TextInput.cjs.d.ts +1 -75
- package/dist/TextInput/TextInput.cjs.js +9 -75
- package/dist/TextInput/TextInput.esm.d.ts +1 -75
- package/dist/TextInput/TextInput.esm.js +8 -74
- package/dist/UniversalHeader/UniversalHeader.cjs.d.ts +1 -26
- package/dist/UniversalHeader/UniversalHeader.cjs.js +5 -30
- package/dist/UniversalHeader/UniversalHeader.esm.d.ts +1 -26
- package/dist/UniversalHeader/UniversalHeader.esm.js +4 -29
- package/dist/_shared/cjs/Breadcrumbs-8b554370.d.ts +61 -0
- package/dist/_shared/cjs/Breadcrumbs-8b554370.js +106 -0
- package/dist/_shared/cjs/BtIconChevronLeftMid-df952a3e.js +31 -0
- package/dist/_shared/cjs/{Button-5dff284a.js → Button-27512fee.js} +6 -27
- package/dist/_shared/cjs/Card-804ab0e5.d.ts +136 -0
- package/dist/_shared/cjs/Card-804ab0e5.js +124 -0
- package/dist/_shared/cjs/Checkbox-21d3c4f6.d.ts +64 -0
- package/dist/_shared/cjs/Checkbox-21d3c4f6.js +62 -0
- package/dist/_shared/cjs/Columns-e90798f8.d.ts +76 -0
- package/dist/_shared/cjs/Columns-e90798f8.js +57 -0
- package/dist/_shared/cjs/{DisclosureMini-5af13d3c.js → DisclosureMini-067e0319.js} +3 -1
- package/dist/_shared/cjs/Filter-f7d2fbda.d.ts +83 -0
- package/dist/_shared/cjs/Filter-f7d2fbda.js +121 -0
- package/dist/_shared/cjs/{FormControl-42360ae8.d.ts → FormControl-9aaddd54.d.ts} +4 -0
- package/dist/_shared/cjs/{FormControl-42360ae8.js → FormControl-9aaddd54.js} +9 -9
- package/dist/_shared/cjs/Group-d83f8c2e.d.ts +46 -0
- package/dist/_shared/cjs/Group-d83f8c2e.js +48 -0
- package/dist/_shared/cjs/ItemGroup-5af4d600.d.ts +27 -0
- package/dist/_shared/cjs/NavItem-df20237c.d.ts +43 -0
- package/dist/_shared/cjs/NavItemWithSubNav-65f21828.d.ts +49 -0
- package/dist/_shared/cjs/Poster-e05bbe13.d.ts +81 -0
- package/dist/_shared/cjs/Poster-e05bbe13.js +50 -0
- package/dist/_shared/cjs/RadioGroup-81805ef9.d.ts +97 -0
- package/dist/_shared/cjs/RadioGroup-81805ef9.js +70 -0
- package/dist/_shared/cjs/SiteFooter-c540b5f1.d.ts +62 -0
- package/dist/_shared/cjs/SiteFooter-c540b5f1.js +73 -0
- package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +78 -0
- package/dist/_shared/cjs/SiteHeader.rehydrator-f7fa2efe.d.ts +78 -0
- package/dist/_shared/cjs/SiteHeader.rehydrator-f7fa2efe.js +673 -0
- package/dist/_shared/cjs/SubNavItem-a84d1bf4.d.ts +48 -0
- package/dist/_shared/cjs/TextInput-33314fc4.d.ts +10 -0
- package/dist/_shared/cjs/TextInput-33314fc4.js +78 -0
- package/dist/_shared/cjs/TextInput-7ed03a48.d.ts +75 -0
- package/dist/_shared/cjs/UniversalHeader-cc1d9e5a.d.ts +26 -0
- package/dist/_shared/cjs/UniversalHeader-cc1d9e5a.js +35 -0
- package/dist/_shared/cjs/debounce-506538c5.js +544 -0
- package/dist/_shared/cjs/index-699086a7.d.ts +2 -0
- package/dist/_shared/cjs/index-74488a9f.d.ts +2 -0
- package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
- package/dist/_shared/cjs/index-e340924e.d.ts +2 -0
- package/dist/_shared/cjs/index-e6d20018.d.ts +3 -0
- package/dist/_shared/cjs/index-eb06f640.d.ts +2 -0
- package/dist/_shared/cjs/index-f419cf04.d.ts +2 -0
- package/dist/_shared/esm/Breadcrumbs-04590057.d.ts +61 -0
- package/dist/_shared/esm/Breadcrumbs-04590057.js +100 -0
- package/dist/_shared/esm/BtIconChevronLeftMid-9f4f3a3d.js +25 -0
- package/dist/_shared/esm/{Button-61241dd0.js → Button-d319fa11.js} +2 -23
- package/dist/_shared/esm/Card-e79eb6c8.d.ts +136 -0
- package/dist/_shared/esm/Card-e79eb6c8.js +118 -0
- package/dist/_shared/esm/Checkbox-94300d8c.d.ts +64 -0
- package/dist/_shared/esm/Checkbox-94300d8c.js +56 -0
- package/dist/_shared/esm/Columns-8704515b.d.ts +76 -0
- package/dist/_shared/esm/Columns-8704515b.js +51 -0
- package/dist/_shared/esm/{DisclosureMini-322fccc0.js → DisclosureMini-022beae3.js} +3 -1
- package/dist/_shared/esm/Filter-41b391e3.d.ts +83 -0
- package/dist/_shared/esm/Filter-41b391e3.js +115 -0
- package/dist/_shared/esm/{FormControl-0744f93f.d.ts → FormControl-5e3fdca3.d.ts} +4 -0
- package/dist/_shared/esm/{FormControl-0744f93f.js → FormControl-5e3fdca3.js} +9 -9
- package/dist/_shared/esm/Group-d62c3f56.d.ts +46 -0
- package/dist/_shared/esm/Group-d62c3f56.js +42 -0
- package/dist/_shared/esm/ItemGroup-5af4d600.d.ts +27 -0
- package/dist/_shared/esm/NavItem-df20237c.d.ts +43 -0
- package/dist/_shared/esm/NavItemWithSubNav-65f21828.d.ts +49 -0
- package/dist/_shared/esm/Poster-107d6954.d.ts +81 -0
- package/dist/_shared/esm/Poster-107d6954.js +44 -0
- package/dist/_shared/esm/RadioGroup-1fd0f389.d.ts +97 -0
- package/dist/_shared/esm/RadioGroup-1fd0f389.js +64 -0
- package/dist/_shared/esm/SiteFooter-8075a9bd.d.ts +62 -0
- package/dist/_shared/esm/SiteFooter-8075a9bd.js +67 -0
- package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +78 -0
- package/dist/_shared/esm/SiteHeader.rehydrator-4da8ac64.d.ts +78 -0
- package/dist/_shared/esm/SiteHeader.rehydrator-4da8ac64.js +666 -0
- package/dist/_shared/esm/SubNavItem-a84d1bf4.d.ts +48 -0
- package/dist/_shared/esm/TextInput-1631dbc4.d.ts +10 -0
- package/dist/_shared/esm/TextInput-1631dbc4.js +72 -0
- package/dist/_shared/esm/TextInput-7ed03a48.d.ts +75 -0
- package/dist/_shared/esm/UniversalHeader-7926abde.d.ts +26 -0
- package/dist/_shared/esm/UniversalHeader-7926abde.js +29 -0
- package/dist/_shared/esm/debounce-e228705f.js +542 -0
- package/dist/_shared/esm/index-699086a7.d.ts +2 -0
- package/dist/_shared/esm/index-74488a9f.d.ts +2 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
- package/dist/_shared/esm/index-e340924e.d.ts +2 -0
- package/dist/_shared/esm/index-e6d20018.d.ts +3 -0
- package/dist/_shared/esm/index-eb06f640.d.ts +2 -0
- package/dist/_shared/esm/index-f419cf04.d.ts +2 -0
- package/dist/index.es.js +178 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +179 -26
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Filter/Filter.d.ts +38 -0
- package/dist/types/components/Filter/FilterControls/FilterControl/FilterControl.d.ts +16 -0
- package/dist/types/components/Filter/FilterControls/FilterControls.d.ts +12 -0
- package/dist/types/components/Filter/FilterItems/FilterItem/FilterItem.d.ts +12 -0
- package/dist/types/components/Filter/FilterItems/FilterItems.d.ts +12 -0
- package/dist/types/components/Filter/index.d.ts +1 -0
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/Pagination/Pagination.d.ts +19 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +27 -0
- package/dist/types/components/PaginationSimple/index.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/ScrollToTop/ScrollToTop.d.ts +24 -0
- package/dist/types/components/ScrollToTop/index.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/TextArea/TextArea.d.ts +60 -0
- package/dist/types/components/TextArea/index.d.ts +1 -0
- package/dist/types/components/TextInput/TextInput.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/hooks/use-pagination.d.ts +1 -0
- package/dist/types/styles.d.ts +7 -2
- package/package.json +4 -4
- /package/dist/_shared/cjs/{Button-5dff284a.d.ts → Button-27512fee.d.ts} +0 -0
- /package/dist/_shared/cjs/{DisclosureMini-5af13d3c.d.ts → DisclosureMini-067e0319.d.ts} +0 -0
- /package/dist/_shared/esm/{Button-61241dd0.d.ts → Button-d319fa11.d.ts} +0 -0
- /package/dist/_shared/esm/{DisclosureMini-322fccc0.d.ts → DisclosureMini-022beae3.d.ts} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
+
import React__default, { useEffect } from 'react';
|
|
4
|
+
import { s as suffixModifier } from './suffix-modifier-7e640670.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Use `Columns` to compose layouts on a 12-column grid.
|
|
8
|
+
*/
|
|
9
|
+
var Columns = function (_a) {
|
|
10
|
+
var children = _a.children, _b = _a.isGutterless, isGutterless = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isGutterless"]);
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
React__default.Children.map(children, function (item) {
|
|
13
|
+
if (item && item.type !== Col) {
|
|
14
|
+
throw new Error("Illegal child passed to <Columns />. Ensure to only use <Columns.Col />.");
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}, [children]);
|
|
18
|
+
return (React__default.createElement("div", __assign({ className: classNames({
|
|
19
|
+
"arc-Columns": true,
|
|
20
|
+
"arc-Columns--gutterless": isGutterless
|
|
21
|
+
}) }, filterDataAttrs(props)),
|
|
22
|
+
React__default.createElement("div", { className: "arc-Columns-inner" }, children)));
|
|
23
|
+
};
|
|
24
|
+
var Col = function (_a) {
|
|
25
|
+
var _b;
|
|
26
|
+
var align = _a.align, children = _a.children, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, offset = _a.offset, offsetS = _a.offsetS, offsetM = _a.offsetM, offsetL = _a.offsetL, offsetXL = _a.offsetXL, span = _a.span, spanS = _a.spanS, spanM = _a.spanM, spanL = _a.spanL, spanXL = _a.spanXL, props = __rest(_a, ["align", "children", "isDebugVisible", "offset", "offsetS", "offsetM", "offsetL", "offsetXL", "span", "spanS", "spanM", "spanL", "spanXL"]);
|
|
27
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
28
|
+
_b["arc-Columns-col"] = true,
|
|
29
|
+
_b[suffixModifier("arc-Columns-col--align", align || "")] = align,
|
|
30
|
+
_b["arc-Columns-col--".concat(span)] = typeof span !== "undefined",
|
|
31
|
+
_b["arc-Columns-col--s".concat(spanS)] = typeof spanS !== "undefined",
|
|
32
|
+
_b["arc-Columns-col--m".concat(spanM)] = typeof spanM !== "undefined",
|
|
33
|
+
_b["arc-Columns-col--l".concat(spanL)] = typeof spanL !== "undefined",
|
|
34
|
+
_b["arc-Columns-col--xL".concat(spanXL)] = typeof spanXL !== "undefined",
|
|
35
|
+
_b["arc-Columns-col--offset"] = typeof offset !== "undefined" ||
|
|
36
|
+
typeof offsetS !== "undefined" ||
|
|
37
|
+
typeof offsetM !== "undefined" ||
|
|
38
|
+
typeof offsetL !== "undefined" ||
|
|
39
|
+
typeof offsetXL !== "undefined",
|
|
40
|
+
_b["arc-Columns-col--offset".concat(offset)] = typeof offset !== "undefined",
|
|
41
|
+
_b["arc-Columns-col--offsetS".concat(offsetS)] = typeof offsetS !== "undefined",
|
|
42
|
+
_b["arc-Columns-col--offsetM".concat(offsetM)] = typeof offsetM !== "undefined",
|
|
43
|
+
_b["arc-Columns-col--offsetL".concat(offsetL)] = typeof offsetL !== "undefined",
|
|
44
|
+
_b["arc-Columns-col--offsetXL".concat(offsetXL)] = typeof offsetXL !== "undefined",
|
|
45
|
+
_b["arc-Columns-col--debugVisible"] = isDebugVisible,
|
|
46
|
+
_b)) }, filterDataAttrs(props)), children));
|
|
47
|
+
};
|
|
48
|
+
Col.displayName = "Columns.Col";
|
|
49
|
+
Columns.Col = Col;
|
|
50
|
+
|
|
51
|
+
export { Columns as C };
|
|
@@ -25,7 +25,9 @@ var DisclosureMini = function (_a) {
|
|
|
25
25
|
"arc-DisclosureMini-summary--icon-left": iconPosition === "left",
|
|
26
26
|
"arc-DisclosureMini-summary--icon-right": iconPosition === "right"
|
|
27
27
|
}), onClick: handleOnClick, "aria-expanded": disclousreState },
|
|
28
|
-
React__default.createElement("
|
|
28
|
+
React__default.createElement("div", { className: classNames("arc-DisclosureMini-summary-icon", {
|
|
29
|
+
"arc-DisclosureMini-summary-icon--small": size === "s"
|
|
30
|
+
}) },
|
|
29
31
|
React__default.createElement(BtIconChevronDown2Px_2, null)),
|
|
30
32
|
React__default.createElement(Text, { size: size === "l" ? "m" : "s" }, summary)),
|
|
31
33
|
React__default.createElement("div", { className: "arc-DisclosureMini-details" },
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare const FilterItems: FC<FilterItemsProps>;
|
|
3
|
+
interface FilterItemsProps {
|
|
4
|
+
/**
|
|
5
|
+
* Render children of `<Filter.Items />`. This should only use `<Filter.Item />`
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Determine the display style of `<Filter.Item />`
|
|
10
|
+
*/
|
|
11
|
+
displayType?: "grid" | "list";
|
|
12
|
+
}
|
|
13
|
+
declare const FilterItem: FC<FilterItemProps>;
|
|
14
|
+
interface FilterItemProps {
|
|
15
|
+
/**
|
|
16
|
+
* Content to display within `Filter.Item`
|
|
17
|
+
*/
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Attach Tags to content provided within `Filter.Item`
|
|
21
|
+
*/
|
|
22
|
+
tags: string[];
|
|
23
|
+
}
|
|
24
|
+
declare const FilterControls: FC<FilterControlsProps>;
|
|
25
|
+
interface FilterControlsProps {
|
|
26
|
+
/**
|
|
27
|
+
* Contents of the `<FilterControls />` Should contain `<FilterControl />`
|
|
28
|
+
*/
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Detmine how to align <FilterControl /> with in <FilterControls />. Default `center`
|
|
32
|
+
*/
|
|
33
|
+
controlsAlignment?: "left" | "right" | "center";
|
|
34
|
+
}
|
|
35
|
+
declare const FilterControl: FC<FilterControlProps>;
|
|
36
|
+
interface FilterControlProps {
|
|
37
|
+
/**
|
|
38
|
+
* Name of the `<FilterControl />`
|
|
39
|
+
*/
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Determine if the `<FilterControl />` is selected
|
|
43
|
+
*/
|
|
44
|
+
isSelected?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* onClick handler
|
|
47
|
+
*/
|
|
48
|
+
onClick?: () => void;
|
|
49
|
+
}
|
|
50
|
+
/** use `Filter` for interactive elements that filter and categorise page content. */
|
|
51
|
+
declare const Filter: FC<FilterProps> & {
|
|
52
|
+
Item: typeof FilterItem;
|
|
53
|
+
Items: typeof FilterItems;
|
|
54
|
+
Control: typeof FilterControl;
|
|
55
|
+
Controls: typeof FilterControls;
|
|
56
|
+
};
|
|
57
|
+
interface FilterProps {
|
|
58
|
+
/**
|
|
59
|
+
* Contents of the `<Filter />` Should contain `<Filter.Item />`
|
|
60
|
+
*/
|
|
61
|
+
children?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* onChange handler called everytime `<FilterControl />` is pressed
|
|
64
|
+
*/
|
|
65
|
+
onChange?: (selectedControls: string[]) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Detmine how to display the content within `<Filter.Items />`. Default is `grid`
|
|
68
|
+
*/
|
|
69
|
+
displayType?: FilterItemsProps["displayType"];
|
|
70
|
+
/**
|
|
71
|
+
* Detmine how to align <Filter.Controls />. Default `center`
|
|
72
|
+
*/
|
|
73
|
+
controlsAlignment?: FilterControlsProps["controlsAlignment"];
|
|
74
|
+
/**
|
|
75
|
+
* Detmine if the `<Filter.Control />` have to partially match or match all
|
|
76
|
+
*/
|
|
77
|
+
logicType?: "AND" | "OR";
|
|
78
|
+
/**
|
|
79
|
+
* Detmine what is display when no items match the filtering criteria
|
|
80
|
+
*/
|
|
81
|
+
error?: ReactNode;
|
|
82
|
+
}
|
|
83
|
+
export { FilterItems, FilterItemsProps, FilterItem, FilterItemProps, FilterControls, FilterControlsProps, FilterControl, FilterControlProps, Filter, FilterProps };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs, b as __spreadArray } from './filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import React__default, { useContext, useState, useEffect } from 'react';
|
|
3
|
+
import { C as Context } from './Surface-bb100ef8.js';
|
|
4
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
5
|
+
|
|
6
|
+
var FilterControl = function (_a) {
|
|
7
|
+
var children = _a.children, onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b;
|
|
8
|
+
var surface = useContext(Context).surface;
|
|
9
|
+
var _c = useState(isSelected), selected = _c[0], setSelected = _c[1];
|
|
10
|
+
var onClickHandler = function () {
|
|
11
|
+
onClick && onClick();
|
|
12
|
+
setSelected(function (previousValue) { return !previousValue; });
|
|
13
|
+
};
|
|
14
|
+
return (React__default.createElement("button", { className: classNames("arc-FilterControl", {
|
|
15
|
+
"arc-FilterControl--onDarkSurface": surface === "dark",
|
|
16
|
+
"arc-FilterControl--selected": selected
|
|
17
|
+
}), onClick: onClickHandler, tabIndex: 0 },
|
|
18
|
+
React__default.createElement("div", { className: "arc-FilterControl-text" }, children)));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var FilterControls = function (_a) {
|
|
22
|
+
var children = _a.children, controlsAlignment = _a.controlsAlignment, props = __rest(_a, ["children", "controlsAlignment"]);
|
|
23
|
+
return (React__default.createElement("div", __assign({ className: classNames("arc-FilterControls", {
|
|
24
|
+
"arc-FilterControls--alignLeft": controlsAlignment === "left",
|
|
25
|
+
"arc-FilterControls--alignRight": controlsAlignment === "right"
|
|
26
|
+
}) }, filterDataAttrs(props)), children));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var FilterItem = function (_a) {
|
|
30
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
31
|
+
return (React__default.createElement("div", __assign({ className: "arc-FilterItem" }, filterDataAttrs(props)), children));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var FilterItems = function (_a) {
|
|
35
|
+
var children = _a.children, _b = _a.displayType, displayType = _b === void 0 ? "grid" : _b, props = __rest(_a, ["children", "displayType"]);
|
|
36
|
+
return (React__default.createElement("div", __assign({ className: classNames("arc-FilterItems", {
|
|
37
|
+
"arc-FilterItems--list": displayType === "list",
|
|
38
|
+
"arc-FilterItems--grid": displayType === "grid"
|
|
39
|
+
}) }, filterDataAttrs(props)), displayType === "list"
|
|
40
|
+
? React__default.Children.toArray(children).map(function (child, index, array) { return (React__default.createElement(React__default.Fragment, { key: index },
|
|
41
|
+
child,
|
|
42
|
+
index !== array.length - 1 && (React__default.createElement(React__default.Fragment, null,
|
|
43
|
+
React__default.createElement("div", { className: "arc-FilterItems-separator", "data-testid": "arc-FilterItems-separator" }))))); })
|
|
44
|
+
: children));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** use `Filter` for interactive elements that filter and categorise page content. */
|
|
48
|
+
var Filter = function (_a) {
|
|
49
|
+
var children = _a.children, onChange = _a.onChange, displayType = _a.displayType, controlsAlignment = _a.controlsAlignment, _b = _a.logicType, logicType = _b === void 0 ? "OR" : _b, error = _a.error, props = __rest(_a, ["children", "onChange", "displayType", "controlsAlignment", "logicType", "error"]);
|
|
50
|
+
var _c = useState([]), selectedControls = _c[0], setSelectedControls = _c[1];
|
|
51
|
+
var controls = React__default.Children.toArray(children).find(function (child) { return React__default.isValidElement(child) && child.type === FilterControls; });
|
|
52
|
+
var items = React__default.Children.toArray(children).find(function (child) { return React__default.isValidElement(child) && child.type === FilterItems; });
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
var initialSelectedControls = [];
|
|
55
|
+
if (controls && React__default.isValidElement(controls)) {
|
|
56
|
+
React__default.Children.forEach(controls.props.children, function (child) {
|
|
57
|
+
if (child.props.isSelected) {
|
|
58
|
+
initialSelectedControls.push(child.props.children);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
setSelectedControls(initialSelectedControls);
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
}, []);
|
|
65
|
+
var handleControlClick = function (clickedControl) {
|
|
66
|
+
if (selectedControls.includes(clickedControl)) {
|
|
67
|
+
var updatedControls = selectedControls.filter(function (control) { return control !== clickedControl; });
|
|
68
|
+
setSelectedControls(updatedControls);
|
|
69
|
+
if (onChange) {
|
|
70
|
+
onChange(updatedControls);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
var updatedControls = __spreadArray(__spreadArray([], selectedControls, true), [clickedControl], false);
|
|
75
|
+
setSelectedControls(updatedControls);
|
|
76
|
+
if (onChange) {
|
|
77
|
+
onChange(updatedControls);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var filterItems = React__default.Children.toArray(items && React__default.isValidElement(items) && items.props.children);
|
|
82
|
+
var filteredItems = filterItems.filter(function (filteredItem) {
|
|
83
|
+
// If no tags are selected, show all items
|
|
84
|
+
if (selectedControls.length === 0) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
// If logicType is "AND", all selected tags should be present in the item's tags
|
|
88
|
+
if (logicType === "AND") {
|
|
89
|
+
return selectedControls.every(function (control) {
|
|
90
|
+
return filteredItem.props.tags.includes(control);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// Check if item has tags property and if any selected tags are present in item's tags
|
|
95
|
+
return selectedControls.some(function (control) {
|
|
96
|
+
return filteredItem.props.tags.includes(control);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return (React__default.createElement("div", __assign({ className: "arc-Filter" }, filterDataAttrs(props)),
|
|
101
|
+
React__default.createElement(FilterControls, { controlsAlignment: controlsAlignment }, controls &&
|
|
102
|
+
React__default.isValidElement(controls) &&
|
|
103
|
+
React__default.Children.map(controls.props.children, function (control, index) { return (React__default.createElement(FilterControl, { key: index, onClick: function () { return handleControlClick(control.props.children); }, isSelected: control.props.isSelected }, control.props.children)); })),
|
|
104
|
+
filteredItems.length === 0 ? (React__default.createElement(React__default.Fragment, null, error)) : (React__default.createElement(FilterItems, { displayType: displayType }, filteredItems.map(function (item) { return item.props.children; })))));
|
|
105
|
+
};
|
|
106
|
+
Filter.Controls = FilterControls;
|
|
107
|
+
Filter.Control = FilterControl;
|
|
108
|
+
Filter.Items = FilterItems;
|
|
109
|
+
Filter.Item = FilterItem;
|
|
110
|
+
FilterControls.displayName = "Filter.Controls";
|
|
111
|
+
FilterControl.displayName = "Filter.Control";
|
|
112
|
+
FilterItems.displayName = "Filter.Items";
|
|
113
|
+
FilterItem.displayName = "Filter.Item";
|
|
114
|
+
|
|
115
|
+
export { Filter as F };
|
|
@@ -87,6 +87,10 @@ interface FormControlProps {
|
|
|
87
87
|
* onClick handler for FormControlDisclosure
|
|
88
88
|
*/
|
|
89
89
|
onClickDisclosure?: () => void;
|
|
90
|
+
/**
|
|
91
|
+
* Optional additional information for the FormControl.
|
|
92
|
+
*/
|
|
93
|
+
supplementaryInfo?: React.ReactNode;
|
|
90
94
|
/**
|
|
91
95
|
* Position helper text under label. This is set to `false` by default.
|
|
92
96
|
*/
|
|
@@ -3,8 +3,7 @@ import { c as classNames } from './index-2ae58626.js';
|
|
|
3
3
|
import React__default, { createContext, useContext } from 'react';
|
|
4
4
|
import { B as BtIconAlert_2 } from './BtIconAlert-55a6ed5c.js';
|
|
5
5
|
import { C as Context$1 } from './Surface-bb100ef8.js';
|
|
6
|
-
import { D as DisclosureMini } from './DisclosureMini-
|
|
7
|
-
import { V as VerticalSpace } from './VerticalSpace-93980c9c.js';
|
|
6
|
+
import { D as DisclosureMini } from './DisclosureMini-022beae3.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Optionally define ariaDescribedBy if errorMessage or helper exist.
|
|
@@ -42,7 +41,7 @@ var Provider = Context.Provider;
|
|
|
42
41
|
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
43
42
|
*/
|
|
44
43
|
var FormControl = function (_a) {
|
|
45
|
-
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, _e = _a.helperUnderLabel, helperUnderLabel = _e === void 0 ? false : _e, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
44
|
+
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, supplementaryInfo = _a.supplementaryInfo, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, _e = _a.helperUnderLabel, helperUnderLabel = _e === void 0 ? false : _e, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "supplementaryInfo", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
46
45
|
var surface = useContext(Context$1).surface;
|
|
47
46
|
var _f = useAriaDescribedby({
|
|
48
47
|
disclosureText: disclosureText,
|
|
@@ -77,12 +76,13 @@ var FormControl = function (_a) {
|
|
|
77
76
|
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
78
77
|
helperUnderLabel && (React__default.createElement(React__default.Fragment, null, helper && (React__default.createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
|
|
79
78
|
children,
|
|
80
|
-
|
|
81
|
-
React__default.createElement("
|
|
82
|
-
React__default.createElement(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
React__default.createElement("div", { className: "arc-FormControl-info" },
|
|
80
|
+
!helperUnderLabel && (React__default.createElement("div", { className: "arc-FormControl-helperContainer" }, errorMessage ? (React__default.createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
81
|
+
React__default.createElement("span", { className: "arc-FormControl-error--icon" },
|
|
82
|
+
React__default.createElement(BtIconAlert_2, null)),
|
|
83
|
+
errorMessage)) : disclosureTitle ? (React__default.createElement(React__default.Fragment, null,
|
|
84
|
+
React__default.createElement(DisclosureMini, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText))) : (helper && (React__default.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))),
|
|
85
|
+
supplementaryInfo && (React__default.createElement("div", { className: "arc-FormControl-supplementaryInfo" }, supplementaryInfo))))));
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
export { Context as C, FormControl as F, useAriaDescribedby as u };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Use `Group` to arrange flexible items in a row.
|
|
4
|
+
*/
|
|
5
|
+
declare const Group: FC<GroupProps> & {
|
|
6
|
+
Item: typeof GroupItem;
|
|
7
|
+
};
|
|
8
|
+
declare const GroupItem: FC<ItemProps>;
|
|
9
|
+
interface ItemProps {
|
|
10
|
+
/**
|
|
11
|
+
* Content to display in the Group.Item.
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Should the Group.Item be visible for debugging and documentation
|
|
16
|
+
* purposes?
|
|
17
|
+
*/
|
|
18
|
+
isDebugVisible?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Should the Group.Item stretch to fill the available space?
|
|
21
|
+
*/
|
|
22
|
+
grow?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface GroupProps {
|
|
25
|
+
/**
|
|
26
|
+
* Contents of the Group. Should only contain `Group.Item`.
|
|
27
|
+
*/
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Should all Group.Items in the Group stretch to fill the available space?
|
|
31
|
+
*/
|
|
32
|
+
grow?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Should all Group.Items in the Group stretch to fill the available space with equal widths?
|
|
35
|
+
*/
|
|
36
|
+
growEqual?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Should a border be shown between Group.Items? **Warning: Sets CSS property `overflow:hidden`.**
|
|
39
|
+
*/
|
|
40
|
+
gutterBorder?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Should wrapping of Group.Items in the Group be disabled?
|
|
43
|
+
*/
|
|
44
|
+
noWrap?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export { Group, GroupItem, ItemProps, GroupProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
+
import React__default, { useContext, useEffect } from 'react';
|
|
4
|
+
import { C as Context } from './Surface-bb100ef8.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Use `Group` to arrange flexible items in a row.
|
|
8
|
+
*/
|
|
9
|
+
var Group = function (_a) {
|
|
10
|
+
var _b;
|
|
11
|
+
var children = _a.children, _c = _a.grow, grow = _c === void 0 ? false : _c, _d = _a.growEqual, growEqual = _d === void 0 ? false : _d, _e = _a.gutterBorder, gutterBorder = _e === void 0 ? false : _e, _f = _a.noWrap, noWrap = _f === void 0 ? false : _f, props = __rest(_a, ["children", "grow", "growEqual", "gutterBorder", "noWrap"]);
|
|
12
|
+
var surface = useContext(Context).surface;
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
React__default.Children.map(children, function (item) {
|
|
15
|
+
if (item && item.type !== GroupItem) {
|
|
16
|
+
throw new Error("Illegal child passed to <Group />. Ensure to only use <Group.Item />.");
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}, [children]);
|
|
20
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
21
|
+
_b["arc-Group"] = true,
|
|
22
|
+
_b["arc-Group--grow"] = grow,
|
|
23
|
+
_b["arc-Group--growEqual"] = growEqual,
|
|
24
|
+
_b["arc-Group--gutterBorder"] = gutterBorder,
|
|
25
|
+
_b["arc-Group--noWrap"] = noWrap,
|
|
26
|
+
_b["arc-Group--onDarkSurface"] = surface === "dark",
|
|
27
|
+
_b)) }, filterDataAttrs(props)),
|
|
28
|
+
React__default.createElement("div", { className: "arc-Group-inner" }, children)));
|
|
29
|
+
};
|
|
30
|
+
var GroupItem = function (_a) {
|
|
31
|
+
var _b;
|
|
32
|
+
var children = _a.children, _c = _a.grow, grow = _c === void 0 ? false : _c, _d = _a.isDebugVisible, isDebugVisible = _d === void 0 ? false : _d, props = __rest(_a, ["children", "grow", "isDebugVisible"]);
|
|
33
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
34
|
+
_b["arc-Group-item"] = true,
|
|
35
|
+
_b["arc-Group-item--grow"] = grow,
|
|
36
|
+
_b["arc-Group-item--debugVisible"] = isDebugVisible,
|
|
37
|
+
_b)) }, filterDataAttrs(props)), children));
|
|
38
|
+
};
|
|
39
|
+
GroupItem.displayName = "Group.Item";
|
|
40
|
+
Group.Item = GroupItem;
|
|
41
|
+
|
|
42
|
+
export { Group as G };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare const ItemGroup: FC<ItemGroupProps>;
|
|
3
|
+
interface ItemGroupProps {
|
|
4
|
+
/**
|
|
5
|
+
* Contents of the ItemGroup. Must be Item components.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* A top-level URL for the ItemGroup to link to.
|
|
10
|
+
*/
|
|
11
|
+
href?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Title text to be displayed in the ItemGroup summary.
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text to display in top-level link inside the ItemGroup in narrow viewports.
|
|
18
|
+
* Only applies if `href` is present. If not provided, top-level link text
|
|
19
|
+
* will be automatically generated from `title`.
|
|
20
|
+
*/
|
|
21
|
+
viewAllTitle?: string;
|
|
22
|
+
/**
|
|
23
|
+
* On click handler.
|
|
24
|
+
*/
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export { ItemGroup, ItemGroupProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare const NavItem: FC<NavItemProps>;
|
|
3
|
+
interface NavItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Contents of the NavItem. Must be SiteHeader.ItemGroup or
|
|
6
|
+
* SiteHeader.Column components.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* A top-level URL for the NavItem to link to.
|
|
11
|
+
*
|
|
12
|
+
* When `children` are not present, the URL to link to when the NavItem is
|
|
13
|
+
* clicked or touched.
|
|
14
|
+
*
|
|
15
|
+
* When `children` are present, the URL to link to when a top-level link
|
|
16
|
+
* inside the NavItem panel is clicked or touched.
|
|
17
|
+
*/
|
|
18
|
+
href?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Should the NavItem be highlighted as the current item/page? Only applies if
|
|
21
|
+
* `children` are not present (and `href` is present).
|
|
22
|
+
*/
|
|
23
|
+
isCurrent?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Content to display in the NavItem panel promo area.
|
|
26
|
+
*/
|
|
27
|
+
promo?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Top-level text to display in the NavItem.
|
|
30
|
+
*/
|
|
31
|
+
title: string;
|
|
32
|
+
/**
|
|
33
|
+
* Text to display in top-level link inside the NavItem panel. Only
|
|
34
|
+
* applies if both `children` are present and `href` is true. If not
|
|
35
|
+
* provided, top-level link text will be automatically generated from `title`.
|
|
36
|
+
*/
|
|
37
|
+
viewAllTitle?: string;
|
|
38
|
+
/**
|
|
39
|
+
* On click handler.
|
|
40
|
+
*/
|
|
41
|
+
onClick?: () => void;
|
|
42
|
+
}
|
|
43
|
+
export { NavItem, NavItemProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactElement, ReactNode } from "react";
|
|
4
|
+
declare const Context: React.Context<{
|
|
5
|
+
navItem: React.MutableRefObject<HTMLLIElement> | null;
|
|
6
|
+
subTitle: string | null;
|
|
7
|
+
}>;
|
|
8
|
+
declare const NavItemWithSubNav: FC<NavItemWithSubNavProps>;
|
|
9
|
+
interface NavItemWithSubNavProps {
|
|
10
|
+
/**
|
|
11
|
+
* The URL to link to when a top-level link inside the NavItemWithSubNav panel
|
|
12
|
+
* is clicked or touched.
|
|
13
|
+
*/
|
|
14
|
+
href?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Content to be displayed in the first slot of the NavItemWithSubNav. Must be
|
|
17
|
+
* a single SiteHeader.SubNavItem component.
|
|
18
|
+
*/
|
|
19
|
+
slot1: ReactElement;
|
|
20
|
+
/**
|
|
21
|
+
* Content to be displayed in the second slot of the NavItemWithSubNav. Must
|
|
22
|
+
* be a single SiteHeader.SubNavItem component.
|
|
23
|
+
*/
|
|
24
|
+
slot2: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Content to be displayed in the third slot of the NavItemWithSubNav. Must be
|
|
27
|
+
* a single SiteHeader.SubNavItem component.
|
|
28
|
+
*/
|
|
29
|
+
slot3?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Title text to display inside the NavItemWithSubNav panel.
|
|
32
|
+
*/
|
|
33
|
+
subTitle?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Top-level text to display in the NavItemWithSubNav.
|
|
36
|
+
*/
|
|
37
|
+
title: string;
|
|
38
|
+
/**
|
|
39
|
+
* Text to display in top-level link inside the NavItemWithSubNav panel. Only
|
|
40
|
+
* applies if `href` is true. If not provided, text will be automatically
|
|
41
|
+
* generated from `title`.
|
|
42
|
+
*/
|
|
43
|
+
viewAllTitle?: string;
|
|
44
|
+
/**
|
|
45
|
+
* view all click handler.
|
|
46
|
+
*/
|
|
47
|
+
onViewAllClick?: () => void;
|
|
48
|
+
}
|
|
49
|
+
export { NavItemWithSubNav, NavItemWithSubNavProps, Context as NavItemContext };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
|
+
import { anchorPoints } from "./index-9483ad5f";
|
|
4
|
+
import { loadingOptions } from "./Image-3596ce55";
|
|
5
|
+
declare const PosterVideo: FC<PosterVideoProps>;
|
|
6
|
+
interface PosterVideoProps {
|
|
7
|
+
/**
|
|
8
|
+
* Anchor point for the Poster.Video,
|
|
9
|
+
*/
|
|
10
|
+
anchor?: typeof anchorPoints[number];
|
|
11
|
+
/**
|
|
12
|
+
* Should the Poster.Video autoplay?
|
|
13
|
+
*/
|
|
14
|
+
autoPlay?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* HTML video sources for the Poster.Video. [See MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video).
|
|
17
|
+
*/
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Should the Poster.Video loop?
|
|
21
|
+
*/
|
|
22
|
+
loop?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const PosterImage: FC<PosterImageProps>;
|
|
25
|
+
interface PosterImageProps {
|
|
26
|
+
/**
|
|
27
|
+
* Alternative text for the Poster.Image, shown if the image cannot be displayed. Consider avoiding this prop if the image is for decorative purposes only.
|
|
28
|
+
*/
|
|
29
|
+
alt?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Anchor point for the Poster.Image.
|
|
32
|
+
*/
|
|
33
|
+
anchor?: typeof anchorPoints[number];
|
|
34
|
+
/**
|
|
35
|
+
* Loading behaviour of the Poster.Image.
|
|
36
|
+
*/
|
|
37
|
+
loading?: typeof loadingOptions[number];
|
|
38
|
+
/**
|
|
39
|
+
* The HTML [sizes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Example_4_Using_the_srcset_and_sizes_attributes) attribute for the Poster.Image. Required if `srcSet` is defined.
|
|
40
|
+
*/
|
|
41
|
+
sizes?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The `src` for the Poster.Image. Used if srcSet is not defined, or as a fallback.
|
|
44
|
+
*/
|
|
45
|
+
src: string;
|
|
46
|
+
/**
|
|
47
|
+
* A comma-separated list indicating a set of possible sources for the user agent to use for different screen sizes for the Poster.Image. Same format as [srcSet](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Example_4_Using_the_srcset_and_sizes_attributes), i.e. `my-image-200.png 200w, my-image-200.png 200w`.
|
|
48
|
+
*/
|
|
49
|
+
srcSet?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Contents of the PosterImage.
|
|
52
|
+
*/
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Use `Poster` to compose content on an image or video background.
|
|
57
|
+
*/
|
|
58
|
+
declare const Poster: FC<PosterProps> & {
|
|
59
|
+
Image: typeof PosterImage;
|
|
60
|
+
Video: typeof PosterVideo;
|
|
61
|
+
};
|
|
62
|
+
interface PosterProps {
|
|
63
|
+
/**
|
|
64
|
+
* Poster background to overlay content on top of. Must be one of Poster.Image or Poster.Video.
|
|
65
|
+
*/
|
|
66
|
+
background: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Contents of the Poster. Each item will be wrapped in an PosterItem component.
|
|
69
|
+
*/
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* Apply an overlay to the Poster background, e.g. a scrim gradient for text legibility.
|
|
73
|
+
*/
|
|
74
|
+
overlay?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The background surface colour to show behind the Poster content before it loads.
|
|
77
|
+
* If using `overlay`, the gradient will match the surface.
|
|
78
|
+
*/
|
|
79
|
+
surface?: "darker" | "lighter";
|
|
80
|
+
}
|
|
81
|
+
export { PosterVideo, PosterVideoProps, PosterImage, PosterImageProps, Poster, PosterProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { S as Surface } from './Surface-bb100ef8.js';
|
|
5
|
+
import { I as Image } from './Image-3596ce55.js';
|
|
6
|
+
import { s as suffixModifier } from './suffix-modifier-7e640670.js';
|
|
7
|
+
|
|
8
|
+
var PosterImage = function (_a) {
|
|
9
|
+
var alt = _a.alt, _b = _a.anchor, anchor = _b === void 0 ? "C" : _b, loading = _a.loading, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, props = __rest(_a, ["alt", "anchor", "loading", "sizes", "src", "srcSet"]);
|
|
10
|
+
return (React__default.createElement(Image, __assign({ alt: alt, anchor: anchor, fit: "cover", loading: loading, sizes: sizes, src: src, srcSet: srcSet }, props)));
|
|
11
|
+
};
|
|
12
|
+
PosterImage.displayName = "Poster.Image";
|
|
13
|
+
|
|
14
|
+
var PosterVideo = function (_a) {
|
|
15
|
+
var _b;
|
|
16
|
+
var _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, _d = _a.autoPlay, autoPlay = _d === void 0 ? true : _d, children = _a.children, _e = _a.loop, loop = _e === void 0 ? true : _e, props = __rest(_a, ["anchor", "autoPlay", "children", "loop"]);
|
|
17
|
+
return (React__default.createElement("video", __assign({ className: classNames((_b = {
|
|
18
|
+
"arc-PosterVideo": true
|
|
19
|
+
},
|
|
20
|
+
_b[suffixModifier("arc-PosterVideo--anchor", anchor)] = anchor,
|
|
21
|
+
_b)), autoPlay: autoPlay, muted: true, loop: loop }, filterDataAttrs(props)), children));
|
|
22
|
+
};
|
|
23
|
+
PosterVideo.displayName = "Poster.Video";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Use `Poster` to compose content on an image or video background.
|
|
27
|
+
*/
|
|
28
|
+
var Poster = function (_a) {
|
|
29
|
+
var background = _a.background, children = _a.children, _b = _a.overlay, overlay = _b === void 0 ? true : _b, _c = _a.surface, surface = _c === void 0 ? "darker" : _c, props = __rest(_a, ["background", "children", "overlay", "surface"]);
|
|
30
|
+
return (React__default.createElement(Surface, { background: surface },
|
|
31
|
+
React__default.createElement("div", __assign({ className: classNames({
|
|
32
|
+
"arc-Poster": true,
|
|
33
|
+
"arc-Poster--overlay": overlay,
|
|
34
|
+
"arc-Poster--overlayLight": surface === "lighter"
|
|
35
|
+
}) }, filterDataAttrs(props)),
|
|
36
|
+
React__default.createElement("div", { className: "arc-Poster-backgroundWrapper" }, background),
|
|
37
|
+
React__default.createElement("div", { className: "arc-Poster-body" }, children))));
|
|
38
|
+
};
|
|
39
|
+
PosterImage.displayName = "Poster.Image";
|
|
40
|
+
Poster.Image = PosterImage;
|
|
41
|
+
PosterVideo.displayName = "Poster.Video";
|
|
42
|
+
Poster.Video = PosterVideo;
|
|
43
|
+
|
|
44
|
+
export { Poster as P };
|