@trops/dash-react 1.0.36 → 1.0.37

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
@@ -2881,7 +2881,7 @@ var ProgressBar3 = function ProgressBar3(props) {
2881
2881
  };
2882
2882
 
2883
2883
  function _typeof$w(o) { "@babel/helpers - typeof"; return _typeof$w = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$w(o); }
2884
- var _excluded$p = ["title", "message", "duration", "onClose", "className", "children"];
2884
+ var _excluded$p = ["title", "message", "duration", "onClose", "className", "children", "type"];
2885
2885
  function ownKeys$r(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; }
2886
2886
  function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty$s(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2887
2887
  function _defineProperty$s(e, r, t) { return (r = _toPropertyKey$w(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -2889,6 +2889,32 @@ function _toPropertyKey$w(t) { var i = _toPrimitive$w(t, "string"); return "symb
2889
2889
  function _toPrimitive$w(t, r) { if ("object" != _typeof$w(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$w(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2890
2890
  function _objectWithoutProperties$p(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose$p(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; }
2891
2891
  function _objectWithoutPropertiesLoose$p(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; }
2892
+ var TOAST_TYPE_STYLES = {
2893
+ success: {
2894
+ bg: "bg-emerald-950/95",
2895
+ border: "border-emerald-500",
2896
+ accent: "text-emerald-400",
2897
+ icon: "circle-check"
2898
+ },
2899
+ error: {
2900
+ bg: "bg-rose-950/95",
2901
+ border: "border-rose-500",
2902
+ accent: "text-rose-400",
2903
+ icon: "circle-xmark"
2904
+ },
2905
+ warning: {
2906
+ bg: "bg-amber-950/95",
2907
+ border: "border-amber-500",
2908
+ accent: "text-amber-400",
2909
+ icon: "triangle-exclamation"
2910
+ },
2911
+ info: {
2912
+ bg: "bg-sky-950/95",
2913
+ border: "border-sky-500",
2914
+ accent: "text-sky-400",
2915
+ icon: "circle-info"
2916
+ }
2917
+ };
2892
2918
  var Toast = function Toast(_ref) {
2893
2919
  var _ref$title = _ref.title,
2894
2920
  title = _ref$title === void 0 ? "" : _ref$title,
@@ -2902,6 +2928,8 @@ var Toast = function Toast(_ref) {
2902
2928
  className = _ref$className === void 0 ? "" : _ref$className,
2903
2929
  _ref$children = _ref.children,
2904
2930
  children = _ref$children === void 0 ? null : _ref$children,
2931
+ _ref$type = _ref.type,
2932
+ type = _ref$type === void 0 ? null : _ref$type,
2905
2933
  props = _objectWithoutProperties$p(_ref, _excluded$p);
2906
2934
  var _useContext = useContext(ThemeContext),
2907
2935
  currentTheme = _useContext.currentTheme;
@@ -2919,6 +2947,40 @@ var Toast = function Toast(_ref) {
2919
2947
  return clearTimeout(timer);
2920
2948
  };
2921
2949
  }, [duration, onClose]);
2950
+
2951
+ // Type-specific rendering: colored border, icon, and accent text
2952
+ if (type && TOAST_TYPE_STYLES[type]) {
2953
+ var t = TOAST_TYPE_STYLES[type];
2954
+ return /*#__PURE__*/jsx("div", {
2955
+ id: uuid,
2956
+ className: "rounded-md border-l-4 ".concat(t.border, " ").concat(t.bg, " shadow-lg p-3 text-white ").concat(className),
2957
+ role: "status",
2958
+ children: /*#__PURE__*/jsxs("div", {
2959
+ className: "flex items-start gap-3",
2960
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
2961
+ icon: t.icon,
2962
+ className: "h-4 w-4 mt-0.5 flex-shrink-0 ".concat(t.accent)
2963
+ }), /*#__PURE__*/jsxs("div", {
2964
+ className: "flex-1 min-w-0",
2965
+ children: [title && /*#__PURE__*/jsx("div", {
2966
+ className: "font-semibold text-sm ".concat(t.accent),
2967
+ children: title
2968
+ }), message && /*#__PURE__*/jsx("div", {
2969
+ className: "text-sm text-white/90 break-words",
2970
+ children: message
2971
+ }), children]
2972
+ }), onClose && /*#__PURE__*/jsx("button", {
2973
+ type: "button",
2974
+ onClick: onClose,
2975
+ className: "text-white/60 hover:text-white text-lg leading-none flex-shrink-0",
2976
+ "aria-label": "Close toast",
2977
+ children: "\xD7"
2978
+ })]
2979
+ })
2980
+ });
2981
+ }
2982
+
2983
+ // Default theme-driven rendering (backward compatible)
2922
2984
  return /*#__PURE__*/jsx("div", {
2923
2985
  id: uuid,
2924
2986
  className: "border ".concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " rounded-md p-4 shadow-lg ").concat(className),