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

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 (39) hide show
  1. package/css/components/_breadcrumbs.css +3 -3
  2. package/css/components/_menu.css +2 -0
  3. package/css/core/_aside.css +2 -2
  4. package/css/theme/_utilities.css +1 -1
  5. package/dist/cjs/components/badge/Badge.js +1 -1
  6. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +1 -1
  7. package/dist/cjs/components/button/Button.js +1 -1
  8. package/dist/cjs/components/chip/Chip.js +1 -1
  9. package/dist/cjs/components/empty/EmptyContent.js +2 -2
  10. package/dist/cjs/components/menu/MenuItem.js +1 -1
  11. package/dist/cjs/components/panel/Panel.js +5 -1
  12. package/dist/cjs/core/responsive/Responsive.js +1 -1
  13. package/dist/cjs/core/section/Section.js +11 -27
  14. package/dist/cjs/overlays/flyout/Flyout.js +1 -1
  15. package/dist/cjs/overlays/modal/Modal.js +1 -1
  16. package/dist/esm/components/badge/Badge.js +1 -1
  17. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +1 -1
  18. package/dist/esm/components/button/Button.js +1 -1
  19. package/dist/esm/components/chip/Chip.js +1 -1
  20. package/dist/esm/components/empty/EmptyContent.js +2 -2
  21. package/dist/esm/components/menu/MenuItem.js +1 -1
  22. package/dist/esm/components/panel/Panel.js +5 -1
  23. package/dist/esm/core/responsive/Responsive.js +1 -1
  24. package/dist/esm/core/section/Section.js +11 -27
  25. package/dist/esm/overlays/flyout/Flyout.js +1 -1
  26. package/dist/esm/overlays/modal/Modal.js +1 -1
  27. package/dist/types/core/section/Section.d.ts +2 -2
  28. package/package.json +2 -2
  29. package/src/components/badge/Badge.tsx +3 -1
  30. package/src/components/breadcrumbs/Breadcrumbs.tsx +1 -1
  31. package/src/components/button/Button.tsx +1 -1
  32. package/src/components/chip/Chip.tsx +1 -1
  33. package/src/components/empty/EmptyContent.tsx +2 -2
  34. package/src/components/menu/MenuItem.tsx +1 -1
  35. package/src/components/panel/Panel.tsx +2 -0
  36. package/src/core/responsive/Responsive.tsx +1 -1
  37. package/src/core/section/Section.tsx +9 -1
  38. package/src/overlays/flyout/Flyout.tsx +1 -1
  39. package/src/overlays/modal/Modal.tsx +1 -1
@@ -95,7 +95,7 @@
95
95
 
96
96
  .fabric-breadcrumbs[data-variant="modern"] {
97
97
  & > .fabric-breadcrumbLink {
98
- --linkcolor: color-mix(in lab, var(--color) 50%, var(--fabric-bg));
98
+ --linkcolor: color-mix(in lab, var(--color) 35%, var(--fabric-bg));
99
99
 
100
100
  position: relative;
101
101
  list-style: none;
@@ -164,11 +164,11 @@
164
164
  }
165
165
 
166
166
  &:hover {
167
- --linkcolor: color-mix(in lab, var(--color) 65%, var(--fabric-bg));
167
+ --linkcolor: color-mix(in lab, var(--color) 40%, var(--fabric-bg));
168
168
  }
169
169
 
170
170
  &:active {
171
- --linkcolor: color-mix(in lab, var(--color) 35%, var(--fabric-bg));
171
+ --linkcolor: color-mix(in lab, var(--color) 45%, var(--fabric-bg));
172
172
  }
173
173
  }
174
174
  }
@@ -70,6 +70,8 @@
70
70
  &.active {
71
71
  pointer-events: none;
72
72
  background-color: color-mix(in lab, var(--color) 20%, var(--fabric-bg));
73
+ border-start-start-radius: 0;
74
+ border-end-start-radius: 0;
73
75
 
74
76
  & > div {
75
77
  box-shadow: 4px 0 0 var(--color) inset;
@@ -112,14 +112,14 @@
112
112
 
113
113
  &::before {
114
114
  height: 32px;
115
- border: 1px solid var(--color-tint-700);
115
+ border: 1px solid var(--color-tint-500);
116
116
  border-width: 0 1.5px;
117
117
  }
118
118
 
119
119
  &:hover::before,
120
120
  &:active::before {
121
121
  height: 100%;
122
- background-color: var(--color-primary-600);
122
+ background-color: var(--color-primary-300);
123
123
  border-color: var(--bg-color-base);
124
124
  border-width: 0 1.25px;
125
125
  }
@@ -81,7 +81,7 @@
81
81
  unicode-bidi: plaintext;
82
82
  }
83
83
 
84
- @utility flex-auto {
84
+ @utility flex-content {
85
85
  flex: 0 0 auto;
86
86
  }
87
87
 
@@ -95,7 +95,7 @@ var Badge = function Badge(_ref) {
95
95
  "data-ref": "badge",
96
96
  "data-ping": ping,
97
97
  "data-placement": placement,
98
- className: classNames("fabric-badge", className, "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none", forButton && !placement || inline ? "relative" : "absolute"),
98
+ className: classNames("fabric-badge", className, "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none", forButton && !placement || inline ? "relative flex-content" : "absolute"),
99
99
  children: [label && /*#__PURE__*/jsxRuntime.jsx("span", {
100
100
  className: "p-1",
101
101
  children: label
@@ -51,7 +51,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
51
51
  color = _ref.color,
52
52
  aria = _objectWithoutProperties(_ref, _excluded);
53
53
  var _useMemo = react.useMemo(function () {
54
- var nodeList = react.Children.toArray(children);
54
+ var nodeList = react.Children.toArray(children).filter(Boolean);
55
55
  if (nodeList.length > 7) {
56
56
  return [nodeList.slice(0, 3), nodeList.slice(3, -3), nodeList.slice(-3)];
57
57
  }
@@ -174,7 +174,7 @@ var Button = function Button(_ref) {
174
174
  className: classNames("fabric-buttonLabel", "truncate"),
175
175
  "data-colored-icon": !!iconBg,
176
176
  children: children
177
- }), !utilities.isNil(badge) && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread({}, badgeProps)), hotKey && /*#__PURE__*/jsxRuntime.jsx(HotKeyLabel.HotKeyLabel, {
177
+ }), !utilities.isNil(badge) && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread({}, badgeProps)), hotKey && children && /*#__PURE__*/jsxRuntime.jsx(HotKeyLabel.HotKeyLabel, {
178
178
  keyCombo: hotKey
179
179
  }), altIcon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
180
180
  className: "fabric-altIcon",
@@ -95,7 +95,7 @@ var Chip = function Chip(_ref) {
95
95
  }, aria), {}, {
96
96
  children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
97
97
  "data-ref": "chipIcon",
98
- className: classNames("fabric-chipIcon", "m-1 flex-auto"),
98
+ className: classNames("fabric-chipIcon", "m-1 flex-content"),
99
99
  icon: icon,
100
100
  bg: iconBg,
101
101
  onClick: onIconClick,
@@ -101,13 +101,13 @@ var EmptyContent = function EmptyContent(_ref) {
101
101
  icon: icon
102
102
  }), /*#__PURE__*/react.isValidElement(icon) && icon, !icon && /*#__PURE__*/jsxRuntime.jsx(DefaultIcon, {})]
103
103
  }), title && /*#__PURE__*/jsxRuntime.jsx("div", {
104
- className: "font-medium text-center text-dimmed",
104
+ className: "font-medium text-center opacity-85",
105
105
  style: {
106
106
  fontSize: "1.5em"
107
107
  },
108
108
  children: title
109
109
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
110
- className: "font-medium text-center text-muted",
110
+ className: "font-medium text-center opacity-65",
111
111
  style: {
112
112
  fontSize: "0.875em"
113
113
  },
@@ -130,7 +130,7 @@ var MenuItem = function MenuItem(_ref) {
130
130
  ref: utilities.mergeRefs(ref, elRef),
131
131
  "data-dropdown-dismiss": true,
132
132
  "data-color": color,
133
- className: classNames("fabric-menuItem cursor-pointer", className, active && "active", minimal && "minimal", disabled && "disabled", "rounded-capped relative max-w-[50vw] my-0.5"),
133
+ className: classNames("fabric-menuItem cursor-pointer", className, active && "active", minimal && "minimal", disabled && "disabled", "rounded relative max-w-[50vw] my-0.5"),
134
134
  "data-active": active,
135
135
  "data-open": childOpen,
136
136
  disabled: disabled,
@@ -9,6 +9,7 @@ var usePropToggle = require('../../hooks/usePropToggle.js');
9
9
  var icons = require('../../types/icons.js');
10
10
  var Animations = require('../animations/Animations.js');
11
11
  var Icon = require('../icon/Icon.js');
12
+ var HotKey = require('../../hotkeys/HotKey.js');
12
13
  var jsxRuntime = require('react/jsx-runtime');
13
14
 
14
15
  var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "iconBg", "iconColor", "rtlFlip", "panelId", "height", "width", "minHeight", "minWidth", "maxHeight", "maxWidth", "loading", "expandable", "expanded", "onExpand", "collapsable", "collapsed", "onCollapse", "onClose", "onBack"];
@@ -107,7 +108,10 @@ var Panel = function Panel(_ref) {
107
108
  maxHeight: maxHeight
108
109
  }
109
110
  }, aria), {}, {
110
- children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
111
+ children: [expanded && /*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
112
+ keyCombo: "esc",
113
+ handler: toggleExpand
114
+ }), /*#__PURE__*/jsxRuntime.jsxs("header", {
111
115
  role: "none",
112
116
  className: classNames("fabric-panelHeader", headerClassName, "flex flex-nowrap items-center area-head"),
113
117
  "data-ref": "panelHeader",
@@ -106,7 +106,7 @@ var Col = function Col(_ref3) {
106
106
  stretchContent = _ref3.stretchContent,
107
107
  aria = _objectWithoutProperties(_ref3, _excluded3);
108
108
  return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
109
- className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align), truncate && "truncate")
109
+ className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-content", align && "self-".concat(align), truncate && "truncate")
110
110
  }, aria), {}, {
111
111
  children: children
112
112
  }));
@@ -1,46 +1,30 @@
1
1
  'use strict';
2
2
 
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
3
5
  var classNames = require('classnames');
4
6
  var ErrorBoundary = require('../boundary/ErrorBoundary.js');
5
7
  var jsxRuntime = require('react/jsx-runtime');
6
8
 
7
- /*
8
- * React Fabric
9
- * @version: 1.0.0
10
- *
11
- *
12
- * The MIT License (MIT)
13
- * Copyright (c) 2024 Adarsh Pastakia
14
- *
15
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
16
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
17
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
19
- * subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all copies or substantial
22
- * portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
25
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- */
29
-
9
+ var _excluded = ["children", "className", "dir", "ref"];
10
+ 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; }
11
+ 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; }
30
12
  var Section = function Section(_ref) {
31
13
  var children = _ref.children,
32
14
  className = _ref.className,
33
15
  dir = _ref.dir,
34
- ref = _ref.ref;
35
- return /*#__PURE__*/jsxRuntime.jsx("div", {
16
+ ref = _ref.ref,
17
+ rest = _objectWithoutProperties(_ref, _excluded);
18
+ return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
36
19
  "data-ref": "section",
37
20
  dir: dir,
38
- ref: ref,
21
+ ref: ref
22
+ }, rest), {}, {
39
23
  className: classNames("fabric-section", className, "grid area-content overflow-hidden"),
40
24
  children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
41
25
  children: children
42
26
  })
43
- });
27
+ }));
44
28
  };
45
29
 
46
30
  exports.Section = Section;
@@ -120,7 +120,7 @@ var Flyout = function Flyout(_ref) {
120
120
  children: title
121
121
  }), actions, /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
122
122
  "data-ref": "panelClose",
123
- className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-stretch"),
123
+ className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
124
124
  icon: icons.CoreIcons.close,
125
125
  onClick: function onClick() {
126
126
  return handleClose(false);
@@ -114,7 +114,7 @@ var Modal = function Modal(_ref) {
114
114
  children: title
115
115
  }), actions, /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
116
116
  "data-ref": "panelClose",
117
- className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-stretch"),
117
+ className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
118
118
  icon: icons.CoreIcons.close,
119
119
  onClick: function onClick() {
120
120
  return handleClose(false);
@@ -95,7 +95,7 @@ var Badge = function Badge(_ref) {
95
95
  "data-ref": "badge",
96
96
  "data-ping": ping,
97
97
  "data-placement": placement,
98
- className: classNames("fabric-badge", className, "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none", forButton && !placement || inline ? "relative" : "absolute"),
98
+ className: classNames("fabric-badge", className, "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none", forButton && !placement || inline ? "relative flex-content" : "absolute"),
99
99
  children: [label && /*#__PURE__*/jsx("span", {
100
100
  className: "p-1",
101
101
  children: label
@@ -51,7 +51,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
51
51
  color = _ref.color,
52
52
  aria = _objectWithoutProperties(_ref, _excluded);
53
53
  var _useMemo = useMemo(function () {
54
- var nodeList = Children.toArray(children);
54
+ var nodeList = Children.toArray(children).filter(Boolean);
55
55
  if (nodeList.length > 7) {
56
56
  return [nodeList.slice(0, 3), nodeList.slice(3, -3), nodeList.slice(-3)];
57
57
  }
@@ -174,7 +174,7 @@ var Button = function Button(_ref) {
174
174
  className: classNames("fabric-buttonLabel", "truncate"),
175
175
  "data-colored-icon": !!iconBg,
176
176
  children: children
177
- }), !isNil(badge) && /*#__PURE__*/jsx(Badge, _objectSpread({}, badgeProps)), hotKey && /*#__PURE__*/jsx(HotKeyLabel, {
177
+ }), !isNil(badge) && /*#__PURE__*/jsx(Badge, _objectSpread({}, badgeProps)), hotKey && children && /*#__PURE__*/jsx(HotKeyLabel, {
178
178
  keyCombo: hotKey
179
179
  }), altIcon && /*#__PURE__*/jsx(Icon, {
180
180
  className: "fabric-altIcon",
@@ -95,7 +95,7 @@ var Chip = function Chip(_ref) {
95
95
  }, aria), {}, {
96
96
  children: [icon && /*#__PURE__*/jsx(Icon, {
97
97
  "data-ref": "chipIcon",
98
- className: classNames("fabric-chipIcon", "m-1 flex-auto"),
98
+ className: classNames("fabric-chipIcon", "m-1 flex-content"),
99
99
  icon: icon,
100
100
  bg: iconBg,
101
101
  onClick: onIconClick,
@@ -101,13 +101,13 @@ var EmptyContent = function EmptyContent(_ref) {
101
101
  icon: icon
102
102
  }), /*#__PURE__*/isValidElement(icon) && icon, !icon && /*#__PURE__*/jsx(DefaultIcon, {})]
103
103
  }), title && /*#__PURE__*/jsx("div", {
104
- className: "font-medium text-center text-dimmed",
104
+ className: "font-medium text-center opacity-85",
105
105
  style: {
106
106
  fontSize: "1.5em"
107
107
  },
108
108
  children: title
109
109
  }), /*#__PURE__*/jsx("div", {
110
- className: "font-medium text-center text-muted",
110
+ className: "font-medium text-center opacity-65",
111
111
  style: {
112
112
  fontSize: "0.875em"
113
113
  },
@@ -130,7 +130,7 @@ var MenuItem = function MenuItem(_ref) {
130
130
  ref: mergeRefs(ref, elRef),
131
131
  "data-dropdown-dismiss": true,
132
132
  "data-color": color,
133
- className: classNames("fabric-menuItem cursor-pointer", className, active && "active", minimal && "minimal", disabled && "disabled", "rounded-capped relative max-w-[50vw] my-0.5"),
133
+ className: classNames("fabric-menuItem cursor-pointer", className, active && "active", minimal && "minimal", disabled && "disabled", "rounded relative max-w-[50vw] my-0.5"),
134
134
  "data-active": active,
135
135
  "data-open": childOpen,
136
136
  disabled: disabled,
@@ -9,6 +9,7 @@ import { usePropToggle } from '../../hooks/usePropToggle.js';
9
9
  import { CoreIcons } from '../../types/icons.js';
10
10
  import { Loading } from '../animations/Animations.js';
11
11
  import { Icon } from '../icon/Icon.js';
12
+ import { HotKey } from '../../hotkeys/HotKey.js';
12
13
  import { jsxs, jsx } from 'react/jsx-runtime';
13
14
 
14
15
  var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "iconBg", "iconColor", "rtlFlip", "panelId", "height", "width", "minHeight", "minWidth", "maxHeight", "maxWidth", "loading", "expandable", "expanded", "onExpand", "collapsable", "collapsed", "onCollapse", "onClose", "onBack"];
@@ -107,7 +108,10 @@ var Panel = function Panel(_ref) {
107
108
  maxHeight: maxHeight
108
109
  }
109
110
  }, aria), {}, {
110
- children: [/*#__PURE__*/jsxs("header", {
111
+ children: [expanded && /*#__PURE__*/jsx(HotKey, {
112
+ keyCombo: "esc",
113
+ handler: toggleExpand
114
+ }), /*#__PURE__*/jsxs("header", {
111
115
  role: "none",
112
116
  className: classNames("fabric-panelHeader", headerClassName, "flex flex-nowrap items-center area-head"),
113
117
  "data-ref": "panelHeader",
@@ -106,7 +106,7 @@ var Col = function Col(_ref3) {
106
106
  stretchContent = _ref3.stretchContent,
107
107
  aria = _objectWithoutProperties(_ref3, _excluded3);
108
108
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
109
- className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-none", align && "self-".concat(align), truncate && "truncate")
109
+ className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-content", align && "self-".concat(align), truncate && "truncate")
110
110
  }, aria), {}, {
111
111
  children: children
112
112
  }));
@@ -1,46 +1,30 @@
1
1
  'use client';
2
2
 
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import classNames from 'classnames';
4
6
  import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
5
7
  import { jsx } from 'react/jsx-runtime';
6
8
 
7
- /*
8
- * React Fabric
9
- * @version: 1.0.0
10
- *
11
- *
12
- * The MIT License (MIT)
13
- * Copyright (c) 2024 Adarsh Pastakia
14
- *
15
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
16
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
17
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
19
- * subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all copies or substantial
22
- * portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
25
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- */
29
-
9
+ var _excluded = ["children", "className", "dir", "ref"];
10
+ 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; }
11
+ 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; }
30
12
  var Section = function Section(_ref) {
31
13
  var children = _ref.children,
32
14
  className = _ref.className,
33
15
  dir = _ref.dir,
34
- ref = _ref.ref;
35
- return /*#__PURE__*/jsx("div", {
16
+ ref = _ref.ref,
17
+ rest = _objectWithoutProperties(_ref, _excluded);
18
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
36
19
  "data-ref": "section",
37
20
  dir: dir,
38
- ref: ref,
21
+ ref: ref
22
+ }, rest), {}, {
39
23
  className: classNames("fabric-section", className, "grid area-content overflow-hidden"),
40
24
  children: /*#__PURE__*/jsx(ErrorBoundary, {
41
25
  children: children
42
26
  })
43
- });
27
+ }));
44
28
  };
45
29
 
46
30
  export { Section };
@@ -120,7 +120,7 @@ var Flyout = function Flyout(_ref) {
120
120
  children: title
121
121
  }), actions, /*#__PURE__*/jsx(Icon, {
122
122
  "data-ref": "panelClose",
123
- className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-stretch"),
123
+ className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
124
124
  icon: CoreIcons.close,
125
125
  onClick: function onClick() {
126
126
  return handleClose(false);
@@ -114,7 +114,7 @@ var Modal = function Modal(_ref) {
114
114
  children: title
115
115
  }), actions, /*#__PURE__*/jsx(Icon, {
116
116
  "data-ref": "panelClose",
117
- className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-stretch"),
117
+ className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
118
118
  icon: CoreIcons.close,
119
119
  onClick: function onClick() {
120
120
  return handleClose(false);
@@ -1,4 +1,4 @@
1
- import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
1
+ import { TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
2
2
  /**
3
3
  * A component that represents a section of content within a page, with templated grid layout.
4
4
  * It can be used to group related content together and can be styled with additional CSS classes.
@@ -17,6 +17,6 @@ import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
17
17
  *
18
18
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--section} for more details.
19
19
  */
20
- export declare const Section: ({ children, className, dir, ref, }: ChildrenProp & CssProp & RefProp<HTMLDivElement> & {
20
+ export declare const Section: ({ children, className, dir, ref, ...rest }: ChildrenProp & CssProp & TestProps & RefProp<HTMLDivElement> & {
21
21
  dir?: "ltr" | "rtl";
22
22
  }) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.52",
3
+ "version": "1.0.0-beta.54",
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": "0eabb9d88d91af93d657bcc209b226fd576e8260"
57
+ "gitHead": "242f15e3de29d365cce6f41f4ef99ab36bb6b995"
58
58
  }
@@ -170,7 +170,9 @@ export const Badge = ({
170
170
  "fabric-badge",
171
171
  className,
172
172
  "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none",
173
- (forButton && !placement) || inline ? "relative" : "absolute",
173
+ (forButton && !placement) || inline
174
+ ? "relative flex-content"
175
+ : "absolute",
174
176
  )}
175
177
  >
176
178
  {label && <span className="p-1">{label}</span>}
@@ -83,7 +83,7 @@ export const Breadcrumbs = ({
83
83
  ...aria
84
84
  }: BreadcrumbProps) => {
85
85
  const [start, overflow, end] = useMemo(() => {
86
- const nodeList = Children.toArray(children as AnyObject);
86
+ const nodeList = Children.toArray(children as AnyObject).filter(Boolean);
87
87
  if (nodeList.length > 7) {
88
88
  return [nodeList.slice(0, 3), nodeList.slice(3, -3), nodeList.slice(-3)];
89
89
  }
@@ -329,7 +329,7 @@ export const Button = <Tag extends React.ElementType = "button">({
329
329
  </label>
330
330
  )}
331
331
  {!isNil(badge) && <Badge {...badgeProps} />}
332
- {hotKey && <HotKeyLabel keyCombo={hotKey} />}
332
+ {hotKey && children && <HotKeyLabel keyCombo={hotKey} />}
333
333
  {altIcon && (
334
334
  <Icon className={"fabric-altIcon"} icon={altIcon} rtlFlip />
335
335
  )}
@@ -190,7 +190,7 @@ export const Chip = <Tag extends React.ElementType = "div">({
190
190
  {icon && (
191
191
  <Icon
192
192
  data-ref="chipIcon"
193
- className={classNames("fabric-chipIcon", "m-1 flex-auto")}
193
+ className={classNames("fabric-chipIcon", "m-1 flex-content")}
194
194
  icon={icon}
195
195
  bg={iconBg}
196
196
  onClick={onIconClick}
@@ -164,14 +164,14 @@ export const EmptyContent = ({
164
164
  </div>
165
165
  {title && (
166
166
  <div
167
- className="font-medium text-center text-dimmed"
167
+ className="font-medium text-center opacity-85"
168
168
  style={{ fontSize: "1.5em" }}
169
169
  >
170
170
  {title}
171
171
  </div>
172
172
  )}
173
173
  <div
174
- className="font-medium text-center text-muted"
174
+ className="font-medium text-center opacity-65"
175
175
  style={{ fontSize: "0.875em" }}
176
176
  >
177
177
  {message}
@@ -171,7 +171,7 @@ export const MenuItem = <Tag extends React.ElementType = "button">({
171
171
  active && "active",
172
172
  minimal && "minimal",
173
173
  disabled && "disabled",
174
- "rounded-capped relative max-w-[50vw] my-0.5",
174
+ "rounded relative max-w-[50vw] my-0.5",
175
175
  )}
176
176
  data-active={active}
177
177
  data-open={childOpen}
@@ -38,6 +38,7 @@ import {
38
38
  import { CoreIcons } from "../../types/icons";
39
39
  import { Loading } from "../animations/Animations";
40
40
  import { Icon } from "../icon/Icon";
41
+ import { HotKey } from "../../hotkeys/HotKey";
41
42
 
42
43
  export interface PanelProps
43
44
  extends CssProp,
@@ -205,6 +206,7 @@ export const Panel = ({
205
206
  }
206
207
  {...aria}
207
208
  >
209
+ {expanded && <HotKey keyCombo="esc" handler={toggleExpand} />}
208
210
  <header
209
211
  role="none"
210
212
  className={classNames(
@@ -218,7 +218,7 @@ export const Col = ({
218
218
  flex === "full" && "flex-full",
219
219
  flex === "auto" && "flex-auto",
220
220
  flex === "initial" && "flex-initial",
221
- flex === "content" && "flex-none",
221
+ flex === "content" && "flex-content",
222
222
  align && `self-${align}`,
223
223
  truncate && "truncate",
224
224
  )}
@@ -22,7 +22,12 @@
22
22
  */
23
23
 
24
24
  import classNames from "classnames";
25
- import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
25
+ import {
26
+ TestProps,
27
+ type ChildrenProp,
28
+ type CssProp,
29
+ type RefProp,
30
+ } from "../../types";
26
31
  import { ErrorBoundary } from "../boundary/ErrorBoundary";
27
32
 
28
33
  /**
@@ -48,14 +53,17 @@ export const Section = ({
48
53
  className,
49
54
  dir,
50
55
  ref,
56
+ ...rest
51
57
  }: ChildrenProp &
52
58
  CssProp &
59
+ TestProps &
53
60
  RefProp<HTMLDivElement> & { dir?: "ltr" | "rtl" }) => {
54
61
  return (
55
62
  <div
56
63
  data-ref="section"
57
64
  dir={dir}
58
65
  ref={ref}
66
+ {...rest}
59
67
  className={classNames(
60
68
  "fabric-section",
61
69
  className,
@@ -245,7 +245,7 @@ export const Flyout = ({
245
245
  data-ref="panelClose"
246
246
  className={classNames(
247
247
  "fabric-panelAction",
248
- "cursor-pointer p-1 text-xl self-stretch",
248
+ "cursor-pointer p-1 text-xl self-center",
249
249
  )}
250
250
  icon={CoreIcons.close}
251
251
  onClick={() => handleClose(false)}
@@ -240,7 +240,7 @@ export const Modal = ({
240
240
  data-ref="panelClose"
241
241
  className={classNames(
242
242
  "fabric-panelAction",
243
- "cursor-pointer p-1 text-xl self-stretch",
243
+ "cursor-pointer p-1 text-xl self-center",
244
244
  )}
245
245
  icon={CoreIcons.close}
246
246
  onClick={() => handleClose(false)}