@react-fabric/core 1.0.0-beta.1 → 1.0.0-beta.4

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 (56) hide show
  1. package/css/index.js +2 -2
  2. package/dist/cjs/components/animations/Animations.js +1 -1
  3. package/dist/cjs/components/badge/Badge.js +6 -4
  4. package/dist/cjs/components/button/Button.js +4 -3
  5. package/dist/cjs/components/button/Button.module.css +1 -1
  6. package/dist/cjs/components/callout/Callout.js +3 -2
  7. package/dist/cjs/components/collapsable/Collapsable.js +3 -2
  8. package/dist/cjs/components/menu/MenuItem.js +1 -1
  9. package/dist/cjs/core/aside/Aside.js +4 -2
  10. package/dist/cjs/core/section/Section.js +5 -2
  11. package/dist/cjs/index.js +1 -0
  12. package/dist/cjs/overlays/alert/Alert.js +38 -16
  13. package/dist/cjs/types/icons.js +2 -0
  14. package/dist/cjs/typography/Abbr.js +2 -0
  15. package/dist/esm/components/animations/Animations.js +1 -1
  16. package/dist/esm/components/badge/Badge.js +7 -5
  17. package/dist/esm/components/button/Button.js +4 -3
  18. package/dist/esm/components/button/Button.module.css +1 -1
  19. package/dist/esm/components/callout/Callout.js +3 -2
  20. package/dist/esm/components/collapsable/Collapsable.js +3 -2
  21. package/dist/esm/components/menu/MenuItem.js +1 -1
  22. package/dist/esm/core/aside/Aside.js +4 -2
  23. package/dist/esm/core/section/Section.js +5 -2
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/overlays/alert/Alert.js +27 -5
  26. package/dist/esm/types/icons.js +2 -0
  27. package/dist/esm/typography/Abbr.js +2 -0
  28. package/dist/types/components/button/Button.d.ts +2 -1
  29. package/dist/types/components/callout/Callout.d.ts +3 -3
  30. package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
  31. package/dist/types/components/menu/types.d.ts +2 -2
  32. package/dist/types/components/tabpanel/Tab.d.ts +4 -0
  33. package/dist/types/core/aside/Aside.d.ts +9 -5
  34. package/dist/types/core/section/Section.d.ts +2 -2
  35. package/dist/types/overlays/alert/Alert.d.ts +9 -1
  36. package/dist/types/types/icons.d.ts +2 -0
  37. package/dist/types/types/index.d.ts +2 -2
  38. package/dist/types/typography/Abbr.d.ts +3 -3
  39. package/dist/types/typography/Link.d.ts +2 -1
  40. package/package.json +3 -3
  41. package/src/components/animations/Animations.tsx +1 -1
  42. package/src/components/badge/Badge.tsx +24 -20
  43. package/src/components/button/Button.module.css +1 -1
  44. package/src/components/button/Button.tsx +5 -2
  45. package/src/components/callout/Callout.tsx +8 -1
  46. package/src/components/collapsable/Collapsable.tsx +6 -1
  47. package/src/components/menu/Menu.tsx +1 -1
  48. package/src/components/menu/types.ts +2 -2
  49. package/src/components/tabpanel/Tab.tsx +4 -0
  50. package/src/core/aside/Aside.tsx +23 -4
  51. package/src/core/section/Section.tsx +8 -2
  52. package/src/overlays/alert/Alert.tsx +25 -2
  53. package/src/types/icons.ts +5 -0
  54. package/src/types/index.ts +5 -2
  55. package/src/typography/Abbr.tsx +4 -3
  56. package/src/typography/Link.tsx +3 -0
package/css/index.js CHANGED
@@ -190,7 +190,7 @@ module.exports = plugin(
190
190
  cardpulse: {
191
191
  "50%": { opacity: 0.5 },
192
192
  },
193
- progress: {
193
+ bgprogress: {
194
194
  "0%": {
195
195
  "background-position-x": 0,
196
196
  },
@@ -201,7 +201,7 @@ module.exports = plugin(
201
201
  },
202
202
  animation: {
203
203
  pulse: "cardpulse 2s cubic-bezier(.4,0,.6,1) infinite",
204
- progress: "progress 750ms linear infinite",
204
+ progress: "bgprogress 750ms linear infinite",
205
205
  },
206
206
  aspectRatio: {
207
207
  screen: "4 / 3",
@@ -58,7 +58,7 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
58
58
  };
59
59
  var AnimationBars = function AnimationBars(_ref2) {
60
60
  var _ref2$color = _ref2.color,
61
- color = _ref2$color === void 0 ? "tint-700" : _ref2$color,
61
+ color = _ref2$color === void 0 ? "tint" : _ref2$color,
62
62
  _ref2$size = _ref2.size,
63
63
  size = _ref2$size === void 0 ? "2rem" : _ref2$size;
64
64
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -44,10 +44,12 @@ var Badge = function Badge(_ref) {
44
44
  rtlFlip = _ref.rtlFlip,
45
45
  rest = _objectWithoutProperties(_ref, _excluded);
46
46
  var label = react.useMemo(function () {
47
- if (utilities.isNumber(value) && max && value > max) {
48
- return "".concat(max, "+");
47
+ if (!utilities.isNil(value)) {
48
+ if (utilities.isNumber(value) && max && value > max) {
49
+ return "".concat(max, "+");
50
+ }
51
+ return "".concat(value);
49
52
  }
50
- return "".concat(value);
51
53
  }, [value, max]);
52
54
  var innerRef = react.useMemo(function () {
53
55
  return utilities.mergeRefs(ref, children === null || children === void 0 ? void 0 : children.props.ref);
@@ -60,7 +62,7 @@ var Badge = function Badge(_ref) {
60
62
  className: classNames(forButton ? "contents" : "relative", block ? "block" : "inline-block"),
61
63
  children: [children && /*#__PURE__*/react.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
62
64
  ref: innerRef
63
- })), /*#__PURE__*/jsxRuntime.jsxs("div", {
65
+ })), (!!ping || label) && /*#__PURE__*/jsxRuntime.jsxs("div", {
64
66
  "data-ref": "badge",
65
67
  "data-ping": ping,
66
68
  "data-placement": placement,
@@ -16,7 +16,7 @@ var Icon = require('../icon/Icon.js');
16
16
  var Button_module = require('./Button.module.css');
17
17
  var jsxRuntime = require('react/jsx-runtime');
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", "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", "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
  /**
@@ -47,6 +47,7 @@ var Button = function Button(_ref) {
47
47
  spinOnHover = _ref.spinOnHover,
48
48
  onClick = _ref.onClick,
49
49
  actionMessage = _ref.actionMessage,
50
+ stopPropagation = _ref.stopPropagation,
50
51
  _ref$type = _ref.type,
51
52
  type = _ref$type === void 0 ? "button" : _ref$type,
52
53
  hotKey = _ref.hotKey,
@@ -68,7 +69,7 @@ var Button = function Button(_ref) {
68
69
  setActionDone = _useState4[1];
69
70
  var clickHandler = react.useCallback(function (e) {
70
71
  setBusy(true);
71
- // e.stopPropagation();
72
+ stopPropagation && e.stopPropagation();
72
73
  var ret = onClick === null || onClick === void 0 ? void 0 : onClick(e);
73
74
  void Promise.resolve(ret).then(function (b) {
74
75
  setBusy(false);
@@ -76,7 +77,7 @@ var Button = function Button(_ref) {
76
77
  setActionDone(true);
77
78
  }
78
79
  });
79
- }, [onClick, disabled, actionMessage, showActionDoneEvent]);
80
+ }, [onClick, disabled, actionMessage, showActionDoneEvent, stopPropagation]);
80
81
 
81
82
  /** ***************** reset done state on timeout *******************/
82
83
  react.useEffect(function () {
@@ -1 +1 @@
1
- @layer comp{.buttonWrapper{--color:theme(colors.primary.500);border-radius:var(--rounding);font-size:1rem;& .button{background-color:var(--bg);background-image:var(--click-gradient);border-radius:inherit;color:var(--text);outline:1px solid var(--outline);&.spinOnHover:hover .buttonIcon{& :global{animation:spin 2s linear infinite}}&>*{pointer-events:none}&:not(:disabled) input[type=file]{pointer-events:auto;&::-webkit-file-upload-button{cursor:pointer;inset:0;position:absolute}}}& .rounded{border-radius:9999px}& .buttonLabel{line-height:1;order:1;padding:.5em 1em;&+.altIcon{margin-inline-start:-1em}}& .buttonChild{line-height:1;order:1;padding:.5em}& .buttonIcon{font-size:1.125em;padding:.3889em}& :global(.hotkey-label){align-self:center;order:3}& .altIcon{align-self:center;order:4;padding:.125em .5em}& [data-ref=badge]{align-self:center;margin-inline-end:.5em;order:2}}.buttonGroup{&>.buttonWrapper{flex:0 1 1em}&:not(.flex)+&:not(.flex){margin-inline-start:.5rem}}}@layer util{.buttonWrapper{&[data-size=xs]{font-size:.625rem}&[data-size=sm]{font-size:.875rem}&[data-size=md]{font-size:1.125rem}&[data-size=lg]{font-size:1.25rem}&[data-size=xl]{font-size:1.5rem}}.button{--bg:color-mix(in lab,var(--fabric-bg) 99%,var(--tint));--outline:color-mix(in lab,var(--bg) 90%,var(--fabric-text));--text:color-mix(in lab,var(--color) 80%,var(--fabric-text));--bg-hover:color-mix(in lab,var(--color) 18%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 25%,var(--fabric-bg));--bg-active:color-mix(in lab,var(--color) 36%,var(--fabric-bg));&[data-color=accent]{--color:theme(colors.accent.500)}&[data-color=info]{--color:theme(colors.info.500)}&[data-color=danger]{--color:theme(colors.danger.500)}&[data-color=success]{--color:theme(colors.success.500)}&[data-color=warning]{--color:theme(colors.warning.500)}&[data-variant=outline]{--outline:var(--color)}&[data-variant=solid]{--outline:var(--color);--bg:color-mix(in lab,var(--color) 96%,var(--fabric-text));--text:theme(colors.white);--bg-hover:color-mix(in lab,var(--color) 90%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 80%,theme(colors.black));--bg-active:color-mix(in lab,var(--color) 70%,theme(colors.black));& :global(.hotkey-label){background-color:theme(backgroundColor.dark/30%);color:theme(colors.white/70%)}}&[data-variant=link]{--bg:transparent;--outline:transparent;background-image:none;box-shadow:none}&[data-color=invert]{--bg:theme(backgroundColor.invert);--text:color-mix(in lab,var(--color) 90%,theme(textColor.invert));--bg-hover:color-mix(in lab,var(--color) 15%,theme(backgroundColor.invert));--bg-click:color-mix(in lab,var(--color) 35%,theme(backgroundColor.invert))}}.buttonIcon[data-align=start]{order:0;&+.buttonLabel[data-colored-icon=false]{margin-inline-start:-1em}}.buttonIcon[data-align=end]{order:2;&~.buttonLabel[data-colored-icon=false]{margin-inline-end:-1em}}}@layer var{.buttonWrapper{height:unset;padding:unset;&[data-disabled=true]{cursor:not-allowed;& .button{background-image:var(--active-gradient);opacity:.5;pointer-events:none}}&[data-loading=true]{cursor:wait;& .button{background-image:var(--progress-gradient);background-size:1em 1em;pointer-events:none;& :global{animation:progress .75s linear infinite}}& .button:not([data-variant=solid]){background-color:color-mix(in lab,var(--color) 15%,var(--fabric-bg))}}&:global(.btn-dashed)>.button{color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}.button{--tw-ring-color:var(--color);&:hover{background-color:var(--bg-hover)}&:active{background-color:var(--bg-click);background-image:var(--active-gradient);.buttonIcon,.buttonLabel{transform:translateY(1px)}}&[data-active=true],&[data-checked=true],&[data-dropdown-open=true]{background-color:var(--bg-active);background-image:none}&[data-active=true],&[data-dropdown-open=true]{pointer-events:none}}.buttonGroup{&>.buttonWrapper{margin:0;& .button[data-variant=link]{--outline:theme(backgroundColor.base)}}&:not(.vertical){&>:not(:first-child){&:before{border-inline-start:.5px solid theme(borderColor.base);content:"";inset-block:5%;inset-inline-start:-.5px;position:absolute}}&.separator>:not(:first-child){margin-inline-start:2px;&:before{inset-inline-start:-1.5px}}&>:not(:last-child) .button{border-end-end-radius:0;border-start-end-radius:0}&>:not(:first-child) .button{border-end-start-radius:0;border-start-start-radius:0}}&.vertical{&>:not(:first-child){&:before{border-block-start:.5px solid theme(borderColor.base);content:"";inset-block-start:-.5px;inset-inline:5%;position:absolute}}&.separator>:not(:first-child){margin-block-start:1px;&:before{inset-block-start:-1px}}&>:not(:last-child) .button{border-end-end-radius:0;border-end-start-radius:0}&>:not(:first-child) .button{border-start-end-radius:0;border-start-start-radius:0}}}}
1
+ @layer comp{.buttonWrapper{--color:theme(colors.primary.500);border-radius:var(--rounding);font-size:1rem;& .button{background-color:var(--bg);background-image:var(--click-gradient);border-radius:inherit;color:var(--text);outline:1px solid var(--outline);&.spinOnHover:hover .buttonIcon{& :global{animation:spin 2s linear infinite}}&>*{pointer-events:none}&:not(:disabled) input[type=file]{pointer-events:auto;&::-webkit-file-upload-button{cursor:pointer;inset:0;position:absolute}}}& .rounded{border-radius:9999px}& .buttonLabel{line-height:1;order:1;padding:.5em 1em;&+.altIcon{margin-inline-start:-1em}}& .buttonChild{line-height:1;order:1;padding:.5em}& .buttonIcon{font-size:1.125em;padding:.3889em}& :global(.hotkey-label){align-self:center;order:3}& .altIcon{align-self:center;order:4;padding:.125em .5em}& [data-ref=badge]{align-self:center;margin-inline-end:.5em;order:2}}.buttonGroup{&>.buttonWrapper{flex:0 1 1em}&:not(.flex)+&:not(.flex){margin-inline-start:.5rem}}}@layer util{.buttonWrapper{&[data-size=xs]{font-size:.625rem}&[data-size=sm]{font-size:.875rem}&[data-size=md]{font-size:1.125rem}&[data-size=lg]{font-size:1.25rem}&[data-size=xl]{font-size:1.5rem}}.button{--bg:color-mix(in lab,var(--fabric-bg) 99%,var(--tint));--outline:color-mix(in lab,var(--bg) 90%,var(--fabric-text));--text:color-mix(in lab,var(--color) 80%,var(--fabric-text));--bg-hover:color-mix(in lab,var(--color) 18%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 25%,var(--fabric-bg));--bg-active:color-mix(in lab,var(--color) 36%,var(--fabric-bg));&[data-color=accent]{--color:theme(colors.accent.500)}&[data-color=info]{--color:theme(colors.info.500)}&[data-color=danger]{--color:theme(colors.danger.500)}&[data-color=success]{--color:theme(colors.success.500)}&[data-color=warning]{--color:theme(colors.warning.500)}&[data-variant=outline]{--outline:var(--color)}&[data-variant=solid]{--outline:var(--color);--bg:color-mix(in lab,var(--color) 96%,var(--fabric-text));--text:theme(colors.white);--bg-hover:color-mix(in lab,var(--color) 90%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 80%,theme(colors.black));--bg-active:color-mix(in lab,var(--color) 70%,theme(colors.black));& :global(.hotkey-label){background-color:theme(backgroundColor.dark/30%);color:theme(colors.white/70%)}}&[data-variant=link]{--bg:transparent;--outline:transparent;background-image:none;box-shadow:none}&[data-color=invert]{--bg:theme(backgroundColor.invert);--text:color-mix(in lab,var(--color) 90%,theme(textColor.invert));--bg-hover:color-mix(in lab,var(--color) 15%,theme(backgroundColor.invert));--bg-click:color-mix(in lab,var(--color) 35%,theme(backgroundColor.invert))}}.buttonIcon[data-align=start]{order:0;&+.buttonLabel[data-colored-icon=false]{margin-inline-start:-1em}}.buttonIcon[data-align=end]{order:2;&~.buttonLabel[data-colored-icon=false]{margin-inline-end:-1em}}}@layer var{.buttonWrapper{height:unset;padding:unset;&[data-disabled=true]{cursor:not-allowed;& .button{background-image:var(--active-gradient);opacity:.5;pointer-events:none}}&[data-loading=true]{cursor:wait;& .button{background-image:var(--progress-gradient);background-size:1em 1em;pointer-events:none;& :global{animation:bgprogress .75s linear infinite}}& .button:not([data-variant=solid]){background-color:color-mix(in lab,var(--color) 15%,var(--fabric-bg))}}&:global(.btn-dashed)>.button{color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}.button{--tw-ring-color:var(--color);&:hover{background-color:var(--bg-hover)}&:active{background-color:var(--bg-click);background-image:var(--active-gradient);.buttonIcon,.buttonLabel{transform:translateY(1px)}}&[data-active=true],&[data-checked=true],&[data-dropdown-open=true]{background-color:var(--bg-active);background-image:none}&[data-active=true],&[data-dropdown-open=true]{pointer-events:none}}.buttonGroup{&>.buttonWrapper{margin:0;& .button[data-variant=link]{--outline:theme(backgroundColor.base)}}&:not(.vertical){&>:not(:first-child){&:before{border-inline-start:.5px solid theme(borderColor.base);content:"";inset-block:5%;inset-inline-start:-.5px;position:absolute}}&.separator>:not(:first-child){margin-inline-start:2px;&:before{inset-inline-start:-1.5px}}&>:not(:last-child) .button{border-end-end-radius:0;border-start-end-radius:0}&>:not(:first-child) .button{border-end-start-radius:0;border-start-start-radius:0}}&.vertical{&>:not(:first-child){&:before{border-block-start:.5px solid theme(borderColor.base);content:"";inset-block-start:-.5px;inset-inline:5%;position:absolute}}&.separator>:not(:first-child){margin-block-start:1px;&:before{inset-block-start:-1px}}&>:not(:last-child) .button{border-end-end-radius:0;border-end-start-radius:0}&>:not(:first-child) .button{border-start-end-radius:0;border-start-start-radius:0}}}}
@@ -9,7 +9,7 @@ require('@react-fabric/utilities');
9
9
  var Icon = require('../icon/Icon.js');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
- var _excluded = ["children", "color", "legend", "title", "icon", "border", "onClose"];
12
+ var _excluded = ["children", "color", "legend", "title", "icon", "border", "onClose", "className"];
13
13
  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; }
14
14
  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; }
15
15
  var Callout = function Callout(_ref) {
@@ -21,9 +21,10 @@ var Callout = function Callout(_ref) {
21
21
  icon = _ref.icon,
22
22
  border = _ref.border,
23
23
  onClose = _ref.onClose,
24
+ className = _ref.className,
24
25
  aria = _objectWithoutProperties(_ref, _excluded);
25
26
  return /*#__PURE__*/jsxRuntime.jsxs("fieldset", _objectSpread(_objectSpread({
26
- className: classNames("block rounded-capped border max-w-full relative overflow-hidden mb-4", getColor.getBgClass(color + "-50"), getColor.getColorClass(color + "-700"), getColor.getBorderClass(color + "-300"), border === "dashed" && "border-dashed", border === "dotted" && "border-dotted")
27
+ className: classNames(className, "block rounded-capped border max-w-full relative overflow-hidden mb-4", getColor.getBgClass(color + "-50"), getColor.getColorClass(color + "-700"), getColor.getBorderClass(color + "-300"), border === "dashed" && "border-dashed", border === "dotted" && "border-dotted")
27
28
  }, aria), {}, {
28
29
  children: [legend && /*#__PURE__*/jsxRuntime.jsx("legend", {
29
30
  className: "px-2 mx-4 font-medium",
@@ -11,11 +11,12 @@ var Icon = require('../icon/Icon.js');
11
11
  var Collapsable_module = require('./Collapsable.module.css');
12
12
  var jsxRuntime = require('react/jsx-runtime');
13
13
 
14
- var _excluded = ["ref", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
14
+ var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
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
  var Collapsable = function Collapsable(_ref) {
18
18
  var ref = _ref.ref,
19
+ disabled = _ref.disabled,
19
20
  className = _ref.className,
20
21
  bodyClassName = _ref.bodyClassName,
21
22
  headerClassName = _ref.headerClassName,
@@ -63,7 +64,7 @@ var Collapsable = function Collapsable(_ref) {
63
64
  ref: headRef,
64
65
  className: classNames(Collapsable_module.collapsableHead, "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
65
66
  onClick: function onClick() {
66
- return setOpenState(!openState);
67
+ return !disabled && setOpenState(!openState);
67
68
  },
68
69
  children: [/*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
69
70
  size: "1.125em",
@@ -7,10 +7,10 @@ var utilities = require('@react-fabric/utilities');
7
7
  var classNames = require('classnames');
8
8
  var react$1 = require('react');
9
9
  var HotKeyLabel = require('../../hotkeys/HotKeyLabel.js');
10
+ require('@babel/runtime/helpers/slicedToArray');
10
11
  require('react-i18next');
11
12
  require('../../hooks/useEffectDebugger.js');
12
13
  var jsxRuntime = require('react/jsx-runtime');
13
- require('@babel/runtime/helpers/slicedToArray');
14
14
  require('../../hotkeys/HotKeyWrapper.js');
15
15
  var Tooltip = require('../../overlays/tooltip/Tooltip.js');
16
16
  var Badge = require('../badge/Badge.js');
@@ -26,6 +26,8 @@ var Aside = function Aside(_ref) {
26
26
  iconBg = _ref.iconBg,
27
27
  iconColor = _ref.iconColor,
28
28
  rtlFlip = _ref.rtlFlip,
29
+ className = _ref.className,
30
+ bodyClassName = _ref.bodyClassName,
29
31
  headerClassName = _ref.headerClassName,
30
32
  resizeable = _ref.resizeable,
31
33
  flyout = _ref.flyout,
@@ -101,7 +103,7 @@ var Aside = function Aside(_ref) {
101
103
  };
102
104
  }, [width, minWidth, maxWidth]);
103
105
  return /*#__PURE__*/jsxRuntime.jsxs("aside", {
104
- className: classNames(Aside_module.aside, "overflow-hidden grid"),
106
+ className: classNames(Aside_module.aside, className, "overflow-hidden grid"),
105
107
  "data-align": align,
106
108
  "data-flyout": peek,
107
109
  "data-collapsed": isCollapsed,
@@ -138,7 +140,7 @@ var Aside = function Aside(_ref) {
138
140
  }), /*#__PURE__*/jsxRuntime.jsx("section", {
139
141
  ref: elementRef,
140
142
  "data-ref": "asideBody",
141
- className: classNames(Aside_module.asideBody, "overflow-hidden grid"),
143
+ className: classNames(Aside_module.asideBody, bodyClassName, "overflow-hidden grid"),
142
144
  style: isCollapsed ? widthStyles : undefined,
143
145
  children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
144
146
  children: children
@@ -30,11 +30,14 @@ var jsxRuntime = require('react/jsx-runtime');
30
30
 
31
31
  var Section = function Section(_ref) {
32
32
  var children = _ref.children,
33
- dir = _ref.dir;
33
+ className = _ref.className,
34
+ dir = _ref.dir,
35
+ ref = _ref.ref;
34
36
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35
37
  "data-ref": "section",
36
38
  dir: dir,
37
- className: classNames(Section_module.section, "grid area-content overflow-hidden"),
39
+ ref: ref,
40
+ className: classNames(Section_module.section, className, "grid area-content overflow-hidden"),
38
41
  children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
39
42
  children: children
40
43
  })
package/dist/cjs/index.js CHANGED
@@ -44,6 +44,7 @@ var ThemeProvider = require('./core/theme/ThemeProvider.js');
44
44
  var Viewport = require('./core/viewport/Viewport.js');
45
45
  var index = require('./i18n/index.js');
46
46
  require('@babel/runtime/helpers/defineProperty');
47
+ require('@babel/runtime/helpers/slicedToArray');
47
48
  require('@floating-ui/react');
48
49
  require('classnames');
49
50
  require('react');
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
- var react = require('@floating-ui/react');
4
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
+ var react$1 = require('@floating-ui/react');
5
6
  var classNames = require('classnames');
6
- var react$1 = require('react');
7
+ var react = require('react');
7
8
  var reactI18next = require('react-i18next');
8
9
  var Animations = require('../../components/animations/Animations.js');
9
10
  var Button = require('../../components/button/Button.js');
@@ -28,10 +29,16 @@ var Alert = function Alert(_ref) {
28
29
  onClose = _ref.onClose,
29
30
  type = _ref.type,
30
31
  okLabel = _ref.okLabel,
31
- cancelLabel = _ref.cancelLabel;
32
+ cancelLabel = _ref.cancelLabel,
33
+ placeholder = _ref.placeholder,
34
+ defaultValue = _ref.defaultValue;
32
35
  var _useTranslation = reactI18next.useTranslation("core"),
33
36
  t = _useTranslation.t;
34
- var _useFloating = react.useFloating({
37
+ var _useState = react.useState(defaultValue),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ value = _useState2[0],
40
+ setValue = _useState2[1];
41
+ var _useFloating = react$1.useFloating({
35
42
  open: true,
36
43
  onOpenChange: function onOpenChange() {
37
44
  handleClose(false);
@@ -39,16 +46,16 @@ var Alert = function Alert(_ref) {
39
46
  }),
40
47
  refs = _useFloating.refs,
41
48
  context = _useFloating.context;
42
- var dismiss = react.useDismiss(context, {
49
+ var dismiss = react$1.useDismiss(context, {
43
50
  outsidePressEvent: "mousedown",
44
51
  escapeKey: true
45
52
  });
46
- var role = react.useRole(context);
53
+ var role = react$1.useRole(context);
47
54
 
48
55
  // Merge all the interactions into prop getters
49
- var _useInteractions = react.useInteractions([dismiss, role]),
56
+ var _useInteractions = react$1.useInteractions([dismiss, role]),
50
57
  getFloatingProps = _useInteractions.getFloatingProps;
51
- var iconType = react$1.useMemo(function () {
58
+ var iconType = react.useMemo(function () {
52
59
  if (icon) return /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
53
60
  icon: icon,
54
61
  size: "md",
@@ -78,25 +85,25 @@ var Alert = function Alert(_ref) {
78
85
  });
79
86
  }
80
87
  }, [color, type, icon]);
81
- var handleClose = react$1.useCallback(function (ret) {
88
+ var handleClose = react.useCallback(function (ret) {
82
89
  refs.floating.current && (refs.floating.current.dataset.show = "false");
83
90
  setTimeout(function () {
84
91
  onClose(ret);
85
92
  }, 250);
86
93
  }, [onClose]);
87
- react$1.useLayoutEffect(function () {
94
+ react.useLayoutEffect(function () {
88
95
  setTimeout(function () {
89
96
  return refs.floating.current && (refs.floating.current.dataset.show = "true");
90
97
  }, 100);
91
98
  }, []);
92
- return /*#__PURE__*/jsxRuntime.jsx(react.FloatingPortal, {
93
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingOverlay, {
99
+ return /*#__PURE__*/jsxRuntime.jsx(react$1.FloatingPortal, {
100
+ children: /*#__PURE__*/jsxRuntime.jsx(react$1.FloatingOverlay, {
94
101
  lockScroll: true,
95
102
  style: {
96
103
  zIndex: "var(--z-overlay-mask)"
97
104
  },
98
105
  className: "bg-base/50 backdrop-blur-sm grid place-items-center",
99
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
106
+ children: /*#__PURE__*/jsxRuntime.jsx(react$1.FloatingFocusManager, {
100
107
  context: context,
101
108
  children: /*#__PURE__*/jsxRuntime.jsxs("dialog", _objectSpread(_objectSpread({
102
109
  role: "alertdialog",
@@ -112,9 +119,24 @@ var Alert = function Alert(_ref) {
112
119
  }), /*#__PURE__*/jsxRuntime.jsx("p", {
113
120
  className: "area-[message] py-4",
114
121
  children: message
115
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
116
- className: "area-[message]",
117
- children: message
122
+ }), type === "prompt" && /*#__PURE__*/jsxRuntime.jsx("input", {
123
+ value: value,
124
+ placeholder: placeholder,
125
+ className: classNames("border rounded focus:border-primary-500"),
126
+ ref: function ref(e) {
127
+ return e != null && setTimeout(function () {
128
+ return e.focus();
129
+ }, 100);
130
+ },
131
+ onBlur: function onBlur(e) {
132
+ return e.target.focus();
133
+ },
134
+ onChange: function onChange(e) {
135
+ return setValue(e.target.value);
136
+ },
137
+ onKeyDown: function onKeyDown(e) {
138
+ return e.key === "Enter" && handleClose(value);
139
+ }
118
140
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
119
141
  className: "flex gap-1 justify-center flex-nowrap pt-2 area-[actions]",
120
142
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -52,6 +52,8 @@ exports.CoreIcons = void 0;
52
52
  _CoreIcons.caretUp = "M7,15L12,10L17,15H7Z";
53
53
  _CoreIcons.expand = "M5 2c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h14c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879zM5 4h14c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-14c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM8 13h3v3c0 0.552 0.448 1 1 1s1-0.448 1-1v-3h3c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3v-3c0-0.552-0.448-1-1-1s-1 0.448-1 1v3h-3c-0.552 0-1 0.448-1 1s0.448 1 1 1z";
54
54
  _CoreIcons.collapse = "M5 2c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h14c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879zM5 4h14c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-14c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM8 13h8c0.552 0 1-0.448 1-1s-0.448-1-1-1h-8c-0.552 0-1 0.448-1 1s0.448 1 1 1z";
55
+ _CoreIcons.expandActive = "M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z";
56
+ _CoreIcons.collapseActive = "M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z";
55
57
  _CoreIcons.expandAll = "M5.293 16.707l6 6c0.391 0.391 1.024 0.391 1.414 0l6-6c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414zM18.707 7.293l-6-6c-0.391-0.391-1.024-0.391-1.414 0l-6 6c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
56
58
  _CoreIcons.colapseAll = "M18.707 21.293l-6-6c-0.391-0.391-1.024-0.391-1.414 0l-6 6c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414zM5.293 2.707l6 6c0.391 0.391 1.024 0.391 1.414 0l6-6c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
57
59
  _CoreIcons.folderClosed = "M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z";
@@ -42,6 +42,7 @@ var AbbrText = function AbbrText(_ref) {
42
42
  var Abbr = function Abbr(_ref2) {
43
43
  var children = _ref2.children,
44
44
  abbr = _ref2.abbr,
45
+ className = _ref2.className,
45
46
  renderer = _ref2.renderer,
46
47
  _ref2$copyContent = _ref2.copyContent,
47
48
  copyContent = _ref2$copyContent === void 0 ? "text" : _ref2$copyContent;
@@ -101,6 +102,7 @@ var Abbr = function Abbr(_ref2) {
101
102
 
102
103
  /** ***************** component *******************/
103
104
  return /*#__PURE__*/jsxRuntime.jsx("span", {
105
+ className: className,
104
106
  children: inner
105
107
  });
106
108
  };
@@ -58,7 +58,7 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
58
58
  };
59
59
  var AnimationBars = function AnimationBars(_ref2) {
60
60
  var _ref2$color = _ref2.color,
61
- color = _ref2$color === void 0 ? "tint-700" : _ref2$color,
61
+ color = _ref2$color === void 0 ? "tint" : _ref2$color,
62
62
  _ref2$size = _ref2.size,
63
63
  size = _ref2$size === void 0 ? "2rem" : _ref2$size;
64
64
  return /*#__PURE__*/jsx("div", {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
- import { isObject, isNumber, mergeRefs } from '@react-fabric/utilities';
5
+ import { isObject, isNil, isNumber, mergeRefs } from '@react-fabric/utilities';
6
6
  import classNames from 'classnames';
7
7
  import { useMemo, cloneElement } from 'react';
8
8
  import { Icon } from '../icon/Icon.js';
@@ -44,10 +44,12 @@ var Badge = function Badge(_ref) {
44
44
  rtlFlip = _ref.rtlFlip,
45
45
  rest = _objectWithoutProperties(_ref, _excluded);
46
46
  var label = useMemo(function () {
47
- if (isNumber(value) && max && value > max) {
48
- return "".concat(max, "+");
47
+ if (!isNil(value)) {
48
+ if (isNumber(value) && max && value > max) {
49
+ return "".concat(max, "+");
50
+ }
51
+ return "".concat(value);
49
52
  }
50
- return "".concat(value);
51
53
  }, [value, max]);
52
54
  var innerRef = useMemo(function () {
53
55
  return mergeRefs(ref, children === null || children === void 0 ? void 0 : children.props.ref);
@@ -60,7 +62,7 @@ var Badge = function Badge(_ref) {
60
62
  className: classNames(forButton ? "contents" : "relative", block ? "block" : "inline-block"),
61
63
  children: [children && /*#__PURE__*/cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
62
64
  ref: innerRef
63
- })), /*#__PURE__*/jsxs("div", {
65
+ })), (!!ping || label) && /*#__PURE__*/jsxs("div", {
64
66
  "data-ref": "badge",
65
67
  "data-ping": ping,
66
68
  "data-placement": placement,
@@ -16,7 +16,7 @@ import { Icon } from '../icon/Icon.js';
16
16
  import classes from './Button.module.css';
17
17
  import { jsxs, jsx } from 'react/jsx-runtime';
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", "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", "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
  /**
@@ -47,6 +47,7 @@ var Button = function Button(_ref) {
47
47
  spinOnHover = _ref.spinOnHover,
48
48
  onClick = _ref.onClick,
49
49
  actionMessage = _ref.actionMessage,
50
+ stopPropagation = _ref.stopPropagation,
50
51
  _ref$type = _ref.type,
51
52
  type = _ref$type === void 0 ? "button" : _ref$type,
52
53
  hotKey = _ref.hotKey,
@@ -68,7 +69,7 @@ var Button = function Button(_ref) {
68
69
  setActionDone = _useState4[1];
69
70
  var clickHandler = useCallback(function (e) {
70
71
  setBusy(true);
71
- // e.stopPropagation();
72
+ stopPropagation && e.stopPropagation();
72
73
  var ret = onClick === null || onClick === void 0 ? void 0 : onClick(e);
73
74
  void Promise.resolve(ret).then(function (b) {
74
75
  setBusy(false);
@@ -76,7 +77,7 @@ var Button = function Button(_ref) {
76
77
  setActionDone(true);
77
78
  }
78
79
  });
79
- }, [onClick, disabled, actionMessage, showActionDoneEvent]);
80
+ }, [onClick, disabled, actionMessage, showActionDoneEvent, stopPropagation]);
80
81
 
81
82
  /** ***************** reset done state on timeout *******************/
82
83
  useEffect(function () {
@@ -1 +1 @@
1
- @layer comp{.buttonWrapper{--color:theme(colors.primary.500);border-radius:var(--rounding);font-size:1rem;& .button{background-color:var(--bg);background-image:var(--click-gradient);border-radius:inherit;color:var(--text);outline:1px solid var(--outline);&.spinOnHover:hover .buttonIcon{& :global{animation:spin 2s linear infinite}}&>*{pointer-events:none}&:not(:disabled) input[type=file]{pointer-events:auto;&::-webkit-file-upload-button{cursor:pointer;inset:0;position:absolute}}}& .rounded{border-radius:9999px}& .buttonLabel{line-height:1;order:1;padding:.5em 1em;&+.altIcon{margin-inline-start:-1em}}& .buttonChild{line-height:1;order:1;padding:.5em}& .buttonIcon{font-size:1.125em;padding:.3889em}& :global(.hotkey-label){align-self:center;order:3}& .altIcon{align-self:center;order:4;padding:.125em .5em}& [data-ref=badge]{align-self:center;margin-inline-end:.5em;order:2}}.buttonGroup{&>.buttonWrapper{flex:0 1 1em}&:not(.flex)+&:not(.flex){margin-inline-start:.5rem}}}@layer util{.buttonWrapper{&[data-size=xs]{font-size:.625rem}&[data-size=sm]{font-size:.875rem}&[data-size=md]{font-size:1.125rem}&[data-size=lg]{font-size:1.25rem}&[data-size=xl]{font-size:1.5rem}}.button{--bg:color-mix(in lab,var(--fabric-bg) 99%,var(--tint));--outline:color-mix(in lab,var(--bg) 90%,var(--fabric-text));--text:color-mix(in lab,var(--color) 80%,var(--fabric-text));--bg-hover:color-mix(in lab,var(--color) 18%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 25%,var(--fabric-bg));--bg-active:color-mix(in lab,var(--color) 36%,var(--fabric-bg));&[data-color=accent]{--color:theme(colors.accent.500)}&[data-color=info]{--color:theme(colors.info.500)}&[data-color=danger]{--color:theme(colors.danger.500)}&[data-color=success]{--color:theme(colors.success.500)}&[data-color=warning]{--color:theme(colors.warning.500)}&[data-variant=outline]{--outline:var(--color)}&[data-variant=solid]{--outline:var(--color);--bg:color-mix(in lab,var(--color) 96%,var(--fabric-text));--text:theme(colors.white);--bg-hover:color-mix(in lab,var(--color) 90%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 80%,theme(colors.black));--bg-active:color-mix(in lab,var(--color) 70%,theme(colors.black));& :global(.hotkey-label){background-color:theme(backgroundColor.dark/30%);color:theme(colors.white/70%)}}&[data-variant=link]{--bg:transparent;--outline:transparent;background-image:none;box-shadow:none}&[data-color=invert]{--bg:theme(backgroundColor.invert);--text:color-mix(in lab,var(--color) 90%,theme(textColor.invert));--bg-hover:color-mix(in lab,var(--color) 15%,theme(backgroundColor.invert));--bg-click:color-mix(in lab,var(--color) 35%,theme(backgroundColor.invert))}}.buttonIcon[data-align=start]{order:0;&+.buttonLabel[data-colored-icon=false]{margin-inline-start:-1em}}.buttonIcon[data-align=end]{order:2;&~.buttonLabel[data-colored-icon=false]{margin-inline-end:-1em}}}@layer var{.buttonWrapper{height:unset;padding:unset;&[data-disabled=true]{cursor:not-allowed;& .button{background-image:var(--active-gradient);opacity:.5;pointer-events:none}}&[data-loading=true]{cursor:wait;& .button{background-image:var(--progress-gradient);background-size:1em 1em;pointer-events:none;& :global{animation:progress .75s linear infinite}}& .button:not([data-variant=solid]){background-color:color-mix(in lab,var(--color) 15%,var(--fabric-bg))}}&:global(.btn-dashed)>.button{color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}.button{--tw-ring-color:var(--color);&:hover{background-color:var(--bg-hover)}&:active{background-color:var(--bg-click);background-image:var(--active-gradient);.buttonIcon,.buttonLabel{transform:translateY(1px)}}&[data-active=true],&[data-checked=true],&[data-dropdown-open=true]{background-color:var(--bg-active);background-image:none}&[data-active=true],&[data-dropdown-open=true]{pointer-events:none}}.buttonGroup{&>.buttonWrapper{margin:0;& .button[data-variant=link]{--outline:theme(backgroundColor.base)}}&:not(.vertical){&>:not(:first-child){&:before{border-inline-start:.5px solid theme(borderColor.base);content:"";inset-block:5%;inset-inline-start:-.5px;position:absolute}}&.separator>:not(:first-child){margin-inline-start:2px;&:before{inset-inline-start:-1.5px}}&>:not(:last-child) .button{border-end-end-radius:0;border-start-end-radius:0}&>:not(:first-child) .button{border-end-start-radius:0;border-start-start-radius:0}}&.vertical{&>:not(:first-child){&:before{border-block-start:.5px solid theme(borderColor.base);content:"";inset-block-start:-.5px;inset-inline:5%;position:absolute}}&.separator>:not(:first-child){margin-block-start:1px;&:before{inset-block-start:-1px}}&>:not(:last-child) .button{border-end-end-radius:0;border-end-start-radius:0}&>:not(:first-child) .button{border-start-end-radius:0;border-start-start-radius:0}}}}
1
+ @layer comp{.buttonWrapper{--color:theme(colors.primary.500);border-radius:var(--rounding);font-size:1rem;& .button{background-color:var(--bg);background-image:var(--click-gradient);border-radius:inherit;color:var(--text);outline:1px solid var(--outline);&.spinOnHover:hover .buttonIcon{& :global{animation:spin 2s linear infinite}}&>*{pointer-events:none}&:not(:disabled) input[type=file]{pointer-events:auto;&::-webkit-file-upload-button{cursor:pointer;inset:0;position:absolute}}}& .rounded{border-radius:9999px}& .buttonLabel{line-height:1;order:1;padding:.5em 1em;&+.altIcon{margin-inline-start:-1em}}& .buttonChild{line-height:1;order:1;padding:.5em}& .buttonIcon{font-size:1.125em;padding:.3889em}& :global(.hotkey-label){align-self:center;order:3}& .altIcon{align-self:center;order:4;padding:.125em .5em}& [data-ref=badge]{align-self:center;margin-inline-end:.5em;order:2}}.buttonGroup{&>.buttonWrapper{flex:0 1 1em}&:not(.flex)+&:not(.flex){margin-inline-start:.5rem}}}@layer util{.buttonWrapper{&[data-size=xs]{font-size:.625rem}&[data-size=sm]{font-size:.875rem}&[data-size=md]{font-size:1.125rem}&[data-size=lg]{font-size:1.25rem}&[data-size=xl]{font-size:1.5rem}}.button{--bg:color-mix(in lab,var(--fabric-bg) 99%,var(--tint));--outline:color-mix(in lab,var(--bg) 90%,var(--fabric-text));--text:color-mix(in lab,var(--color) 80%,var(--fabric-text));--bg-hover:color-mix(in lab,var(--color) 18%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 25%,var(--fabric-bg));--bg-active:color-mix(in lab,var(--color) 36%,var(--fabric-bg));&[data-color=accent]{--color:theme(colors.accent.500)}&[data-color=info]{--color:theme(colors.info.500)}&[data-color=danger]{--color:theme(colors.danger.500)}&[data-color=success]{--color:theme(colors.success.500)}&[data-color=warning]{--color:theme(colors.warning.500)}&[data-variant=outline]{--outline:var(--color)}&[data-variant=solid]{--outline:var(--color);--bg:color-mix(in lab,var(--color) 96%,var(--fabric-text));--text:theme(colors.white);--bg-hover:color-mix(in lab,var(--color) 90%,var(--fabric-bg));--bg-click:color-mix(in lab,var(--color) 80%,theme(colors.black));--bg-active:color-mix(in lab,var(--color) 70%,theme(colors.black));& :global(.hotkey-label){background-color:theme(backgroundColor.dark/30%);color:theme(colors.white/70%)}}&[data-variant=link]{--bg:transparent;--outline:transparent;background-image:none;box-shadow:none}&[data-color=invert]{--bg:theme(backgroundColor.invert);--text:color-mix(in lab,var(--color) 90%,theme(textColor.invert));--bg-hover:color-mix(in lab,var(--color) 15%,theme(backgroundColor.invert));--bg-click:color-mix(in lab,var(--color) 35%,theme(backgroundColor.invert))}}.buttonIcon[data-align=start]{order:0;&+.buttonLabel[data-colored-icon=false]{margin-inline-start:-1em}}.buttonIcon[data-align=end]{order:2;&~.buttonLabel[data-colored-icon=false]{margin-inline-end:-1em}}}@layer var{.buttonWrapper{height:unset;padding:unset;&[data-disabled=true]{cursor:not-allowed;& .button{background-image:var(--active-gradient);opacity:.5;pointer-events:none}}&[data-loading=true]{cursor:wait;& .button{background-image:var(--progress-gradient);background-size:1em 1em;pointer-events:none;& :global{animation:bgprogress .75s linear infinite}}& .button:not([data-variant=solid]){background-color:color-mix(in lab,var(--color) 15%,var(--fabric-bg))}}&:global(.btn-dashed)>.button{color:theme(colors.tint.600);outline:1px dashed theme(colors.tint.600);&[data-invalid=true]{background-color:theme(colors.danger.100);color:theme(colors.danger.600);outline:1px dashed theme(colors.danger.600)}}}.button{--tw-ring-color:var(--color);&:hover{background-color:var(--bg-hover)}&:active{background-color:var(--bg-click);background-image:var(--active-gradient);.buttonIcon,.buttonLabel{transform:translateY(1px)}}&[data-active=true],&[data-checked=true],&[data-dropdown-open=true]{background-color:var(--bg-active);background-image:none}&[data-active=true],&[data-dropdown-open=true]{pointer-events:none}}.buttonGroup{&>.buttonWrapper{margin:0;& .button[data-variant=link]{--outline:theme(backgroundColor.base)}}&:not(.vertical){&>:not(:first-child){&:before{border-inline-start:.5px solid theme(borderColor.base);content:"";inset-block:5%;inset-inline-start:-.5px;position:absolute}}&.separator>:not(:first-child){margin-inline-start:2px;&:before{inset-inline-start:-1.5px}}&>:not(:last-child) .button{border-end-end-radius:0;border-start-end-radius:0}&>:not(:first-child) .button{border-end-start-radius:0;border-start-start-radius:0}}&.vertical{&>:not(:first-child){&:before{border-block-start:.5px solid theme(borderColor.base);content:"";inset-block-start:-.5px;inset-inline:5%;position:absolute}}&.separator>:not(:first-child){margin-block-start:1px;&:before{inset-block-start:-1px}}&>:not(:last-child) .button{border-end-end-radius:0;border-end-start-radius:0}&>:not(:first-child) .button{border-start-end-radius:0;border-start-start-radius:0}}}}
@@ -9,7 +9,7 @@ import '@react-fabric/utilities';
9
9
  import { Icon } from '../icon/Icon.js';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
11
11
 
12
- var _excluded = ["children", "color", "legend", "title", "icon", "border", "onClose"];
12
+ var _excluded = ["children", "color", "legend", "title", "icon", "border", "onClose", "className"];
13
13
  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; }
14
14
  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; }
15
15
  var Callout = function Callout(_ref) {
@@ -21,9 +21,10 @@ var Callout = function Callout(_ref) {
21
21
  icon = _ref.icon,
22
22
  border = _ref.border,
23
23
  onClose = _ref.onClose,
24
+ className = _ref.className,
24
25
  aria = _objectWithoutProperties(_ref, _excluded);
25
26
  return /*#__PURE__*/jsxs("fieldset", _objectSpread(_objectSpread({
26
- className: classNames("block rounded-capped border max-w-full relative overflow-hidden mb-4", getBgClass(color + "-50"), getColorClass(color + "-700"), getBorderClass(color + "-300"), border === "dashed" && "border-dashed", border === "dotted" && "border-dotted")
27
+ className: classNames(className, "block rounded-capped border max-w-full relative overflow-hidden mb-4", getBgClass(color + "-50"), getColorClass(color + "-700"), getBorderClass(color + "-300"), border === "dashed" && "border-dashed", border === "dotted" && "border-dotted")
27
28
  }, aria), {}, {
28
29
  children: [legend && /*#__PURE__*/jsx("legend", {
29
30
  className: "px-2 mx-4 font-medium",
@@ -11,11 +11,12 @@ import { Icon } from '../icon/Icon.js';
11
11
  import classes from './Collapsable.module.css';
12
12
  import { jsxs, jsx } from 'react/jsx-runtime';
13
13
 
14
- var _excluded = ["ref", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
14
+ var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
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
  var Collapsable = function Collapsable(_ref) {
18
18
  var ref = _ref.ref,
19
+ disabled = _ref.disabled,
19
20
  className = _ref.className,
20
21
  bodyClassName = _ref.bodyClassName,
21
22
  headerClassName = _ref.headerClassName,
@@ -63,7 +64,7 @@ var Collapsable = function Collapsable(_ref) {
63
64
  ref: headRef,
64
65
  className: classNames(classes.collapsableHead, "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
65
66
  onClick: function onClick() {
66
- return setOpenState(!openState);
67
+ return !disabled && setOpenState(!openState);
67
68
  },
68
69
  children: [/*#__PURE__*/jsx(Icon, {
69
70
  size: "1.125em",
@@ -7,10 +7,10 @@ import { iconToken } from '@react-fabric/utilities';
7
7
  import classNames from 'classnames';
8
8
  import { useMemo, useCallback, Fragment } from 'react';
9
9
  import { HotKeyLabel } from '../../hotkeys/HotKeyLabel.js';
10
+ import '@babel/runtime/helpers/slicedToArray';
10
11
  import 'react-i18next';
11
12
  import '../../hooks/useEffectDebugger.js';
12
13
  import { jsx, jsxs } from 'react/jsx-runtime';
13
- import '@babel/runtime/helpers/slicedToArray';
14
14
  import '../../hotkeys/HotKeyWrapper.js';
15
15
  import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
16
16
  import { getBadgeProps, Badge } from '../badge/Badge.js';
@@ -26,6 +26,8 @@ var Aside = function Aside(_ref) {
26
26
  iconBg = _ref.iconBg,
27
27
  iconColor = _ref.iconColor,
28
28
  rtlFlip = _ref.rtlFlip,
29
+ className = _ref.className,
30
+ bodyClassName = _ref.bodyClassName,
29
31
  headerClassName = _ref.headerClassName,
30
32
  resizeable = _ref.resizeable,
31
33
  flyout = _ref.flyout,
@@ -101,7 +103,7 @@ var Aside = function Aside(_ref) {
101
103
  };
102
104
  }, [width, minWidth, maxWidth]);
103
105
  return /*#__PURE__*/jsxs("aside", {
104
- className: classNames(classes.aside, "overflow-hidden grid"),
106
+ className: classNames(classes.aside, className, "overflow-hidden grid"),
105
107
  "data-align": align,
106
108
  "data-flyout": peek,
107
109
  "data-collapsed": isCollapsed,
@@ -138,7 +140,7 @@ var Aside = function Aside(_ref) {
138
140
  }), /*#__PURE__*/jsx("section", {
139
141
  ref: elementRef,
140
142
  "data-ref": "asideBody",
141
- className: classNames(classes.asideBody, "overflow-hidden grid"),
143
+ className: classNames(classes.asideBody, bodyClassName, "overflow-hidden grid"),
142
144
  style: isCollapsed ? widthStyles : undefined,
143
145
  children: /*#__PURE__*/jsx(ErrorBoundary, {
144
146
  children: children
@@ -30,11 +30,14 @@ import { jsx } from 'react/jsx-runtime';
30
30
 
31
31
  var Section = function Section(_ref) {
32
32
  var children = _ref.children,
33
- dir = _ref.dir;
33
+ className = _ref.className,
34
+ dir = _ref.dir,
35
+ ref = _ref.ref;
34
36
  return /*#__PURE__*/jsx("div", {
35
37
  "data-ref": "section",
36
38
  dir: dir,
37
- className: classNames(classes.section, "grid area-content overflow-hidden"),
39
+ ref: ref,
40
+ className: classNames(classes.section, className, "grid area-content overflow-hidden"),
38
41
  children: /*#__PURE__*/jsx(ErrorBoundary, {
39
42
  children: children
40
43
  })
package/dist/esm/index.js CHANGED
@@ -44,6 +44,7 @@ export { ThemeProvider } from './core/theme/ThemeProvider.js';
44
44
  export { Viewport } from './core/viewport/Viewport.js';
45
45
  export { addTranslationBundle } from './i18n/index.js';
46
46
  import '@babel/runtime/helpers/defineProperty';
47
+ import '@babel/runtime/helpers/slicedToArray';
47
48
  import '@floating-ui/react';
48
49
  import 'classnames';
49
50
  import 'react';