@arc-ui/components 10.7.0 → 10.8.1
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/{index.d.ts → Align.cjs.d.ts} +0 -0
- package/dist/Align/Align.cjs.js +33 -0
- package/dist/Align/Align.esm.d.ts +25 -0
- package/dist/Align/{index.js → Align.esm.js} +3 -3
- package/dist/Align/package.json +7 -0
- package/dist/Base/{index.d.ts → Base.cjs.d.ts} +0 -0
- package/dist/Base/Base.cjs.js +23 -0
- package/dist/Base/Base.esm.d.ts +16 -0
- package/dist/Base/{index.js → Base.esm.js} +1 -1
- package/dist/Base/package.json +7 -0
- package/dist/BrandLogo/BrandLogo.cjs.d.ts +1 -0
- package/dist/BrandLogo/BrandLogo.cjs.js +14 -0
- package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -0
- package/dist/BrandLogo/BrandLogo.esm.js +6 -0
- package/dist/BrandLogo/package.json +7 -0
- package/dist/Breadcrumbs/{index.d.ts → Breadcrumbs.cjs.d.ts} +0 -0
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +650 -0
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +61 -0
- package/dist/Breadcrumbs/{index.js → Breadcrumbs.esm.js} +7 -7
- package/dist/Breadcrumbs/package.json +7 -0
- package/dist/Button/Button.cjs.d.ts +1 -0
- package/dist/Button/Button.cjs.js +16 -0
- package/dist/Button/Button.esm.d.ts +1 -0
- package/dist/Button/Button.esm.js +8 -0
- package/dist/Button/package.json +7 -0
- package/dist/Card/{index.d.ts → Card.cjs.d.ts} +0 -0
- package/dist/Card/Card.cjs.js +126 -0
- package/dist/Card/Card.esm.d.ts +130 -0
- package/dist/Card/{index.js → Card.esm.js} +9 -9
- package/dist/Card/package.json +7 -0
- package/dist/Checkbox/{index.d.ts → Checkbox.cjs.d.ts} +0 -0
- package/dist/Checkbox/Checkbox.cjs.js +54 -0
- package/dist/Checkbox/Checkbox.esm.d.ts +59 -0
- package/dist/Checkbox/{index.js → Checkbox.esm.js} +4 -4
- package/dist/Checkbox/package.json +7 -0
- package/dist/Clock/{index.d.ts → Clock.cjs.d.ts} +0 -0
- package/dist/Clock/Clock.cjs.js +43 -0
- package/dist/Clock/Clock.esm.d.ts +15 -0
- package/dist/Clock/{index.js → Clock.esm.js} +1 -1
- package/dist/Clock/package.json +7 -0
- package/dist/Columns/{index.d.ts → Columns.cjs.d.ts} +0 -0
- package/dist/Columns/Columns.cjs.js +59 -0
- package/dist/Columns/Columns.esm.d.ts +76 -0
- package/dist/Columns/{index.js → Columns.esm.js} +3 -3
- package/dist/Columns/package.json +7 -0
- package/dist/Curve/Curve.cjs.d.ts +1 -0
- package/dist/Curve/Curve.cjs.js +13 -0
- package/dist/Curve/Curve.esm.d.ts +1 -0
- package/dist/Curve/Curve.esm.js +5 -0
- package/dist/Curve/package.json +7 -0
- package/dist/Disclosure/{index.d.ts → Disclosure.cjs.d.ts} +1 -1
- package/dist/Disclosure/Disclosure.cjs.js +33 -0
- package/dist/Disclosure/Disclosure.esm.d.ts +31 -0
- package/dist/Disclosure/{index.js → Disclosure.esm.js} +5 -5
- package/dist/Disclosure/package.json +7 -0
- package/dist/Elevation/{index.d.ts → Elevation.cjs.d.ts} +0 -0
- package/dist/Elevation/Elevation.cjs.js +25 -0
- package/dist/Elevation/Elevation.esm.d.ts +16 -0
- package/dist/Elevation/{index.js → Elevation.esm.js} +2 -2
- package/dist/Elevation/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.d.ts +1 -0
- package/dist/FormControl/FormControl.cjs.js +14 -0
- package/dist/FormControl/FormControl.esm.d.ts +1 -0
- package/dist/FormControl/FormControl.esm.js +5 -0
- package/dist/FormControl/package.json +7 -0
- package/dist/Group/{index.d.ts → Group.cjs.d.ts} +0 -0
- package/dist/Group/Group.cjs.js +50 -0
- package/dist/Group/Group.esm.d.ts +46 -0
- package/dist/Group/{index.js → Group.esm.js} +3 -3
- package/dist/Group/package.json +7 -0
- package/dist/Heading/Heading.cjs.d.ts +1 -0
- package/dist/Heading/Heading.cjs.js +14 -0
- package/dist/Heading/Heading.esm.d.ts +1 -0
- package/dist/Heading/Heading.esm.js +6 -0
- package/dist/Heading/package.json +7 -0
- package/dist/Icon/Icon.cjs.d.ts +1 -0
- package/dist/Icon/Icon.cjs.js +15 -0
- package/dist/Icon/Icon.esm.d.ts +1 -0
- package/dist/Icon/Icon.esm.js +7 -0
- package/dist/Icon/package.json +7 -0
- package/dist/Image/Image.cjs.d.ts +1 -0
- package/dist/Image/Image.cjs.js +13 -0
- package/dist/Image/Image.esm.d.ts +1 -0
- package/dist/Image/Image.esm.js +5 -0
- package/dist/Image/package.json +7 -0
- package/dist/Markup/{index.d.ts → Markup.cjs.d.ts} +0 -0
- package/dist/Markup/Markup.cjs.js +27 -0
- package/dist/Markup/Markup.esm.d.ts +16 -0
- package/dist/Markup/{index.js → Markup.esm.js} +3 -3
- package/dist/Markup/package.json +7 -0
- package/dist/Poster/{index.d.ts → Poster.cjs.d.ts} +2 -2
- package/dist/Poster/Poster.cjs.js +52 -0
- package/dist/Poster/Poster.esm.d.ts +81 -0
- package/dist/Poster/{index.js → Poster.esm.js} +5 -5
- package/dist/Poster/package.json +7 -0
- package/dist/RadioGroup/{index.d.ts → RadioGroup.cjs.d.ts} +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.js +72 -0
- package/dist/RadioGroup/RadioGroup.esm.d.ts +85 -0
- package/dist/RadioGroup/{index.js → RadioGroup.esm.js} +4 -4
- package/dist/RadioGroup/package.json +7 -0
- package/dist/Rule/{index.d.ts → Rule.cjs.d.ts} +0 -0
- package/dist/Rule/Rule.cjs.js +25 -0
- package/dist/Rule/Rule.esm.d.ts +8 -0
- package/dist/Rule/{index.js → Rule.esm.js} +3 -3
- package/dist/Rule/package.json +7 -0
- package/dist/Section/Section.cjs.d.ts +1 -0
- package/dist/Section/Section.cjs.js +12 -0
- package/dist/Section/Section.esm.d.ts +1 -0
- package/dist/Section/Section.esm.js +4 -0
- package/dist/Section/package.json +7 -0
- package/dist/SiteFooter/{index.d.ts → SiteFooter.cjs.d.ts} +0 -0
- package/dist/SiteFooter/SiteFooter.cjs.js +97 -0
- package/dist/SiteFooter/SiteFooter.esm.d.ts +64 -0
- package/dist/SiteFooter/{index.js → SiteFooter.esm.js} +10 -10
- package/dist/SiteFooter/package.json +7 -0
- package/dist/SiteHeader/{index.d.ts → SiteHeader.cjs.d.ts} +1 -1
- package/dist/SiteHeader/SiteHeader.cjs.js +647 -0
- package/dist/SiteHeader/SiteHeader.esm.d.ts +252 -0
- package/dist/SiteHeader/{index.js → SiteHeader.esm.js} +11 -11
- package/dist/SiteHeader/package.json +7 -0
- package/dist/Surface/{index.d.ts → Surface.cjs.d.ts} +1 -1
- package/dist/Surface/Surface.cjs.js +15 -0
- package/dist/Surface/Surface.esm.d.ts +1 -0
- package/dist/Surface/Surface.esm.js +4 -0
- package/dist/Surface/package.json +7 -0
- package/dist/Text/Text.cjs.d.ts +1 -0
- package/dist/Text/Text.cjs.js +14 -0
- package/dist/Text/Text.esm.d.ts +1 -0
- package/dist/Text/Text.esm.js +6 -0
- package/dist/Text/package.json +7 -0
- package/dist/TextInput/{index.d.ts → TextInput.cjs.d.ts} +1 -1
- package/dist/TextInput/TextInput.cjs.js +64 -0
- package/dist/TextInput/TextInput.esm.d.ts +71 -0
- package/dist/TextInput/{index.js → TextInput.esm.js} +4 -4
- package/dist/TextInput/package.json +7 -0
- package/dist/UniversalHeader/{index.d.ts → UniversalHeader.cjs.d.ts} +0 -0
- package/dist/UniversalHeader/UniversalHeader.cjs.js +38 -0
- package/dist/UniversalHeader/UniversalHeader.esm.d.ts +26 -0
- package/dist/UniversalHeader/{index.js → UniversalHeader.esm.js} +3 -3
- package/dist/UniversalHeader/package.json +7 -0
- package/dist/VerticalSpace/{index.d.ts → VerticalSpace.cjs.d.ts} +0 -0
- package/dist/VerticalSpace/VerticalSpace.cjs.js +27 -0
- package/dist/VerticalSpace/VerticalSpace.esm.d.ts +18 -0
- package/dist/VerticalSpace/{index.js → VerticalSpace.esm.js} +2 -2
- package/dist/VerticalSpace/package.json +7 -0
- package/dist/VisuallyHidden/{index.d.ts → VisuallyHidden.cjs.d.ts} +0 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs.js +19 -0
- package/dist/VisuallyHidden/VisuallyHidden.esm.d.ts +12 -0
- package/dist/VisuallyHidden/{index.js → VisuallyHidden.esm.js} +0 -0
- package/dist/VisuallyHidden/package.json +7 -0
- package/dist/_shared/{BrandLogo-6cc8202e.d.ts → cjs/BrandLogo-3c6102ef.d.ts} +0 -0
- package/dist/_shared/cjs/BrandLogo-3c6102ef.js +31 -0
- package/dist/_shared/{Button-2fcbd4ed.d.ts → cjs/Button-1743b3ec.d.ts} +0 -0
- package/dist/_shared/cjs/Button-1743b3ec.js +57 -0
- package/dist/_shared/{Curve-5f476d0b.d.ts → cjs/Curve-e72ce25b.d.ts} +1 -1
- package/dist/_shared/cjs/Curve-e72ce25b.js +30 -0
- package/dist/_shared/{FormControl-9dc9ecc3.d.ts → cjs/FormControl-7d8e10fa.d.ts} +0 -0
- package/dist/_shared/cjs/FormControl-7d8e10fa.js +82 -0
- package/dist/_shared/{Heading-8c640dd1.d.ts → cjs/Heading-cc38c3ec.d.ts} +0 -0
- package/dist/_shared/cjs/Heading-cc38c3ec.js +41 -0
- package/dist/_shared/{Icon-b053f03d.d.ts → cjs/Icon-bb5a5fd1.d.ts} +0 -0
- package/dist/_shared/cjs/Icon-bb5a5fd1.js +33 -0
- package/dist/_shared/{Image-a3225049.d.ts → cjs/Image-fe760a06.d.ts} +0 -0
- package/dist/_shared/cjs/Image-fe760a06.js +45 -0
- package/dist/_shared/{Section-927988cb.d.ts → cjs/Section-780f2377.d.ts} +0 -0
- package/dist/_shared/cjs/Section-780f2377.js +23 -0
- package/dist/_shared/{Surface-3fe44a2a.d.ts → cjs/Surface-d6b8010e.d.ts} +0 -0
- package/dist/_shared/cjs/Surface-d6b8010e.js +58 -0
- package/dist/_shared/{Text-1c43d82b.d.ts → cjs/Text-1d3844be.d.ts} +0 -0
- package/dist/_shared/cjs/Text-1d3844be.js +32 -0
- package/dist/_shared/{handle-link-click-35e09d0c.d.ts → cjs/handle-link-click-17a44cf4.d.ts} +0 -0
- package/dist/_shared/cjs/handle-link-click-17a44cf4.js +15 -0
- package/dist/_shared/cjs/index-45bfb67b.js +63 -0
- package/dist/_shared/{index-e3c83626.d.ts → cjs/index-78b35bc1.d.ts} +0 -0
- package/dist/_shared/cjs/index-78b35bc1.js +215 -0
- package/dist/_shared/{index-9483ad5f.d.ts → cjs/index-9483ad5f.d.ts} +2 -2
- package/dist/_shared/cjs/index-c81c9401.d.ts +4 -0
- package/dist/_shared/cjs/index.es-f590caaf.js +290 -0
- package/dist/_shared/{suffix-modifier-2a93822c.d.ts → cjs/suffix-modifier-edf7851e.d.ts} +0 -0
- package/dist/_shared/cjs/suffix-modifier-edf7851e.js +19 -0
- package/dist/_shared/{use-media-query-f11805d4.d.ts → cjs/use-media-query-75d1bbae.d.ts} +0 -0
- package/dist/_shared/cjs/use-media-query-75d1bbae.js +41 -0
- package/dist/_shared/esm/BrandLogo-ea3dd0e6.d.ts +26 -0
- package/dist/_shared/{BrandLogo-6cc8202e.js → esm/BrandLogo-ea3dd0e6.js} +4 -4
- package/dist/_shared/esm/Button-d59c31a2.d.ts +98 -0
- package/dist/_shared/{Button-2fcbd4ed.js → esm/Button-d59c31a2.js} +5 -5
- package/dist/_shared/esm/Curve-cfdca379.d.ts +32 -0
- package/dist/_shared/{Curve-5f476d0b.js → esm/Curve-cfdca379.js} +3 -3
- package/dist/_shared/esm/FormControl-33194106.d.ts +70 -0
- package/dist/_shared/{FormControl-9dc9ecc3.js → esm/FormControl-33194106.js} +3 -3
- package/dist/_shared/esm/Heading-183be76c.d.ts +46 -0
- package/dist/_shared/{Heading-8c640dd1.js → esm/Heading-183be76c.js} +4 -4
- package/dist/_shared/esm/Icon-2fd92daa.d.ts +34 -0
- package/dist/_shared/{Icon-b053f03d.js → esm/Icon-2fd92daa.js} +5 -5
- package/dist/_shared/esm/Image-7e4948f6.d.ts +94 -0
- package/dist/_shared/{Image-a3225049.js → esm/Image-7e4948f6.js} +3 -3
- package/dist/_shared/esm/Section-f1256c87.d.ts +21 -0
- package/dist/_shared/{Section-927988cb.js → esm/Section-f1256c87.js} +2 -2
- package/dist/_shared/esm/Surface-d515d212.d.ts +50 -0
- package/dist/_shared/{Surface-3fe44a2a.js → esm/Surface-d515d212.js} +2 -2
- package/dist/_shared/esm/Text-d8988620.d.ts +34 -0
- package/dist/_shared/{Text-1c43d82b.js → esm/Text-d8988620.js} +4 -4
- package/dist/_shared/esm/handle-link-click-f64f55a2.d.ts +7 -0
- package/dist/_shared/{handle-link-click-35e09d0c.js → esm/handle-link-click-f64f55a2.js} +0 -0
- package/dist/_shared/esm/index-229fc864.d.ts +2 -0
- package/dist/_shared/{index-e3c83626.js → esm/index-229fc864.js} +0 -0
- package/dist/_shared/{index-56d9df62.js → esm/index-2ae58626.js} +0 -0
- package/dist/_shared/esm/index-9483ad5f.d.ts +14 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +4 -0
- package/dist/_shared/{index.es-ff960629.js → esm/index.es-42f84e2d.js} +0 -0
- package/dist/_shared/esm/suffix-modifier-f5e28822.d.ts +10 -0
- package/dist/_shared/{suffix-modifier-2a93822c.js → esm/suffix-modifier-f5e28822.js} +1 -1
- package/dist/_shared/esm/use-media-query-38faed7f.d.ts +19 -0
- package/dist/_shared/{use-media-query-f11805d4.js → esm/use-media-query-38faed7f.js} +0 -0
- package/package.json +3 -3
- package/dist/BrandLogo/index.d.ts +0 -1
- package/dist/BrandLogo/index.js +0 -6
- package/dist/Button/index.d.ts +0 -1
- package/dist/Button/index.js +0 -8
- package/dist/Curve/index.d.ts +0 -1
- package/dist/Curve/index.js +0 -5
- package/dist/FormControl/index.d.ts +0 -1
- package/dist/FormControl/index.js +0 -5
- package/dist/Heading/index.d.ts +0 -1
- package/dist/Heading/index.js +0 -6
- package/dist/Icon/index.d.ts +0 -1
- package/dist/Icon/index.js +0 -7
- package/dist/Image/index.d.ts +0 -1
- package/dist/Image/index.js +0 -5
- package/dist/Section/index.d.ts +0 -1
- package/dist/Section/index.js +0 -4
- package/dist/Surface/index.js +0 -4
- package/dist/Text/index.d.ts +0 -1
- package/dist/Text/index.js +0 -6
- package/dist/_shared/index-c81c9401.d.ts +0 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { I as Icon } from '../_shared/Icon-
|
|
3
|
-
import { a as __assign } from '../_shared/index-
|
|
4
|
-
import { c as classNames } from '../_shared/index-
|
|
5
|
-
import { h as handleLinkClick } from '../_shared/handle-link-click-
|
|
6
|
-
import '../_shared/index.es-
|
|
7
|
-
import '../_shared/suffix-modifier-
|
|
8
|
-
import '../_shared/Surface-
|
|
2
|
+
import { I as Icon } from '../_shared/esm/Icon-2fd92daa.js';
|
|
3
|
+
import { a as __assign } from '../_shared/esm/index-229fc864.js';
|
|
4
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
5
|
+
import { h as handleLinkClick } from '../_shared/esm/handle-link-click-f64f55a2.js';
|
|
6
|
+
import '../_shared/esm/index.es-42f84e2d.js';
|
|
7
|
+
import '../_shared/esm/suffix-modifier-f5e28822.js';
|
|
8
|
+
import '../_shared/esm/Surface-d515d212.js';
|
|
9
9
|
|
|
10
10
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
11
11
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "../_shared/cjs/Button-1743b3ec";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Button = require('../_shared/cjs/Button-1743b3ec.js');
|
|
6
|
+
require('../_shared/cjs/index-78b35bc1.js');
|
|
7
|
+
require('../_shared/cjs/index-45bfb67b.js');
|
|
8
|
+
require('react');
|
|
9
|
+
require('../_shared/cjs/suffix-modifier-edf7851e.js');
|
|
10
|
+
require('../_shared/cjs/Icon-bb5a5fd1.js');
|
|
11
|
+
require('../_shared/cjs/index.es-f590caaf.js');
|
|
12
|
+
require('../_shared/cjs/Surface-d6b8010e.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Button = Button.Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "../_shared/esm/Button-d59c31a2";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { B as Button } from '../_shared/esm/Button-d59c31a2.js';
|
|
2
|
+
import '../_shared/esm/index-229fc864.js';
|
|
3
|
+
import '../_shared/esm/index-2ae58626.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../_shared/esm/suffix-modifier-f5e28822.js';
|
|
6
|
+
import '../_shared/esm/Icon-2fd92daa.js';
|
|
7
|
+
import '../_shared/esm/index.es-42f84e2d.js';
|
|
8
|
+
import '../_shared/esm/Surface-d515d212.js';
|
|
File without changes
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../_shared/cjs/index-78b35bc1.js');
|
|
6
|
+
var index$1 = require('../_shared/cjs/index-45bfb67b.js');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var Icon = require('../_shared/cjs/Icon-bb5a5fd1.js');
|
|
9
|
+
var Image = require('../_shared/cjs/Image-fe760a06.js');
|
|
10
|
+
var Heading = require('../_shared/cjs/Heading-cc38c3ec.js');
|
|
11
|
+
var suffixModifier = require('../_shared/cjs/suffix-modifier-edf7851e.js');
|
|
12
|
+
var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
|
|
13
|
+
var handleLinkClick = require('../_shared/cjs/handle-link-click-17a44cf4.js');
|
|
14
|
+
require('../_shared/cjs/index.es-f590caaf.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Detect interaction mode
|
|
22
|
+
*/
|
|
23
|
+
var useInteractionMode = function () {
|
|
24
|
+
var _a = React.useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
|
|
25
|
+
React.useEffect(function () {
|
|
26
|
+
var onKeyDown = function (event) {
|
|
27
|
+
if (event.altKey || event.ctrlKey || event.metaKey) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setInteractionMode("keyboard");
|
|
31
|
+
};
|
|
32
|
+
var onPointerDown = function () {
|
|
33
|
+
setInteractionMode("pointer");
|
|
34
|
+
};
|
|
35
|
+
if (typeof window !== "undefined") {
|
|
36
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
37
|
+
document.addEventListener("click", onPointerDown, true);
|
|
38
|
+
}
|
|
39
|
+
return function () {
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
42
|
+
document.removeEventListener("click", onPointerDown);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
return { interactionMode: interactionMode };
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Use `Card` to contain content and actions about a single subject.
|
|
51
|
+
*/
|
|
52
|
+
var Card = function (_a) {
|
|
53
|
+
var _b;
|
|
54
|
+
var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ? "Read more" : _c, children = _a.children, _d = _a.fill, fill = _d === void 0 ? "solid" : _d, href = _a.href, imageAlt = _a.imageAlt, imageHeight = _a.imageHeight, imageLoading = _a.imageLoading, imageSrc = _a.imageSrc, imageSrcSet = _a.imageSrcSet, linkData = _a.linkData, minHeight = _a.minHeight, onClick = _a.onClick, target = _a.target, title = _a.title, _e = _a.titleSize, titleSize = _e === void 0 ? "s" : _e, props = index.__rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageHeight", "imageLoading", "imageSrc", "imageSrcSet", "linkData", "minHeight", "onClick", "target", "title", "titleSize"]);
|
|
55
|
+
var surface = React.useContext(Surface.Context).surface;
|
|
56
|
+
var interactionMode = useInteractionMode().interactionMode;
|
|
57
|
+
var Wrapper = function (_a) {
|
|
58
|
+
var children = _a.children;
|
|
59
|
+
return fill === "outlined" || fill === "neutral" ? (React__default["default"].createElement("div", null, children)) : (React__default["default"].createElement(Surface.Surface, { background: surface === "dark" ? "white" : "darker" }, children));
|
|
60
|
+
};
|
|
61
|
+
var coverImage = imageSrc && (React__default["default"].createElement(CardImage, { alt: imageAlt, height: imageHeight, loading: imageLoading, src: imageSrc, srcSet: imageSrcSet }));
|
|
62
|
+
return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {
|
|
63
|
+
"arc-Card": true,
|
|
64
|
+
"arc-Card--onDarkSurface": surface === "dark"
|
|
65
|
+
},
|
|
66
|
+
_b[suffixModifier.suffixModifier("arc-Card--fill", fill)] = fill !== "solid",
|
|
67
|
+
_b["arc-is-".concat(interactionMode, "InteractionMode")] = interactionMode,
|
|
68
|
+
_b)) }, index.filterDataAttrs(props)),
|
|
69
|
+
React__default["default"].createElement(Wrapper, null,
|
|
70
|
+
React__default["default"].createElement("div", { className: "arc-Card-inner", style: { minHeight: minHeight } },
|
|
71
|
+
React__default["default"].createElement("div", { className: "arc-Card-header" },
|
|
72
|
+
React__default["default"].createElement("div", { className: "arc-Card-title" },
|
|
73
|
+
React__default["default"].createElement(Heading.Heading, { size: titleSize },
|
|
74
|
+
React__default["default"].createElement(CardLink, { stretch: true, onClick: onClick, actionId: actionId, fill: fill, href: href, linkData: linkData, target: target }, title))),
|
|
75
|
+
coverImage),
|
|
76
|
+
React__default["default"].createElement("div", { className: "arc-Card-children" },
|
|
77
|
+
React__default["default"].createElement(Card.Block, null, children)),
|
|
78
|
+
href && (React__default["default"].createElement(CardBlock, null,
|
|
79
|
+
React__default["default"].createElement(CardLink, { href: href, fill: fill, actionId: actionId, onClick: onClick, isButton: true }, actionLabel)))))));
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Internal `Card.Block` component to section blocks of content within a Card.
|
|
83
|
+
*/
|
|
84
|
+
var CardBlock = function (_a) {
|
|
85
|
+
var _b = _a.align, align = _b === void 0 ? "left" : _b, children = _a.children, _c = _a.isFullWidth, isFullWidth = _c === void 0 ? false : _c, _d = _a.grow, grow = _d === void 0 ? false : _d;
|
|
86
|
+
return (React__default["default"].createElement("div", { className: index$1.classNames({
|
|
87
|
+
"arc-Card-block": true,
|
|
88
|
+
"arc-Card-block--alignCenter": align === "center",
|
|
89
|
+
"arc-Card-block--alignRight": align === "right",
|
|
90
|
+
"arc-Card-block--fullWidth": isFullWidth,
|
|
91
|
+
"arc-Card-block--grow": grow
|
|
92
|
+
}) },
|
|
93
|
+
React__default["default"].createElement("div", { className: "arc-Card-blockInner" }, children)));
|
|
94
|
+
};
|
|
95
|
+
CardBlock.displayName = "Card.Block";
|
|
96
|
+
Card.Block = CardBlock;
|
|
97
|
+
/**
|
|
98
|
+
* Internal `Card.Image` component to show an image within a Card.
|
|
99
|
+
*/
|
|
100
|
+
var CardImage = function (_a) {
|
|
101
|
+
var _b = _a.alt, alt = _b === void 0 ? "" : _b, _c = _a.height, height = _c === void 0 ? 176 : _c, loading = _a.loading, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet;
|
|
102
|
+
return (React__default["default"].createElement("div", { className: index$1.classNames({
|
|
103
|
+
"arc-Card-image": true
|
|
104
|
+
}) },
|
|
105
|
+
React__default["default"].createElement(Image.Image, { alt: alt, fit: "cover", height: height, loading: loading, sizes: sizes, src: src, srcSet: srcSet })));
|
|
106
|
+
};
|
|
107
|
+
CardImage.displayName = "Card.Image";
|
|
108
|
+
Card.Image = CardImage;
|
|
109
|
+
/**
|
|
110
|
+
* Internal `CardLink` component.
|
|
111
|
+
*/
|
|
112
|
+
var CardLink = function (_a) {
|
|
113
|
+
var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, onClick = _a.onClick, stretch = _a.stretch, target = _a.target;
|
|
114
|
+
var surface = React.useContext(Surface.Context).surface;
|
|
115
|
+
return (React__default["default"].createElement("a", index.__assign({ onClick: handleLinkClick.handleLinkClick({ handler: onClick }), "aria-describedby": actionId, className: index$1.classNames({
|
|
116
|
+
"arc-Card-link": true,
|
|
117
|
+
"arc-Card-link--button": isButton,
|
|
118
|
+
"arc-Card-link--onDarkSurface": surface === "dark" && fill !== "neutral",
|
|
119
|
+
"arc-Card-link--stretch": stretch
|
|
120
|
+
}), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target }, index.filterDataAttrs(linkData)),
|
|
121
|
+
React__default["default"].createElement("span", { className: "arc-Card-linkText" }, children),
|
|
122
|
+
isButton && (React__default["default"].createElement("span", { className: "arc-Card-linkIcon" },
|
|
123
|
+
React__default["default"].createElement(Icon.Icon, { icon: "btChevronRightMid", size: 16 })))));
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
exports.Card = Card;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, HTMLAttributes } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Use `Card` to contain content and actions about a single subject.
|
|
6
|
+
*/
|
|
7
|
+
declare const Card: FC<CardProps> & {
|
|
8
|
+
Block: typeof CardBlock;
|
|
9
|
+
Image: typeof CardImage;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Internal `Card.Block` component to section blocks of content within a Card.
|
|
13
|
+
*/
|
|
14
|
+
declare const CardBlock: FC<{
|
|
15
|
+
/**
|
|
16
|
+
* Contents of the CardBlock.
|
|
17
|
+
*/
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* How should the content of the block be aligned?
|
|
21
|
+
*/
|
|
22
|
+
align?: "left" | "center" | "right";
|
|
23
|
+
/**
|
|
24
|
+
* Should the block stretch to the width of the Card?
|
|
25
|
+
*/
|
|
26
|
+
isFullWidth?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Should the block grow to the fill the available vertical space? Used when the Card appears in a column.
|
|
29
|
+
*/
|
|
30
|
+
grow?: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Internal `Card.Image` component to show an image within a Card.
|
|
34
|
+
*/
|
|
35
|
+
declare const CardImage: FC<{
|
|
36
|
+
/**
|
|
37
|
+
* Alternative text for the Card.Image, shown if the image cannot be displayed.
|
|
38
|
+
*/
|
|
39
|
+
alt?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Height of the Card.Image.
|
|
42
|
+
*/
|
|
43
|
+
height?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Loading behaviour of the Card.Image.
|
|
46
|
+
*/
|
|
47
|
+
loading?: "eager" | "lazy";
|
|
48
|
+
/**
|
|
49
|
+
* The HTML [sizes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Example_4_Using_the_srcset_and_sizes_attributes) attribute. Required if srcSet is defined.
|
|
50
|
+
*/
|
|
51
|
+
sizes?: string;
|
|
52
|
+
/**
|
|
53
|
+
* HTML src for the Card.Image.
|
|
54
|
+
*/
|
|
55
|
+
src: string;
|
|
56
|
+
/**
|
|
57
|
+
* A comma-separated list indicating a set of possible image sources for the user agent to use for different screen sizes. 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`.
|
|
58
|
+
*/
|
|
59
|
+
srcSet?: string;
|
|
60
|
+
}>;
|
|
61
|
+
type TitleSize = "xs" | "s" | "m" | "l" | "xl";
|
|
62
|
+
interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
63
|
+
/**
|
|
64
|
+
* The HTML ID passed to the Card Button for aria- attributes.
|
|
65
|
+
*/
|
|
66
|
+
actionId?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Label for the Card's Button. You should specify this if defining an href.
|
|
69
|
+
*/
|
|
70
|
+
actionLabel?: string;
|
|
71
|
+
/**
|
|
72
|
+
* A `Card.Image` to use for the cover image.
|
|
73
|
+
*/
|
|
74
|
+
coverImage?: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Card fill.
|
|
77
|
+
*/
|
|
78
|
+
fill?: "solid" | "outlined" | "neutral";
|
|
79
|
+
/**
|
|
80
|
+
* A URL to link to when the Card is clicked or touched.
|
|
81
|
+
*/
|
|
82
|
+
href: string;
|
|
83
|
+
/**
|
|
84
|
+
* Alternative text for the Card cover image, shown if the image cannot be displayed.
|
|
85
|
+
*/
|
|
86
|
+
imageAlt?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Height of the Card cover image.
|
|
89
|
+
*/
|
|
90
|
+
imageHeight?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Loading behaviour of the Card cover image.
|
|
93
|
+
*/
|
|
94
|
+
imageLoading?: "eager" | "lazy";
|
|
95
|
+
/**
|
|
96
|
+
* HTML src for the Card cover image.
|
|
97
|
+
*/
|
|
98
|
+
imageSrc?: string;
|
|
99
|
+
/**
|
|
100
|
+
* A comma-separated list indicating a set of possible image sources for the user agent to use for different screen sizes in the Card cover 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`.
|
|
101
|
+
*/
|
|
102
|
+
imageSrcSet?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Object of `data-` attributes to render on internal anchor element, e.g.
|
|
105
|
+
* `{ data-analytics-link: "My link"}` => `<a data-analytics-link="My link">`.
|
|
106
|
+
*/
|
|
107
|
+
linkData?: {};
|
|
108
|
+
/**
|
|
109
|
+
* The minimum height of the card. Cards in a series of columns will match the
|
|
110
|
+
* height of the tallest Card.
|
|
111
|
+
*/
|
|
112
|
+
minHeight?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Link target attribute for the Card link.
|
|
115
|
+
*/
|
|
116
|
+
target?: "_blank" | "_parent" | "_self" | "_top";
|
|
117
|
+
/**
|
|
118
|
+
* The title for the Card, describing the content. This is required to provide good accessibility to screen readers.
|
|
119
|
+
*/
|
|
120
|
+
title: string;
|
|
121
|
+
/**
|
|
122
|
+
* The size for the Card title.
|
|
123
|
+
*/
|
|
124
|
+
titleSize?: TitleSize;
|
|
125
|
+
/**
|
|
126
|
+
* On click handler.
|
|
127
|
+
*/
|
|
128
|
+
onClick?: () => void;
|
|
129
|
+
}
|
|
130
|
+
export { Card };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-
|
|
2
|
-
import { c as classNames } from '../_shared/index-
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
|
|
2
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
3
3
|
import React, { useState, useEffect, useContext } from 'react';
|
|
4
|
-
import { I as Icon } from '../_shared/Icon-
|
|
5
|
-
import { I as Image } from '../_shared/Image-
|
|
6
|
-
import { H as Heading } from '../_shared/Heading-
|
|
7
|
-
import { s as suffixModifier } from '../_shared/suffix-modifier-
|
|
8
|
-
import { C as Context, S as Surface } from '../_shared/Surface-
|
|
9
|
-
import { h as handleLinkClick } from '../_shared/handle-link-click-
|
|
10
|
-
import '../_shared/index.es-
|
|
4
|
+
import { I as Icon } from '../_shared/esm/Icon-2fd92daa.js';
|
|
5
|
+
import { I as Image } from '../_shared/esm/Image-7e4948f6.js';
|
|
6
|
+
import { H as Heading } from '../_shared/esm/Heading-183be76c.js';
|
|
7
|
+
import { s as suffixModifier } from '../_shared/esm/suffix-modifier-f5e28822.js';
|
|
8
|
+
import { C as Context, S as Surface } from '../_shared/esm/Surface-d515d212.js';
|
|
9
|
+
import { h as handleLinkClick } from '../_shared/esm/handle-link-click-f64f55a2.js';
|
|
10
|
+
import '../_shared/esm/index.es-42f84e2d.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Detect interaction mode
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../_shared/cjs/index-78b35bc1.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var index$1 = require('../_shared/cjs/index-45bfb67b.js');
|
|
8
|
+
var FormControl = require('../_shared/cjs/FormControl-7d8e10fa.js');
|
|
9
|
+
var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Use `Checkbox` to allow users to select individual options.
|
|
17
|
+
*/
|
|
18
|
+
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
19
|
+
var _b = _a.checked, checked = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, label = _a.label, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _e = _a.size, size = _e === void 0 ? "l" : _e, value = _a.value, props = index.__rest(_a, ["checked", "errorMessage", "helper", "id", "isDisabled", "isRequired", "label", "name", "onBlur", "onChange", "size", "value"]);
|
|
20
|
+
var requirementStatus = React.useContext(FormControl.Context).requirementStatus;
|
|
21
|
+
var surface = React.useContext(Surface.Context).surface;
|
|
22
|
+
var _f = FormControl.useAriaDescribedby({
|
|
23
|
+
id: id,
|
|
24
|
+
errorMessage: errorMessage
|
|
25
|
+
}), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError;
|
|
26
|
+
var idLabel = "".concat(id, "-label");
|
|
27
|
+
var checkedProps = {};
|
|
28
|
+
if (typeof onChange === "function") {
|
|
29
|
+
checkedProps.checked = checked;
|
|
30
|
+
}
|
|
31
|
+
else if (checked && !onChange) {
|
|
32
|
+
checkedProps.defaultChecked = true;
|
|
33
|
+
}
|
|
34
|
+
if (requirementStatus === "required") {
|
|
35
|
+
isRequired = true;
|
|
36
|
+
}
|
|
37
|
+
return (React__default["default"].createElement("div", { className: index$1.classNames({
|
|
38
|
+
"arc-Checkbox": true,
|
|
39
|
+
"arc-Checkbox--disabled": isDisabled,
|
|
40
|
+
"arc-Checkbox--invalid": errorMessage,
|
|
41
|
+
"arc-Checkbox--small": size === "s",
|
|
42
|
+
"arc-Checkbox--onDarkSurface": surface === "dark"
|
|
43
|
+
}) },
|
|
44
|
+
React__default["default"].createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
|
|
45
|
+
React__default["default"].createElement("input", index.__assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-Checkbox-input" }, checkedProps, { disabled: isDisabled, id: id, name: name, onBlur: onBlur, onChange: onChange, ref: ref, required: isRequired, type: "checkbox", value: value }, index.filterDataAttrs(props))),
|
|
46
|
+
React__default["default"].createElement("span", { className: "arc-Checkbox-box" }),
|
|
47
|
+
React__default["default"].createElement("span", null,
|
|
48
|
+
label,
|
|
49
|
+
!isRequired && requirementStatus !== "optional" ? (React__default["default"].createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
|
|
50
|
+
helper && React__default["default"].createElement("span", { className: "arc-Checkbox-helper" }, helper))),
|
|
51
|
+
errorMessage && (React__default["default"].createElement("div", { id: idError, className: "arc-Checkbox-error" }, errorMessage))));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
exports.Checkbox = Checkbox;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
type EventType = React.ChangeEvent<HTMLInputElement>;
|
|
4
|
+
/**
|
|
5
|
+
* Use `Checkbox` to allow users to select individual options.
|
|
6
|
+
*/
|
|
7
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
interface CheckboxProps {
|
|
9
|
+
/**
|
|
10
|
+
* Error message for the Checkbox.
|
|
11
|
+
*/
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Helper text for the Checkbox, shown below the label.
|
|
15
|
+
*/
|
|
16
|
+
helper?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* ID for the Checkbox.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Is the input checked?
|
|
23
|
+
*/
|
|
24
|
+
checked?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Should the Checkbox be disabled?
|
|
27
|
+
*/
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Is the Checkbox required?
|
|
31
|
+
*/
|
|
32
|
+
isRequired?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Label for the Checkbox.
|
|
35
|
+
*/
|
|
36
|
+
label: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Name for the Checkbox.
|
|
39
|
+
*/
|
|
40
|
+
name?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Function to call when the Checkbox loses focus.
|
|
43
|
+
*/
|
|
44
|
+
onBlur?: (e: EventType) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Callback function to update the Checkbox's controlled `checked` prop, for
|
|
47
|
+
* example `e => setChecked(e.target.checked)`.
|
|
48
|
+
*/
|
|
49
|
+
onChange?: (event: EventType) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Size of the Checkbox.
|
|
52
|
+
*/
|
|
53
|
+
size?: "s" | "l";
|
|
54
|
+
/**
|
|
55
|
+
* Value for the Checkbox.
|
|
56
|
+
*/
|
|
57
|
+
value?: string;
|
|
58
|
+
}
|
|
59
|
+
export { Checkbox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
|
|
2
2
|
import React, { forwardRef, useContext } from 'react';
|
|
3
|
-
import { c as classNames } from '../_shared/index-
|
|
4
|
-
import { C as Context, u as useAriaDescribedby } from '../_shared/FormControl-
|
|
5
|
-
import { C as Context$1 } from '../_shared/Surface-
|
|
3
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
4
|
+
import { C as Context, u as useAriaDescribedby } from '../_shared/esm/FormControl-33194106.js';
|
|
5
|
+
import { C as Context$1 } from '../_shared/esm/Surface-d515d212.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Use `Checkbox` to allow users to select individual options.
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../_shared/cjs/index-78b35bc1.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `Clock` is a demo component that shows the current time.
|
|
14
|
+
*/
|
|
15
|
+
var Clock = function (_a) {
|
|
16
|
+
var _b = _a.locale, locale = _b === void 0 ? "en-GB" : _b, props = index.__rest(_a, ["locale"]);
|
|
17
|
+
var _c = React.useState(new Date()), time = _c[0], setTime = _c[1];
|
|
18
|
+
var _d = React.useState(time.toLocaleTimeString(locale)), humanTime = _d[0], setHumanTime = _d[1];
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
var tick = function () {
|
|
21
|
+
var newTime = new Date();
|
|
22
|
+
setTime(newTime);
|
|
23
|
+
setHumanTime(newTime.toLocaleTimeString(locale));
|
|
24
|
+
};
|
|
25
|
+
tick();
|
|
26
|
+
var interval = setInterval(tick, 1000);
|
|
27
|
+
return function () { return clearInterval(interval); };
|
|
28
|
+
}, [locale]);
|
|
29
|
+
return (React__default["default"].createElement("time", index.__assign({ className: "arc-Clock", dateTime: time.toISOString() }, index.filterDataAttrs(props), { "data-locale": locale }), humanTime));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var Clock_rehydrator = (function (el) { return index.__awaiter(void 0, void 0, void 0, function () {
|
|
33
|
+
var props;
|
|
34
|
+
return index.__generator(this, function (_a) {
|
|
35
|
+
props = {
|
|
36
|
+
locale: el.dataset.locale
|
|
37
|
+
};
|
|
38
|
+
return [2 /*return*/, React__default["default"].createElement(Clock, index.__assign({}, props))];
|
|
39
|
+
});
|
|
40
|
+
}); });
|
|
41
|
+
|
|
42
|
+
exports.Clock = Clock;
|
|
43
|
+
exports.ClockRehydrator = Clock_rehydrator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* `Clock` is a demo component that shows the current time.
|
|
5
|
+
*/
|
|
6
|
+
declare const Clock: FC<ClockProps>;
|
|
7
|
+
type LocaleType = "en-GB" | "en-US" | "ar-EG";
|
|
8
|
+
interface ClockProps {
|
|
9
|
+
/**
|
|
10
|
+
* Locale for the Clock.
|
|
11
|
+
*/
|
|
12
|
+
locale?: LocaleType;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: (el: HTMLTimeElement) => Promise<JSX.Element>;
|
|
15
|
+
export { Clock, _default as ClockRehydrator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign, f as filterDataAttrs, d as __awaiter, e as __generator } from '../_shared/index-
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs, d as __awaiter, e as __generator } from '../_shared/esm/index-229fc864.js';
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../_shared/cjs/index-78b35bc1.js');
|
|
6
|
+
var index$1 = require('../_shared/cjs/index-45bfb67b.js');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var suffixModifier = require('../_shared/cjs/suffix-modifier-edf7851e.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Use `Columns` to compose layouts on a 12-column grid.
|
|
16
|
+
*/
|
|
17
|
+
var Columns = function (_a) {
|
|
18
|
+
var children = _a.children, _b = _a.isGutterless, isGutterless = _b === void 0 ? false : _b, props = index.__rest(_a, ["children", "isGutterless"]);
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
React__default["default"].Children.map(children, function (item) {
|
|
21
|
+
if (item && item.type !== Col) {
|
|
22
|
+
throw new Error("Illegal child passed to <Columns />. Ensure to only use <Columns.Col />.");
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}, [children]);
|
|
26
|
+
return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames({
|
|
27
|
+
"arc-Columns": true,
|
|
28
|
+
"arc-Columns--gutterless": isGutterless
|
|
29
|
+
}) }, index.filterDataAttrs(props)),
|
|
30
|
+
React__default["default"].createElement("div", { className: "arc-Columns-inner" }, children)));
|
|
31
|
+
};
|
|
32
|
+
var Col = function (_a) {
|
|
33
|
+
var _b;
|
|
34
|
+
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 = index.__rest(_a, ["align", "children", "isDebugVisible", "offset", "offsetS", "offsetM", "offsetL", "offsetXL", "span", "spanS", "spanM", "spanL", "spanXL"]);
|
|
35
|
+
return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {},
|
|
36
|
+
_b["arc-Columns-col"] = true,
|
|
37
|
+
_b[suffixModifier.suffixModifier("arc-Columns-col--align", align || "")] = align,
|
|
38
|
+
_b["arc-Columns-col--".concat(span)] = typeof span !== "undefined",
|
|
39
|
+
_b["arc-Columns-col--s".concat(spanS)] = typeof spanS !== "undefined",
|
|
40
|
+
_b["arc-Columns-col--m".concat(spanM)] = typeof spanM !== "undefined",
|
|
41
|
+
_b["arc-Columns-col--l".concat(spanL)] = typeof spanL !== "undefined",
|
|
42
|
+
_b["arc-Columns-col--xL".concat(spanXL)] = typeof spanXL !== "undefined",
|
|
43
|
+
_b["arc-Columns-col--offset"] = typeof offset !== "undefined" ||
|
|
44
|
+
typeof offsetS !== "undefined" ||
|
|
45
|
+
typeof offsetM !== "undefined" ||
|
|
46
|
+
typeof offsetL !== "undefined" ||
|
|
47
|
+
typeof offsetXL !== "undefined",
|
|
48
|
+
_b["arc-Columns-col--offset".concat(offset)] = typeof offset !== "undefined",
|
|
49
|
+
_b["arc-Columns-col--offsetS".concat(offsetS)] = typeof offsetS !== "undefined",
|
|
50
|
+
_b["arc-Columns-col--offsetM".concat(offsetM)] = typeof offsetM !== "undefined",
|
|
51
|
+
_b["arc-Columns-col--offsetL".concat(offsetL)] = typeof offsetL !== "undefined",
|
|
52
|
+
_b["arc-Columns-col--offsetXL".concat(offsetXL)] = typeof offsetXL !== "undefined",
|
|
53
|
+
_b["arc-Columns-col--debugVisible"] = isDebugVisible,
|
|
54
|
+
_b)) }, index.filterDataAttrs(props)), children));
|
|
55
|
+
};
|
|
56
|
+
Col.displayName = "Columns.Col";
|
|
57
|
+
Columns.Col = Col;
|
|
58
|
+
|
|
59
|
+
exports.Columns = Columns;
|