@arc-ui/components 10.1.0 → 10.2.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.
Files changed (180) hide show
  1. package/dist/Align/index.d.ts +25 -0
  2. package/dist/Align/index.js +25 -0
  3. package/dist/Base/index.d.ts +16 -0
  4. package/dist/Base/index.js +12 -0
  5. package/dist/BrandLogo/index.d.ts +1 -0
  6. package/dist/BrandLogo/index.js +6 -0
  7. package/dist/Breadcrumbs/index.d.ts +57 -0
  8. package/dist/Breadcrumbs/index.js +17294 -0
  9. package/dist/Button/index.d.ts +1 -0
  10. package/dist/Button/index.js +8 -0
  11. package/dist/Card/index.d.ts +126 -0
  12. package/dist/Card/index.js +118 -0
  13. package/dist/Checkbox/index.d.ts +59 -0
  14. package/dist/Checkbox/index.js +46 -0
  15. package/dist/Clock/index.d.ts +15 -0
  16. package/dist/Clock/index.js +34 -0
  17. package/dist/Columns/index.d.ts +76 -0
  18. package/dist/Columns/index.js +51 -0
  19. package/dist/Curve/index.d.ts +1 -0
  20. package/dist/Curve/index.js +5 -0
  21. package/dist/Disclosure/index.d.ts +31 -0
  22. package/dist/Disclosure/index.js +25 -0
  23. package/dist/Elevation/index.d.ts +16 -0
  24. package/dist/Elevation/index.js +17 -0
  25. package/dist/FormControl/index.d.ts +1 -0
  26. package/dist/FormControl/index.js +5 -0
  27. package/dist/Group/index.d.ts +46 -0
  28. package/dist/Group/index.js +42 -0
  29. package/dist/Heading/index.d.ts +1 -0
  30. package/dist/Heading/index.js +6 -0
  31. package/dist/Icon/index.d.ts +1 -0
  32. package/dist/Icon/index.js +7 -0
  33. package/dist/Image/index.d.ts +1 -0
  34. package/dist/Image/index.js +5 -0
  35. package/dist/Markup/index.d.ts +16 -0
  36. package/dist/Markup/index.js +19 -0
  37. package/dist/Poster/index.d.ts +76 -0
  38. package/dist/Poster/index.js +44 -0
  39. package/dist/RadioGroup/index.d.ts +85 -0
  40. package/dist/RadioGroup/index.js +64 -0
  41. package/dist/Rule/index.d.ts +8 -0
  42. package/dist/Rule/index.js +17 -0
  43. package/dist/Section/index.d.ts +1 -0
  44. package/dist/Section/index.js +4 -0
  45. package/dist/SiteFooter/index.d.ts +64 -0
  46. package/dist/SiteFooter/index.js +88 -0
  47. package/dist/SiteHeader/index.d.ts +252 -0
  48. package/dist/SiteHeader/index.js +638 -0
  49. package/dist/Surface/index.d.ts +1 -0
  50. package/dist/Surface/index.js +4 -0
  51. package/dist/Text/index.d.ts +1 -0
  52. package/dist/Text/index.js +6 -0
  53. package/dist/TextInput/index.d.ts +71 -0
  54. package/dist/TextInput/index.js +56 -0
  55. package/dist/UniversalHeader/index.d.ts +26 -0
  56. package/dist/UniversalHeader/index.js +30 -0
  57. package/dist/VerticalSpace/index.d.ts +18 -0
  58. package/dist/VerticalSpace/index.js +19 -0
  59. package/dist/_shared/BrandLogo-6cc8202e.d.ts +26 -0
  60. package/dist/_shared/BrandLogo-6cc8202e.js +25 -0
  61. package/dist/_shared/Button-abfb12d4.d.ts +98 -0
  62. package/dist/_shared/Button-abfb12d4.js +51 -0
  63. package/dist/_shared/Curve-5f476d0b.d.ts +32 -0
  64. package/dist/_shared/Curve-5f476d0b.js +24 -0
  65. package/dist/_shared/FormControl-9dc9ecc3.d.ts +70 -0
  66. package/dist/_shared/FormControl-9dc9ecc3.js +74 -0
  67. package/dist/_shared/Heading-8c640dd1.d.ts +46 -0
  68. package/dist/_shared/Heading-8c640dd1.js +35 -0
  69. package/dist/_shared/Icon-4d523b46.d.ts +34 -0
  70. package/dist/_shared/Icon-4d523b46.js +27 -0
  71. package/dist/_shared/Image-a3225049.d.ts +94 -0
  72. package/dist/_shared/Image-a3225049.js +39 -0
  73. package/dist/_shared/Section-927988cb.d.ts +21 -0
  74. package/dist/_shared/Section-927988cb.js +17 -0
  75. package/dist/_shared/Surface-3fe44a2a.d.ts +50 -0
  76. package/dist/_shared/Surface-3fe44a2a.js +49 -0
  77. package/dist/_shared/Text-1c43d82b.d.ts +34 -0
  78. package/dist/_shared/Text-1c43d82b.js +26 -0
  79. package/dist/_shared/handle-link-click-35e09d0c.d.ts +7 -0
  80. package/dist/_shared/handle-link-click-35e09d0c.js +13 -0
  81. package/dist/_shared/index-56d9df62.js +61 -0
  82. package/dist/_shared/index-9483ad5f.d.ts +14 -0
  83. package/dist/_shared/index-c81c9401.d.ts +4 -0
  84. package/dist/_shared/index-e3c83626.d.ts +2 -0
  85. package/dist/_shared/index-e3c83626.js +208 -0
  86. package/dist/_shared/index.es-f5886c3a.js +284 -0
  87. package/dist/_shared/suffix-modifier-2a93822c.d.ts +10 -0
  88. package/dist/_shared/suffix-modifier-2a93822c.js +17 -0
  89. package/dist/_shared/use-media-query-f11805d4.d.ts +19 -0
  90. package/dist/_shared/use-media-query-f11805d4.js +39 -0
  91. package/dist/index.es.js +17489 -175
  92. package/dist/index.es.js.map +1 -1
  93. package/dist/index.js +17488 -173
  94. package/dist/index.js.map +1 -1
  95. package/dist/styles.css +1 -1
  96. package/dist/types/components/Align/Align.d.ts +1 -2
  97. package/dist/types/components/Align/index.d.ts +1 -1
  98. package/dist/types/components/Base/Base.d.ts +1 -2
  99. package/dist/types/components/Base/index.d.ts +1 -1
  100. package/dist/types/components/BrandLogo/BrandLogo.d.ts +1 -2
  101. package/dist/types/components/BrandLogo/index.d.ts +1 -1
  102. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  103. package/dist/types/components/Breadcrumbs/BreadcrumbsItem/BreadcrumbsItem.d.ts +17 -0
  104. package/dist/types/components/Breadcrumbs/BreadcrumbsLink/BreadcrumbsLink.d.ts +25 -0
  105. package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
  106. package/dist/types/components/Button/Button.d.ts +2 -2
  107. package/dist/types/components/Button/index.d.ts +1 -1
  108. package/dist/types/components/Card/Card.d.ts +6 -2
  109. package/dist/types/components/Card/index.d.ts +1 -1
  110. package/dist/types/components/Checkbox/Checkbox.d.ts +2 -2
  111. package/dist/types/components/Checkbox/index.d.ts +1 -1
  112. package/dist/types/components/Clock/Clock.d.ts +1 -2
  113. package/dist/types/components/Clock/index.d.ts +1 -1
  114. package/dist/types/components/Columns/Columns.d.ts +2 -2
  115. package/dist/types/components/Columns/index.d.ts +1 -1
  116. package/dist/types/components/Curve/Curve.d.ts +1 -2
  117. package/dist/types/components/Curve/index.d.ts +1 -1
  118. package/dist/types/components/Disclosure/Disclosure.d.ts +1 -2
  119. package/dist/types/components/Disclosure/index.d.ts +1 -1
  120. package/dist/types/components/Elevation/Elevation.d.ts +1 -2
  121. package/dist/types/components/Elevation/index.d.ts +1 -1
  122. package/dist/types/components/FormControl/FormControl.d.ts +1 -2
  123. package/dist/types/components/FormControl/index.d.ts +1 -1
  124. package/dist/types/components/Group/Group.d.ts +1 -2
  125. package/dist/types/components/Group/index.d.ts +1 -1
  126. package/dist/types/components/Heading/Heading.d.ts +1 -2
  127. package/dist/types/components/Heading/index.d.ts +1 -1
  128. package/dist/types/components/Icon/Icon.d.ts +1 -2
  129. package/dist/types/components/Icon/index.d.ts +1 -1
  130. package/dist/types/components/Image/Image.d.ts +1 -2
  131. package/dist/types/components/Image/index.d.ts +1 -1
  132. package/dist/types/components/Markup/Markup.d.ts +1 -2
  133. package/dist/types/components/Markup/index.d.ts +1 -1
  134. package/dist/types/components/Poster/Poster.d.ts +3 -4
  135. package/dist/types/components/Poster/PosterImage.d.ts +0 -1
  136. package/dist/types/components/Poster/PosterVideo.d.ts +1 -2
  137. package/dist/types/components/Poster/index.d.ts +1 -1
  138. package/dist/types/components/RadioGroup/RadioButton/RadioButton.d.ts +1 -2
  139. package/dist/types/components/RadioGroup/RadioButton/index.d.ts +1 -1
  140. package/dist/types/components/RadioGroup/RadioGroup.d.ts +7 -3
  141. package/dist/types/components/RadioGroup/index.d.ts +1 -1
  142. package/dist/types/components/Rule/Rule.d.ts +1 -2
  143. package/dist/types/components/Rule/index.d.ts +1 -1
  144. package/dist/types/components/Section/Section.d.ts +1 -2
  145. package/dist/types/components/Section/index.d.ts +1 -1
  146. package/dist/types/components/SiteFooter/SiteFooter.d.ts +5 -2
  147. package/dist/types/components/SiteFooter/index.d.ts +1 -1
  148. package/dist/types/components/SiteHeader/SiteHeader.d.ts +11 -8
  149. package/dist/types/components/SiteHeader/components/BackButton/BackButton.d.ts +0 -1
  150. package/dist/types/components/SiteHeader/components/BackButton/index.d.ts +1 -1
  151. package/dist/types/components/SiteHeader/components/Column/Column.d.ts +1 -2
  152. package/dist/types/components/SiteHeader/components/Column/index.d.ts +1 -1
  153. package/dist/types/components/SiteHeader/components/Item/Item.d.ts +5 -2
  154. package/dist/types/components/SiteHeader/components/Item/index.d.ts +1 -1
  155. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +5 -2
  156. package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +1 -1
  157. package/dist/types/components/SiteHeader/components/MenuButton/MenuButton.d.ts +1 -2
  158. package/dist/types/components/SiteHeader/components/MenuButton/index.d.ts +1 -1
  159. package/dist/types/components/SiteHeader/components/NavItem/NavItem.d.ts +4 -1
  160. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.d.ts +5 -2
  161. package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +2 -2
  162. package/dist/types/components/SiteHeader/components/Panel/Panel.d.ts +1 -1
  163. package/dist/types/components/SiteHeader/components/Panel/index.d.ts +1 -1
  164. package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.d.ts +5 -2
  165. package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +1 -1
  166. package/dist/types/components/SiteHeader/index.d.ts +1 -1
  167. package/dist/types/components/Surface/Surface.d.ts +1 -2
  168. package/dist/types/components/Surface/index.d.ts +1 -1
  169. package/dist/types/components/Text/Text.d.ts +1 -2
  170. package/dist/types/components/Text/index.d.ts +1 -1
  171. package/dist/types/components/TextInput/TextInput.d.ts +2 -2
  172. package/dist/types/components/TextInput/index.d.ts +1 -1
  173. package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +1 -2
  174. package/dist/types/components/UniversalHeader/index.d.ts +1 -1
  175. package/dist/types/components/VerticalSpace/VerticalSpace.d.ts +1 -2
  176. package/dist/types/components/VerticalSpace/index.d.ts +1 -1
  177. package/dist/types/components/index.d.ts +29 -28
  178. package/dist/types/helpers/handle-link-click.d.ts +7 -0
  179. package/dist/types/styles.d.ts +2 -0
  180. package/package.json +7 -7
@@ -0,0 +1 @@
1
+ export { Button } from "../_shared/Button-abfb12d4";
@@ -0,0 +1,8 @@
1
+ export { B as Button } from '../_shared/Button-abfb12d4.js';
2
+ import '../_shared/index-e3c83626.js';
3
+ import '../_shared/index-56d9df62.js';
4
+ import 'react';
5
+ import '../_shared/suffix-modifier-2a93822c.js';
6
+ import '../_shared/Icon-4d523b46.js';
7
+ import '../_shared/index.es-f5886c3a.js';
8
+ import '../_shared/Surface-3fe44a2a.js';
@@ -0,0 +1,126 @@
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
+ * How should the content of the block be aligned?
17
+ */
18
+ align?: "left" | "center" | "right";
19
+ /**
20
+ * Should the block stretch to the width of the Card?
21
+ */
22
+ isFullWidth?: boolean;
23
+ /**
24
+ * Should the block grow to the fill the available vertical space? Used when the Card appears in a column.
25
+ */
26
+ grow?: boolean;
27
+ }>;
28
+ /**
29
+ * Internal `Card.Image` component to show an image within a Card.
30
+ */
31
+ declare const CardImage: FC<{
32
+ /**
33
+ * Alternative text for the Card.Image, shown if the image cannot be displayed.
34
+ */
35
+ alt?: string;
36
+ /**
37
+ * Height of the Card.Image.
38
+ */
39
+ height?: number;
40
+ /**
41
+ * Loading behaviour of the Card.Image.
42
+ */
43
+ loading?: "eager" | "lazy";
44
+ /**
45
+ * 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.
46
+ */
47
+ sizes?: string;
48
+ /**
49
+ * HTML src for the Card.Image.
50
+ */
51
+ src: string;
52
+ /**
53
+ * 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`.
54
+ */
55
+ srcSet?: string;
56
+ }>;
57
+ type TitleSize = "xs" | "s" | "m" | "l" | "xl";
58
+ interface CardProps extends HTMLAttributes<HTMLElement> {
59
+ /**
60
+ * The HTML ID passed to the Card Button for aria- attributes.
61
+ */
62
+ actionId?: string;
63
+ /**
64
+ * Label for the Card's Button. You should specify this if defining an href.
65
+ */
66
+ actionLabel?: string;
67
+ /**
68
+ * A `Card.Image` to use for the cover image.
69
+ */
70
+ coverImage?: React.ReactNode;
71
+ /**
72
+ * Card fill.
73
+ */
74
+ fill?: "solid" | "outlined" | "neutral";
75
+ /**
76
+ * A URL to link to when the Card is clicked or touched.
77
+ */
78
+ href: string;
79
+ /**
80
+ * Alternative text for the Card cover image, shown if the image cannot be displayed.
81
+ */
82
+ imageAlt?: string;
83
+ /**
84
+ * Height of the Card cover image.
85
+ */
86
+ imageHeight?: number;
87
+ /**
88
+ * Loading behaviour of the Card cover image.
89
+ */
90
+ imageLoading?: "eager" | "lazy";
91
+ /**
92
+ * HTML src for the Card cover image.
93
+ */
94
+ imageSrc?: string;
95
+ /**
96
+ * 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`.
97
+ */
98
+ imageSrcSet?: string;
99
+ /**
100
+ * Object of `data-` attributes to render on internal anchor element, e.g.
101
+ * `{ data-analytics-link: "My link"}` => `<a data-analytics-link="My link">`.
102
+ */
103
+ linkData?: {};
104
+ /**
105
+ * The minimum height of the card. Cards in a series of columns will match the
106
+ * height of the tallest Card.
107
+ */
108
+ minHeight?: number;
109
+ /**
110
+ * Link target attribute for the Card link.
111
+ */
112
+ target?: "_blank" | "_parent" | "_self" | "_top";
113
+ /**
114
+ * The title for the Card, describing the content. This is required to provide good accessibility to screen readers.
115
+ */
116
+ title: string;
117
+ /**
118
+ * The size for the Card title.
119
+ */
120
+ titleSize?: TitleSize;
121
+ /**
122
+ * On click handler.
123
+ */
124
+ onClick?: () => void;
125
+ }
126
+ export { Card };
@@ -0,0 +1,118 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
+ import { c as classNames } from '../_shared/index-56d9df62.js';
3
+ import React, { useState, useEffect, useContext } from 'react';
4
+ import { I as Icon } from '../_shared/Icon-4d523b46.js';
5
+ import { I as Image } from '../_shared/Image-a3225049.js';
6
+ import { H as Heading } from '../_shared/Heading-8c640dd1.js';
7
+ import { s as suffixModifier } from '../_shared/suffix-modifier-2a93822c.js';
8
+ import { C as Context, S as Surface } from '../_shared/Surface-3fe44a2a.js';
9
+ import { h as handleLinkClick } from '../_shared/handle-link-click-35e09d0c.js';
10
+ import '../_shared/index.es-f5886c3a.js';
11
+
12
+ /**
13
+ * Detect interaction mode
14
+ */
15
+ var useInteractionMode = function () {
16
+ var _a = useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
17
+ useEffect(function () {
18
+ var onKeyDown = function (event) {
19
+ if (event.altKey || event.ctrlKey || event.metaKey) {
20
+ return;
21
+ }
22
+ setInteractionMode("keyboard");
23
+ };
24
+ var onPointerDown = function () {
25
+ setInteractionMode("pointer");
26
+ };
27
+ if (typeof window !== "undefined") {
28
+ document.addEventListener("keydown", onKeyDown, true);
29
+ document.addEventListener("click", onPointerDown, true);
30
+ }
31
+ return function () {
32
+ if (typeof window !== "undefined") {
33
+ document.removeEventListener("keydown", onKeyDown);
34
+ document.removeEventListener("click", onPointerDown);
35
+ }
36
+ };
37
+ }, []);
38
+ return { interactionMode: interactionMode };
39
+ };
40
+
41
+ /**
42
+ * Use `Card` to contain content and actions about a single subject.
43
+ */
44
+ var Card = function (_a) {
45
+ var _b;
46
+ 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 = __rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageHeight", "imageLoading", "imageSrc", "imageSrcSet", "linkData", "minHeight", "onClick", "target", "title", "titleSize"]);
47
+ var surface = useContext(Context).surface;
48
+ var interactionMode = useInteractionMode().interactionMode;
49
+ var Wrapper = function (_a) {
50
+ var children = _a.children;
51
+ return fill === "outlined" || fill === "neutral" ? (React.createElement("div", null, children)) : (React.createElement(Surface, { background: surface === "dark" ? "white" : "darker" }, children));
52
+ };
53
+ var coverImage = imageSrc && (React.createElement(CardImage, { alt: imageAlt, height: imageHeight, loading: imageLoading, src: imageSrc, srcSet: imageSrcSet }));
54
+ return (React.createElement("div", __assign({ className: classNames((_b = {
55
+ "arc-Card": true,
56
+ "arc-Card--onDarkSurface": surface === "dark"
57
+ },
58
+ _b[suffixModifier("arc-Card--fill", fill)] = fill !== "solid",
59
+ _b["arc-is-".concat(interactionMode, "InteractionMode")] = interactionMode,
60
+ _b)) }, filterDataAttrs(props)),
61
+ React.createElement(Wrapper, null,
62
+ React.createElement("div", { className: "arc-Card-inner", style: { minHeight: minHeight } },
63
+ React.createElement("div", { className: "arc-Card-header" },
64
+ React.createElement("div", { className: "arc-Card-title" },
65
+ React.createElement(Heading, { size: titleSize },
66
+ React.createElement(CardLink, { stretch: true, onClick: onClick, actionId: actionId, fill: fill, href: href, linkData: linkData, target: target }, title))),
67
+ coverImage),
68
+ React.createElement("div", { className: "arc-Card-children" },
69
+ React.createElement(Card.Block, null, children)),
70
+ href && (React.createElement(CardBlock, null,
71
+ React.createElement(CardLink, { href: href, fill: fill, actionId: actionId, onClick: onClick, isButton: true }, actionLabel)))))));
72
+ };
73
+ /**
74
+ * Internal `Card.Block` component to section blocks of content within a Card.
75
+ */
76
+ var CardBlock = function (_a) {
77
+ 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;
78
+ return (React.createElement("div", { className: classNames({
79
+ "arc-Card-block": true,
80
+ "arc-Card-block--alignCenter": align === "center",
81
+ "arc-Card-block--alignRight": align === "right",
82
+ "arc-Card-block--fullWidth": isFullWidth,
83
+ "arc-Card-block--grow": grow
84
+ }) },
85
+ React.createElement("div", { className: "arc-Card-blockInner" }, children)));
86
+ };
87
+ CardBlock.displayName = "Card.Block";
88
+ Card.Block = CardBlock;
89
+ /**
90
+ * Internal `Card.Image` component to show an image within a Card.
91
+ */
92
+ var CardImage = function (_a) {
93
+ 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;
94
+ return (React.createElement("div", { className: classNames({
95
+ "arc-Card-image": true
96
+ }) },
97
+ React.createElement(Image, { alt: alt, fit: "cover", height: height, loading: loading, sizes: sizes, src: src, srcSet: srcSet })));
98
+ };
99
+ CardImage.displayName = "Card.Image";
100
+ Card.Image = CardImage;
101
+ /**
102
+ * Internal `CardLink` component.
103
+ */
104
+ var CardLink = function (_a) {
105
+ 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;
106
+ var surface = useContext(Context).surface;
107
+ return (React.createElement("a", __assign({ onClick: handleLinkClick({ handler: onClick }), "aria-describedby": actionId, className: classNames({
108
+ "arc-Card-link": true,
109
+ "arc-Card-link--button": isButton,
110
+ "arc-Card-link--onDarkSurface": surface === "dark" && fill !== "neutral",
111
+ "arc-Card-link--stretch": stretch
112
+ }), href: href, rel: target === "_blank" ? "noopener noreferrer" : undefined, tabIndex: isButton ? -1 : undefined, target: target }, filterDataAttrs(linkData)),
113
+ React.createElement("span", { className: "arc-Card-linkText" }, children),
114
+ isButton && (React.createElement("span", { className: "arc-Card-linkIcon" },
115
+ React.createElement(Icon, { icon: "btChevronRight2px", size: 8 })))));
116
+ };
117
+
118
+ export { Card };
@@ -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 };
@@ -0,0 +1,46 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
+ import React, { forwardRef, useContext } from 'react';
3
+ import { c as classNames } from '../_shared/index-56d9df62.js';
4
+ import { C as Context, u as useAriaDescribedby } from '../_shared/FormControl-9dc9ecc3.js';
5
+ import { C as Context$1 } from '../_shared/Surface-3fe44a2a.js';
6
+
7
+ /**
8
+ * Use `Checkbox` to allow users to select individual options.
9
+ */
10
+ var Checkbox = forwardRef(function (_a, ref) {
11
+ 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 = __rest(_a, ["checked", "errorMessage", "helper", "id", "isDisabled", "isRequired", "label", "name", "onBlur", "onChange", "size", "value"]);
12
+ var requirementStatus = useContext(Context).requirementStatus;
13
+ var surface = useContext(Context$1).surface;
14
+ var _f = useAriaDescribedby({
15
+ id: id,
16
+ errorMessage: errorMessage
17
+ }), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError;
18
+ var idLabel = "".concat(id, "-label");
19
+ var checkedProps = {};
20
+ if (typeof onChange === "function") {
21
+ checkedProps.checked = checked;
22
+ }
23
+ else if (checked && !onChange) {
24
+ checkedProps.defaultChecked = true;
25
+ }
26
+ if (requirementStatus === "required") {
27
+ isRequired = true;
28
+ }
29
+ return (React.createElement("div", { className: classNames({
30
+ "arc-Checkbox": true,
31
+ "arc-Checkbox--disabled": isDisabled,
32
+ "arc-Checkbox--invalid": errorMessage,
33
+ "arc-Checkbox--small": size === "s",
34
+ "arc-Checkbox--onDarkSurface": surface === "dark"
35
+ }) },
36
+ React.createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
37
+ React.createElement("input", __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 }, filterDataAttrs(props))),
38
+ React.createElement("span", { className: "arc-Checkbox-box" }),
39
+ React.createElement("span", null,
40
+ label,
41
+ !isRequired && requirementStatus !== "optional" ? (React.createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
42
+ helper && React.createElement("span", { className: "arc-Checkbox-helper" }, helper))),
43
+ errorMessage && (React.createElement("div", { id: idError, className: "arc-Checkbox-error" }, errorMessage))));
44
+ });
45
+
46
+ export { Checkbox };
@@ -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 };
@@ -0,0 +1,34 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs, d as __awaiter, e as __generator } from '../_shared/index-e3c83626.js';
2
+ import React, { useState, useEffect } from 'react';
3
+
4
+ /**
5
+ * `Clock` is a demo component that shows the current time.
6
+ */
7
+ var Clock = function (_a) {
8
+ var _b = _a.locale, locale = _b === void 0 ? "en-GB" : _b, props = __rest(_a, ["locale"]);
9
+ var _c = useState(new Date()), time = _c[0], setTime = _c[1];
10
+ var _d = useState(time.toLocaleTimeString(locale)), humanTime = _d[0], setHumanTime = _d[1];
11
+ useEffect(function () {
12
+ var tick = function () {
13
+ var newTime = new Date();
14
+ setTime(newTime);
15
+ setHumanTime(newTime.toLocaleTimeString(locale));
16
+ };
17
+ tick();
18
+ var interval = setInterval(tick, 1000);
19
+ return function () { return clearInterval(interval); };
20
+ }, [locale]);
21
+ return (React.createElement("time", __assign({ className: "arc-Clock", dateTime: time.toISOString() }, filterDataAttrs(props), { "data-locale": locale }), humanTime));
22
+ };
23
+
24
+ var Clock_rehydrator = (function (el) { return __awaiter(void 0, void 0, void 0, function () {
25
+ var props;
26
+ return __generator(this, function (_a) {
27
+ props = {
28
+ locale: el.dataset.locale
29
+ };
30
+ return [2 /*return*/, React.createElement(Clock, __assign({}, props))];
31
+ });
32
+ }); });
33
+
34
+ export { Clock, Clock_rehydrator as ClockRehydrator };
@@ -0,0 +1,76 @@
1
+ import { FC, ReactNode } from "react";
2
+ /**
3
+ * Use `Columns` to compose layouts on a 12-column grid.
4
+ */
5
+ declare const Columns: FC<ColumnsProps> & {
6
+ Col: typeof Col;
7
+ };
8
+ declare const Col: FC<ColProps>;
9
+ type Span = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
+ type Offset = "0" | "24" | "48" | "72" | "96" | "120" | "144" | "168" | "192" | "216" | "240" | "264" | "288" | "312" | "336" | "360" | "384";
11
+ interface ColProps {
12
+ /**
13
+ * Vertically align the Column.
14
+ */
15
+ align?: "top" | "center" | "bottom";
16
+ /**
17
+ * Content to display in the Column.
18
+ */
19
+ children?: ReactNode;
20
+ /**
21
+ * Should the Column be visible for debugging and documentation
22
+ * purposes?
23
+ */
24
+ isDebugVisible?: boolean;
25
+ /**
26
+ * Overlay the column over the previous content on the default breakpoint and above. Multiples of 24 up to 384. Use with caution, and ensure to check responsive behaviour.
27
+ */
28
+ offset?: Offset;
29
+ /**
30
+ * Overlay the column over the previous content on the S breakpoint and above. Multiples of 24 up to 384. Use with caution, and ensure to check responsive behaviour.
31
+ */
32
+ offsetS?: Offset;
33
+ /**
34
+ * Overlay the column over the previous content on the M breakpoint and above. Multiples of 24 up to 384. Use with caution, and ensure to check responsive behaviour.
35
+ */
36
+ offsetM?: Offset;
37
+ /**
38
+ * Overlay the column over the previous content on the L breakpoint and above. Multiples of 24 up to 384. Use with caution, and ensure to check responsive behaviour.
39
+ */
40
+ offsetL?: Offset;
41
+ /**
42
+ * Overlay the column over the previous content on the XL breakpoint and above. Multiples of 24 up to 384. Use with caution, and ensure to check responsive behaviour.
43
+ */
44
+ offsetXL?: Offset;
45
+ /**
46
+ * The number of columns to span on the default breakpoint and above, from 1 to 12.
47
+ */
48
+ span?: Span;
49
+ /**
50
+ * The number of columns to span on the S breakpoint and above, from 1 to 12.
51
+ */
52
+ spanS?: Span;
53
+ /**
54
+ * The number of columns to span on the M breakpoint and above, from 1 to 12.
55
+ */
56
+ spanM?: Span;
57
+ /**
58
+ * The number of columns to span on the L breakpoint and above, from 1 to 12.
59
+ */
60
+ spanL?: Span;
61
+ /**
62
+ * The number of columns to span on the XL breakpoint and above, from 1 to 12.
63
+ */
64
+ spanXL?: Span;
65
+ }
66
+ interface ColumnsProps {
67
+ /**
68
+ * Contents of the Columns. Should only contain `Columns.Col`.
69
+ */
70
+ children: ReactNode;
71
+ /**
72
+ * Should the Columns be gutterless?
73
+ */
74
+ isGutterless?: boolean;
75
+ }
76
+ export { Columns };
@@ -0,0 +1,51 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
+ import { c as classNames } from '../_shared/index-56d9df62.js';
3
+ import React, { useEffect } from 'react';
4
+ import { s as suffixModifier } from '../_shared/suffix-modifier-2a93822c.js';
5
+
6
+ /**
7
+ * Use `Columns` to compose layouts on a 12-column grid.
8
+ */
9
+ var Columns = function (_a) {
10
+ var children = _a.children, _b = _a.isGutterless, isGutterless = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isGutterless"]);
11
+ useEffect(function () {
12
+ React.Children.map(children, function (item) {
13
+ if (item && item.type !== Col) {
14
+ throw new Error("Illegal child passed to <Columns />. Ensure to only use <Columns.Col />.");
15
+ }
16
+ });
17
+ }, [children]);
18
+ return (React.createElement("div", __assign({ className: classNames({
19
+ "arc-Columns": true,
20
+ "arc-Columns--gutterless": isGutterless
21
+ }) }, filterDataAttrs(props)),
22
+ React.createElement("div", { className: "arc-Columns-inner" }, children)));
23
+ };
24
+ var Col = function (_a) {
25
+ var _b;
26
+ var align = _a.align, children = _a.children, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, offset = _a.offset, offsetS = _a.offsetS, offsetM = _a.offsetM, offsetL = _a.offsetL, offsetXL = _a.offsetXL, span = _a.span, spanS = _a.spanS, spanM = _a.spanM, spanL = _a.spanL, spanXL = _a.spanXL, props = __rest(_a, ["align", "children", "isDebugVisible", "offset", "offsetS", "offsetM", "offsetL", "offsetXL", "span", "spanS", "spanM", "spanL", "spanXL"]);
27
+ return (React.createElement("div", __assign({ className: classNames((_b = {},
28
+ _b["arc-Columns-col"] = true,
29
+ _b[suffixModifier("arc-Columns-col--align", align || "")] = align,
30
+ _b["arc-Columns-col--".concat(span)] = typeof span !== "undefined",
31
+ _b["arc-Columns-col--s".concat(spanS)] = typeof spanS !== "undefined",
32
+ _b["arc-Columns-col--m".concat(spanM)] = typeof spanM !== "undefined",
33
+ _b["arc-Columns-col--l".concat(spanL)] = typeof spanL !== "undefined",
34
+ _b["arc-Columns-col--xL".concat(spanXL)] = typeof spanXL !== "undefined",
35
+ _b["arc-Columns-col--offset"] = typeof offset !== "undefined" ||
36
+ typeof offsetS !== "undefined" ||
37
+ typeof offsetM !== "undefined" ||
38
+ typeof offsetL !== "undefined" ||
39
+ typeof offsetXL !== "undefined",
40
+ _b["arc-Columns-col--offset".concat(offset)] = typeof offset !== "undefined",
41
+ _b["arc-Columns-col--offsetS".concat(offsetS)] = typeof offsetS !== "undefined",
42
+ _b["arc-Columns-col--offsetM".concat(offsetM)] = typeof offsetM !== "undefined",
43
+ _b["arc-Columns-col--offsetL".concat(offsetL)] = typeof offsetL !== "undefined",
44
+ _b["arc-Columns-col--offsetXL".concat(offsetXL)] = typeof offsetXL !== "undefined",
45
+ _b["arc-Columns-col--debugVisible"] = isDebugVisible,
46
+ _b)) }, filterDataAttrs(props)), children));
47
+ };
48
+ Col.displayName = "Columns.Col";
49
+ Columns.Col = Col;
50
+
51
+ export { Columns };
@@ -0,0 +1 @@
1
+ export { Curve } from "../_shared/Curve-5f476d0b";
@@ -0,0 +1,5 @@
1
+ export { C as Curve } from '../_shared/Curve-5f476d0b.js';
2
+ import '../_shared/index-e3c83626.js';
3
+ import '../_shared/index-56d9df62.js';
4
+ import 'react';
5
+ import '../_shared/suffix-modifier-2a93822c.js';
@@ -0,0 +1,31 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { HeadingLevel } from "../_shared/Heading-8c640dd1";
3
+ /**
4
+ * Use `Disclosure` to display content that is only visible when toggled into
5
+ * an "open" state.
6
+ */
7
+ declare const Disclosure: FC<DisclosureProps>;
8
+ interface DisclosureProps {
9
+ /**
10
+ * Content to display in the Disclosure.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * HTML section heading level of the Disclosure summary. If not provided, will
15
+ * render as a span.
16
+ */
17
+ headingLevel?: HeadingLevel;
18
+ /**
19
+ * Should Disclosure details be indented to line-up with summary text?
20
+ */
21
+ indentDetails?: boolean;
22
+ /**
23
+ * Should the Disclosure content be open by default?
24
+ */
25
+ isOpen?: boolean;
26
+ /**
27
+ * The Disclosure summary text.
28
+ */
29
+ summary: string;
30
+ }
31
+ export { Disclosure };
@@ -0,0 +1,25 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
+ import { c as classNames } from '../_shared/index-56d9df62.js';
3
+ import React, { useContext } from 'react';
4
+ import { H as Heading } from '../_shared/Heading-8c640dd1.js';
5
+ import { C as Context } from '../_shared/Surface-3fe44a2a.js';
6
+ import '../_shared/suffix-modifier-2a93822c.js';
7
+
8
+ /**
9
+ * Use `Disclosure` to display content that is only visible when toggled into
10
+ * an "open" state.
11
+ */
12
+ var Disclosure = function (_a) {
13
+ var children = _a.children, headingLevel = _a.headingLevel, _b = _a.indentDetails, indentDetails = _b === void 0 ? false : _b, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, summary = _a.summary, props = __rest(_a, ["children", "headingLevel", "indentDetails", "isOpen", "summary"]);
14
+ var surface = useContext(Context).surface;
15
+ return (React.createElement("details", __assign({ className: classNames({
16
+ "arc-Disclosure": true,
17
+ "arc-Disclosure--indentDetails": indentDetails,
18
+ "arc-Disclosure--onDarkSurface": surface === "dark"
19
+ }), open: isOpen }, filterDataAttrs(props)),
20
+ React.createElement("summary", { className: "arc-Disclosure-summary" },
21
+ React.createElement(Heading, { level: headingLevel, size: "s" }, summary)),
22
+ React.createElement("div", { className: "arc-Disclosure-details" }, children)));
23
+ };
24
+
25
+ export { Disclosure };
@@ -0,0 +1,16 @@
1
+ import { FC, ReactNode } from "react";
2
+ /**
3
+ * Use `Elevation` to elevate what matters.
4
+ */
5
+ declare const Elevation: FC<ElevationProps>;
6
+ interface ElevationProps {
7
+ /**
8
+ * Contents to Elevate.
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Should the Elevation be full width?
13
+ */
14
+ isFullWidth?: boolean;
15
+ }
16
+ export { Elevation };
@@ -0,0 +1,17 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
+ import { c as classNames } from '../_shared/index-56d9df62.js';
3
+ import React from 'react';
4
+
5
+ /**
6
+ * Use `Elevation` to elevate what matters.
7
+ */
8
+ var Elevation = function (_a) {
9
+ var _b;
10
+ var children = _a.children, _c = _a.isFullWidth, isFullWidth = _c === void 0 ? false : _c, props = __rest(_a, ["children", "isFullWidth"]);
11
+ return (React.createElement("div", __assign({ className: classNames((_b = {},
12
+ _b["arc-Elevation"] = true,
13
+ _b["arc-Elevation--fullWidth"] = isFullWidth,
14
+ _b)) }, filterDataAttrs(props)), children));
15
+ };
16
+
17
+ export { Elevation };
@@ -0,0 +1 @@
1
+ export { FormControl, FormControlContext } from "../_shared/FormControl-9dc9ecc3";
@@ -0,0 +1,5 @@
1
+ export { F as FormControl, C as FormControlContext } from '../_shared/FormControl-9dc9ecc3.js';
2
+ import '../_shared/index-e3c83626.js';
3
+ import '../_shared/index-56d9df62.js';
4
+ import 'react';
5
+ import '../_shared/Surface-3fe44a2a.js';