@arc-ui/community-components 3.10.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.cts CHANGED
@@ -59,6 +59,10 @@ interface HeaderBarNotificationProps {
59
59
  handleClick: () => void;
60
60
  text: string;
61
61
  };
62
+ /**
63
+ * Specify a size or mutliple sizes where the notification only appears.
64
+ */
65
+ showAtSize?: ("s" | "m" | "l" | "xl")[];
62
66
  }
63
67
 
64
68
  interface AccordionHeadingProps {
@@ -669,6 +673,10 @@ interface ActionTileProps {
669
673
  * Heading text (required)
670
674
  */
671
675
  heading: string;
676
+ /**
677
+ * Whether to use the compact tile variant
678
+ */
679
+ isCompact?: boolean;
672
680
  /**
673
681
  * Whether the tile is in active/selected state
674
682
  */
@@ -687,6 +695,8 @@ interface LinkTileProps extends React$1.HTMLAttributes<HTMLDivElement> {
687
695
  href?: string;
688
696
  /** Whether to show the arrow icon. Defaults to true */
689
697
  showIcon?: boolean;
698
+ /** Visual tone variant. Defaults to brand */
699
+ tone?: "brand" | "neutral";
690
700
  }
691
701
 
692
702
  declare const InlineLinkGroup: React$1.FC<InlineLinkGroupProps>;
package/lib/index.d.mts CHANGED
@@ -59,6 +59,10 @@ interface HeaderBarNotificationProps {
59
59
  handleClick: () => void;
60
60
  text: string;
61
61
  };
62
+ /**
63
+ * Specify a size or mutliple sizes where the notification only appears.
64
+ */
65
+ showAtSize?: ("s" | "m" | "l" | "xl")[];
62
66
  }
63
67
 
64
68
  interface AccordionHeadingProps {
@@ -669,6 +673,10 @@ interface ActionTileProps {
669
673
  * Heading text (required)
670
674
  */
671
675
  heading: string;
676
+ /**
677
+ * Whether to use the compact tile variant
678
+ */
679
+ isCompact?: boolean;
672
680
  /**
673
681
  * Whether the tile is in active/selected state
674
682
  */
@@ -687,6 +695,8 @@ interface LinkTileProps extends React$1.HTMLAttributes<HTMLDivElement> {
687
695
  href?: string;
688
696
  /** Whether to show the arrow icon. Defaults to true */
689
697
  showIcon?: boolean;
698
+ /** Visual tone variant. Defaults to brand */
699
+ tone?: "brand" | "neutral";
690
700
  }
691
701
 
692
702
  declare const InlineLinkGroup: React$1.FC<InlineLinkGroupProps>;
package/lib/index.mjs CHANGED
@@ -130,72 +130,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
130
130
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
131
131
  };
132
132
 
133
- /**
134
- * Filters out attributes from the given props object based on a pattern.
135
- *
136
- * This function extracts all properties that match either the `data-*` or `aria-*` attribute patterns
137
- * and returns a new object containing only those properties.
138
- *
139
- * @param props - The object containing properties to filter.
140
- * @returns A new object containing only the matched attributes (`data-*` and `aria-*`) from the input props.
141
- */
142
- var attributePrefixes = ["data-", "aria-"];
143
- var filterAttrs = function (props) {
144
- var filteredProps = {};
145
- var _loop_1 = function (prop) {
146
- if (Object.prototype.hasOwnProperty.call(props, prop) &&
147
- attributePrefixes.some(function (prefix) { return prop.startsWith(prefix); })) {
148
- filteredProps[prop] = props[prop];
149
- }
150
- };
151
- for (var prop in props) {
152
- _loop_1(prop);
153
- }
154
- return filteredProps;
155
- };
156
-
157
- /**
158
- * Do not edit directly
159
- * Generated file
160
- */
161
-
162
- const BtIconCrossAlt =
163
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='m16.707 16.02 4.482-4.494a.5.5 0 1 0-.707-.706l-4.48 4.493-4.482-4.493a.5.5 0 1 0-.707.706l4.483 4.494-4.483 4.494a.5.5 0 1 0 .707.706l4.481-4.493 4.481 4.493a.5.5 0 1 0 .707-.706Z'/%3e%3c/svg%3e";
164
-
165
- var styles$v = {"container":"HeaderBarNotification-module_container__18nau","content":"HeaderBarNotification-module_content__SUo-l","image":"HeaderBarNotification-module_image__uV-nD","details":"HeaderBarNotification-module_details__S5Rrx","closeButtonContainer":"HeaderBarNotification-module_closeButtonContainer__b1UDI"};
166
-
167
- var HeaderBarNotification = function (_a) {
168
- var headerActionProps = _a.headerActionProps, notificationId = _a.notificationId, _b = _a.isPersistant, isPersistant = _b === void 0 ? false : _b, icon = _a.icon, image = _a.image, heading = _a.heading, tagline = _a.tagline, children = _a.children, button = _a.button, props = __rest(_a, ["headerActionProps", "notificationId", "isPersistant", "icon", "image", "heading", "tagline", "children", "button"]);
169
- var _c = useState(isPersistant), showNotification = _c[0], setShowNotification = _c[1];
170
- var localStorageId = "hide".concat(notificationId.replace(/[^a-zA-Z0-9\-_]/g, ""));
171
- // Check to see if the notication has been hidden or not and show it if so
172
- useEffect(function () {
173
- if (typeof window !== "undefined" && !isPersistant) {
174
- setShowNotification(!localStorage.getItem(localStorageId));
175
- }
176
- }, []);
177
- // Handle the closure of the notification, store it in the session so we don't keep showing it.
178
- var handleClosePopup = function () {
179
- if (!isPersistant)
180
- localStorage.setItem(localStorageId, "true");
181
- setShowNotification(false);
182
- };
183
- return (React.createElement(Popover, __assign({ open: showNotification, side: "bottom", sideOffset: 12, maxWidth: 900, arrow: true, content: React.createElement("div", { className: styles$v.container },
184
- React.createElement("div", { className: styles$v.content },
185
- (image || icon) && (React.createElement("div", { className: styles$v.image },
186
- image && (React.createElement(Image$2, { src: image, alt: heading, fit: "cover", width: 55 })),
187
- icon && React.createElement(Icon, { icon: icon, size: 35 }))),
188
- React.createElement("div", { className: styles$v.details },
189
- tagline && (React.createElement(Text, { size: "m", tone: "muted" }, tagline)),
190
- React.createElement(Heading, { size: "s", level: "3" }, heading),
191
- children)),
192
- button && (React.createElement(ButtonV2, { onClick: button.handleClick, label: button.text, buttonStyle: "secondary", isFullWidth: true })),
193
- React.createElement("div", { className: styles$v.closeButtonContainer },
194
- React.createElement(Tooltip, { side: "bottom", title: "Dismiss Notification", asChild: true },
195
- React.createElement(ButtonV2, { "data-testid": localStorageId, buttonStyle: "tertiary", "aria-label": "Close ".concat(notificationId, " popup"), onClick: handleClosePopup, icon: BtIconCrossAlt })))) }, filterAttrs(props)),
196
- React.createElement(NavigationHeaderAction, __assign({ isAttention: true }, headerActionProps))));
197
- };
198
-
199
133
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
200
134
 
201
135
  function getDefaultExportFromCjs (x) {
@@ -289,6 +223,73 @@ function requireClassnames () {
289
223
  var classnamesExports = requireClassnames();
290
224
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
291
225
 
226
+ /**
227
+ * Filters out attributes from the given props object based on a pattern.
228
+ *
229
+ * This function extracts all properties that match either the `data-*` or `aria-*` attribute patterns
230
+ * and returns a new object containing only those properties.
231
+ *
232
+ * @param props - The object containing properties to filter.
233
+ * @returns A new object containing only the matched attributes (`data-*` and `aria-*`) from the input props.
234
+ */
235
+ var attributePrefixes = ["data-", "aria-"];
236
+ var filterAttrs = function (props) {
237
+ var filteredProps = {};
238
+ var _loop_1 = function (prop) {
239
+ if (Object.prototype.hasOwnProperty.call(props, prop) &&
240
+ attributePrefixes.some(function (prefix) { return prop.startsWith(prefix); })) {
241
+ filteredProps[prop] = props[prop];
242
+ }
243
+ };
244
+ for (var prop in props) {
245
+ _loop_1(prop);
246
+ }
247
+ return filteredProps;
248
+ };
249
+
250
+ /**
251
+ * Do not edit directly
252
+ * Generated file
253
+ */
254
+
255
+ const BtIconCrossAlt =
256
+ "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='m16.707 16.02 4.482-4.494a.5.5 0 1 0-.707-.706l-4.48 4.493-4.482-4.493a.5.5 0 1 0-.707.706l4.483 4.494-4.483 4.494a.5.5 0 1 0 .707.706l4.481-4.493 4.481 4.493a.5.5 0 1 0 .707-.706Z'/%3e%3c/svg%3e";
257
+
258
+ var styles$v = {"popupNotification":"HeaderBarNotification-module_popupNotification__HAxod","hiddenByDefault":"HeaderBarNotification-module_hiddenByDefault__JHbUy","s":"HeaderBarNotification-module_s__HofMM","m":"HeaderBarNotification-module_m__ZUdjq","l":"HeaderBarNotification-module_l__wlZ1Z","xl":"HeaderBarNotification-module_xl__z7DBP","container":"HeaderBarNotification-module_container__18nau","content":"HeaderBarNotification-module_content__SUo-l","image":"HeaderBarNotification-module_image__uV-nD","details":"HeaderBarNotification-module_details__S5Rrx","closeButtonContainer":"HeaderBarNotification-module_closeButtonContainer__b1UDI"};
259
+
260
+ var HeaderBarNotification = function (_a) {
261
+ var _b;
262
+ var headerActionProps = _a.headerActionProps, notificationId = _a.notificationId, _c = _a.isPersistant, isPersistant = _c === void 0 ? false : _c, icon = _a.icon, image = _a.image, heading = _a.heading, tagline = _a.tagline, children = _a.children, button = _a.button, showAtSize = _a.showAtSize, props = __rest(_a, ["headerActionProps", "notificationId", "isPersistant", "icon", "image", "heading", "tagline", "children", "button", "showAtSize"]);
263
+ var _d = useState(isPersistant), showNotification = _d[0], setShowNotification = _d[1];
264
+ var localStorageId = "hide".concat(notificationId.replace(/[^a-zA-Z0-9\-_]/g, ""));
265
+ // Check to see if the notication has been hidden or not and show it if so
266
+ useEffect(function () {
267
+ if (typeof window !== "undefined" && !isPersistant) {
268
+ setShowNotification(!localStorage.getItem(localStorageId));
269
+ }
270
+ }, []);
271
+ // Handle the closure of the notification, store it in the session so we don't keep showing it.
272
+ var handleClosePopup = function () {
273
+ if (!isPersistant)
274
+ localStorage.setItem(localStorageId, "true");
275
+ setShowNotification(false);
276
+ };
277
+ return (React.createElement(Popover, __assign({ open: showNotification, side: "bottom", sideOffset: 12, maxWidth: 900, arrow: true, asChild: true, className: classNames(styles$v.popupNotification, (_b = {}, _b[styles$v.hiddenByDefault] = showAtSize, _b), showAtSize === null || showAtSize === void 0 ? void 0 : showAtSize.map(function (s) { return styles$v[s]; })), content: React.createElement("div", { className: styles$v.container },
278
+ React.createElement("div", { className: styles$v.content },
279
+ (image || icon) && (React.createElement("div", { className: styles$v.image },
280
+ image && (React.createElement(Image$2, { src: image, alt: heading, fit: "cover", width: 55 })),
281
+ icon && React.createElement(Icon, { icon: icon, size: 35 }))),
282
+ React.createElement("div", { className: styles$v.details },
283
+ tagline && (React.createElement(Text, { size: "m", tone: "muted" }, tagline)),
284
+ React.createElement(Heading, { size: "s", level: "3" }, heading),
285
+ children)),
286
+ button && (React.createElement(ButtonV2, { onClick: button.handleClick, label: button.text, buttonStyle: "secondary", isFullWidth: true })),
287
+ React.createElement("div", { className: styles$v.closeButtonContainer },
288
+ React.createElement(Tooltip, { side: "bottom", title: "Dismiss Notification", asChild: true },
289
+ React.createElement(ButtonV2, { "data-testid": localStorageId, buttonStyle: "tertiary", "aria-label": "Close ".concat(notificationId, " popup"), onClick: handleClosePopup, icon: BtIconCrossAlt })))) }, filterAttrs(props)),
290
+ React.createElement(NavigationHeaderAction, __assign({ isAttention: true }, headerActionProps))));
291
+ };
292
+
292
293
  var styles$u = {"accordion-header":"AccordionHeading-module_accordion-header__8s12f","accordion-header--hasImage":"AccordionHeading-module_accordion-header--hasImage__wbDjW","accordion-header--padded":"AccordionHeading-module_accordion-header--padded__me1JY","accordion-header--headingSizeM":"AccordionHeading-module_accordion-header--headingSizeM__amLfy"};
293
294
 
294
295
  var AccordionHeading = function (_a) {
@@ -4015,33 +4016,38 @@ var ContentInfoWidget = function (_a) {
4015
4016
  React.createElement(Text, { size: "xs", tone: "muted" }, text))));
4016
4017
  };
4017
4018
 
4018
- var styles$b = {"action-tile":"ActionTile-module_action-tile__JPwGb","action-tile-content":"ActionTile-module_action-tile-content__ZkgHc","action-tile-content--without-icon":"ActionTile-module_action-tile-content--without-icon__7F5xj","action-tile-icon":"ActionTile-module_action-tile-icon__PY1EN","action-tile-heading":"ActionTile-module_action-tile-heading__Uxdu9","action-tile--active":"ActionTile-module_action-tile--active__-aWze","action-tile-tick":"ActionTile-module_action-tile-tick__vhsJE"};
4019
+ var styles$b = {"action-tile":"ActionTile-module_action-tile__JPwGb","action-tile-content":"ActionTile-module_action-tile-content__ZkgHc","action-tile-content--without-icon":"ActionTile-module_action-tile-content--without-icon__7F5xj","action-tile-icon":"ActionTile-module_action-tile-icon__PY1EN","action-tile-heading":"ActionTile-module_action-tile-heading__Uxdu9","action-tile--compact":"ActionTile-module_action-tile--compact__wq5Aa","action-tile--active":"ActionTile-module_action-tile--active__-aWze","action-tile-tick":"ActionTile-module_action-tile-tick__vhsJE"};
4019
4020
 
4020
4021
  var ActionTile = function (_a) {
4021
4022
  var _b, _c;
4022
- var icon = _a.icon, activeIcon = _a.activeIcon, heading = _a.heading, _d = _a.isActive, isActive = _d === void 0 ? false : _d, onClick = _a.onClick, props = __rest(_a, ["icon", "activeIcon", "heading", "isActive", "onClick"]);
4023
+ var icon = _a.icon, activeIcon = _a.activeIcon, heading = _a.heading, _d = _a.isCompact, isCompact = _d === void 0 ? false : _d, _e = _a.isActive, isActive = _e === void 0 ? false : _e, onClick = _a.onClick, props = __rest(_a, ["icon", "activeIcon", "heading", "isCompact", "isActive", "onClick"]);
4023
4024
  var displayIcon = isActive && activeIcon ? activeIcon : icon;
4025
+ var iconSize = isCompact ? 40 : 48;
4024
4026
  var content = (React.createElement(React.Fragment, null,
4025
4027
  React.createElement("div", { className: classNames(styles$b["action-tile-content"], (_b = {},
4026
4028
  _b[styles$b["action-tile-content--without-icon"]] = !displayIcon,
4027
4029
  _b)) },
4028
4030
  displayIcon && (React.createElement("div", { className: styles$b["action-tile-icon"] },
4029
- React.createElement(Icon, { icon: displayIcon, size: 48 }))),
4031
+ React.createElement(Icon, { icon: displayIcon, size: iconSize }))),
4030
4032
  React.createElement("span", { className: styles$b["action-tile-heading"] }, heading)),
4031
4033
  isActive && (React.createElement("div", { className: styles$b["action-tile-tick"] },
4032
4034
  React.createElement(Icon, { icon: BtIconTickAlt2Px, size: 28 })))));
4033
4035
  return (React.createElement("button", __assign({ type: "button", className: classNames(styles$b["action-tile"], (_c = {},
4034
4036
  _c[styles$b["action-tile--active"]] = isActive,
4037
+ _c[styles$b["action-tile--compact"]] = isCompact,
4035
4038
  _c)), onClick: onClick, "aria-pressed": isActive }, filterAttrs(props)), content));
4036
4039
  };
4037
4040
 
4038
- var styles$a = {"link-tile":"LinkTile-module_link-tile__xVUP3","link-tile-content":"LinkTile-module_link-tile-content__H-QN8","link-tile-icon":"LinkTile-module_link-tile-icon__kTMfH","link-tile-text":"LinkTile-module_link-tile-text__0K6zf"};
4041
+ var styles$a = {"link-tile":"LinkTile-module_link-tile__xVUP3","link-tile-content":"LinkTile-module_link-tile-content__H-QN8","link-tile-icon":"LinkTile-module_link-tile-icon__kTMfH","link-tile-text":"LinkTile-module_link-tile-text__0K6zf","link-tile--neutral":"LinkTile-module_link-tile--neutral__T2z5x"};
4039
4042
 
4040
4043
  var LinkTile = function (_a) {
4041
- var text = _a.text, href = _a.href, _b = _a.showIcon, showIcon = _b === void 0 ? true : _b, className = _a.className, props = __rest(_a, ["text", "href", "showIcon", "className"]);
4044
+ var _b;
4045
+ var text = _a.text, href = _a.href, _c = _a.showIcon, showIcon = _c === void 0 ? true : _c, _d = _a.tone, tone = _d === void 0 ? "brand" : _d, className = _a.className, props = __rest(_a, ["text", "href", "showIcon", "tone", "className"]);
4042
4046
  var Component = href ? "a" : "div";
4043
4047
  var linkProps = href ? { href: href } : {};
4044
- return (React.createElement(Component, __assign({ className: classNames(styles$a["link-tile"], className) }, linkProps, props), text && (React.createElement("div", { className: styles$a["link-tile-content"] },
4048
+ return (React.createElement(Component, __assign({ className: classNames(styles$a["link-tile"], (_b = {},
4049
+ _b[styles$a["link-tile--neutral"]] = tone === "neutral",
4050
+ _b), className) }, linkProps, props), text && (React.createElement("div", { className: styles$a["link-tile-content"] },
4045
4051
  React.createElement("span", { className: styles$a["link-tile-text"] }, text),
4046
4052
  showIcon && (React.createElement("span", { className: styles$a["link-tile-icon"] },
4047
4053
  React.createElement(Icon, { icon: BtIconArrowAltRight, size: 32 })))))));