@trops/dash-react 1.0.55 → 1.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import * as SolidIcons from '@fortawesome/free-solid-svg-icons';
3
3
  import { faCheck } from '@fortawesome/free-solid-svg-icons';
4
4
  export * from '@fortawesome/free-solid-svg-icons';
5
5
  import * as BrandIcons from '@fortawesome/free-brands-svg-icons';
6
- import React, { createContext, useContext, useState, useCallback, useMemo, useRef, useEffect, createElement, Fragment, Children } from 'react';
6
+ import React, { createContext, useContext, useState, useCallback, useMemo, useRef, useEffect, createElement, forwardRef, Fragment, Children } from 'react';
7
7
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
8
8
  import { Dialog, Transition } from '@headlessui/react';
9
9
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -3737,7 +3737,7 @@ function _toPropertyKey$C(t) { var i = _toPrimitive$C(t, "string"); return "symb
3737
3737
  function _toPrimitive$C(t, r) { if ("object" != _typeof$C(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$C(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3738
3738
  function _objectWithoutProperties$v(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose$v(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
3739
3739
  function _objectWithoutPropertiesLoose$v(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3740
- var Card = function Card(_ref) {
3740
+ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
3741
3741
  var children = _ref.children,
3742
3742
  _ref$onClick = _ref.onClick,
3743
3743
  onClick = _ref$onClick === void 0 ? null : _ref$onClick,
@@ -3768,13 +3768,14 @@ var Card = function Card(_ref) {
3768
3768
  var hoverStyles = hover && !selected ? "hover:shadow-md ".concat(hoverBg, " ").concat(hoverBorder) : hover ? "hover:shadow-md" : "";
3769
3769
  var clickableStyles = onClick ? "cursor-pointer" : "";
3770
3770
  return /*#__PURE__*/jsx("div", {
3771
+ ref: ref,
3771
3772
  id: uuid,
3772
3773
  onClick: onClick,
3773
3774
  className: "".concat(selected ? selectedBg : styles.backgroundColor, " ").concat(selected ? selectedBorder : styles.borderColor, " ").concat(styles.textColor, " ").concat(padding, " ").concat(rounded, " ").concat(shadow, " transition-all duration-200 ").concat(hoverStyles, " ").concat(clickableStyles, " border ").concat(className),
3774
3775
  children: children
3775
3776
  });
3776
- };
3777
- var Card2 = function Card2(_ref2) {
3777
+ });
3778
+ var Card2 = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3778
3779
  var children = _ref2.children,
3779
3780
  _ref2$onClick = _ref2.onClick,
3780
3781
  onClick = _ref2$onClick === void 0 ? null : _ref2$onClick,
@@ -3805,13 +3806,14 @@ var Card2 = function Card2(_ref2) {
3805
3806
  var hoverStyles = hover && !selected ? "hover:shadow-md ".concat(hoverBg, " ").concat(hoverBorder) : hover ? "hover:shadow-md" : "";
3806
3807
  var clickableStyles = onClick ? "cursor-pointer" : "";
3807
3808
  return /*#__PURE__*/jsx("div", {
3809
+ ref: ref,
3808
3810
  id: uuid,
3809
3811
  onClick: onClick,
3810
3812
  className: "".concat(selected ? selectedBg : styles.backgroundColor, " ").concat(selected ? selectedBorder : styles.borderColor, " ").concat(styles.textColor, " ").concat(padding, " ").concat(rounded, " ").concat(shadow, " transition-all duration-200 ").concat(hoverStyles, " ").concat(clickableStyles, " border ").concat(className),
3811
3813
  children: children
3812
3814
  });
3813
- };
3814
- var Card3 = function Card3(_ref3) {
3815
+ });
3816
+ var Card3 = /*#__PURE__*/forwardRef(function (_ref3, ref) {
3815
3817
  var children = _ref3.children,
3816
3818
  _ref3$onClick = _ref3.onClick,
3817
3819
  onClick = _ref3$onClick === void 0 ? null : _ref3$onClick,
@@ -3842,12 +3844,13 @@ var Card3 = function Card3(_ref3) {
3842
3844
  var hoverStyles = hover && !selected ? "hover:shadow-sm ".concat(hoverBg, " ").concat(hoverBorder) : hover ? "hover:shadow-sm" : "";
3843
3845
  var clickableStyles = onClick ? "cursor-pointer" : "";
3844
3846
  return /*#__PURE__*/jsx("div", {
3847
+ ref: ref,
3845
3848
  id: uuid,
3846
3849
  onClick: onClick,
3847
3850
  className: "".concat(selected ? selectedBg : styles.backgroundColor, " ").concat(selected ? selectedBorder : styles.borderColor, " ").concat(styles.textColor, " ").concat(padding, " ").concat(rounded, " ").concat(shadow, " transition-all duration-200 ").concat(hoverStyles, " ").concat(clickableStyles, " border ").concat(className),
3848
3851
  children: children
3849
3852
  });
3850
- };
3853
+ });
3851
3854
 
3852
3855
  // Subcomponents for Card structure
3853
3856
  Card.Header = function (_ref4) {
@@ -9937,7 +9940,7 @@ var ColorSwatch = function ColorSwatch(_ref) {
9937
9940
  "aria-label": "".concat(ROLE_LABELS[role], " color: ").concat(label, ". Drag to reorder or use arrow keys."),
9938
9941
  "aria-grabbed": isDragging,
9939
9942
  children: [/*#__PURE__*/jsx("div", {
9940
- className: "flex-1 min-h-0 w-full rounded-lg transition-all group-hover:scale-105 group-hover:shadow-lg ring-1 ring-white/10 ".concat(isDragOver ? "shadow-lg shadow-blue-400/30" : ""),
9943
+ className: "flex-1 min-h-0 w-full rounded-lg transition-all group-hover:scale-105 group-hover:shadow-lg ".concat(isDragOver ? "shadow-lg shadow-blue-400/30" : ""),
9941
9944
  style: {
9942
9945
  backgroundColor: hex
9943
9946
  }
@@ -10110,10 +10113,14 @@ var PalettePreviewPane = function PalettePreviewPane(_ref2) {
10110
10113
  children: activeRoles.map(function (role, index) {
10111
10114
  var colorIndex = roleAssignments[role];
10112
10115
  var color = palette[colorIndex];
10113
- return /*#__PURE__*/jsx("div", {
10116
+ return /*#__PURE__*/jsx(Card3, {
10114
10117
  ref: function ref(el) {
10115
10118
  return swatchRefs.current[role] = el;
10116
10119
  },
10120
+ padding: "p-0",
10121
+ shadow: "shadow-none",
10122
+ rounded: "rounded-lg",
10123
+ className: "flex flex-1 min-h-0 min-w-0",
10117
10124
  children: /*#__PURE__*/jsx(ColorSwatch, {
10118
10125
  color: color,
10119
10126
  role: role,