@arc-ui/components 11.2.0 → 11.4.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 (85) hide show
  1. package/dist/Button/Button.cjs.d.ts +1 -1
  2. package/dist/Button/Button.cjs.js +1 -1
  3. package/dist/Button/Button.esm.d.ts +1 -1
  4. package/dist/Button/Button.esm.js +1 -1
  5. package/dist/Card/Card.cjs.js +1 -1
  6. package/dist/Card/Card.esm.js +1 -1
  7. package/dist/Checkbox/Checkbox.cjs.js +8 -27
  8. package/dist/Checkbox/Checkbox.esm.js +3 -22
  9. package/dist/FormControl/FormControl.cjs.d.ts +1 -1
  10. package/dist/FormControl/FormControl.cjs.js +1 -1
  11. package/dist/FormControl/FormControl.esm.d.ts +1 -1
  12. package/dist/FormControl/FormControl.esm.js +1 -1
  13. package/dist/ProgressBar/ProgressBar.cjs.d.ts +47 -0
  14. package/dist/ProgressBar/ProgressBar.cjs.js +113 -0
  15. package/dist/ProgressBar/ProgressBar.esm.d.ts +47 -0
  16. package/dist/ProgressBar/ProgressBar.esm.js +105 -0
  17. package/dist/ProgressBar/package.json +7 -0
  18. package/dist/RadioGroup/RadioGroup.cjs.d.ts +2 -2
  19. package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
  20. package/dist/RadioGroup/RadioGroup.esm.d.ts +2 -2
  21. package/dist/RadioGroup/RadioGroup.esm.js +2 -2
  22. package/dist/Select/Select.cjs.d.ts +2 -2
  23. package/dist/Select/Select.cjs.js +75 -74
  24. package/dist/Select/Select.esm.d.ts +2 -2
  25. package/dist/Select/Select.esm.js +3 -2
  26. package/dist/SiteHeader/SiteHeader.cjs.js +1 -1
  27. package/dist/SiteHeader/SiteHeader.esm.js +1 -1
  28. package/dist/Switch/Switch.cjs.d.ts +1 -1
  29. package/dist/Switch/Switch.cjs.js +13 -12
  30. package/dist/Switch/Switch.esm.d.ts +1 -1
  31. package/dist/Switch/Switch.esm.js +4 -3
  32. package/dist/Tag/Tag.cjs.d.ts +33 -0
  33. package/dist/Tag/Tag.cjs.js +73 -0
  34. package/dist/Tag/Tag.esm.d.ts +33 -0
  35. package/dist/Tag/Tag.esm.js +65 -0
  36. package/dist/Tag/package.json +7 -0
  37. package/dist/TextInput/TextInput.cjs.d.ts +2 -2
  38. package/dist/TextInput/TextInput.cjs.js +1 -1
  39. package/dist/TextInput/TextInput.esm.d.ts +2 -2
  40. package/dist/TextInput/TextInput.esm.js +1 -1
  41. package/dist/VerticalSpace/VerticalSpace.cjs.d.ts +1 -1
  42. package/dist/VerticalSpace/VerticalSpace.cjs.js +1 -1
  43. package/dist/VerticalSpace/VerticalSpace.esm.d.ts +1 -1
  44. package/dist/VerticalSpace/VerticalSpace.esm.js +1 -1
  45. package/dist/_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js +29 -0
  46. package/dist/_shared/cjs/{Button-b3a69953.js → Button-1af6868c.js} +1 -4
  47. package/dist/_shared/{esm/FormControl-84c9ace6.d.ts → cjs/FormControl-d4d9c665.d.ts} +4 -0
  48. package/dist/_shared/cjs/{FormControl-e6b7d7c5.js → FormControl-d4d9c665.js} +6 -5
  49. package/dist/_shared/cjs/VerticalSpace-7aed88ab.d.ts +34 -0
  50. package/dist/_shared/cjs/{VerticalSpace-65ad083c.js → VerticalSpace-7aed88ab.js} +6 -2
  51. package/dist/_shared/cjs/index-c81c9401.d.ts +1 -1
  52. package/dist/_shared/cjs/{BtIconTickAlt2Px-b12ecc78.js → index.module-af7c85f2.js} +34 -59
  53. package/dist/_shared/esm/BtIconTickAlt2Px-da97e9ae.js +23 -0
  54. package/dist/_shared/esm/{Button-69439f8f.js → Button-10700df4.js} +1 -4
  55. package/dist/_shared/{cjs/FormControl-e6b7d7c5.d.ts → esm/FormControl-2cb96de7.d.ts} +4 -0
  56. package/dist/_shared/esm/{FormControl-84c9ace6.js → FormControl-2cb96de7.js} +6 -5
  57. package/dist/_shared/esm/VerticalSpace-3579b20e.d.ts +34 -0
  58. package/dist/_shared/esm/{VerticalSpace-6b4f5e50.js → VerticalSpace-3579b20e.js} +6 -2
  59. package/dist/_shared/esm/index-c81c9401.d.ts +1 -1
  60. package/dist/_shared/esm/{BtIconTickAlt2Px-2c4ec3be.js → index.module-599b86dd.js} +2 -22
  61. package/dist/index.es.js +77 -38
  62. package/dist/index.es.js.map +1 -1
  63. package/dist/index.js +77 -37
  64. package/dist/index.js.map +1 -1
  65. package/dist/styles.css +1 -1
  66. package/dist/types/components/FormControl/FormControl.d.ts +4 -0
  67. package/dist/types/components/ProgressBar/ProgressBar.d.ts +46 -0
  68. package/dist/types/components/ProgressBar/constants/progress-bar-icon-map.d.ts +3 -0
  69. package/dist/types/components/ProgressBar/index.d.ts +1 -0
  70. package/dist/types/components/ProgressBar/types/progress-bar-icons.d.ts +1 -0
  71. package/dist/types/components/ProgressBar/types/progress-bar-state.d.ts +1 -0
  72. package/dist/types/components/ProgressBar/utils/get-progress-bar-props.d.ts +1 -0
  73. package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
  74. package/dist/types/components/Select/Select.d.ts +1 -1
  75. package/dist/types/components/Tag/Tag.d.ts +32 -0
  76. package/dist/types/components/Tag/index.d.ts +1 -0
  77. package/dist/types/components/TextInput/TextInput.d.ts +1 -1
  78. package/dist/types/components/VerticalSpace/VerticalSpace.d.ts +17 -1
  79. package/dist/types/components/index.d.ts +1 -0
  80. package/dist/types/styles.d.ts +2 -0
  81. package/package.json +4 -4
  82. package/dist/_shared/cjs/VerticalSpace-65ad083c.d.ts +0 -18
  83. package/dist/_shared/esm/VerticalSpace-6b4f5e50.d.ts +0 -18
  84. /package/dist/_shared/cjs/{Button-b3a69953.d.ts → Button-1af6868c.d.ts} +0 -0
  85. /package/dist/_shared/esm/{Button-69439f8f.d.ts → Button-10700df4.d.ts} +0 -0
@@ -4,11 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var index = require('../_shared/cjs/index-45bfb67b.js');
7
- var BtIconTickAlt2Px = require('../_shared/cjs/BtIconTickAlt2Px-b12ecc78.js');
7
+ var index_module = require('../_shared/cjs/index.module-af7c85f2.js');
8
8
  var Icon = require('../_shared/cjs/Icon-719d13d4.js');
9
+ var BtIconTickAlt2Px = require('../_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js');
9
10
  var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
10
- var FormControl = require('../_shared/cjs/FormControl-e6b7d7c5.js');
11
- var VerticalSpace = require('../_shared/cjs/VerticalSpace-65ad083c.js');
11
+ var FormControl = require('../_shared/cjs/FormControl-d4d9c665.js');
12
+ var VerticalSpace = require('../_shared/cjs/VerticalSpace-7aed88ab.js');
12
13
  var Text = require('../_shared/cjs/Text-1d3844be.js');
13
14
  require('react-dom');
14
15
  require('../_shared/cjs/index-78b35bc1.js');
@@ -21,7 +22,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
22
 
22
23
  function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
23
24
  const [size, setSize] = React.useState(undefined);
24
- BtIconTickAlt2Px.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
25
+ index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
25
26
  if (element) {
26
27
  // provide size as early as possible
27
28
  setSize({
@@ -69,16 +70,16 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
69
70
  /* -------------------------------------------------------------------------------------------------
70
71
  * Switch
71
72
  * -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$SWITCH_NAME = 'Switch';
72
- const [$6be4966fd9bbc698$var$createSwitchContext, $6be4966fd9bbc698$export$cf7f5f17f69cbd43] = BtIconTickAlt2Px.$c512c27ab02ef895$export$50c7b4e9d9f19c1($6be4966fd9bbc698$var$SWITCH_NAME);
73
+ const [$6be4966fd9bbc698$var$createSwitchContext, $6be4966fd9bbc698$export$cf7f5f17f69cbd43] = index_module.$c512c27ab02ef895$export$50c7b4e9d9f19c1($6be4966fd9bbc698$var$SWITCH_NAME);
73
74
  const [$6be4966fd9bbc698$var$SwitchProvider, $6be4966fd9bbc698$var$useSwitchContext] = $6be4966fd9bbc698$var$createSwitchContext($6be4966fd9bbc698$var$SWITCH_NAME);
74
75
  const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
75
76
  const { __scopeSwitch: __scopeSwitch , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
76
77
  const [button, setButton] = React.useState(null);
77
- const composedRefs = BtIconTickAlt2Px.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setButton(node)
78
+ const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setButton(node)
78
79
  );
79
80
  const hasConsumerStoppedPropagationRef = React.useRef(false); // We set this to true by default so that events bubble to forms without JS (SSR)
80
81
  const isFormControl = button ? Boolean(button.closest('form')) : true;
81
- const [checked = false, setChecked] = BtIconTickAlt2Px.$71cd76cc60e0454e$export$6f32135080cb4c3({
82
+ const [checked = false, setChecked] = index_module.$71cd76cc60e0454e$export$6f32135080cb4c3({
82
83
  prop: checkedProp,
83
84
  defaultProp: defaultChecked,
84
85
  onChange: onCheckedChange
@@ -87,7 +88,7 @@ const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React.forwardRef
87
88
  scope: __scopeSwitch,
88
89
  checked: checked,
89
90
  disabled: disabled
90
- }, /*#__PURE__*/ React.createElement(BtIconTickAlt2Px.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, BtIconTickAlt2Px._extends({
91
+ }, /*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, index_module._extends({
91
92
  type: "button",
92
93
  role: "switch",
93
94
  "aria-checked": checked,
@@ -98,7 +99,7 @@ const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React.forwardRef
98
99
  value: value
99
100
  }, switchProps, {
100
101
  ref: composedRefs,
101
- onClick: BtIconTickAlt2Px.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event)=>{
102
+ onClick: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event)=>{
102
103
  setChecked((prevChecked)=>!prevChecked
103
104
  );
104
105
  if (isFormControl) {
@@ -128,7 +129,7 @@ const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React.forwardRef
128
129
  const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
129
130
  const { __scopeSwitch: __scopeSwitch , ...thumbProps } = props;
130
131
  const context = $6be4966fd9bbc698$var$useSwitchContext($6be4966fd9bbc698$var$THUMB_NAME, __scopeSwitch);
131
- return /*#__PURE__*/ React.createElement(BtIconTickAlt2Px.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, BtIconTickAlt2Px._extends({
132
+ return /*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({
132
133
  "data-state": $6be4966fd9bbc698$var$getState(context.checked),
133
134
  "data-disabled": context.disabled ? '' : undefined
134
135
  }, thumbProps, {
@@ -138,7 +139,7 @@ const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React.forwardRef
138
139
  /* ---------------------------------------------------------------------------------------------- */ const $6be4966fd9bbc698$var$BubbleInput = (props)=>{
139
140
  const { control: control , checked: checked , bubbles: bubbles = true , ...inputProps } = props;
140
141
  const ref = React.useRef(null);
141
- const prevChecked = BtIconTickAlt2Px.$010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
142
+ const prevChecked = index_module.$010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
142
143
  const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control); // Bubble checked change to parents (e.g form change event)
143
144
  React.useEffect(()=>{
144
145
  const input = ref.current;
@@ -157,7 +158,7 @@ const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React.forwardRef
157
158
  checked,
158
159
  bubbles
159
160
  ]);
160
- return /*#__PURE__*/ React.createElement("input", BtIconTickAlt2Px._extends({
161
+ return /*#__PURE__*/ React.createElement("input", index_module._extends({
161
162
  type: "checkbox",
162
163
  "aria-hidden": true,
163
164
  defaultChecked: checked
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { SwitchProps as RadixSwitchProps } from "@radix-ui/react-switch";
3
- import { FormControlProps } from "../_shared/esm/FormControl-84c9ace6";
3
+ import { FormControlProps } from "../_shared/esm/FormControl-2cb96de7";
4
4
  /** Use `Switch` to toggle between checked and not checked. */
5
5
  declare const Switch: FC<SwitchProps>;
6
6
  interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper"> {
@@ -1,10 +1,11 @@
1
1
  import React__default, { useState, forwardRef, useRef, createElement, useEffect, useContext } from 'react';
2
2
  import { c as classNames } from '../_shared/esm/index-2ae58626.js';
3
- import { g as $9f79659886946c16$export$e5c5a5f917a5871c, $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, h as $71cd76cc60e0454e$export$6f32135080cb4c3, d as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, e as $e42e1063c40fb3ef$export$b9ecd428b558ff10, i as $010c2913dbd2fe3d$export$5cae361ad82dce8b, B as BtIconTickAlt2Px_2 } from '../_shared/esm/BtIconTickAlt2Px-2c4ec3be.js';
3
+ import { g as $9f79659886946c16$export$e5c5a5f917a5871c, $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, h as $71cd76cc60e0454e$export$6f32135080cb4c3, d as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, e as $e42e1063c40fb3ef$export$b9ecd428b558ff10, i as $010c2913dbd2fe3d$export$5cae361ad82dce8b } from '../_shared/esm/index.module-599b86dd.js';
4
4
  import { I as Icon } from '../_shared/esm/Icon-61f7237a.js';
5
+ import { B as BtIconTickAlt2Px_2 } from '../_shared/esm/BtIconTickAlt2Px-da97e9ae.js';
5
6
  import { C as Context } from '../_shared/esm/Surface-bf201530.js';
6
- import { F as FormControl } from '../_shared/esm/FormControl-84c9ace6.js';
7
- import { V as VerticalSpace } from '../_shared/esm/VerticalSpace-6b4f5e50.js';
7
+ import { F as FormControl } from '../_shared/esm/FormControl-2cb96de7.js';
8
+ import { V as VerticalSpace } from '../_shared/esm/VerticalSpace-3579b20e.js';
8
9
  import { T as Text } from '../_shared/esm/Text-6b958ad8.js';
9
10
  import 'react-dom';
10
11
  import '../_shared/esm/index-229fc864.js';
@@ -0,0 +1,33 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { ArcIcon } from "../_shared/cjs/arc-icon-17594b2f";
3
+ /**
4
+ * use `Tag` to promote features and manage filtering.
5
+ */
6
+ declare const Tag: FC<TagProps>;
7
+ interface TagProps {
8
+ /**
9
+ * Content to render within the Tag
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Determine if the Tag is removable.
14
+ */
15
+ isRemovable?: boolean;
16
+ /**
17
+ * Provide a link for the tag
18
+ */
19
+ link?: string;
20
+ /**
21
+ * Determine a icon to display within the tag.
22
+ */
23
+ icon?: ArcIcon;
24
+ /**
25
+ * onClick Handler for Tag
26
+ */
27
+ onClick?: () => void;
28
+ /**
29
+ * Execute function on remove
30
+ */
31
+ onRemove?: () => void;
32
+ }
33
+ export { Tag };
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = require('../_shared/cjs/index-78b35bc1.js');
6
+ var React$1 = require('react');
7
+ var index$1 = require('../_shared/cjs/index-45bfb67b.js');
8
+ var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
9
+ var Icon = require('../_shared/cjs/Icon-719d13d4.js');
10
+ require('../_shared/cjs/suffix-modifier-edf7851e.js');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
15
+
16
+ const React = React__default["default"];
17
+ const BtIconCross = props =>
18
+ /*#__PURE__*/ React.createElement(
19
+ "svg",
20
+ Object.assign(
21
+ {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ viewBox: "0 0 32 32"
24
+ },
25
+ props
26
+ ),
27
+ /*#__PURE__*/ React.createElement("defs", null),
28
+ /*#__PURE__*/ React.createElement("path", {
29
+ d:
30
+ "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",
31
+ fill: "currentColor"
32
+ }),
33
+ /*#__PURE__*/ React.createElement("path", {
34
+ d:
35
+ "M20.85352,11.14648a.49983.49983,0,0,0-.707,0L16,15.293l-4.14648-4.14649a.5.5,0,0,0-.707.707L15.293,16l-4.14649,4.14648a.5.5,0,1,0,.707.707L16,16.707l4.14648,4.14649a.5.5,0,0,0,.707-.707L16.707,16l4.14649-4.14648A.49983.49983,0,0,0,20.85352,11.14648Z",
36
+ fill: "currentColor"
37
+ })
38
+ );
39
+ var BtIconCross_2 = BtIconCross;
40
+
41
+ /**
42
+ * use `Tag` to promote features and manage filtering.
43
+ */
44
+ var Tag = function (_a) {
45
+ var children = _a.children, isRemovable = _a.isRemovable, link = _a.link, icon = _a.icon, onClick = _a.onClick, onRemove = _a.onRemove, props = index.__rest(_a, ["children", "isRemovable", "link", "icon", "onClick", "onRemove"]);
46
+ var surface = React$1.useContext(Surface.Context).surface;
47
+ var _b = React$1.useState(false), isRemoved = _b[0], setIsRemoved = _b[1];
48
+ var onRemoveHandler = function () {
49
+ setIsRemoved(function (p) { return !p; });
50
+ onRemove && onRemove();
51
+ };
52
+ return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames("arc-Tag", {
53
+ "arc-Tag--onDarkSurface": surface === "dark",
54
+ "arc-Tag--isRemovable": isRemovable,
55
+ "arc-Tag--hasIcon": icon,
56
+ "arc-Tag--hasLink": link || onClick,
57
+ "arc-Tag--removed": isRemoved
58
+ }) }, (isRemoved && { "aria-hidden": true }), index.filterDataAttrs(props)),
59
+ link ? (React__default["default"].createElement("a", { className: "arc-Tag-content", href: link, tabIndex: 0 },
60
+ icon && (React__default["default"].createElement("span", { className: "arc-Tag-icon" },
61
+ React__default["default"].createElement(Icon.Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
62
+ React__default["default"].createElement("div", { className: "arc-Tag-label" }, children))) : (React__default["default"].createElement(React__default["default"].Fragment, null, onClick ? (React__default["default"].createElement("button", { className: "arc-Tag-content", onClick: onClick, "data-testid": "arc-Tag-content" },
63
+ icon && (React__default["default"].createElement("span", { className: "arc-Tag-icon" },
64
+ React__default["default"].createElement(Icon.Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
65
+ React__default["default"].createElement("div", { className: "arc-Tag-label" }, children))) : (React__default["default"].createElement("div", { className: "arc-Tag-content", "data-testid": "arc-Tag-content" },
66
+ icon && (React__default["default"].createElement("span", { className: "arc-Tag-icon" },
67
+ React__default["default"].createElement(Icon.Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
68
+ React__default["default"].createElement("div", { className: "arc-Tag-label" }, children))))),
69
+ isRemovable && (React__default["default"].createElement("button", { className: "arc-Tag-icon arc-Tag-icon--removable", onClick: onRemoveHandler, "data-testid": "arc-Tag-icon-removable", "aria-live": "polite", "aria-roledescription": "remove tag" },
70
+ React__default["default"].createElement(Icon.Icon, { icon: BtIconCross_2, color: "brand", size: 20 })))));
71
+ };
72
+
73
+ exports.Tag = Tag;
@@ -0,0 +1,33 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { ArcIcon } from "../_shared/esm/arc-icon-17594b2f";
3
+ /**
4
+ * use `Tag` to promote features and manage filtering.
5
+ */
6
+ declare const Tag: FC<TagProps>;
7
+ interface TagProps {
8
+ /**
9
+ * Content to render within the Tag
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Determine if the Tag is removable.
14
+ */
15
+ isRemovable?: boolean;
16
+ /**
17
+ * Provide a link for the tag
18
+ */
19
+ link?: string;
20
+ /**
21
+ * Determine a icon to display within the tag.
22
+ */
23
+ icon?: ArcIcon;
24
+ /**
25
+ * onClick Handler for Tag
26
+ */
27
+ onClick?: () => void;
28
+ /**
29
+ * Execute function on remove
30
+ */
31
+ onRemove?: () => void;
32
+ }
33
+ export { Tag };
@@ -0,0 +1,65 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
2
+ import React__default, { useContext, useState } from 'react';
3
+ import { c as classNames } from '../_shared/esm/index-2ae58626.js';
4
+ import { C as Context } from '../_shared/esm/Surface-bf201530.js';
5
+ import { I as Icon } from '../_shared/esm/Icon-61f7237a.js';
6
+ import '../_shared/esm/suffix-modifier-f5e28822.js';
7
+
8
+ const React = React__default;
9
+ const BtIconCross = props =>
10
+ /*#__PURE__*/ React.createElement(
11
+ "svg",
12
+ Object.assign(
13
+ {
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ viewBox: "0 0 32 32"
16
+ },
17
+ props
18
+ ),
19
+ /*#__PURE__*/ React.createElement("defs", null),
20
+ /*#__PURE__*/ React.createElement("path", {
21
+ d:
22
+ "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",
23
+ fill: "currentColor"
24
+ }),
25
+ /*#__PURE__*/ React.createElement("path", {
26
+ d:
27
+ "M20.85352,11.14648a.49983.49983,0,0,0-.707,0L16,15.293l-4.14648-4.14649a.5.5,0,0,0-.707.707L15.293,16l-4.14649,4.14648a.5.5,0,1,0,.707.707L16,16.707l4.14648,4.14649a.5.5,0,0,0,.707-.707L16.707,16l4.14649-4.14648A.49983.49983,0,0,0,20.85352,11.14648Z",
28
+ fill: "currentColor"
29
+ })
30
+ );
31
+ var BtIconCross_2 = BtIconCross;
32
+
33
+ /**
34
+ * use `Tag` to promote features and manage filtering.
35
+ */
36
+ var Tag = function (_a) {
37
+ var children = _a.children, isRemovable = _a.isRemovable, link = _a.link, icon = _a.icon, onClick = _a.onClick, onRemove = _a.onRemove, props = __rest(_a, ["children", "isRemovable", "link", "icon", "onClick", "onRemove"]);
38
+ var surface = useContext(Context).surface;
39
+ var _b = useState(false), isRemoved = _b[0], setIsRemoved = _b[1];
40
+ var onRemoveHandler = function () {
41
+ setIsRemoved(function (p) { return !p; });
42
+ onRemove && onRemove();
43
+ };
44
+ return (React__default.createElement("div", __assign({ className: classNames("arc-Tag", {
45
+ "arc-Tag--onDarkSurface": surface === "dark",
46
+ "arc-Tag--isRemovable": isRemovable,
47
+ "arc-Tag--hasIcon": icon,
48
+ "arc-Tag--hasLink": link || onClick,
49
+ "arc-Tag--removed": isRemoved
50
+ }) }, (isRemoved && { "aria-hidden": true }), filterDataAttrs(props)),
51
+ link ? (React__default.createElement("a", { className: "arc-Tag-content", href: link, tabIndex: 0 },
52
+ icon && (React__default.createElement("span", { className: "arc-Tag-icon" },
53
+ React__default.createElement(Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
54
+ React__default.createElement("div", { className: "arc-Tag-label" }, children))) : (React__default.createElement(React__default.Fragment, null, onClick ? (React__default.createElement("button", { className: "arc-Tag-content", onClick: onClick, "data-testid": "arc-Tag-content" },
55
+ icon && (React__default.createElement("span", { className: "arc-Tag-icon" },
56
+ React__default.createElement(Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
57
+ React__default.createElement("div", { className: "arc-Tag-label" }, children))) : (React__default.createElement("div", { className: "arc-Tag-content", "data-testid": "arc-Tag-content" },
58
+ icon && (React__default.createElement("span", { className: "arc-Tag-icon" },
59
+ React__default.createElement(Icon, { "data-testid": "arc-Tag-icon", icon: icon, size: 16 }))),
60
+ React__default.createElement("div", { className: "arc-Tag-label" }, children))))),
61
+ isRemovable && (React__default.createElement("button", { className: "arc-Tag-icon arc-Tag-icon--removable", onClick: onRemoveHandler, "data-testid": "arc-Tag-icon-removable", "aria-live": "polite", "aria-roledescription": "remove tag" },
62
+ React__default.createElement(Icon, { icon: BtIconCross_2, color: "brand", size: 20 })))));
63
+ };
64
+
65
+ export { Tag };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@arc-ui/tag",
3
+ "types": "./Tag.esm.d.ts",
4
+ "main": "./Tag.cjs.js",
5
+ "module": "./Tag.esm.js",
6
+ "private": true
7
+ }
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import React from "react";
3
3
  import { FC } from "react";
4
- import { FormControlProps } from "../_shared/cjs/FormControl-e6b7d7c5";
4
+ import { FormControlProps } from "../_shared/cjs/FormControl-d4d9c665";
5
5
  type EventType = React.ChangeEvent<HTMLInputElement>;
6
6
  /**
7
7
  * Use `TextInput` to allow custom user text entry with a keyboard.
8
8
  */
9
9
  declare const TextInput: FC<TextInputProps>;
10
- interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus"> {
10
+ interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
11
11
  /**
12
12
  * Uncontrolled default value of the TextInput. If the TextInput is controlled
13
13
  * via `value`/`onChange`, `defaultValue` will be ignored.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var index = require('../_shared/cjs/index-78b35bc1.js');
6
6
  var index$1 = require('../_shared/cjs/index-45bfb67b.js');
7
7
  var React = require('react');
8
- var FormControl = require('../_shared/cjs/FormControl-e6b7d7c5.js');
8
+ var FormControl = require('../_shared/cjs/FormControl-d4d9c665.js');
9
9
  var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
10
10
  var VisuallyHidden = require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
11
11
  require('../_shared/cjs/Text-1d3844be.js');
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import React from "react";
3
3
  import { FC } from "react";
4
- import { FormControlProps } from "../_shared/esm/FormControl-84c9ace6";
4
+ import { FormControlProps } from "../_shared/esm/FormControl-2cb96de7";
5
5
  type EventType = React.ChangeEvent<HTMLInputElement>;
6
6
  /**
7
7
  * Use `TextInput` to allow custom user text entry with a keyboard.
8
8
  */
9
9
  declare const TextInput: FC<TextInputProps>;
10
- interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus"> {
10
+ interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
11
11
  /**
12
12
  * Uncontrolled default value of the TextInput. If the TextInput is controlled
13
13
  * via `value`/`onChange`, `defaultValue` will be ignored.
@@ -1,7 +1,7 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
2
2
  import { c as classNames } from '../_shared/esm/index-2ae58626.js';
3
3
  import React__default, { forwardRef, useContext, useState } from 'react';
4
- import { u as useAriaDescribedby, F as FormControl } from '../_shared/esm/FormControl-84c9ace6.js';
4
+ import { u as useAriaDescribedby, F as FormControl } from '../_shared/esm/FormControl-2cb96de7.js';
5
5
  import { C as Context } from '../_shared/esm/Surface-bf201530.js';
6
6
  import { V as VisuallyHidden } from '../_shared/esm/VisuallyHidden-b9eebf71.js';
7
7
  import '../_shared/esm/Text-6b958ad8.js';
@@ -1 +1 @@
1
- export { VerticalSpace } from "../_shared/cjs/VerticalSpace-65ad083c";
1
+ export { VerticalSpace } from "../_shared/cjs/VerticalSpace-7aed88ab";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var VerticalSpace = require('../_shared/cjs/VerticalSpace-65ad083c.js');
5
+ var VerticalSpace = require('../_shared/cjs/VerticalSpace-7aed88ab.js');
6
6
  require('../_shared/cjs/index-78b35bc1.js');
7
7
  require('../_shared/cjs/index-45bfb67b.js');
8
8
  require('react');
@@ -1 +1 @@
1
- export { VerticalSpace } from "../_shared/esm/VerticalSpace-6b4f5e50";
1
+ export { VerticalSpace } from "../_shared/esm/VerticalSpace-3579b20e";
@@ -1,4 +1,4 @@
1
- export { V as VerticalSpace } from '../_shared/esm/VerticalSpace-6b4f5e50.js';
1
+ export { V as VerticalSpace } from '../_shared/esm/VerticalSpace-3579b20e.js';
2
2
  import '../_shared/esm/index-229fc864.js';
3
3
  import '../_shared/esm/index-2ae58626.js';
4
4
  import 'react';
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var React$1 = require('react');
4
+
5
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
+
7
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
8
+
9
+ const React = React__default["default"];
10
+ const BtIconTickAlt2Px = props =>
11
+ /*#__PURE__*/ React.createElement(
12
+ "svg",
13
+ Object.assign(
14
+ {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ viewBox: "0 0 32 32"
17
+ },
18
+ props
19
+ ),
20
+ /*#__PURE__*/ React.createElement("defs", null),
21
+ /*#__PURE__*/ React.createElement("path", {
22
+ d:
23
+ "M13.49963,21.91418l-4.707-4.707a1.0014,1.0014,0,0,1,0-1.41406,1.02353,1.02353,0,0,1,1.41406,0l3.293,3.293,8.293-8.293a.99989.99989,0,1,1,1.41406,1.41406Z",
24
+ fill: "currentColor"
25
+ })
26
+ );
27
+ var BtIconTickAlt2Px_2 = BtIconTickAlt2Px;
28
+
29
+ exports.BtIconTickAlt2Px_2 = BtIconTickAlt2Px_2;
@@ -71,10 +71,7 @@ var Button = React$1.forwardRef(function (_a, ref) {
71
71
  });
72
72
  var ButtonIcon = function (_a) {
73
73
  var icon = _a.icon, isChevron = _a.isChevron, isBeforeText = _a.isBeforeText;
74
- return (React__default["default"].createElement("span", { className: index$1.classNames({
75
- "arc-Button-icon": true,
76
- "arc-Button-icon--chevron": isChevron
77
- }) }, isChevron ? (React__default["default"].createElement(Icon.Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid.BtIconChevronRightMid_2 })) : (React__default["default"].createElement(Icon.Icon, { icon: icon }))));
74
+ return (React__default["default"].createElement("span", { className: "arc-Button-icon" }, isChevron ? (React__default["default"].createElement(Icon.Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid.BtIconChevronRightMid_2 })) : (React__default["default"].createElement(Icon.Icon, { icon: icon }))));
78
75
  };
79
76
 
80
77
  exports.Button = Button;
@@ -114,5 +114,9 @@ interface FormControlProps {
114
114
  * onClick handler for FormControlDisclosure
115
115
  */
116
116
  onClickDisclosure?: () => void;
117
+ /**
118
+ * Position helper text under label. This is set to `false` by default.
119
+ */
120
+ helperUnderLabel?: boolean;
117
121
  }
118
122
  export { FormControlDisclosure, FormControlDisclosureProps, useAriaDescribedby, FormControl, FormControlProps, Context as FormControlContext };
@@ -101,14 +101,14 @@ var Provider = Context.Provider;
101
101
  * Use `FormControl` to provide inputs with labels, helper text and error messages
102
102
  */
103
103
  var FormControl = function (_a) {
104
- var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = index.__rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
104
+ var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, _e = _a.helperUnderLabel, helperUnderLabel = _e === void 0 ? false : _e, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = index.__rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
105
105
  var surface = React$1.useContext(Surface.Context).surface;
106
- var _e = useAriaDescribedby({
106
+ var _f = useAriaDescribedby({
107
107
  disclosureText: disclosureText,
108
108
  errorMessage: errorMessage,
109
109
  helper: helper,
110
110
  id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
111
- }), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper, idDisclosure = _e.idDisclosure;
111
+ }), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError, idHelper = _f.idHelper, idDisclosure = _f.idDisclosure;
112
112
  var LabelType = ElementType === "div" ? "label" : "legend";
113
113
  var elementProps = {};
114
114
  var labelProps = {};
@@ -134,11 +134,12 @@ var FormControl = function (_a) {
134
134
  React__default["default"].createElement(LabelType, index.__assign({ className: "arc-FormControl-label" }, labelProps),
135
135
  label,
136
136
  requirementStatus === "optional" && (React__default["default"].createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
137
+ helperUnderLabel && (React__default["default"].createElement(React__default["default"].Fragment, null, helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
137
138
  children,
138
- errorMessage ? (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
139
+ !helperUnderLabel && (React__default["default"].createElement(React__default["default"].Fragment, null, errorMessage ? (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
139
140
  React__default["default"].createElement("span", { className: "arc-FormControl-error--icon" },
140
141
  React__default["default"].createElement(BtIconAlert_2, null)),
141
- errorMessage)) : disclosureTitle ? (React__default["default"].createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))));
142
+ errorMessage)) : disclosureTitle ? (React__default["default"].createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))))));
142
143
  };
143
144
 
144
145
  exports.BtIconAlert_2 = BtIconAlert_2;
@@ -0,0 +1,34 @@
1
+ import { FC } from "react";
2
+ /**
3
+ * Use `VerticalSpace` to create vertical space between components.
4
+ */
5
+ declare const VerticalSpace: FC<VerticalSpaceProps>;
6
+ type VerticalSpaceSize = "4" | "8" | "12" | "16" | "20" | "24" | "28" | "32" | "40" | "48" | "64" | "96" | "128";
7
+ interface VerticalSpaceProps {
8
+ /**
9
+ * Should the VerticalSpace be visible for debugging and documentation
10
+ * purposes?
11
+ */
12
+ isDebugVisible?: boolean;
13
+ /**
14
+ * Size of the VerticalSpace.
15
+ */
16
+ size?: VerticalSpaceSize;
17
+ /**
18
+ * Size of the VerticalSpace from the small breakpoint upwards.
19
+ */
20
+ sizeS?: VerticalSpaceSize;
21
+ /**
22
+ * Size of the VerticalSpace from the medium breakpoint upwards.
23
+ */
24
+ sizeM?: VerticalSpaceSize;
25
+ /**
26
+ * Size of the VerticalSpace from the large breakpoint upwards.
27
+ */
28
+ sizeL?: VerticalSpaceSize;
29
+ /**
30
+ * Size of the VerticalSpace from the extra large breakpoint upwards.
31
+ */
32
+ sizeXL?: VerticalSpaceSize;
33
+ }
34
+ export { VerticalSpace, VerticalSpaceSize, VerticalSpaceProps };
@@ -13,11 +13,15 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
  */
14
14
  var VerticalSpace = function (_a) {
15
15
  var _b;
16
- var _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "24" : _d, props = index.__rest(_a, ["isDebugVisible", "size"]);
16
+ var _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "24" : _d, sizeS = _a.sizeS, sizeM = _a.sizeM, sizeL = _a.sizeL, sizeXL = _a.sizeXL, props = index.__rest(_a, ["isDebugVisible", "size", "sizeS", "sizeM", "sizeL", "sizeXL"]);
17
17
  return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {
18
18
  "arc-VerticalSpace": true
19
19
  },
20
- _b["arc-VerticalSpace--size".concat(size)] = size && size !== "24",
20
+ _b["arc-VerticalSpace--size".concat(size)] = size,
21
+ _b["arc-VerticalSpace--sizeS".concat(sizeS)] = sizeS && sizeS,
22
+ _b["arc-VerticalSpace--sizeM".concat(sizeM)] = sizeM && sizeM,
23
+ _b["arc-VerticalSpace--sizeL".concat(sizeL)] = sizeL && sizeL,
24
+ _b["arc-VerticalSpace--sizeXL".concat(sizeXL)] = sizeXL && sizeXL,
21
25
  _b["arc-VerticalSpace--debugVisible"] = isDebugVisible,
22
26
  _b)) }, index.filterDataAttrs(props))));
23
27
  };
@@ -1,4 +1,4 @@
1
- export * from "./FormControl-e6b7d7c5";
1
+ export * from "./FormControl-d4d9c665";
2
2
  export * from "../../Card/Card.cjs";
3
3
  export * from "./index.es-77def0c9";
4
4
  export * from "../../TextInput/TextInput.cjs";