@react-fabric/core 1.0.0-beta.54 → 1.0.0-beta.57

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 (50) hide show
  1. package/css/components/_button.css +8 -4
  2. package/css/components/_card.css +8 -4
  3. package/css/components/_tabPanel.css +65 -9
  4. package/css/core/_aside.css +4 -6
  5. package/css/reset/_reset.css +14 -0
  6. package/dist/cjs/components/avatar/Avatar.js +8 -4
  7. package/dist/cjs/components/button/Button.js +4 -2
  8. package/dist/cjs/components/card/Card.js +18 -12
  9. package/dist/cjs/components/chip/Chip.js +5 -3
  10. package/dist/cjs/components/dropdown/Dropdown.js +1 -0
  11. package/dist/cjs/components/icon/Icon.js +9 -5
  12. package/dist/cjs/components/menu/Menu.js +2 -0
  13. package/dist/cjs/components/tabpanel/Tab.js +1 -1
  14. package/dist/cjs/components/tabpanel/TabPanel.js +5 -2
  15. package/dist/cjs/overlays/flyout/Flyout.js +3 -1
  16. package/dist/cjs/overlays/modal/Modal.js +3 -3
  17. package/dist/cjs/types/icons.js +5 -1
  18. package/dist/esm/components/avatar/Avatar.js +8 -4
  19. package/dist/esm/components/button/Button.js +4 -2
  20. package/dist/esm/components/card/Card.js +18 -12
  21. package/dist/esm/components/chip/Chip.js +5 -3
  22. package/dist/esm/components/dropdown/Dropdown.js +1 -0
  23. package/dist/esm/components/icon/Icon.js +9 -5
  24. package/dist/esm/components/menu/Menu.js +2 -0
  25. package/dist/esm/components/tabpanel/Tab.js +1 -1
  26. package/dist/esm/components/tabpanel/TabPanel.js +5 -2
  27. package/dist/esm/overlays/flyout/Flyout.js +3 -1
  28. package/dist/esm/overlays/modal/Modal.js +3 -3
  29. package/dist/esm/types/icons.js +5 -1
  30. package/dist/types/components/avatar/Avatar.d.ts +5 -1
  31. package/dist/types/components/button/Button.d.ts +5 -1
  32. package/dist/types/components/card/Card.d.ts +5 -3
  33. package/dist/types/components/chip/Chip.d.ts +5 -1
  34. package/dist/types/components/tabpanel/TabPanel.d.ts +10 -2
  35. package/dist/types/overlays/flyout/Flyout.d.ts +5 -1
  36. package/dist/types/overlays/modal/Modal.d.ts +2 -2
  37. package/dist/types/types/icons.d.ts +5 -1
  38. package/package.json +2 -2
  39. package/src/components/avatar/Avatar.tsx +9 -1
  40. package/src/components/button/Button.tsx +14 -1
  41. package/src/components/card/Card.tsx +29 -15
  42. package/src/components/chip/Chip.tsx +8 -2
  43. package/src/components/dropdown/Dropdown.tsx +1 -0
  44. package/src/components/icon/Icon.tsx +5 -1
  45. package/src/components/menu/Menu.tsx +2 -0
  46. package/src/components/tabpanel/Tab.tsx +2 -2
  47. package/src/components/tabpanel/TabPanel.tsx +13 -1
  48. package/src/overlays/flyout/Flyout.tsx +6 -1
  49. package/src/overlays/modal/Modal.tsx +3 -3
  50. package/src/types/icons.ts +10 -1
@@ -10,7 +10,7 @@ import { useState, useMemo } from 'react';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
11
11
  import { getColor } from '../../utils/getColor.js';
12
12
 
13
- var _excluded = ["ref", "name", "avatar", "fallbackIcon", "bg", "color", "size", "rounded", "variant", "className", "viewBox", "onClick"];
13
+ var _excluded = ["ref", "name", "avatar", "fallbackIcon", "bg", "color", "size", "rounded", "variant", "className", "viewBox", "preventDefault", "onClick"];
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  var SizeMap = {
@@ -64,7 +64,8 @@ var Avatar = function Avatar(_ref) {
64
64
  className = _ref.className,
65
65
  _ref$viewBox = _ref.viewBox,
66
66
  viewBox = _ref$viewBox === void 0 ? "0 0 24 24" : _ref$viewBox,
67
- onClick = _ref.onClick,
67
+ preventDefault = _ref.preventDefault,
68
+ _onClick = _ref.onClick,
68
69
  aria = _objectWithoutProperties(_ref, _excluded);
69
70
  var _useState = useState(true),
70
71
  _useState2 = _slicedToArray(_useState, 2),
@@ -159,9 +160,12 @@ var Avatar = function Avatar(_ref) {
159
160
  return /*#__PURE__*/jsxs("dfn", _objectSpread(_objectSpread({
160
161
  role: "presentation",
161
162
  className: classNames("fabric-avatar", className, "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", !rounded && "rounded", rounded && "rounded-full"),
162
- onClick: onClick,
163
+ onClick: function onClick(e) {
164
+ preventDefault && e.preventDefault();
165
+ _onClick === null || _onClick === void 0 || _onClick(e);
166
+ },
163
167
  style: styles,
164
- "data-clickable": !!onClick,
168
+ "data-clickable": !!_onClick,
165
169
  ref: ref
166
170
  }, aria), {}, {
167
171
  children: [!fallback && avatarImage, fallback && fallbackAvatar]
@@ -16,7 +16,7 @@ import { AnimationIndicator } from '../animations/Animations.js';
16
16
  import { getBadgeProps, Badge } from '../badge/Badge.js';
17
17
  import { Icon } from '../icon/Icon.js';
18
18
 
19
- var _excluded = ["as", "ref", "children", "className", "active", "color", "icon", "iconBg", "iconColor", "iconAlign", "altIcon", "rtlFlip", "rounded", "size", "disabled", "loading", "variant", "badge", "fullWidth", "spinOnHover", "onClick", "actionMessage", "stopPropagation", "type", "hotKey", "showActionDone", "showActionDoneEvent", "tabIndex", "data-ref"];
19
+ var _excluded = ["as", "ref", "children", "className", "active", "color", "icon", "iconBg", "iconColor", "iconAlign", "altIcon", "rtlFlip", "rounded", "size", "disabled", "loading", "variant", "badge", "fullWidth", "spinOnHover", "onClick", "actionMessage", "preventDefault", "stopPropagation", "type", "hotKey", "showActionDone", "showActionDoneEvent", "tabIndex", "data-ref"];
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
22
  /**
@@ -68,6 +68,7 @@ var Button = function Button(_ref) {
68
68
  spinOnHover = _ref.spinOnHover,
69
69
  onClick = _ref.onClick,
70
70
  actionMessage = _ref.actionMessage,
71
+ preventDefault = _ref.preventDefault,
71
72
  stopPropagation = _ref.stopPropagation,
72
73
  _ref$type = _ref.type,
73
74
  type = _ref$type === void 0 ? "button" : _ref$type,
@@ -92,6 +93,7 @@ var Button = function Button(_ref) {
92
93
  // Handle click events
93
94
  var clickHandler = useCallback(function (e) {
94
95
  setBusy(true);
96
+ preventDefault && e.preventDefault();
95
97
  stopPropagation && e.stopPropagation();
96
98
  var ret = onClick === null || onClick === void 0 ? void 0 : onClick(e);
97
99
  void Promise.resolve(ret).then(function (b) {
@@ -100,7 +102,7 @@ var Button = function Button(_ref) {
100
102
  setActionDone(true);
101
103
  }
102
104
  });
103
- }, [onClick, disabled, actionMessage, showActionDoneEvent, stopPropagation]);
105
+ }, [onClick, disabled, preventDefault, actionMessage, showActionDoneEvent, stopPropagation]);
104
106
 
105
107
  /** ***************** reset done state on timeout *******************/
106
108
  useEffect(function () {
@@ -11,7 +11,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
11
11
  import '@react-fabric/utilities';
12
12
  import { nodeCheck } from '../../utils/nodeCheck.js';
13
13
 
14
- var _excluded = ["children", "className", "bodyClassName", "selected", "selectedRibbon", "onClick", "onDragStart", "flex", "draggable", "dragKey", "dragData", "ref"];
14
+ var _excluded = ["children", "className", "bodyClassName", "selected", "selectedRibbon", "onClick", "onDragStart", "flex", "draggable", "dragKey", "dragData", "ref", "as"];
15
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
17
  /**
@@ -61,6 +61,7 @@ var Card = function Card(_ref) {
61
61
  dragKey = _ref.dragKey,
62
62
  dragData = _ref.dragData,
63
63
  ref = _ref.ref,
64
+ as = _ref.as,
64
65
  aria = _objectWithoutProperties(_ref, _excluded);
65
66
  var _useMemo = useMemo(function () {
66
67
  return Children.toArray(children).reduce(function (ret, node) {
@@ -77,22 +78,27 @@ var Card = function Card(_ref) {
77
78
  dragKey && ((_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.setData(dragKey, JSON.stringify(dragData)));
78
79
  dragKey && (onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event, dragKey, dragData));
79
80
  }, [onDragStart, dragKey, dragData]);
81
+ var E = as !== null && as !== void 0 ? as : "div";
80
82
  return /*#__PURE__*/jsx("div", {
81
- className: classNames("fabric-cardWrapper", "rounded-capped relative grid", flex && "flex-1", selected && selectedRibbon && "selected", selected && "outline-2 outline-accent-500 outline-offset-2"),
83
+ className: classNames("fabric-cardWrapper", "rounded-capped relative grid", flex && "flex-1", selected && selectedRibbon && "selected", selected && "outline-1 outline-accent-500 outline-offset-2"),
82
84
  children: /*#__PURE__*/jsx(ErrorBoundary, {
83
- children: /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
84
- className: classNames("fabric-card", className, "rounded-capped flex flex-col flex-nowrap overflow-hidden", onClick && "clickable"),
85
+ children: /*#__PURE__*/jsxs("div", {
86
+ className: classNames("fabric-card", className, "rounded-capped relative flex flex-col flex-nowrap overflow-hidden", "href" in aria && "clickable", "to" in aria && "clickable", onClick && "clickable"),
85
87
  draggable: draggable,
86
88
  onDragStart: !draggable ? undefined : handleDragStart,
87
- ref: ref
88
- }, aria), {}, {
89
- children: [header, /*#__PURE__*/jsx("div", {
89
+ ref: ref,
90
+ children: [header, /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
90
91
  role: "none",
91
- className: classNames("fabric-cardBody", bodyClassName, "flex-1"),
92
- onClick: onClick,
93
- children: body
94
- }), footer]
95
- }))
92
+ onClick: onClick
93
+ }, aria), {}, {
94
+ className: "contents",
95
+ children: body && /*#__PURE__*/jsx("object", {
96
+ type: "none",
97
+ className: classNames("fabric-cardBody", bodyClassName, "flex-1"),
98
+ children: body
99
+ })
100
+ })), footer]
101
+ })
96
102
  })
97
103
  });
98
104
  };
@@ -10,7 +10,7 @@ import { getColor } from '../../utils/getColor.js';
10
10
  import '@react-fabric/utilities';
11
11
  import { Icon } from '../icon/Icon.js';
12
12
 
13
- var _excluded = ["ref", "children", "className", "size", "color", "variant", "icon", "iconBg", "iconColor", "rtlFlip", "disabled", "onClick", "onIconClick", "onRemove", "rounded", "stopPropagation", "as"];
13
+ var _excluded = ["ref", "children", "className", "size", "color", "variant", "icon", "iconBg", "iconColor", "rtlFlip", "disabled", "onClick", "onIconClick", "onRemove", "rounded", "preventDefault", "stopPropagation", "as"];
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  var SizeMap = {
@@ -57,6 +57,7 @@ var Chip = function Chip(_ref) {
57
57
  onIconClick = _ref.onIconClick,
58
58
  onRemove = _ref.onRemove,
59
59
  rounded = _ref.rounded,
60
+ preventDefault = _ref.preventDefault,
60
61
  stopPropagation = _ref.stopPropagation,
61
62
  as = _ref.as,
62
63
  aria = _objectWithoutProperties(_ref, _excluded);
@@ -75,9 +76,10 @@ var Chip = function Chip(_ref) {
75
76
  return s;
76
77
  }, [color, size], "Chip styles");
77
78
  var clickHandler = useCallback(function (e) {
78
- if (stopPropagation) e.stopPropagation();
79
+ preventDefault && e.preventDefault();
80
+ stopPropagation && e.stopPropagation();
79
81
  onClick === null || onClick === void 0 || onClick(e);
80
- }, [onClick, stopPropagation]);
82
+ }, [onClick, preventDefault, stopPropagation]);
81
83
  var removeHandler = useCallback(function (e) {
82
84
  if (stopPropagation) e.stopPropagation();
83
85
  onRemove === null || onRemove === void 0 || onRemove(e);
@@ -112,6 +112,7 @@ var DropdownElement = function DropdownElement(_ref) {
112
112
  var _anchor$props$onClick, _anchor$props;
113
113
  (_anchor$props$onClick = (_anchor$props = anchor.props).onClick) === null || _anchor$props$onClick === void 0 || _anchor$props$onClick.call(_anchor$props, e);
114
114
  e.stopPropagation();
115
+ e.preventDefault();
115
116
  }
116
117
  })), {}, {
117
118
  "data-inner-clickable": "true",
@@ -63,7 +63,7 @@ var Icon = function Icon(_ref) {
63
63
  _ref$viewBox = _ref.viewBox,
64
64
  viewBox = _ref$viewBox === void 0 ? "0 0 24 24" : _ref$viewBox,
65
65
  className = _ref.className,
66
- onClick = _ref.onClick,
66
+ _onClick = _ref.onClick,
67
67
  rest = _objectWithoutProperties(_ref, _excluded);
68
68
  /** ***************** style map *******************/
69
69
  var styles = useMemo(function () {
@@ -121,12 +121,16 @@ var Icon = function Icon(_ref) {
121
121
  ref: ref
122
122
  }, rest), {}, {
123
123
  role: "presentation",
124
- className: classNames("fabric-icon", "select-none overflow-hidden box-content leading-none not-italic text-center", !rounded && "rounded", rounded && "rounded-full", animate && "animate-".concat(animate), !!onClick && disabled && "opacity-30 pointer-events-none", className),
125
- onClick: onClick,
124
+ className: classNames("fabric-icon", "select-none overflow-hidden box-content leading-none not-italic text-center", !rounded && "rounded", rounded && "rounded-full", animate && "animate-".concat(animate), !!_onClick && disabled && "opacity-30 pointer-events-none", className),
125
+ onClick: function onClick(e) {
126
+ _onClick && e.stopPropagation();
127
+ _onClick && e.preventDefault();
128
+ _onClick === null || _onClick === void 0 || _onClick(e);
129
+ },
126
130
  "data-flip": rtlFlip,
127
131
  style: styles,
128
- "data-clickable": !!onClick,
129
- "data-inner-clickable": !!onClick,
132
+ "data-clickable": !!_onClick,
133
+ "data-inner-clickable": !!_onClick,
130
134
  children: iconEl
131
135
  }));
132
136
  };
@@ -241,12 +241,14 @@ var Menu = function Menu(props) {
241
241
  var tree = useFloatingTree();
242
242
  if (tree) {
243
243
  return /*#__PURE__*/jsx(MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
244
+ className: "",
244
245
  menuClassName: props.className
245
246
  }));
246
247
  }
247
248
  if (parentId === null) {
248
249
  return /*#__PURE__*/jsx(FloatingTree, {
249
250
  children: /*#__PURE__*/jsx(MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
251
+ className: "",
250
252
  menuClassName: props.className
251
253
  }))
252
254
  });
@@ -92,7 +92,7 @@ var Tab = function Tab(_ref) {
92
92
  disabled: disabled,
93
93
  "data-color": color,
94
94
  "data-inner-clickable": true,
95
- className: classNames("fabric-tabButton", className, active && "active pointer-events-none", active && activeClassName, disabled && "text-tint-500 pointer-events-none", tabFlex ? "flex-1" : "flex-initial max-w-36", minimal ? "min-w-6" : "min-w-18", "flex items-center justify-center px-1 rounded overflow-hidden cursor-pointer"),
95
+ className: classNames("fabric-tabButton", className, active && "active pointer-events-none", active && activeClassName, disabled && "text-tint-500 pointer-events-none", tabFlex ? "flex-1" : "flex-initial max-w-36", minimal ? "min-w-6 rounded" : "rounded-capped", "flex items-center justify-center overflow-hidden cursor-pointer"),
96
96
  onClick: function onClick() {
97
97
  return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
98
98
  },
@@ -49,11 +49,13 @@ var TabPanel = function TabPanel(_ref) {
49
49
  _ref$orientation = _ref.orientation,
50
50
  orientation = _ref$orientation === void 0 ? "top" : _ref$orientation,
51
51
  activeTab = _ref.activeTab,
52
+ activeClassName = _ref.activeClassName,
52
53
  justify = _ref.justify,
53
54
  variant = _ref.variant,
54
55
  tabFlex = _ref.tabFlex,
55
56
  append = _ref.append,
56
57
  prepend = _ref.prepend,
58
+ tabRotate = _ref.tabRotate,
57
59
  gap = _ref.gap,
58
60
  onBeforeChange = _ref.onBeforeChange,
59
61
  onChange = _ref.onChange;
@@ -92,16 +94,17 @@ var TabPanel = function TabPanel(_ref) {
92
94
  "data-orientation": orientation,
93
95
  "data-variant": variant !== null && variant !== void 0 ? variant : "default",
94
96
  children: [/*#__PURE__*/jsxs("div", {
95
- className: classNames("fabric-tabHeader", headerClassName, justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
97
+ className: classNames("fabric-tabHeader", headerClassName, tabRotate && "tab-rotate", justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
96
98
  children: [prepend, /*#__PURE__*/jsx("div", {
97
99
  className: classNames("fabric-tabList", justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", ["bottom", "end"].includes(orientation) ? "self-start" : "self-end", "flex flex-1 flex-nowrap overflow-auto scroll-thin"),
98
100
  style: {
99
101
  gap: gap
100
102
  },
101
103
  children: tabs.map(function (node) {
102
- var _node$props$tabFlex;
104
+ var _node$props$tabFlex, _node$props$activeCla;
103
105
  return /*#__PURE__*/cloneElement(node, {
104
106
  tabFlex: (_node$props$tabFlex = node.props.tabFlex) !== null && _node$props$tabFlex !== void 0 ? _node$props$tabFlex : tabFlex,
107
+ activeClassName: (_node$props$activeCla = node.props.activeClassName) !== null && _node$props$activeCla !== void 0 ? _node$props$activeCla : activeClassName,
105
108
  onClick: handleClick,
106
109
  active: node.props.id === active
107
110
  });
@@ -13,7 +13,7 @@ import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
13
13
  import { CoreIcons } from '../../types/icons.js';
14
14
  import { jsxs, jsx } from 'react/jsx-runtime';
15
15
 
16
- var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "closeOnClick", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "minWidth", "hideMask", "align"];
16
+ var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "closeOnClick", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "minWidth", "root", "hideMask", "align"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  var Flyout = function Flyout(_ref) {
@@ -33,6 +33,7 @@ var Flyout = function Flyout(_ref) {
33
33
  size = _ref.size,
34
34
  width = _ref.width,
35
35
  minWidth = _ref.minWidth,
36
+ root = _ref.root,
36
37
  hideMask = _ref.hideMask,
37
38
  _ref$align = _ref.align,
38
39
  align = _ref$align === void 0 ? "start" : _ref$align,
@@ -85,6 +86,7 @@ var Flyout = function Flyout(_ref) {
85
86
  }
86
87
  }, [closeOnClick, handleClose]);
87
88
  return /*#__PURE__*/jsxs(FloatingPortal, {
89
+ root: root,
88
90
  children: [!hideMask && /*#__PURE__*/jsx(FloatingOverlay, {
89
91
  lockScroll: true,
90
92
  style: {
@@ -13,7 +13,7 @@ import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
13
13
  import { CoreIcons } from '../../types/icons.js';
14
14
  import { jsx, jsxs } from 'react/jsx-runtime';
15
15
 
16
- var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "noMask", "width", "height", "minHeight", "minWidth"];
16
+ var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "hideMask", "width", "height", "minHeight", "minWidth"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  var Modal = function Modal(_ref) {
@@ -31,7 +31,7 @@ var Modal = function Modal(_ref) {
31
31
  loading = _ref.loading,
32
32
  root = _ref.root,
33
33
  size = _ref.size,
34
- noMask = _ref.noMask,
34
+ hideMask = _ref.hideMask,
35
35
  width = _ref.width,
36
36
  height = _ref.height,
37
37
  minHeight = _ref.minHeight,
@@ -85,7 +85,7 @@ var Modal = function Modal(_ref) {
85
85
  position: "absolute",
86
86
  overflow: "hidden"
87
87
  },
88
- className: classNames("grid place-items-center p-16", !noMask && "bg-tint-100/20 backdrop-blur-sm"),
88
+ className: classNames("grid place-items-center p-16", !hideMask && "bg-tint-100/20 backdrop-blur-sm"),
89
89
  children: /*#__PURE__*/jsx(FloatingFocusManager, {
90
90
  context: context,
91
91
  children: /*#__PURE__*/jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
@@ -194,7 +194,7 @@ var CoreIcons;
194
194
  _CoreIcons.mediaSplitter = "M3 15V17H5V15M15 19V21H17V19M19 3H5C3.9 3 3 3.9 3 5V9H5V5H19V9H21V5C21 3.9 20.1 3 19 3M21 19H19V21C20.1 21 21 20.1 21 19M1 11V13H23V11M7 19V21H9V19M19 15V17H21V15M11 19V21H13V19M3 19C3 20.1 3.9 21 5 21V19Z";
195
195
  _CoreIcons.mediaPlay = "M8,5.14V19.14L19,12.14L8,5.14Z";
196
196
  _CoreIcons.mediaPause = "M14,19H18V5H14M6,19H10V5H6V19Z";
197
- _CoreIcons.mediaContrast = "M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z";
197
+ _CoreIcons.mediaContrast = "M12,20C9.79,20 7.79,19.1 6.34,17.66L17.66,6.34C19.1,7.79 20,9.79 20,12A8,8 0 0,1 12,20M6,8H8V6H9.5V8H11.5V9.5H9.5V11.5H8V9.5H6M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,16H17V14.5H12V16Z";
198
198
  _CoreIcons.mediaEqs = "M7 3H5V9H7V3M19 3H17V13H19V3M3 13H5V21H7V13H9V11H3V13M15 7H13V3H11V7H9V9H15V7M11 21H13V11H11V21M15 15V17H17V21H19V17H21V15H15Z";
199
199
  _CoreIcons.mediaCaptionOff = "M5,4C4.45,4 4,4.18 3.59,4.57C3.2,4.96 3,5.44 3,6V18C3,18.56 3.2,19.04 3.59,19.43C4,19.82 4.45,20 5,20H19C19.5,20 20,19.81 20.39,19.41C20.8,19 21,18.53 21,18V6C21,5.47 20.8,5 20.39,4.59C20,4.19 19.5,4 19,4H5M4.5,5.5H19.5V18.5H4.5V5.5M7,9C6.7,9 6.47,9.09 6.28,9.28C6.09,9.47 6,9.7 6,10V14C6,14.3 6.09,14.53 6.28,14.72C6.47,14.91 6.7,15 7,15H10C10.27,15 10.5,14.91 10.71,14.72C10.91,14.53 11,14.3 11,14V13H9.5V13.5H7.5V10.5H9.5V11H11V10C11,9.7 10.91,9.47 10.71,9.28C10.5,9.09 10.27,9 10,9H7M14,9C13.73,9 13.5,9.09 13.29,9.28C13.09,9.47 13,9.7 13,10V14C13,14.3 13.09,14.53 13.29,14.72C13.5,14.91 13.73,15 14,15H17C17.3,15 17.53,14.91 17.72,14.72C17.91,14.53 18,14.3 18,14V13H16.5V13.5H14.5V10.5H16.5V11H18V10C18,9.7 17.91,9.47 17.72,9.28C17.53,9.09 17.3,9 17,9H14Z";
200
200
  _CoreIcons.mediaCaptionOn = "M18,11H16.5V10.5H14.5V13.5H16.5V13H18V14A1,1 0 0,1 17,15H14A1,1 0 0,1 13,14V10A1,1 0 0,1 14,9H17A1,1 0 0,1 18,10M11,11H9.5V10.5H7.5V13.5H9.5V13H11V14A1,1 0 0,1 10,15H7A1,1 0 0,1 6,14V10A1,1 0 0,1 7,9H10A1,1 0 0,1 11,10M19,4H5C3.89,4 3,4.89 3,6V18A2,2 0 0,0 5,20H19A2,2 0 0,0 21,18V6C21,4.89 20.1,4 19,4Z";
@@ -205,6 +205,10 @@ var CoreIcons;
205
205
  _CoreIcons.mediaVolume3 = "M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";
206
206
  _CoreIcons.mediaComment = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M6,7H18V9H6V7M6,11H15V13H6V11Z";
207
207
  _CoreIcons.mediaCommentAdd = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M11,6H13V9H16V11H13V14H11V11H8V9H11V6Z";
208
+ _CoreIcons.mediaLightness = "M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z";
209
+ _CoreIcons.mediaColor = "M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z";
210
+ _CoreIcons.mediaInvert = "M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z";
211
+ _CoreIcons.mediaSaturate = "M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z";
208
212
  })(CoreIcons || (CoreIcons = {}));
209
213
 
210
214
  export { CoreIcons };
@@ -36,6 +36,10 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
36
36
  * rounded icon
37
37
  */
38
38
  rounded?: boolean;
39
+ /**
40
+ * prevent click default, useful when component is within a `a` link
41
+ */
42
+ preventDefault?: boolean;
39
43
  /**
40
44
  * click handler
41
45
  */
@@ -69,4 +73,4 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
69
73
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-avatar--docs} for more details.
70
74
  * @see {@link https://boringavatars.com/} for more information on Boring Avatars.
71
75
  */
72
- export declare const Avatar: ({ ref, name, avatar, fallbackIcon, bg, color, size, rounded, variant, className, viewBox, onClick, ...aria }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
76
+ export declare const Avatar: ({ ref, name, avatar, fallbackIcon, bg, color, size, rounded, variant, className, viewBox, preventDefault, onClick, ...aria }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -74,6 +74,10 @@ export interface BaseProps extends CssProp, AriaProps, IconProps, RefProp, TestP
74
74
  * keyboard shortcut
75
75
  */
76
76
  hotKey?: string;
77
+ /**
78
+ * prevent click default, useful when button is within a `a` link
79
+ */
80
+ preventDefault?: boolean;
77
81
  stopPropagation?: boolean;
78
82
  onMouseOut?: MouseEventHandler;
79
83
  onMouseOver?: MouseEventHandler;
@@ -114,5 +118,5 @@ export type ButtonProps<Tag extends React.ElementType = "button"> = BaseProps &
114
118
  *
115
119
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-button--docs} for more details.
116
120
  */
117
- export declare const Button: <Tag extends React.ElementType = "button">({ as, ref, children, className, active, color, icon, iconBg, iconColor, iconAlign, altIcon, rtlFlip, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }: ButtonProps<Tag>) => import("react/jsx-runtime").JSX.Element;
121
+ export declare const Button: <Tag extends React.ElementType = "button">({ as, ref, children, className, active, color, icon, iconBg, iconColor, iconAlign, altIcon, rtlFlip, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, preventDefault, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }: ButtonProps<Tag>) => import("react/jsx-runtime").JSX.Element;
118
122
  export {};
@@ -1,8 +1,8 @@
1
1
  import { type DragEvent, type MouseEventHandler } from "react";
2
2
  import { type ContentProps } from "../../core/content/Content";
3
3
  import { type HeadFootProps } from "../../core/headfoot/HeadFoot";
4
- import { type AriaProps, type ChildrenProp, type CssProp, type RefProp, type TestProps } from "../../types";
5
- export interface CardProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDivElement>, ChildrenProp<React.ReactElement<HeadFootProps | ContentProps>> {
4
+ import { PolymorphicProps, type AriaProps, type ChildrenProp, type CssProp, type RefProp, type TestProps } from "../../types";
5
+ interface BaseProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDivElement>, ChildrenProp<React.ReactElement<HeadFootProps | ContentProps>> {
6
6
  /**
7
7
  * apply flex fill styling
8
8
  */
@@ -40,6 +40,7 @@ export interface CardProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDi
40
40
  */
41
41
  dragData?: KeyValue;
42
42
  }
43
+ export type CardProps<Tag extends React.ElementType = "div"> = BaseProps & PolymorphicProps<Tag>;
43
44
  /**
44
45
  * A component that displays a card with a header, body, and footer. It can be used to display content in a structured format.
45
46
  * It supports various features such as click handling, drag-and-drop functionality, and customizable styles.
@@ -74,4 +75,5 @@ export interface CardProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDi
74
75
  *
75
76
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-card--docs} for more details.
76
77
  */
77
- export declare const Card: ({ children, className, bodyClassName, selected, selectedRibbon, onClick, onDragStart, flex, draggable, dragKey, dragData, ref, ...aria }: CardProps) => import("react/jsx-runtime").JSX.Element;
78
+ export declare const Card: <Tag extends React.ElementType = "div">({ children, className, bodyClassName, selected, selectedRibbon, onClick, onDragStart, flex, draggable, dragKey, dragData, ref, as, ...aria }: CardProps<Tag>) => import("react/jsx-runtime").JSX.Element;
79
+ export {};
@@ -21,6 +21,10 @@ export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, Chi
21
21
  * disabled state
22
22
  */
23
23
  disabled?: boolean;
24
+ /**
25
+ * prevent click default, useful when component is within a `a` link
26
+ */
27
+ preventDefault?: boolean;
24
28
  /**
25
29
  * prevent click propagation
26
30
  */
@@ -58,4 +62,4 @@ export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, Chi
58
62
  *
59
63
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-chip--docs} for more details.
60
64
  */
61
- export declare const Chip: <Tag extends React.ElementType = "div">({ ref, children, className, size, color, variant, icon, iconBg, iconColor, rtlFlip, disabled, onClick, onIconClick, onRemove, rounded, stopPropagation, as, ...aria }: ChipProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
65
+ export declare const Chip: <Tag extends React.ElementType = "div">({ ref, children, className, size, color, variant, icon, iconBg, iconColor, rtlFlip, disabled, onClick, onIconClick, onRemove, rounded, preventDefault, stopPropagation, as, ...aria }: ChipProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -13,11 +13,15 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
13
13
  /**
14
14
  * tab variations
15
15
  */
16
- variant?: "soft" | "solid" | "outline";
16
+ variant?: "soft" | "solid" | "outline" | "pills";
17
17
  /**
18
18
  * tab button flex to fill tabs
19
19
  */
20
20
  tabFlex?: boolean;
21
+ /**
22
+ * rotate tab sideways for start/end orientation
23
+ */
24
+ tabRotate?: boolean;
21
25
  /**
22
26
  * tab button gap
23
27
  */
@@ -30,6 +34,10 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
30
34
  * tab list className
31
35
  */
32
36
  headerClassName?: string;
37
+ /**
38
+ * active tab className
39
+ */
40
+ activeClassName?: string;
33
41
  /**
34
42
  * append element
35
43
  */
@@ -80,4 +88,4 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
80
88
  *
81
89
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
82
90
  */
83
- export declare const TabPanel: ({ children, headerClassName, orientation, activeTab, justify, variant, tabFlex, append, prepend, gap, onBeforeChange, onChange, }: TabPanelProps) => import("react/jsx-runtime").JSX.Element;
91
+ export declare const TabPanel: ({ children, headerClassName, orientation, activeTab, activeClassName, justify, variant, tabFlex, append, prepend, tabRotate, gap, onBeforeChange, onChange, }: TabPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -38,6 +38,10 @@ export interface FlyoutProps extends AriaProps, TestProps, Omit<IconProps, "icon
38
38
  * minimum width
39
39
  */
40
40
  minWidth?: string | number;
41
+ /**
42
+ * portal root element
43
+ */
44
+ root?: HTMLElement;
41
45
  /**
42
46
  * hide backdrop mask
43
47
  */
@@ -55,4 +59,4 @@ export interface FlyoutProps extends AriaProps, TestProps, Omit<IconProps, "icon
55
59
  */
56
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
57
61
  }
58
- export declare const Flyout: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Flyout: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, root, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -49,7 +49,7 @@ export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon"
49
49
  /**
50
50
  * hide mask background
51
51
  */
52
- noMask?: boolean;
52
+ hideMask?: boolean;
53
53
  /**
54
54
  * close handler
55
55
  */
@@ -59,4 +59,4 @@ export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon"
59
59
  */
60
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
61
61
  }
62
- export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, noMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, hideMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -191,7 +191,7 @@ export declare namespace CoreIcons {
191
191
  const mediaSplitter = "M3 15V17H5V15M15 19V21H17V19M19 3H5C3.9 3 3 3.9 3 5V9H5V5H19V9H21V5C21 3.9 20.1 3 19 3M21 19H19V21C20.1 21 21 20.1 21 19M1 11V13H23V11M7 19V21H9V19M19 15V17H21V15M11 19V21H13V19M3 19C3 20.1 3.9 21 5 21V19Z";
192
192
  const mediaPlay = "M8,5.14V19.14L19,12.14L8,5.14Z";
193
193
  const mediaPause = "M14,19H18V5H14M6,19H10V5H6V19Z";
194
- const mediaContrast = "M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z";
194
+ const mediaContrast = "M12,20C9.79,20 7.79,19.1 6.34,17.66L17.66,6.34C19.1,7.79 20,9.79 20,12A8,8 0 0,1 12,20M6,8H8V6H9.5V8H11.5V9.5H9.5V11.5H8V9.5H6M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,16H17V14.5H12V16Z";
195
195
  const mediaEqs = "M7 3H5V9H7V3M19 3H17V13H19V3M3 13H5V21H7V13H9V11H3V13M15 7H13V3H11V7H9V9H15V7M11 21H13V11H11V21M15 15V17H17V21H19V17H21V15H15Z";
196
196
  const mediaCaptionOff = "M5,4C4.45,4 4,4.18 3.59,4.57C3.2,4.96 3,5.44 3,6V18C3,18.56 3.2,19.04 3.59,19.43C4,19.82 4.45,20 5,20H19C19.5,20 20,19.81 20.39,19.41C20.8,19 21,18.53 21,18V6C21,5.47 20.8,5 20.39,4.59C20,4.19 19.5,4 19,4H5M4.5,5.5H19.5V18.5H4.5V5.5M7,9C6.7,9 6.47,9.09 6.28,9.28C6.09,9.47 6,9.7 6,10V14C6,14.3 6.09,14.53 6.28,14.72C6.47,14.91 6.7,15 7,15H10C10.27,15 10.5,14.91 10.71,14.72C10.91,14.53 11,14.3 11,14V13H9.5V13.5H7.5V10.5H9.5V11H11V10C11,9.7 10.91,9.47 10.71,9.28C10.5,9.09 10.27,9 10,9H7M14,9C13.73,9 13.5,9.09 13.29,9.28C13.09,9.47 13,9.7 13,10V14C13,14.3 13.09,14.53 13.29,14.72C13.5,14.91 13.73,15 14,15H17C17.3,15 17.53,14.91 17.72,14.72C17.91,14.53 18,14.3 18,14V13H16.5V13.5H14.5V10.5H16.5V11H18V10C18,9.7 17.91,9.47 17.72,9.28C17.53,9.09 17.3,9 17,9H14Z";
197
197
  const mediaCaptionOn = "M18,11H16.5V10.5H14.5V13.5H16.5V13H18V14A1,1 0 0,1 17,15H14A1,1 0 0,1 13,14V10A1,1 0 0,1 14,9H17A1,1 0 0,1 18,10M11,11H9.5V10.5H7.5V13.5H9.5V13H11V14A1,1 0 0,1 10,15H7A1,1 0 0,1 6,14V10A1,1 0 0,1 7,9H10A1,1 0 0,1 11,10M19,4H5C3.89,4 3,4.89 3,6V18A2,2 0 0,0 5,20H19A2,2 0 0,0 21,18V6C21,4.89 20.1,4 19,4Z";
@@ -202,4 +202,8 @@ export declare namespace CoreIcons {
202
202
  const mediaVolume3 = "M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";
203
203
  const mediaComment = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M6,7H18V9H6V7M6,11H15V13H6V11Z";
204
204
  const mediaCommentAdd = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M11,6H13V9H16V11H13V14H11V11H8V9H11V6Z";
205
+ const mediaLightness = "M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z";
206
+ const mediaColor = "M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z";
207
+ const mediaInvert = "M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z";
208
+ const mediaSaturate = "M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z";
205
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.54",
3
+ "version": "1.0.0-beta.57",
4
4
  "description": "RUF: Core package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -54,5 +54,5 @@
54
54
  "node": ">=18.12.0",
55
55
  "npm": ">=8.19.0"
56
56
  },
57
- "gitHead": "242f15e3de29d365cce6f41f4ef99ab36bb6b995"
57
+ "gitHead": "9b596a0a8d6cecaa8479f80c495b64fb42ce739f"
58
58
  }
@@ -73,6 +73,10 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
73
73
  * rounded icon
74
74
  */
75
75
  rounded?: boolean;
76
+ /**
77
+ * prevent click default, useful when component is within a `a` link
78
+ */
79
+ preventDefault?: boolean;
76
80
  /**
77
81
  * click handler
78
82
  */
@@ -127,6 +131,7 @@ export const Avatar = ({
127
131
  variant = "beam",
128
132
  className,
129
133
  viewBox = "0 0 24 24",
134
+ preventDefault,
130
135
  onClick,
131
136
  ...aria
132
137
  }: AvatarProps) => {
@@ -220,7 +225,10 @@ export const Avatar = ({
220
225
  !rounded && "rounded",
221
226
  rounded && "rounded-full",
222
227
  )}
223
- onClick={onClick}
228
+ onClick={(e) => {
229
+ preventDefault && e.preventDefault();
230
+ onClick?.(e);
231
+ }}
224
232
  style={styles}
225
233
  data-clickable={!!onClick}
226
234
  ref={ref}
@@ -136,6 +136,10 @@ export interface BaseProps
136
136
  */
137
137
  hotKey?: string;
138
138
 
139
+ /**
140
+ * prevent click default, useful when button is within a `a` link
141
+ */
142
+ preventDefault?: boolean;
139
143
  stopPropagation?: boolean;
140
144
 
141
145
  onMouseOut?: MouseEventHandler;
@@ -202,6 +206,7 @@ export const Button = <Tag extends React.ElementType = "button">({
202
206
  spinOnHover,
203
207
  onClick,
204
208
  actionMessage,
209
+ preventDefault,
205
210
  stopPropagation,
206
211
  type = "button",
207
212
  hotKey,
@@ -220,6 +225,7 @@ export const Button = <Tag extends React.ElementType = "button">({
220
225
  const clickHandler = useCallback(
221
226
  (e: React.MouseEvent) => {
222
227
  setBusy(true);
228
+ preventDefault && e.preventDefault();
223
229
  stopPropagation && e.stopPropagation();
224
230
  const ret = onClick?.(e);
225
231
  void Promise.resolve(ret).then((b) => {
@@ -229,7 +235,14 @@ export const Button = <Tag extends React.ElementType = "button">({
229
235
  }
230
236
  });
231
237
  },
232
- [onClick, disabled, actionMessage, showActionDoneEvent, stopPropagation],
238
+ [
239
+ onClick,
240
+ disabled,
241
+ preventDefault,
242
+ actionMessage,
243
+ showActionDoneEvent,
244
+ stopPropagation,
245
+ ],
233
246
  );
234
247
 
235
248
  /** ***************** reset done state on timeout *******************/