@arc-ui/components 10.8.1 → 11.0.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.js +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +4 -4
- 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 +4 -4
- package/dist/Card/Card.cjs.js +3 -3
- package/dist/Card/Card.esm.js +3 -3
- package/dist/Checkbox/Checkbox.cjs.js +32 -8
- package/dist/Checkbox/Checkbox.esm.js +34 -10
- package/dist/Disclosure/Disclosure.cjs.js +3 -0
- package/dist/Disclosure/Disclosure.esm.js +3 -0
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- 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 +2 -3
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.js +1 -1
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.esm.js +1 -1
- package/dist/SiteFooter/SiteFooter.cjs.js +5 -3
- package/dist/SiteFooter/SiteFooter.esm.js +4 -2
- package/dist/SiteHeader/SiteHeader.cjs.js +35 -13
- package/dist/SiteHeader/SiteHeader.esm.js +32 -10
- package/dist/TextInput/TextInput.cjs.d.ts +1 -1
- package/dist/TextInput/TextInput.cjs.js +1 -1
- package/dist/TextInput/TextInput.esm.d.ts +1 -1
- package/dist/TextInput/TextInput.esm.js +1 -1
- 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-a1b7421b.d.ts} +0 -0
- package/dist/_shared/cjs/{FormControl-7d8e10fa.js → FormControl-a1b7421b.js} +38 -5
- 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/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.d.ts → index.es-77def0c9.d.ts} +0 -0
- package/dist/_shared/cjs/{use-media-query-75d1bbae.js → index.es-77def0c9.js} +9 -0
- package/dist/_shared/esm/BtIconChevronDown2Px-4abd079b.js +23 -0
- package/dist/_shared/esm/BtIconChevronRight2Px-a5cc1d05.js +43 -0
- package/dist/_shared/esm/BtIconChevronRightMid-386cf272.js +25 -0
- package/dist/_shared/esm/{Button-d59c31a2.d.ts → Button-5ff56a7b.d.ts} +3 -3
- package/dist/_shared/esm/Button-5ff56a7b.js +74 -0
- package/dist/_shared/esm/{FormControl-33194106.d.ts → FormControl-feedc495.d.ts} +0 -0
- package/dist/_shared/esm/{FormControl-33194106.js → FormControl-feedc495.js} +40 -8
- package/dist/_shared/esm/{Icon-2fd92daa.d.ts → Icon-76d0d8c0.d.ts} +6 -6
- package/dist/_shared/esm/Icon-76d0d8c0.js +46 -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.d.ts → index.es-00cb3bcb.d.ts} +0 -0
- package/dist/_shared/esm/{use-media-query-38faed7f.js → index.es-00cb3bcb.js} +8 -1
- package/dist/index.es.js +454 -528
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +311 -385
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Icon/Icon.d.ts +6 -6
- package/dist/types/types/arc-icon.d.ts +2 -0
- package/package.json +4 -3
- 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/Icon-2fd92daa.js +0 -27
- package/dist/_shared/esm/index.es-42f84e2d.js +0 -286
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-78b35bc1.js');
|
|
4
|
+
var React$1 = require('react');
|
|
5
|
+
var index$1 = require('./index-45bfb67b.js');
|
|
6
|
+
var suffixModifier = require('./suffix-modifier-edf7851e.js');
|
|
7
|
+
var Surface = require('./Surface-d6b8010e.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
|
|
12
|
+
|
|
13
|
+
const React = React__default["default"];
|
|
14
|
+
const ArcIconArc = props =>
|
|
15
|
+
/*#__PURE__*/ React.createElement(
|
|
16
|
+
"svg",
|
|
17
|
+
Object.assign(
|
|
18
|
+
{
|
|
19
|
+
viewBox: "0 0 16 16",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
+
},
|
|
22
|
+
props
|
|
23
|
+
),
|
|
24
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
25
|
+
fill: "none",
|
|
26
|
+
d: "M3.472 11.69a6.5 6.5 0 012.321-6.839A6.5 6.5 0 0113 4.38",
|
|
27
|
+
stroke: "currentColor"
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
var ArcIconArc_2 = ArcIconArc;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Use `Icon` to display brand iconography.
|
|
34
|
+
*/
|
|
35
|
+
var Icon = function (_a) {
|
|
36
|
+
var _b;
|
|
37
|
+
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 = index.__rest(_a, ["testId", "color", "icon", "isInline", "label", "size"]);
|
|
38
|
+
var surface = React$1.useContext(Surface.Context).surface;
|
|
39
|
+
var Icon = icon;
|
|
40
|
+
return (React__default["default"].createElement("span", index.__assign({ "data-testid": testId, "aria-label": label, className: index$1.classNames((_b = {},
|
|
41
|
+
_b["arc-Icon"] = true,
|
|
42
|
+
_b[suffixModifier.suffixModifier("arc-Icon--color", color)] = color !== "auto",
|
|
43
|
+
_b["arc-Icon--inline"] = isInline,
|
|
44
|
+
_b["arc-Icon--onDarkSurface"] = surface === "dark",
|
|
45
|
+
_b)), role: label ? "img" : undefined, style: {
|
|
46
|
+
height: size,
|
|
47
|
+
width: size
|
|
48
|
+
} }, index.filterDataAttrs(props)),
|
|
49
|
+
React__default["default"].createElement(Icon, null)));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.Icon = Icon;
|
|
File without changes
|
|
@@ -38,4 +38,13 @@ var useMediaQuery = function (mediaQuery) {
|
|
|
38
38
|
return matches;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Do not edit directly
|
|
43
|
+
* Generated file
|
|
44
|
+
*/
|
|
45
|
+
var ArcBreakpointM = 768;
|
|
46
|
+
var ArcBreakpointL = 1024;
|
|
47
|
+
|
|
48
|
+
exports.ArcBreakpointL = ArcBreakpointL;
|
|
49
|
+
exports.ArcBreakpointM = ArcBreakpointM;
|
|
41
50
|
exports.useMediaQuery = useMediaQuery;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
const React = React$1;
|
|
4
|
+
const BtIconChevronDown2Px = props =>
|
|
5
|
+
/*#__PURE__*/ React.createElement(
|
|
6
|
+
"svg",
|
|
7
|
+
Object.assign(
|
|
8
|
+
{
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
viewBox: "0 0 32 32"
|
|
11
|
+
},
|
|
12
|
+
props
|
|
13
|
+
),
|
|
14
|
+
/*#__PURE__*/ React.createElement("defs", null),
|
|
15
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
16
|
+
d:
|
|
17
|
+
"M15.99316,23.91406,2.294,10.207A.99989.99989,0,1,1,3.708,8.793l12.28515,12.293L28.292,8.793A.99989.99989,0,1,1,29.70605,10.207Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
var BtIconChevronDown2Px_2 = BtIconChevronDown2Px;
|
|
22
|
+
|
|
23
|
+
export { BtIconChevronDown2Px_2 as B };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React$2 from 'react';
|
|
2
|
+
|
|
3
|
+
const React$1 = React$2;
|
|
4
|
+
const BtIconChevronLeft2Px = props =>
|
|
5
|
+
/*#__PURE__*/ React$1.createElement(
|
|
6
|
+
"svg",
|
|
7
|
+
Object.assign(
|
|
8
|
+
{
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
viewBox: "0 0 32 32"
|
|
11
|
+
},
|
|
12
|
+
props
|
|
13
|
+
),
|
|
14
|
+
/*#__PURE__*/ React$1.createElement("defs", null),
|
|
15
|
+
/*#__PURE__*/ React$1.createElement("path", {
|
|
16
|
+
d:
|
|
17
|
+
"M22.5,29.99854a.99676.99676,0,0,1-.707-.293L8.08594,15.99268,21.793,2.294A1.00023,1.00023,0,0,1,23.207,3.709l-12.293,12.28467L23.207,28.2915a1,1,0,0,1-.707,1.707Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
var BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px;
|
|
22
|
+
|
|
23
|
+
const React = React$2;
|
|
24
|
+
const BtIconChevronRight2Px = props =>
|
|
25
|
+
/*#__PURE__*/ React.createElement(
|
|
26
|
+
"svg",
|
|
27
|
+
Object.assign(
|
|
28
|
+
{
|
|
29
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
+
viewBox: "0 0 32 32"
|
|
31
|
+
},
|
|
32
|
+
props
|
|
33
|
+
),
|
|
34
|
+
/*#__PURE__*/ React.createElement("defs", null),
|
|
35
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
36
|
+
d:
|
|
37
|
+
"M9.5,29.99854A1.00025,1.00025,0,0,1,8.793,28.291l12.293-12.28467L8.793,3.7085A.99989.99989,0,0,1,10.207,2.29443l13.707,13.71289L10.207,29.70605A.99827.99827,0,0,1,9.5,29.99854Z",
|
|
38
|
+
fill: "currentColor"
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
var BtIconChevronRight2Px_2 = BtIconChevronRight2Px;
|
|
42
|
+
|
|
43
|
+
export { BtIconChevronLeft2Px_2 as B, BtIconChevronRight2Px_2 as a };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
const React = React$1;
|
|
4
|
+
const BtIconChevronRightMid = props =>
|
|
5
|
+
/*#__PURE__*/ React.createElement(
|
|
6
|
+
"svg",
|
|
7
|
+
Object.assign(
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
fill: "none",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12
|
+
},
|
|
13
|
+
props
|
|
14
|
+
),
|
|
15
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
16
|
+
fillRule: "evenodd",
|
|
17
|
+
clipRule: "evenodd",
|
|
18
|
+
d:
|
|
19
|
+
"M9.04543 8.0002L6.19676 5.1482C6.07077 5.02196 6 4.85089 6 4.67253C6 4.49418 6.07077 4.32311 6.19676 4.19687C6.25906 4.13446 6.33304 4.08495 6.41449 4.05117C6.49594 4.01739 6.58325 4 6.67143 4C6.75961 4 6.84692 4.01739 6.92837 4.05117C7.00982 4.08495 7.0838 4.13446 7.1461 4.19687L10.4701 7.52487C10.5959 7.65108 10.6665 7.82201 10.6665 8.0002C10.6665 8.1784 10.5959 8.34932 10.4701 8.47553L7.1461 11.8035C7.0838 11.8659 7.00982 11.9155 6.92837 11.9492C6.84692 11.983 6.75961 12.0004 6.67143 12.0004C6.58325 12.0004 6.49594 11.983 6.41449 11.9492C6.33304 11.9155 6.25906 11.8659 6.19676 11.8035C6.07077 11.6773 6 11.5062 6 11.3279C6 11.1495 6.07077 10.9784 6.19676 10.8522L9.04543 8.0002Z",
|
|
20
|
+
fill: "currentColor"
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
var BtIconChevronRightMid_2 = BtIconChevronRightMid;
|
|
24
|
+
|
|
25
|
+
export { BtIconChevronRightMid_2 as B };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { icons } from "@arc-ui/tokens";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { FC } from "react";
|
|
4
|
+
import { ArcIcon } from "./arc-icon-17594b2f";
|
|
5
5
|
type ElementUnion = HTMLButtonElement | HTMLAnchorElement;
|
|
6
6
|
type Ref = React.Ref<ElementUnion> | null;
|
|
7
7
|
/**
|
|
@@ -12,7 +12,7 @@ interface ButtonIconProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Icon variant.
|
|
14
14
|
*/
|
|
15
|
-
icon?:
|
|
15
|
+
icon?: ArcIcon;
|
|
16
16
|
/**
|
|
17
17
|
* Should the icon be a default chevron?
|
|
18
18
|
*/
|
|
@@ -57,7 +57,7 @@ interface ButtonProps extends ButtonElementProps, LinkElementProps {
|
|
|
57
57
|
/**
|
|
58
58
|
* Button icon variant.
|
|
59
59
|
*/
|
|
60
|
-
icon?:
|
|
60
|
+
icon?: ArcIcon;
|
|
61
61
|
/**
|
|
62
62
|
* How should a Button icon be displayed?
|
|
63
63
|
*/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
|
|
2
|
+
import React$1, { forwardRef, useContext } from 'react';
|
|
3
|
+
import { B as BtIconChevronRightMid_2 } from './BtIconChevronRightMid-386cf272.js';
|
|
4
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
5
|
+
import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
|
|
6
|
+
import { I as Icon } from './Icon-76d0d8c0.js';
|
|
7
|
+
import { C as Context } from './Surface-d515d212.js';
|
|
8
|
+
|
|
9
|
+
const React = React$1;
|
|
10
|
+
const BtIconChevronLeftMid = props =>
|
|
11
|
+
/*#__PURE__*/ React.createElement(
|
|
12
|
+
"svg",
|
|
13
|
+
Object.assign(
|
|
14
|
+
{
|
|
15
|
+
viewBox: "0 0 16 16",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
18
|
+
},
|
|
19
|
+
props
|
|
20
|
+
),
|
|
21
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d:
|
|
25
|
+
"M7.62107 8.00023L10.4697 10.8522C10.5957 10.9785 10.6665 11.1495 10.6665 11.3279C10.6665 11.5063 10.5957 11.6773 10.4697 11.8036C10.4074 11.866 10.3335 11.9155 10.252 11.9493C10.1706 11.983 10.0833 12.0004 9.99507 12.0004C9.9069 12.0004 9.81959 11.983 9.73814 11.9493C9.65669 11.9155 9.5827 11.866 9.52041 11.8036L6.19641 8.47556C6.07061 8.34935 5.99998 8.17842 5.99998 8.00023C5.99998 7.82203 6.07061 7.6511 6.19641 7.52489L9.52041 4.19689C9.5827 4.13449 9.65669 4.08498 9.73814 4.0512C9.81959 4.01741 9.9069 4.00003 9.99507 4.00003C10.0832 4.00003 10.1706 4.01741 10.252 4.0512C10.3335 4.08498 10.4074 4.13449 10.4697 4.19689C10.5957 4.32313 10.6665 4.4942 10.6665 4.67256C10.6665 4.85092 10.5957 5.02199 10.4697 5.14823L7.62107 8.00023Z",
|
|
26
|
+
fill: "currentColor"
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
var BtIconChevronLeftMid_2 = BtIconChevronLeftMid;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Use `Button` to allow users to take actions with clicks and taps.
|
|
33
|
+
*/
|
|
34
|
+
var Button = forwardRef(function (_a, ref) {
|
|
35
|
+
var _b;
|
|
36
|
+
var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, supportingText = _a.supportingText, target = _a.target, type = _a.type, props = __rest(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type"]);
|
|
37
|
+
var surface = useContext(Context).surface;
|
|
38
|
+
var buttonClasses = classNames((_b = {
|
|
39
|
+
"arc-Button": true,
|
|
40
|
+
"arc-Button--displayBlock": isDisplayBlock
|
|
41
|
+
},
|
|
42
|
+
_b[suffixModifier("arc-Button--fill", fill)] = fill !== "solid",
|
|
43
|
+
_b["arc-Button--fullWidth"] = isFullWidth,
|
|
44
|
+
_b[suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
|
|
45
|
+
iconPosition &&
|
|
46
|
+
iconPosition !== "afterText",
|
|
47
|
+
_b["arc-Button--hasSupportingText"] = supportingText,
|
|
48
|
+
_b["arc-Button--onDarkSurface"] = surface === "dark",
|
|
49
|
+
_b));
|
|
50
|
+
var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, filterDataAttrs(props));
|
|
51
|
+
var buttonText = supportingText ? (React$1.createElement("span", null,
|
|
52
|
+
React$1.createElement("span", { className: "arc-Button-text" }, label),
|
|
53
|
+
React$1.createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React$1.createElement("span", { className: "arc-Button-text" }, label));
|
|
54
|
+
var buttonIcon = icon || fill === "flat" ? (React$1.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
|
|
55
|
+
if (href && !isDisabled) {
|
|
56
|
+
return (React$1.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
|
|
57
|
+
React$1.createElement("span", { className: "arc-Button-inner" },
|
|
58
|
+
buttonText,
|
|
59
|
+
buttonIcon)));
|
|
60
|
+
}
|
|
61
|
+
return (React$1.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
|
|
62
|
+
React$1.createElement("span", { className: "arc-Button-inner" },
|
|
63
|
+
buttonText,
|
|
64
|
+
buttonIcon)));
|
|
65
|
+
});
|
|
66
|
+
var ButtonIcon = function (_a) {
|
|
67
|
+
var icon = _a.icon, isChevron = _a.isChevron, isBeforeText = _a.isBeforeText;
|
|
68
|
+
return (React$1.createElement("span", { className: classNames({
|
|
69
|
+
"arc-Button-icon": true,
|
|
70
|
+
"arc-Button-icon--chevron": isChevron
|
|
71
|
+
}) }, isChevron ? (React$1.createElement(Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid_2 })) : (React$1.createElement(Icon, { icon: icon }))));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { Button as B };
|
|
File without changes
|
|
@@ -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 React, { createContext, useContext } from 'react';
|
|
3
|
+
import React$1, { createContext, useContext } from 'react';
|
|
4
4
|
import { C as Context$1 } from './Surface-d515d212.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -26,6 +26,35 @@ var useAriaDescribedby = function (_a) {
|
|
|
26
26
|
return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper };
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
const React = React$1;
|
|
30
|
+
const BtIconAlert = props =>
|
|
31
|
+
/*#__PURE__*/ React.createElement(
|
|
32
|
+
"svg",
|
|
33
|
+
Object.assign(
|
|
34
|
+
{
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
viewBox: "0 0 32 32"
|
|
37
|
+
},
|
|
38
|
+
props
|
|
39
|
+
),
|
|
40
|
+
/*#__PURE__*/ React.createElement("defs", null),
|
|
41
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
42
|
+
d:
|
|
43
|
+
"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",
|
|
44
|
+
fill: "currentColor"
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
47
|
+
fill: "currentColor",
|
|
48
|
+
d: "M16 20.99335A1 1 0 1 0 16 22.99335 1 1 0 1 0 16 20.99335z"
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
51
|
+
d:
|
|
52
|
+
"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",
|
|
53
|
+
fill: "currentColor"
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
var BtIconAlert_2 = BtIconAlert;
|
|
57
|
+
|
|
29
58
|
var defaultContext = {
|
|
30
59
|
requirementStatus: null
|
|
31
60
|
};
|
|
@@ -57,18 +86,21 @@ var FormControl = function (_a) {
|
|
|
57
86
|
else {
|
|
58
87
|
elementProps["aria-describedby"] = ariaDescribedby;
|
|
59
88
|
}
|
|
60
|
-
return (React.createElement(Provider, { value: { requirementStatus: requirementStatus } },
|
|
61
|
-
React.createElement(ElementType, __assign({ className: classNames({
|
|
89
|
+
return (React$1.createElement(Provider, { value: { requirementStatus: requirementStatus } },
|
|
90
|
+
React$1.createElement(ElementType, __assign({ className: classNames({
|
|
62
91
|
"arc-FormControl": true,
|
|
63
92
|
"arc-FormControl--smallLabel": labelSize === "s",
|
|
64
93
|
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
65
94
|
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
66
|
-
React.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
95
|
+
React$1.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
67
96
|
label,
|
|
68
|
-
requirementStatus === "optional" && (React.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
69
|
-
helper && (React.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
|
|
97
|
+
requirementStatus === "optional" && (React$1.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
98
|
+
helper && (React$1.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
|
|
70
99
|
children,
|
|
71
|
-
errorMessage && (React.createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
100
|
+
errorMessage && (React$1.createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
101
|
+
React$1.createElement("span", { className: "arc-FormControl-error--icon" },
|
|
102
|
+
React$1.createElement(BtIconAlert_2, null)),
|
|
103
|
+
errorMessage)))));
|
|
72
104
|
};
|
|
73
105
|
|
|
74
|
-
export { Context as C, FormControl as F, useAriaDescribedby as u };
|
|
106
|
+
export { BtIconAlert_2 as B, Context as C, FormControl as F, useAriaDescribedby as u };
|
|
@@ -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$1, { 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-d515d212.js';
|
|
6
|
+
|
|
7
|
+
const React = React$1;
|
|
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$1.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$1.createElement(Icon, null)));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { Icon as I };
|
|
File without changes
|
|
@@ -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 };
|