@arc-ui/components 10.8.1 → 11.1.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/Align/Align.esm.js +4 -4
- package/dist/Badge/Badge.cjs.d.ts +26 -0
- package/dist/Badge/Badge.cjs.js +37 -0
- package/dist/Badge/Badge.esm.d.ts +26 -0
- package/dist/Badge/Badge.esm.js +29 -0
- package/dist/Badge/package.json +7 -0
- package/dist/Base/Base.cjs.d.ts +1 -16
- package/dist/Base/Base.cjs.js +4 -16
- package/dist/Base/Base.esm.d.ts +1 -16
- package/dist/Base/Base.esm.js +3 -15
- package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -1
- package/dist/BrandLogo/BrandLogo.esm.js +2 -2
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +27 -27
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +4 -4
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +5 -5
- package/dist/Card/Card.cjs.js +3 -3
- package/dist/Card/Card.esm.js +27 -27
- package/dist/Checkbox/Checkbox.cjs.js +35 -8
- package/dist/Checkbox/Checkbox.esm.js +38 -11
- package/dist/Clock/Clock.esm.js +3 -3
- package/dist/Columns/Columns.esm.js +5 -5
- package/dist/Curve/Curve.esm.d.ts +1 -1
- package/dist/Curve/Curve.esm.js +1 -1
- package/dist/Disclosure/Disclosure.cjs.js +3 -0
- package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
- package/dist/Disclosure/Disclosure.esm.js +10 -7
- package/dist/Elevation/Elevation.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +4 -1
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +5 -2
- package/dist/Group/Group.esm.js +6 -6
- package/dist/Heading/Heading.esm.d.ts +1 -1
- package/dist/Heading/Heading.esm.js +2 -2
- package/dist/Icon/Icon.cjs.d.ts +1 -1
- package/dist/Icon/Icon.cjs.js +2 -3
- package/dist/Icon/Icon.esm.d.ts +1 -1
- package/dist/Icon/Icon.esm.js +3 -4
- package/dist/Image/Image.esm.d.ts +1 -1
- package/dist/Image/Image.esm.js +1 -1
- package/dist/Markup/Markup.esm.js +3 -3
- package/dist/Poster/Poster.esm.d.ts +1 -1
- package/dist/Poster/Poster.esm.js +9 -9
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.js +4 -1
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.esm.js +15 -12
- package/dist/Rule/Rule.esm.js +3 -3
- package/dist/Section/Section.esm.d.ts +1 -1
- package/dist/Section/Section.esm.js +1 -1
- package/dist/Select/Select.cjs.d.ts +25 -0
- package/dist/Select/Select.cjs.js +3010 -0
- package/dist/Select/Select.esm.d.ts +25 -0
- package/dist/Select/Select.esm.js +2983 -0
- package/dist/Select/package.json +7 -0
- package/dist/SiteFooter/SiteFooter.cjs.js +5 -3
- package/dist/SiteFooter/SiteFooter.esm.js +34 -32
- package/dist/SiteHeader/SiteHeader.cjs.js +35 -13
- package/dist/SiteHeader/SiteHeader.esm.d.ts +1 -1
- package/dist/SiteHeader/SiteHeader.esm.js +110 -88
- package/dist/Surface/Surface.esm.d.ts +1 -1
- package/dist/Surface/Surface.esm.js +1 -1
- package/dist/Text/Text.esm.d.ts +1 -1
- package/dist/Text/Text.esm.js +2 -2
- package/dist/TextInput/TextInput.cjs.d.ts +5 -1
- package/dist/TextInput/TextInput.cjs.js +25 -6
- package/dist/TextInput/TextInput.esm.d.ts +5 -1
- package/dist/TextInput/TextInput.esm.js +28 -9
- package/dist/Truncate/Truncate.cjs.d.ts +18 -0
- package/dist/Truncate/Truncate.cjs.js +17 -0
- package/dist/Truncate/Truncate.esm.d.ts +18 -0
- package/dist/Truncate/Truncate.esm.js +9 -0
- package/dist/Truncate/package.json +7 -0
- package/dist/UniversalHeader/UniversalHeader.esm.js +8 -8
- package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
- package/dist/VisuallyHidden/VisuallyHidden.cjs.d.ts +1 -12
- package/dist/VisuallyHidden/VisuallyHidden.cjs.js +3 -12
- package/dist/VisuallyHidden/VisuallyHidden.esm.d.ts +1 -12
- package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -11
- package/dist/_shared/cjs/Base-e2b846fe.d.ts +19 -0
- package/dist/_shared/cjs/Base-e2b846fe.js +22 -0
- package/dist/_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js +29 -0
- package/dist/_shared/cjs/BtIconChevronRight2Px-a8e40136.js +50 -0
- package/dist/_shared/cjs/BtIconChevronRightMid-5a38d855.js +31 -0
- package/dist/_shared/cjs/{Button-1743b3ec.d.ts → Button-b3a69953.d.ts} +3 -3
- package/dist/_shared/cjs/{Button-1743b3ec.js → Button-b3a69953.js} +29 -6
- package/dist/_shared/cjs/{FormControl-7d8e10fa.d.ts → FormControl-e6b7d7c5.d.ts} +51 -3
- package/dist/_shared/cjs/FormControl-e6b7d7c5.js +147 -0
- package/dist/_shared/cjs/{Icon-bb5a5fd1.d.ts → Icon-719d13d4.d.ts} +6 -6
- package/dist/_shared/cjs/Icon-719d13d4.js +52 -0
- package/dist/_shared/cjs/VisuallyHidden-e2c8b291.d.ts +12 -0
- package/dist/_shared/cjs/VisuallyHidden-e2c8b291.js +17 -0
- package/dist/_shared/cjs/arc-icon-17594b2f.d.ts +4 -0
- package/dist/_shared/cjs/index-c81c9401.d.ts +2 -2
- package/dist/_shared/cjs/{use-media-query-75d1bbae.js → index.es-77def0c9.js} +9 -0
- package/dist/_shared/esm/Base-c235dc45.d.ts +19 -0
- package/dist/_shared/esm/Base-c235dc45.js +15 -0
- package/dist/_shared/esm/{BrandLogo-ea3dd0e6.js → BrandLogo-4f13fe85.js} +4 -4
- package/dist/_shared/esm/BtIconChevronDown2Px-782876e2.js +23 -0
- package/dist/_shared/esm/BtIconChevronRight2Px-b8e7b4ad.js +43 -0
- package/dist/_shared/esm/BtIconChevronRightMid-d9b11761.js +25 -0
- package/dist/_shared/esm/{Button-d59c31a2.d.ts → Button-69439f8f.d.ts} +3 -3
- package/dist/_shared/esm/Button-69439f8f.js +74 -0
- package/dist/_shared/esm/{Curve-cfdca379.js → Curve-50697f7e.js} +2 -2
- package/dist/_shared/esm/{FormControl-33194106.d.ts → FormControl-84c9ace6.d.ts} +51 -3
- package/dist/_shared/esm/FormControl-84c9ace6.js +138 -0
- package/dist/_shared/esm/{Heading-183be76c.js → Heading-eb1e42db.js} +4 -4
- package/dist/_shared/esm/{Icon-2fd92daa.d.ts → Icon-61f7237a.d.ts} +6 -6
- package/dist/_shared/esm/Icon-61f7237a.js +46 -0
- package/dist/_shared/esm/{Image-7e4948f6.js → Image-c0f3d42f.js} +7 -7
- package/dist/_shared/esm/{Section-f1256c87.js → Section-7bc71e26.js} +2 -2
- package/dist/_shared/esm/{Surface-d515d212.js → Surface-bf201530.js} +3 -3
- package/dist/_shared/esm/{Text-d8988620.js → Text-6b958ad8.js} +3 -3
- package/dist/_shared/esm/VisuallyHidden-b9eebf71.d.ts +12 -0
- package/dist/_shared/esm/VisuallyHidden-b9eebf71.js +11 -0
- package/dist/_shared/esm/arc-icon-17594b2f.d.ts +4 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +2 -2
- package/dist/_shared/esm/{use-media-query-38faed7f.js → index.es-00cb3bcb.js} +8 -1
- package/dist/index.es.js +34545 -717
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +34537 -688
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Badge/Badge.d.ts +25 -0
- package/dist/types/components/Badge/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/FormControl/FormControl.d.ts +17 -0
- package/dist/types/components/FormControl/FormControlDisclosure/FormControlDisclosure.d.ts +28 -0
- package/dist/types/components/FormControl/FormControlDisclosure/index.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +6 -6
- package/dist/types/components/Select/Select.d.ts +2 -1
- package/dist/types/components/TextInput/TextInput.d.ts +4 -0
- package/dist/types/components/Truncate/Truncate.d.ts +17 -0
- package/dist/types/components/Truncate/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/hooks/use-aria-describedby.d.ts +5 -1
- package/dist/types/styles.d.ts +4 -0
- package/dist/types/types/arc-icon.d.ts +2 -0
- package/package.json +4 -3
- package/dist/_shared/cjs/FormControl-7d8e10fa.js +0 -82
- package/dist/_shared/cjs/Icon-bb5a5fd1.js +0 -33
- package/dist/_shared/cjs/index.es-f590caaf.js +0 -290
- package/dist/_shared/esm/Button-d59c31a2.js +0 -51
- package/dist/_shared/esm/FormControl-33194106.js +0 -74
- package/dist/_shared/esm/Icon-2fd92daa.js +0 -27
- package/dist/_shared/esm/index.es-42f84e2d.js +0 -286
- /package/dist/_shared/cjs/{use-media-query-75d1bbae.d.ts → index.es-77def0c9.d.ts} +0 -0
- /package/dist/_shared/esm/{BrandLogo-ea3dd0e6.d.ts → BrandLogo-4f13fe85.d.ts} +0 -0
- /package/dist/_shared/esm/{Curve-cfdca379.d.ts → Curve-50697f7e.d.ts} +0 -0
- /package/dist/_shared/esm/{Heading-183be76c.d.ts → Heading-eb1e42db.d.ts} +0 -0
- /package/dist/_shared/esm/{Image-7e4948f6.d.ts → Image-c0f3d42f.d.ts} +0 -0
- /package/dist/_shared/esm/{Section-f1256c87.d.ts → Section-7bc71e26.d.ts} +0 -0
- /package/dist/_shared/esm/{Surface-d515d212.d.ts → Surface-bf201530.d.ts} +0 -0
- /package/dist/_shared/esm/{Text-d8988620.d.ts → Text-6b958ad8.d.ts} +0 -0
- /package/dist/_shared/esm/{use-media-query-38faed7f.d.ts → index.es-00cb3bcb.d.ts} +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
+
import React__default, { useContext, useState, createContext } from 'react';
|
|
4
|
+
import { C as Context$1 } from './Surface-bf201530.js';
|
|
5
|
+
import { T as Text } from './Text-6b958ad8.js';
|
|
6
|
+
import { B as BtIconChevronRightMid_2 } from './BtIconChevronRightMid-d9b11761.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Optionally define ariaDescribedBy if errorMessage or helper exist.
|
|
10
|
+
*/
|
|
11
|
+
var useAriaDescribedby = function (_a) {
|
|
12
|
+
var id = _a.id, _b = _a.idError, idError = _b === void 0 ? "".concat(id, "-error") : _b, _c = _a.idHelper, idHelper = _c === void 0 ? "".concat(id, "-helper") : _c, _d = _a.idDisclosure, idDisclosure = _d === void 0 ? "".concat(id, "-disclosure") : _d, errorMessage = _a.errorMessage, helper = _a.helper, disclosureText = _a.disclosureText;
|
|
13
|
+
if (!id) {
|
|
14
|
+
return {
|
|
15
|
+
ariaDescribedby: undefined,
|
|
16
|
+
idHelper: undefined,
|
|
17
|
+
idError: undefined,
|
|
18
|
+
idDisclosure: undefined
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
var ariaDescribedbyArr = [];
|
|
22
|
+
if (errorMessage) {
|
|
23
|
+
ariaDescribedbyArr.push(idError);
|
|
24
|
+
}
|
|
25
|
+
if (helper) {
|
|
26
|
+
ariaDescribedbyArr.push(idHelper);
|
|
27
|
+
}
|
|
28
|
+
if (disclosureText) {
|
|
29
|
+
ariaDescribedbyArr.push(idDisclosure);
|
|
30
|
+
}
|
|
31
|
+
var ariaDescribedby = ariaDescribedbyArr.length > 0 ? ariaDescribedbyArr.join(" ") : undefined;
|
|
32
|
+
return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper, idDisclosure: idDisclosure };
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const React = React__default;
|
|
36
|
+
const BtIconAlert = props =>
|
|
37
|
+
/*#__PURE__*/ React.createElement(
|
|
38
|
+
"svg",
|
|
39
|
+
Object.assign(
|
|
40
|
+
{
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
viewBox: "0 0 32 32"
|
|
43
|
+
},
|
|
44
|
+
props
|
|
45
|
+
),
|
|
46
|
+
/*#__PURE__*/ React.createElement("defs", null),
|
|
47
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
48
|
+
d:
|
|
49
|
+
"M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
53
|
+
fill: "currentColor",
|
|
54
|
+
d: "M16 20.99335A1 1 0 1 0 16 22.99335 1 1 0 1 0 16 20.99335z"
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
57
|
+
d:
|
|
58
|
+
"M16.00488,19.00977a.49972.49972,0,0,0,.5-.5L16.50684,9.5a.5.5,0,0,0-1,0l-.002,9.00977A.5.5,0,0,0,16.00488,19.00977Z",
|
|
59
|
+
fill: "currentColor"
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
var BtIconAlert_2 = BtIconAlert;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Use `FormControlDisclosure` to display content that is only visible when toggled into
|
|
66
|
+
* an "open" state.
|
|
67
|
+
*/
|
|
68
|
+
var FormControlDisclosure = function (_a) {
|
|
69
|
+
var children = _a.children, summary = _a.summary, onClick = _a.onClick, _b = _a.size, size = _b === void 0 ? "l" : _b, id = _a.id, props = __rest(_a, ["children", "summary", "onClick", "size", "id"]);
|
|
70
|
+
var surface = useContext(Context$1).surface;
|
|
71
|
+
var _c = useState(false), disclousreState = _c[0], setDisclosureState = _c[1];
|
|
72
|
+
var handleOnClick = function () {
|
|
73
|
+
onClick && onClick();
|
|
74
|
+
setDisclosureState(function (prevState) { return !prevState; });
|
|
75
|
+
};
|
|
76
|
+
return (React__default.createElement("details", __assign({ className: classNames({
|
|
77
|
+
"arc-FormControlDisclosure": true,
|
|
78
|
+
"arc-FormControlDisclosure--onDarkSurface": surface === "dark"
|
|
79
|
+
}) }, filterDataAttrs(props), { "data-testid": "FormControlDisclosure" }),
|
|
80
|
+
React__default.createElement("summary", { className: "arc-FormControlDisclosure-summary", onClick: handleOnClick, "aria-expanded": disclousreState },
|
|
81
|
+
React__default.createElement("span", { className: "arc-FormControlDisclosure-summary-icon" },
|
|
82
|
+
React__default.createElement(BtIconChevronRightMid_2, null)),
|
|
83
|
+
React__default.createElement(Text, { size: size === "l" ? "m" : "s" }, summary)),
|
|
84
|
+
React__default.createElement("div", { className: "arc-FormControlDisclosure-details" },
|
|
85
|
+
React__default.createElement(Text, { size: size === "l" ? "m" : "s" },
|
|
86
|
+
React__default.createElement("span", { id: id }, children)))));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var defaultContext = {
|
|
90
|
+
requirementStatus: null
|
|
91
|
+
};
|
|
92
|
+
var Context = createContext(defaultContext);
|
|
93
|
+
var Provider = Context.Provider;
|
|
94
|
+
/**
|
|
95
|
+
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
96
|
+
*/
|
|
97
|
+
var FormControl = function (_a) {
|
|
98
|
+
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, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
99
|
+
var surface = useContext(Context$1).surface;
|
|
100
|
+
var _e = useAriaDescribedby({
|
|
101
|
+
disclosureText: disclosureText,
|
|
102
|
+
errorMessage: errorMessage,
|
|
103
|
+
helper: helper,
|
|
104
|
+
id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
|
|
105
|
+
}), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper, idDisclosure = _e.idDisclosure;
|
|
106
|
+
var LabelType = ElementType === "div" ? "label" : "legend";
|
|
107
|
+
var elementProps = {};
|
|
108
|
+
var labelProps = {};
|
|
109
|
+
if (LabelType === "label") {
|
|
110
|
+
labelProps["htmlFor"] = htmlFor;
|
|
111
|
+
if (htmlFor) {
|
|
112
|
+
labelProps["id"] = "".concat(htmlFor, "-label");
|
|
113
|
+
}
|
|
114
|
+
else if (id) {
|
|
115
|
+
labelProps["id"] = "".concat(id, "-label");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
elementProps["aria-describedby"] = ariaDescribedby;
|
|
120
|
+
}
|
|
121
|
+
return (React__default.createElement(Provider, { value: { requirementStatus: requirementStatus } },
|
|
122
|
+
React__default.createElement(ElementType, __assign({ className: classNames({
|
|
123
|
+
"arc-FormControl": true,
|
|
124
|
+
"arc-FormControl--isDisabled": isDisabled,
|
|
125
|
+
"arc-FormControl--smallLabel": labelSize === "s",
|
|
126
|
+
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
127
|
+
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
128
|
+
React__default.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
129
|
+
label,
|
|
130
|
+
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
131
|
+
children,
|
|
132
|
+
errorMessage ? (React__default.createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
133
|
+
React__default.createElement("span", { className: "arc-FormControl-error--icon" },
|
|
134
|
+
React__default.createElement(BtIconAlert_2, null)),
|
|
135
|
+
errorMessage)) : disclosureTitle ? (React__default.createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))));
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export { BtIconAlert_2 as B, Context as C, FormControl as F, useAriaDescribedby as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default, { useContext } from 'react';
|
|
4
4
|
import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
|
|
5
|
-
import { C as Context } from './Surface-
|
|
5
|
+
import { C as Context } from './Surface-bf201530.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Use `Heading` to display heading text.
|
|
@@ -15,7 +15,7 @@ var Heading = function (_a) {
|
|
|
15
15
|
if (level) {
|
|
16
16
|
Element = "h".concat(level);
|
|
17
17
|
}
|
|
18
|
-
return (
|
|
18
|
+
return (React__default.createElement(Element, __assign({ className: classNames((_b = {
|
|
19
19
|
"arc-Heading": true
|
|
20
20
|
},
|
|
21
21
|
_b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
|
|
@@ -27,7 +27,7 @@ var Heading = function (_a) {
|
|
|
27
27
|
};
|
|
28
28
|
var HeadingProposition = function (_a) {
|
|
29
29
|
var children = _a.children;
|
|
30
|
-
return
|
|
30
|
+
return React__default.createElement("span", { className: "arc-Heading-proposition" }, children);
|
|
31
31
|
};
|
|
32
32
|
HeadingProposition.displayName = "Heading.Proposition";
|
|
33
33
|
Heading.Proposition = HeadingProposition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { icons } from "@arc-ui/tokens";
|
|
2
1
|
import { FC } from "react";
|
|
2
|
+
import { ArcIcon } from "./arc-icon-17594b2f";
|
|
3
3
|
/**
|
|
4
4
|
* Use `Icon` to display brand iconography.
|
|
5
5
|
*/
|
|
@@ -14,14 +14,10 @@ interface IconProps {
|
|
|
14
14
|
* Should the Icon component be styled as an inline element?
|
|
15
15
|
*/
|
|
16
16
|
isInline?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Should a selected variant of the Icon be shown?
|
|
19
|
-
*/
|
|
20
|
-
isSelected?: boolean;
|
|
21
17
|
/**
|
|
22
18
|
* Icon variant.
|
|
23
19
|
*/
|
|
24
|
-
icon?:
|
|
20
|
+
icon?: ArcIcon;
|
|
25
21
|
/**
|
|
26
22
|
* Alternative text label for the Icon.
|
|
27
23
|
*/
|
|
@@ -30,5 +26,9 @@ interface IconProps {
|
|
|
30
26
|
* Size of the Icon, in pixels.
|
|
31
27
|
*/
|
|
32
28
|
size?: number;
|
|
29
|
+
/**
|
|
30
|
+
* value for data-testid
|
|
31
|
+
*/
|
|
32
|
+
testId?: string;
|
|
33
33
|
}
|
|
34
34
|
export { Icon, colors, IconProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
|
+
import React__default, { useContext } from 'react';
|
|
3
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
4
|
+
import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
|
|
5
|
+
import { C as Context } from './Surface-bf201530.js';
|
|
6
|
+
|
|
7
|
+
const React = React__default;
|
|
8
|
+
const ArcIconArc = props =>
|
|
9
|
+
/*#__PURE__*/ React.createElement(
|
|
10
|
+
"svg",
|
|
11
|
+
Object.assign(
|
|
12
|
+
{
|
|
13
|
+
viewBox: "0 0 16 16",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
15
|
+
},
|
|
16
|
+
props
|
|
17
|
+
),
|
|
18
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
19
|
+
fill: "none",
|
|
20
|
+
d: "M3.472 11.69a6.5 6.5 0 012.321-6.839A6.5 6.5 0 0113 4.38",
|
|
21
|
+
stroke: "currentColor"
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
var ArcIconArc_2 = ArcIconArc;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Use `Icon` to display brand iconography.
|
|
28
|
+
*/
|
|
29
|
+
var Icon = function (_a) {
|
|
30
|
+
var _b;
|
|
31
|
+
var testId = _a.testId, _c = _a.color, color = _c === void 0 ? "auto" : _c, _d = _a.icon, icon = _d === void 0 ? ArcIconArc_2 : _d, _e = _a.isInline, isInline = _e === void 0 ? false : _e, label = _a.label, size = _a.size, props = __rest(_a, ["testId", "color", "icon", "isInline", "label", "size"]);
|
|
32
|
+
var surface = useContext(Context).surface;
|
|
33
|
+
var Icon = icon;
|
|
34
|
+
return (React__default.createElement("span", __assign({ "data-testid": testId, "aria-label": label, className: classNames((_b = {},
|
|
35
|
+
_b["arc-Icon"] = true,
|
|
36
|
+
_b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
|
|
37
|
+
_b["arc-Icon--inline"] = isInline,
|
|
38
|
+
_b["arc-Icon--onDarkSurface"] = surface === "dark",
|
|
39
|
+
_b)), role: label ? "img" : undefined, style: {
|
|
40
|
+
height: size,
|
|
41
|
+
width: size
|
|
42
|
+
} }, filterDataAttrs(props)),
|
|
43
|
+
React__default.createElement(Icon, null)));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { Icon as I };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default, { useEffect } from 'react';
|
|
4
4
|
import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -11,27 +11,27 @@ var Image = function (_a) {
|
|
|
11
11
|
var _b;
|
|
12
12
|
var alt = _a.alt, _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, children = _a.children, fillColor = _a.fillColor, fit = _a.fit, height = _a.height, loading = _a.loading, overlay = _a.overlay, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, width = _a.width, props = __rest(_a, ["alt", "anchor", "children", "fillColor", "fit", "height", "loading", "overlay", "sizes", "src", "srcSet", "width"]);
|
|
13
13
|
useEffect(function () {
|
|
14
|
-
|
|
14
|
+
React__default.Children.map(children, function (item) {
|
|
15
15
|
if (item && item.type !== ImageSource) {
|
|
16
16
|
throw new Error("Illegal child passed to <Image />. Ensure to only use <Image.Source />.");
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [children]);
|
|
20
|
-
var img = (
|
|
21
|
-
return (
|
|
20
|
+
var img = (React__default.createElement("img", { className: "arc-Image-img", alt: alt, height: fit === "cover" ? undefined : height, loading: loading, sizes: children ? undefined : sizes, src: src, srcSet: children ? undefined : srcSet, width: fit === "cover" ? undefined : width }));
|
|
21
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
22
22
|
"arc-Image": true,
|
|
23
23
|
"arc-Image--cover": fit === "cover"
|
|
24
24
|
},
|
|
25
25
|
_b["arc-Image--anchor".concat(anchor)] = fit === "cover",
|
|
26
26
|
_b[suffixModifier("arc-Image--overlay", overlay || "")] = overlay,
|
|
27
|
-
_b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (
|
|
27
|
+
_b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (React__default.createElement("picture", null,
|
|
28
28
|
children,
|
|
29
29
|
" ",
|
|
30
|
-
img)) : (
|
|
30
|
+
img)) : (React__default.createElement(React__default.Fragment, null, img))));
|
|
31
31
|
};
|
|
32
32
|
var ImageSource = function (_a) {
|
|
33
33
|
var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type; _a.width; var props = __rest(_a, ["height", "media", "srcSet", "sizes", "type", "width"]);
|
|
34
|
-
return (
|
|
34
|
+
return (React__default.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterDataAttrs(props))));
|
|
35
35
|
};
|
|
36
36
|
ImageSource.displayName = "Image.Source";
|
|
37
37
|
Image.Source = ImageSource;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Use `Section` to compose content into vertical page layouts.
|
|
7
7
|
*/
|
|
8
8
|
var Section = function (_a) {
|
|
9
9
|
var children = _a.children, _b = _a.isFullWidth, isFullWidth = _b === void 0 ? false : _b, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, props = __rest(_a, ["children", "isFullWidth", "isDebugVisible"]);
|
|
10
|
-
return (
|
|
10
|
+
return (React__default.createElement("div", __assign({ className: classNames({
|
|
11
11
|
"arc-Section": true,
|
|
12
12
|
"arc-Section--fullWidth": isFullWidth,
|
|
13
13
|
"arc-Section--debugVisible": isDebugVisible
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __spreadArray, _ as __rest, a as __assign, c as camelCase, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default, { createContext } from 'react';
|
|
4
4
|
|
|
5
5
|
var defaultContext = { surface: "light" };
|
|
6
6
|
var Context = createContext(defaultContext);
|
|
@@ -19,8 +19,8 @@ var Surface = function (_a) {
|
|
|
19
19
|
background === "darker") {
|
|
20
20
|
surface = "dark";
|
|
21
21
|
}
|
|
22
|
-
return (
|
|
23
|
-
|
|
22
|
+
return (React__default.createElement(Provider, { value: { surface: surface } },
|
|
23
|
+
React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
24
24
|
"arc-Surface": true
|
|
25
25
|
},
|
|
26
26
|
_b["arc-Surface--".concat(background &&
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
|
-
import
|
|
3
|
+
import React__default, { useContext } from 'react';
|
|
4
4
|
import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
|
|
5
|
-
import { C as Context } from './Surface-
|
|
5
|
+
import { C as Context } from './Surface-bf201530.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Use `Text` to display text.
|
|
@@ -11,7 +11,7 @@ var Text = function (_a) {
|
|
|
11
11
|
var _b;
|
|
12
12
|
var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
|
|
13
13
|
var surface = useContext(Context).surface;
|
|
14
|
-
return (
|
|
14
|
+
return (React__default.createElement("span", __assign({ className: classNames((_b = {
|
|
15
15
|
"arc-Text": true
|
|
16
16
|
},
|
|
17
17
|
_b[suffixModifier("arc-Text--align", align)] = align !== "left",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Provides text for screen readers that is visually hidden.
|
|
4
|
+
*/
|
|
5
|
+
declare const VisuallyHidden: FC<VisuallyHiddenProps>;
|
|
6
|
+
interface VisuallyHiddenProps {
|
|
7
|
+
/**
|
|
8
|
+
* Content to be Visually Hidden.
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export { VisuallyHidden, VisuallyHiddenProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provides text for screen readers that is visually hidden.
|
|
5
|
+
*/
|
|
6
|
+
var VisuallyHidden = function (_a) {
|
|
7
|
+
var children = _a.children;
|
|
8
|
+
return (React__default.createElement("span", { "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, children));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { VisuallyHidden as V };
|
|
@@ -36,4 +36,11 @@ var useMediaQuery = function (mediaQuery) {
|
|
|
36
36
|
return matches;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Do not edit directly
|
|
41
|
+
* Generated file
|
|
42
|
+
*/
|
|
43
|
+
var ArcBreakpointM = 768;
|
|
44
|
+
var ArcBreakpointL = 1024;
|
|
45
|
+
|
|
46
|
+
export { ArcBreakpointM as A, ArcBreakpointL as a, useMediaQuery as u };
|