@mlw-packages/react-components 1.7.5 → 1.7.6

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.mjs CHANGED
@@ -26,9 +26,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
 
29
- // node_modules/picocolors/picocolors.browser.js
29
+ // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.browser.js
30
30
  var require_picocolors_browser = __commonJS({
31
- "node_modules/picocolors/picocolors.browser.js"(exports, module) {
31
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.browser.js"(exports, module) {
32
32
  "use strict";
33
33
  var x = String;
34
34
  var create = function() {
@@ -39,9 +39,9 @@ var require_picocolors_browser = __commonJS({
39
39
  }
40
40
  });
41
41
 
42
- // node_modules/tailwindcss/lib/util/log.js
42
+ // node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/lib/util/log.js
43
43
  var require_log = __commonJS({
44
- "node_modules/tailwindcss/lib/util/log.js"(exports) {
44
+ "node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/lib/util/log.js"(exports) {
45
45
  "use strict";
46
46
  Object.defineProperty(exports, "__esModule", {
47
47
  value: true
@@ -106,9 +106,9 @@ var require_log = __commonJS({
106
106
  }
107
107
  });
108
108
 
109
- // node_modules/tailwindcss/lib/public/colors.js
109
+ // node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/lib/public/colors.js
110
110
  var require_colors = __commonJS({
111
- "node_modules/tailwindcss/lib/public/colors.js"(exports) {
111
+ "node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/lib/public/colors.js"(exports) {
112
112
  "use strict";
113
113
  Object.defineProperty(exports, "__esModule", {
114
114
  value: true
@@ -467,9 +467,9 @@ var require_colors = __commonJS({
467
467
  }
468
468
  });
469
469
 
470
- // node_modules/tailwindcss/colors.js
470
+ // node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/colors.js
471
471
  var require_colors2 = __commonJS({
472
- "node_modules/tailwindcss/colors.js"(exports, module) {
472
+ "node_modules/.pnpm/tailwindcss@3.4.18_yaml@2.8.1/node_modules/tailwindcss/colors.js"(exports, module) {
473
473
  "use strict";
474
474
  var colors2 = require_colors();
475
475
  module.exports = (colors2.__esModule ? colors2 : { default: colors2 }).default;
@@ -5645,204 +5645,52 @@ AvatarFallbackBase.displayName = AvatarPrimitive.Fallback.displayName;
5645
5645
  import { Slot as Slot3 } from "@radix-ui/react-slot";
5646
5646
  import { cva as cva2 } from "class-variance-authority";
5647
5647
  import { jsx as jsx32 } from "react/jsx-runtime";
5648
- var tailwindColors = {
5649
- // Red
5650
- "red-50": "#fef2f2",
5651
- "red-100": "#fee2e2",
5652
- "red-200": "#fecaca",
5653
- "red-300": "#fca5a5",
5654
- "red-400": "#f87171",
5655
- "red-500": "#ef4444",
5656
- "red-600": "#dc2626",
5657
- "red-700": "#b91c1c",
5658
- "red-800": "#991b1b",
5659
- "red-900": "#7f1d1d",
5660
- // Orange
5661
- "orange-50": "#fff7ed",
5662
- "orange-100": "#ffedd5",
5663
- "orange-200": "#fed7aa",
5664
- "orange-300": "#fdba74",
5665
- "orange-400": "#fb923c",
5666
- "orange-500": "#f97316",
5667
- "orange-600": "#ea580c",
5668
- "orange-700": "#c2410c",
5669
- "orange-800": "#9a3412",
5670
- "orange-900": "#7c2d12",
5671
- // Yellow
5672
- "yellow-50": "#fefce8",
5673
- "yellow-100": "#fef3c7",
5674
- "yellow-200": "#fde68a",
5675
- "yellow-300": "#fcd34d",
5676
- "yellow-400": "#fbbf24",
5677
- "yellow-500": "#f59e0b",
5678
- "yellow-600": "#d97706",
5679
- "yellow-700": "#b45309",
5680
- "yellow-800": "#92400e",
5681
- "yellow-900": "#78350f",
5682
- // Green
5683
- "green-50": "#f0fdf4",
5684
- "green-100": "#dcfce7",
5685
- "green-200": "#bbf7d0",
5686
- "green-300": "#86efac",
5687
- "green-400": "#4ade80",
5688
- "green-500": "#22c55e",
5689
- "green-600": "#16a34a",
5690
- "green-700": "#15803d",
5691
- "green-800": "#166534",
5692
- "green-900": "#14532d",
5693
- // Blue
5694
- "blue-50": "#eff6ff",
5695
- "blue-100": "#dbeafe",
5696
- "blue-200": "#bfdbfe",
5697
- "blue-300": "#93c5fd",
5698
- "blue-400": "#60a5fa",
5699
- "blue-500": "#3b82f6",
5700
- "blue-600": "#2563eb",
5701
- "blue-700": "#1d4ed8",
5702
- "blue-800": "#1e40af",
5703
- "blue-900": "#1e3a8a",
5704
- // Purple
5705
- "purple-50": "#faf5ff",
5706
- "purple-100": "#f3e8ff",
5707
- "purple-200": "#e9d5ff",
5708
- "purple-300": "#d8b4fe",
5709
- "purple-400": "#c084fc",
5710
- "purple-500": "#a855f7",
5711
- "purple-600": "#9333ea",
5712
- "purple-700": "#7c3aed",
5713
- "purple-800": "#6b21a8",
5714
- "purple-900": "#581c87",
5715
- // Pink
5716
- "pink-50": "#fdf2f8",
5717
- "pink-100": "#fce7f3",
5718
- "pink-200": "#fbcfe8",
5719
- "pink-300": "#f9a8d4",
5720
- "pink-400": "#f472b6",
5721
- "pink-500": "#ec4899",
5722
- "pink-600": "#db2777",
5723
- "pink-700": "#be185d",
5724
- "pink-800": "#9d174d",
5725
- "pink-900": "#831843",
5726
- // Gray
5727
- "gray-50": "#f9fafb",
5728
- "gray-100": "#f3f4f6",
5729
- "gray-200": "#e5e7eb",
5730
- "gray-300": "#d1d5db",
5731
- "gray-400": "#9ca3af",
5732
- "gray-500": "#6b7280",
5733
- "gray-600": "#4b5563",
5734
- "gray-700": "#374151",
5735
- "gray-800": "#1f2937",
5736
- "gray-900": "#111827",
5737
- // Indigo
5738
- "indigo-50": "#eef2ff",
5739
- "indigo-100": "#e0e7ff",
5740
- "indigo-200": "#c7d2fe",
5741
- "indigo-300": "#a5b4fc",
5742
- "indigo-400": "#818cf8",
5743
- "indigo-500": "#6366f1",
5744
- "indigo-600": "#4f46e5",
5745
- "indigo-700": "#4338ca",
5746
- "indigo-800": "#3730a3",
5747
- "indigo-900": "#312e81",
5748
- // Teal
5749
- "teal-50": "#f0fdfa",
5750
- "teal-100": "#ccfbf1",
5751
- "teal-200": "#99f6e4",
5752
- "teal-300": "#5eead4",
5753
- "teal-400": "#2dd4bf",
5754
- "teal-500": "#14b8a6",
5755
- "teal-600": "#0d9488",
5756
- "teal-700": "#0f766e",
5757
- "teal-800": "#115e59",
5758
- "teal-900": "#134e4a",
5759
- // Emerald
5760
- "emerald-50": "#ecfdf5",
5761
- "emerald-100": "#d1fae5",
5762
- "emerald-200": "#a7f3d0",
5763
- "emerald-300": "#6ee7b7",
5764
- "emerald-400": "#34d399",
5765
- "emerald-500": "#10b981",
5766
- "emerald-600": "#059669",
5767
- "emerald-700": "#047857",
5768
- "emerald-800": "#065f46",
5769
- "emerald-900": "#064e3b",
5770
- // Cyan
5771
- "cyan-50": "#ecfeff",
5772
- "cyan-100": "#cffafe",
5773
- "cyan-200": "#a5f3fc",
5774
- "cyan-300": "#67e8f9",
5775
- "cyan-400": "#22d3ee",
5776
- "cyan-500": "#06b6d4",
5777
- "cyan-600": "#0891b2",
5778
- "cyan-700": "#0e7490",
5779
- "cyan-800": "#155e75",
5780
- "cyan-900": "#164e63"
5781
- };
5782
- var getTailwindColor = (color) => {
5783
- if (color.startsWith("#") || color.startsWith("rgb") || color.startsWith("hsl")) {
5784
- return color;
5785
- }
5786
- if (tailwindColors[color]) {
5787
- return tailwindColors[color];
5788
- }
5789
- if (!color.includes("-")) {
5790
- const defaultColor = `${color}-500`;
5791
- if (tailwindColors[defaultColor]) {
5792
- return tailwindColors[defaultColor];
5793
- }
5794
- }
5795
- return color;
5796
- };
5797
5648
  var badgeVariants = cva2(
5798
- "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
5649
+ "inline-flex items-center justify-center rounded-md border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
5799
5650
  {
5800
5651
  variants: {
5801
- variant: {
5802
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
5803
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
5804
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
5805
- outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
5806
- },
5807
- status: {
5808
- success: "bg-green-500 border-white dark:border-zinc-900",
5809
- desactivated: "bg-gray-400 border-white dark:border-zinc-900",
5810
- destructive: "bg-red-500 border-white dark:border-zinc-900",
5811
- away: "bg-yellow-400 border-white dark:border-zinc-900",
5812
- custom: "border-white dark:border-zinc-900"
5652
+ size: {
5653
+ sm: "px-1 py-0.5 text-xs",
5654
+ md: "px-2 py-1 text-xs",
5655
+ lg: "px-3 py-1 text-sm"
5813
5656
  }
5814
5657
  },
5815
5658
  defaultVariants: {
5816
- variant: "default"
5659
+ size: "md"
5817
5660
  }
5818
5661
  }
5819
5662
  );
5820
5663
  function BadgeBase({
5821
5664
  className,
5822
- variant,
5823
- status,
5824
- statusColor,
5665
+ color,
5666
+ size = "md",
5825
5667
  asChild = false,
5826
5668
  children,
5827
5669
  style,
5828
5670
  ...props
5829
5671
  }) {
5830
5672
  const Comp = asChild ? Slot3 : "span";
5831
- const isStatus = Boolean(status);
5832
- const resolvedStatusColor = statusColor ? getTailwindColor(statusColor) : void 0;
5833
- const customStyle = status === "custom" && resolvedStatusColor ? { ...style, backgroundColor: resolvedStatusColor } : style;
5673
+ const customStyle = style;
5674
+ const colorClasses = {
5675
+ green: "bg-green-50 text-green-500 border-green-200",
5676
+ gray: "bg-gray-50 text-gray-500 border-gray-200",
5677
+ red: "bg-red-50 text-red-500 border-red-200",
5678
+ yellow: "bg-yellow-50 text-yellow-600 border-yellow-200",
5679
+ blue: "bg-blue-50 text-blue-500 border-blue-200",
5680
+ purple: "bg-purple-50 text-purple-500 border-purple-200"
5681
+ };
5834
5682
  return /* @__PURE__ */ jsx32(
5835
5683
  Comp,
5836
5684
  {
5837
5685
  "data-slot": "badge",
5838
5686
  className: cn(
5839
- badgeVariants({ variant, status: isStatus ? status : void 0 }),
5840
- isStatus && "absolute bottom-0 right-0 rounded-full p-0 h-4 w-4 flex items-center justify-center border-2",
5687
+ badgeVariants({ size }),
5688
+ color ? colorClasses[color] : void 0,
5841
5689
  className
5842
5690
  ),
5843
5691
  style: customStyle,
5844
5692
  ...props,
5845
- children: isStatus ? null : children
5693
+ children
5846
5694
  }
5847
5695
  );
5848
5696
  }
@@ -10118,7 +9966,7 @@ function CalendarBase2({
10118
9966
  head_cell: "text-muted-foreground rounded-md font-semibold text-[clamp(0.575rem,1.2vw,0.75rem)] sm:text-[clamp(0.65rem,1.1vw,0.825rem)] text-center pb-1 uppercase tracking-wider",
10119
9967
  row: "grid grid-cols-7 gap-1",
10120
9968
  cell: cn(
10121
- "min-w-0 h-9 sm:h-10 md:h-11 p-0 relative flex items-center justify-center",
9969
+ "min-w-0 h-9 sm:h-10 md:h-10 p-0 relative flex items-center justify-center",
10122
9970
  "[&:has([aria-selected].day-range-end)]:rounded-r-lg",
10123
9971
  "[&:has([aria-selected].day-range-start)]:rounded-l-lg",
10124
9972
  "[&:has([aria-selected].day-outside)]:bg-muted/50",
@@ -10609,8 +10457,6 @@ function DateTimePicker({
10609
10457
  displayFormat,
10610
10458
  hideTime,
10611
10459
  hideSeconds,
10612
- hideHour,
10613
- hideMinute,
10614
10460
  fromDate,
10615
10461
  toDate,
10616
10462
  disabled,
@@ -10639,18 +10485,16 @@ function DateTimePicker({
10639
10485
  };
10640
10486
  const getTimeFormat = () => {
10641
10487
  if (hideTime) return "";
10642
- if (hideHour && hideMinute) return "";
10643
- if (hideHour) return hideSeconds ? "mm" : "mm:ss";
10644
- if (hideMinute) return hideSeconds ? "HH" : "HH':00'";
10645
10488
  return hideSeconds ? "HH:mm" : "HH:mm:ss";
10646
10489
  };
10647
10490
  const getDisplayFormat = () => {
10648
- if (displayFormat) {
10649
- return displayFormat;
10650
- }
10651
10491
  const timeFormat = getTimeFormat();
10652
- if (!timeFormat) return "PPP";
10653
- return `PPP - ${timeFormat}`;
10492
+ if (displayFormat === true) {
10493
+ if (!timeFormat) return "dd/MM/yyyy";
10494
+ return `dd/MM/yyyy ${timeFormat}`;
10495
+ }
10496
+ if (!timeFormat) return "dd MMMM yyyy";
10497
+ return `dd MMMM yyyy ${timeFormat}`;
10654
10498
  };
10655
10499
  useEffect16(() => {
10656
10500
  if (date) {
@@ -10713,13 +10557,10 @@ function DateTimePicker({
10713
10557
  defaultMonth: fromDate ?? toDate ?? internalDate,
10714
10558
  fromDate,
10715
10559
  toDate,
10716
- className: cn(
10717
- "w-full",
10718
- (hideTime || hideHour && hideMinute) && "border-0"
10719
- )
10560
+ className: cn("w-full", hideTime && "border-0")
10720
10561
  }
10721
10562
  ),
10722
- !hideTime && !(hideHour && hideMinute) && /* @__PURE__ */ jsx66("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ jsxs46(
10563
+ !hideTime && /* @__PURE__ */ jsx66("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ jsxs46(
10723
10564
  PopoverBase,
10724
10565
  {
10725
10566
  open: timePickerOpen,
@@ -11531,6 +11372,73 @@ var CodeBlock = ({
11531
11372
  );
11532
11373
  };
11533
11374
 
11375
+ // src/components/ui/data/StatusIndicator.tsx
11376
+ import { jsx as jsx70, jsxs as jsxs50 } from "react/jsx-runtime";
11377
+ function StatusIndicator({
11378
+ color = "green",
11379
+ size = "sm",
11380
+ position = "top-right",
11381
+ show = true,
11382
+ children,
11383
+ className,
11384
+ ...props
11385
+ }) {
11386
+ const absolutePositionClasses = {
11387
+ "top-right": "absolute top-0 right-0 translate-x-1/2 -translate-y-1/2",
11388
+ "top-left": "absolute top-0 left-0 -translate-x-1/2 -translate-y-1/2",
11389
+ "bottom-right": "absolute bottom-0 right-0 translate-x-1/2 translate-y-1/2",
11390
+ "bottom-left": "absolute bottom-0 left-0 -translate-x-1/2 translate-y-1/2"
11391
+ };
11392
+ const sizeClasses = {
11393
+ xs: "h-2 w-2",
11394
+ sm: "h-2.5 w-2.5",
11395
+ md: "h-3 w-3",
11396
+ lg: "h-4 w-4"
11397
+ };
11398
+ const colorClasses = {
11399
+ green: "bg-green-500",
11400
+ gray: "bg-gray-400",
11401
+ red: "bg-red-500",
11402
+ yellow: "bg-yellow-400",
11403
+ blue: "bg-blue-500",
11404
+ purple: "bg-purple-500",
11405
+ retire: "bg-slate-300/70 ring-1 ring-slate-200"
11406
+ };
11407
+ const dotClass = cn(
11408
+ "rounded-full inline-block",
11409
+ sizeClasses[size],
11410
+ colorClasses[color],
11411
+ "flex-shrink-0"
11412
+ );
11413
+ if (position === "inline") {
11414
+ return /* @__PURE__ */ jsxs50(
11415
+ "span",
11416
+ {
11417
+ className: cn("inline-flex items-center gap-2", className),
11418
+ ...props,
11419
+ children: [
11420
+ show && /* @__PURE__ */ jsx70("span", { className: dotClass, "aria-hidden": !show }),
11421
+ children && /* @__PURE__ */ jsx70("span", { className: "truncate", children })
11422
+ ]
11423
+ }
11424
+ );
11425
+ }
11426
+ return /* @__PURE__ */ jsxs50("div", { className: cn("relative inline-flex", className), ...props, children: [
11427
+ show && /* @__PURE__ */ jsx70(
11428
+ "span",
11429
+ {
11430
+ "aria-hidden": !show,
11431
+ className: cn(
11432
+ "pointer-events-none z-10",
11433
+ absolutePositionClasses[position]
11434
+ ),
11435
+ children: /* @__PURE__ */ jsx70("span", { className: dotClass })
11436
+ }
11437
+ ),
11438
+ /* @__PURE__ */ jsx70("div", { className: "min-w-0", children })
11439
+ ] });
11440
+ }
11441
+
11534
11442
  // src/hooks/use-drag.tsx
11535
11443
  import { useState as useState20, useCallback as useCallback12, useRef as useRef8, useEffect as useEffect18 } from "react";
11536
11444
  var useDrag = (options = {}) => {
@@ -11829,6 +11737,7 @@ export {
11829
11737
  SidebarTriggerBase,
11830
11738
  SkeletonBase,
11831
11739
  SlideBase,
11740
+ StatusIndicator,
11832
11741
  SwitchBase,
11833
11742
  TableBase,
11834
11743
  TableBodyBase,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.5",
6
+ "version": "1.7.6",
7
7
  "homepage": "https://main--68e80310a069c2f10b546ef3.chromatic.com/",
8
8
  "repository": {
9
9
  "type": "git",