@mlw-packages/react-components 1.8.6 → 1.8.7

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.css CHANGED
@@ -429,14 +429,14 @@ body {
429
429
  .-left-1 {
430
430
  left: -0.25rem;
431
431
  }
432
- .-left-3 {
433
- left: -0.75rem;
432
+ .-left-3\.5 {
433
+ left: -0.875rem;
434
434
  }
435
435
  .-right-1 {
436
436
  right: -0.25rem;
437
437
  }
438
- .-right-3 {
439
- right: -0.75rem;
438
+ .-right-3\.5 {
439
+ right: -0.875rem;
440
440
  }
441
441
  .-top-1 {
442
442
  top: -0.25rem;
@@ -738,9 +738,6 @@ body {
738
738
  .ml-64 {
739
739
  margin-left: 16rem;
740
740
  }
741
- .ml-\[90px\] {
742
- margin-left: 90px;
743
- }
744
741
  .ml-auto {
745
742
  margin-left: auto;
746
743
  }
@@ -798,9 +795,6 @@ body {
798
795
  .mt-8 {
799
796
  margin-top: 2rem;
800
797
  }
801
- .mt-\[19px\] {
802
- margin-top: 19px;
803
- }
804
798
  .mt-\[var\(--event-gap\)\] {
805
799
  margin-top: var(--event-gap);
806
800
  }
@@ -1264,9 +1258,6 @@ body {
1264
1258
  .w-\[90\%\] {
1265
1259
  width: 90%;
1266
1260
  }
1267
- .w-\[98\%\] {
1268
- width: 98%;
1269
- }
1270
1261
  .w-auto {
1271
1262
  width: auto;
1272
1263
  }
@@ -1366,6 +1357,9 @@ body {
1366
1357
  .max-w-\[1100px\] {
1367
1358
  max-width: 1100px;
1368
1359
  }
1360
+ .max-w-\[200px\] {
1361
+ max-width: 200px;
1362
+ }
1369
1363
  .max-w-\[210px\] {
1370
1364
  max-width: 210px;
1371
1365
  }
@@ -1971,6 +1965,10 @@ body {
1971
1965
  border-left-width: 1px;
1972
1966
  border-right-width: 1px;
1973
1967
  }
1968
+ .border-x-2 {
1969
+ border-left-width: 2px;
1970
+ border-right-width: 2px;
1971
+ }
1974
1972
  .border-y {
1975
1973
  border-top-width: 1px;
1976
1974
  border-bottom-width: 1px;
@@ -2095,6 +2093,9 @@ body {
2095
2093
  .border-primary\/30 {
2096
2094
  border-color: hsl(var(--primary) / 0.3);
2097
2095
  }
2096
+ .border-primary\/50 {
2097
+ border-color: hsl(var(--primary) / 0.5);
2098
+ }
2098
2099
  .border-primary\/70 {
2099
2100
  border-color: hsl(var(--primary) / 0.7);
2100
2101
  }
@@ -2388,9 +2389,6 @@ body {
2388
2389
  .bg-muted\/50 {
2389
2390
  background-color: hsl(var(--muted) / 0.5);
2390
2391
  }
2391
- .bg-muted\/60 {
2392
- background-color: hsl(var(--muted) / 0.6);
2393
- }
2394
2392
  .bg-muted\/80 {
2395
2393
  background-color: hsl(var(--muted) / 0.8);
2396
2394
  }
@@ -2750,6 +2748,10 @@ body {
2750
2748
  padding-left: 0.625rem;
2751
2749
  padding-right: 0.625rem;
2752
2750
  }
2751
+ .px-20 {
2752
+ padding-left: 5rem;
2753
+ padding-right: 5rem;
2754
+ }
2753
2755
  .px-3 {
2754
2756
  padding-left: 0.75rem;
2755
2757
  padding-right: 0.75rem;
@@ -2964,6 +2966,9 @@ body {
2964
2966
  .text-\[1\.4rem\] {
2965
2967
  font-size: 1.4rem;
2966
2968
  }
2969
+ .text-\[1\.6rem\] {
2970
+ font-size: 1.6rem;
2971
+ }
2967
2972
  .text-\[10px\] {
2968
2973
  font-size: 10px;
2969
2974
  }
@@ -3038,6 +3043,9 @@ body {
3038
3043
  .capitalize {
3039
3044
  text-transform: capitalize;
3040
3045
  }
3046
+ .italic {
3047
+ font-style: italic;
3048
+ }
3041
3049
  .tabular-nums {
3042
3050
  --tw-numeric-spacing: tabular-nums;
3043
3051
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
@@ -3610,6 +3618,10 @@ body {
3610
3618
  --tw-backdrop-blur: blur(8px);
3611
3619
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
3612
3620
  }
3621
+ .backdrop-blur-\[1px\] {
3622
+ --tw-backdrop-blur: blur(1px);
3623
+ backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
3624
+ }
3613
3625
  .backdrop-blur-md {
3614
3626
  --tw-backdrop-blur: blur(12px);
3615
3627
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
@@ -4274,6 +4286,9 @@ body {
4274
4286
  .hover\:bg-primary\/20:hover {
4275
4287
  background-color: hsl(var(--primary) / 0.2);
4276
4288
  }
4289
+ .hover\:bg-primary\/5:hover {
4290
+ background-color: hsl(var(--primary) / 0.05);
4291
+ }
4277
4292
  .hover\:bg-primary\/90:hover {
4278
4293
  background-color: hsl(var(--primary) / 0.9);
4279
4294
  }
@@ -6332,6 +6347,12 @@ body {
6332
6347
  .\[\&\:\:-webkit-scrollbar-thumb\]\:bg-muted::-webkit-scrollbar-thumb {
6333
6348
  background-color: hsl(var(--muted));
6334
6349
  }
6350
+ .\[\&\:\:-webkit-scrollbar-thumb\]\:bg-muted-foreground\/20::-webkit-scrollbar-thumb {
6351
+ background-color: hsl(var(--muted-foreground) / 0.2);
6352
+ }
6353
+ .hover\:\[\&\:\:-webkit-scrollbar-thumb\]\:bg-muted-foreground\/40::-webkit-scrollbar-thumb:hover {
6354
+ background-color: hsl(var(--muted-foreground) / 0.4);
6355
+ }
6335
6356
  .hover\:\[\&\:\:-webkit-scrollbar-thumb\]\:bg-muted-foreground\/50::-webkit-scrollbar-thumb:hover {
6336
6357
  background-color: hsl(var(--muted-foreground) / 0.5);
6337
6358
  }
@@ -6341,6 +6362,9 @@ body {
6341
6362
  .\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar {
6342
6363
  display: none;
6343
6364
  }
6365
+ .\[\&\:\:-webkit-scrollbar\]\:w-1\.5::-webkit-scrollbar {
6366
+ width: 0.375rem;
6367
+ }
6344
6368
  .\[\&\:\:-webkit-scrollbar\]\:w-2::-webkit-scrollbar {
6345
6369
  width: 0.5rem;
6346
6370
  }
package/dist/index.d.mts CHANGED
@@ -1313,6 +1313,7 @@ interface AvatarComboboxItem<T extends string> {
1313
1313
  value: T;
1314
1314
  avatar?: ReactNode;
1315
1315
  avatarClassName?: string;
1316
+ img?: string;
1316
1317
  }
1317
1318
  interface AvatarComboboxTestIds {
1318
1319
  root?: string;
@@ -2147,9 +2148,11 @@ interface LeaderboardProps<T extends string> {
2147
2148
  title?: string;
2148
2149
  className?: string;
2149
2150
  isLoading?: boolean;
2150
- legend?: [string, string][];
2151
+ legend?: string[];
2152
+ best?: boolean;
2153
+ worst?: boolean;
2151
2154
  }
2152
- declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
2155
+ declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, best, worst, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
2153
2156
 
2154
2157
  declare function useIsMobile(): boolean;
2155
2158
 
package/dist/index.d.ts CHANGED
@@ -1313,6 +1313,7 @@ interface AvatarComboboxItem<T extends string> {
1313
1313
  value: T;
1314
1314
  avatar?: ReactNode;
1315
1315
  avatarClassName?: string;
1316
+ img?: string;
1316
1317
  }
1317
1318
  interface AvatarComboboxTestIds {
1318
1319
  root?: string;
@@ -2147,9 +2148,11 @@ interface LeaderboardProps<T extends string> {
2147
2148
  title?: string;
2148
2149
  className?: string;
2149
2150
  isLoading?: boolean;
2150
- legend?: [string, string][];
2151
+ legend?: string[];
2152
+ best?: boolean;
2153
+ worst?: boolean;
2151
2154
  }
2152
- declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
2155
+ declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, best, worst, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
2153
2156
 
2154
2157
  declare function useIsMobile(): boolean;
2155
2158
 
package/dist/index.js CHANGED
@@ -1578,14 +1578,14 @@ var Toaster = ({ testId, ...props }) => {
1578
1578
  text-foreground
1579
1579
  shadow-xl rounded-lg
1580
1580
  border-l-4
1581
- border-border
1581
+
1582
1582
  flex items-center gap-3
1583
1583
  transition-all duration-300
1584
1584
  hover:scale-[1.02] hover:shadow-2xl
1585
- data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50/95 data-[type=success]:text-green-800 data-[type=success]:border-green-500
1585
+ data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50/95 data-[type=success]:text-green-800 data-[type=success]:border-green-500 data-
1586
1586
  data-[type=error]:border-l-red-500 data-[type=error]:bg-red-50/95 data-[type=error]:text-red-800 data-[type=error]:border-red-500
1587
1587
  data-[type=warning]:border-l-yellow-500 data-[type=warning]:bg-yellow-50/95 data-[type=warning]:text-yellow-800 data-[type=warning]:border-yellow-500
1588
- data-[type=info]:border-l-blue-500 data-[type=info]:bg-blue-50/95 data-[type=info]:text-blue-800 data-[type=info]:border-blue-500
1588
+ data-[type=info]:border-l-blue-500 data-[type=info]:bg-blue-50/95 data-[type=info]:text-blue-800 data-[type=info]:border-blue-500
1589
1589
  `,
1590
1590
  description: `
1591
1591
  text-xs
@@ -14254,6 +14254,11 @@ function WeekView({
14254
14254
  // src/components/ui/selects/AvatarCombobox.tsx
14255
14255
  var import_react84 = require("react");
14256
14256
  var import_react85 = require("@phosphor-icons/react");
14257
+
14258
+ // public/pwa-512x512.png
14259
+ var pwa_512x512_default = "./pwa-512x512-4NJPUGCI.png";
14260
+
14261
+ // src/components/ui/selects/AvatarCombobox.tsx
14257
14262
  var import_jsx_runtime85 = require("react/jsx-runtime");
14258
14263
  var DEFAULT_COLORS = [
14259
14264
  "bg-purple-100 text-purple-700",
@@ -14302,10 +14307,14 @@ function AvatarCombobox({
14302
14307
  const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
14303
14308
  const selectedItem = allItems.find((item) => item.value === selected);
14304
14309
  const renderItem = (item) => {
14305
- const avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
14306
- const colorClass = item.avatarClassName ?? getColor(item.value, colors2);
14310
+ let avatarContent;
14311
+ let colorClass;
14312
+ if (!item.img) {
14313
+ avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
14314
+ colorClass = item.avatarClassName ?? getColor(item.value, colors2);
14315
+ }
14307
14316
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
14308
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Square, { className: colorClass, children: avatarContent }),
14317
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Square, { className: colorClass, children: !avatarContent ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("img", { src: pwa_512x512_default }) : avatarContent }),
14309
14318
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "truncate", children: item.label })
14310
14319
  ] });
14311
14320
  };
@@ -16309,7 +16318,7 @@ var Brush = ({
16309
16318
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16310
16319
  "div",
16311
16320
  {
16312
- className: "absolute top-0 bottom-0 left-0 bg-muted/60 pointer-events-none rounded-md",
16321
+ className: "absolute top-0 bottom-0 left-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-l-md border-r border-border/50",
16313
16322
  style: {
16314
16323
  width: `${startIndex / (dataLength - 1) * 100}%`
16315
16324
  }
@@ -16318,7 +16327,7 @@ var Brush = ({
16318
16327
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16319
16328
  "div",
16320
16329
  {
16321
- className: "absolute top-0 bottom-0 right-0 bg-muted/60 pointer-events-none rounded-md",
16330
+ className: "absolute top-0 bottom-0 right-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-r-md border-l border-border/50",
16322
16331
  style: {
16323
16332
  width: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`
16324
16333
  }
@@ -16327,18 +16336,18 @@ var Brush = ({
16327
16336
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
16328
16337
  "div",
16329
16338
  {
16330
- className: "absolute top-0 bottom-0 border cursor-move group rounded-md border-primary/30",
16339
+ className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md",
16331
16340
  style: {
16332
16341
  left: `${startIndex / (dataLength - 1) * 100}%`,
16333
16342
  right: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`,
16334
- backgroundColor: "hsl(var(--primary) / 0.03)"
16343
+ backgroundColor: "transparent"
16335
16344
  },
16336
16345
  onMouseDown: (e) => onMouseDown(e, "middle"),
16337
16346
  children: [
16338
16347
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16339
16348
  "div",
16340
16349
  {
16341
- className: "absolute top-1/2 -translate-y-1/2 -left-3 w-6 h-10 flex items-center justify-center cursor-ew-resize active:scale-95 transition-all",
16350
+ className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
16342
16351
  onMouseDown: (e) => {
16343
16352
  e.stopPropagation();
16344
16353
  onMouseDown(e, "start");
@@ -16346,9 +16355,9 @@ var Brush = ({
16346
16355
  children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16347
16356
  "div",
16348
16357
  {
16349
- className: "w-2 h-7 rounded-full shadow-md ring-2 ring-background flex flex-col items-center justify-center gap-0.5",
16358
+ className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
16350
16359
  style: {
16351
- backgroundColor: brushColor ?? "hsl(var(--primary) / 0.7)"
16360
+ backgroundColor: brushColor ?? "hsl(var(--primary))"
16352
16361
  }
16353
16362
  }
16354
16363
  )
@@ -16357,7 +16366,7 @@ var Brush = ({
16357
16366
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16358
16367
  "div",
16359
16368
  {
16360
- className: "absolute top-1/2 -translate-y-1/2 -right-3 w-6 h-10 flex items-center justify-center cursor-ew-resize active:scale-95 transition-all",
16369
+ className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
16361
16370
  onMouseDown: (e) => {
16362
16371
  e.stopPropagation();
16363
16372
  onMouseDown(e, "end");
@@ -16365,9 +16374,9 @@ var Brush = ({
16365
16374
  children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
16366
16375
  "div",
16367
16376
  {
16368
- className: "w-2 h-7 rounded-full shadow-md ring-2 ring-background flex flex-col items-center justify-center gap-0.5",
16377
+ className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
16369
16378
  style: {
16370
- backgroundColor: brushColor ?? "hsl(var(--primary) / 0.7)"
16379
+ backgroundColor: brushColor ?? "hsl(var(--primary))"
16371
16380
  }
16372
16381
  }
16373
16382
  )
@@ -17236,12 +17245,7 @@ var Chart = ({
17236
17245
  }
17237
17246
  return timeSeries;
17238
17247
  }, [timeSeries]);
17239
- const {
17240
- startIndex,
17241
- endIndex,
17242
- brushRef,
17243
- handleMouseDown
17244
- } = useTimeSeriesRange({
17248
+ const { startIndex, endIndex, brushRef, handleMouseDown } = useTimeSeriesRange({
17245
17249
  dataLength: data.length,
17246
17250
  defaultStartIndex: timeSeriesConfig?.start,
17247
17251
  defaultEndIndex: timeSeriesConfig?.end,
@@ -17382,6 +17386,7 @@ var Chart = ({
17382
17386
  );
17383
17387
  const finalChartTopMargin = chartMargin?.top ?? (showLabels ? 48 : 20);
17384
17388
  const finalChartBottomMargin = (chartMargin?.bottom ?? 5) + (xAxisLabel ? 22 : 0) + (showLegend ? 36 : 0);
17389
+ const HORIZONTAL_PADDING_CLASS = "px-20";
17385
17390
  const effectiveChartWidth = typeof width === "number" ? width : measuredWidth ? Math.max(0, measuredWidth - 32) : computedWidth;
17386
17391
  const chartInnerWidth = effectiveChartWidth - finalChartLeftMargin - finalChartRightMargin;
17387
17392
  const leftYAxisLabelDx = -Math.max(12, Math.round(yAxisTickWidth / 2));
@@ -17451,63 +17456,83 @@ var Chart = ({
17451
17456
  }
17452
17457
  );
17453
17458
  }
17454
- return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { ref: wrapperRef, className: "w-full overflow-hidden min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
17459
+ return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17455
17460
  "div",
17456
17461
  {
17457
- className: cn(
17458
- "rounded-lg bg-card relative w-full max-w-full min-w-0",
17459
- className
17460
- ),
17461
- children: [
17462
+ ref: wrapperRef,
17463
+ className: cn("w-full overflow-hidden min-w-0 rounded-lg", className),
17464
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0", children: [
17462
17465
  title && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17463
17466
  "div",
17464
17467
  {
17465
17468
  className: cn(
17466
- "w-full flex items-center mt-[19px] ml-[90px]",
17469
+ "w-full flex items-center mt-5",
17470
+ HORIZONTAL_PADDING_CLASS,
17467
17471
  titlePosition === "center" && "justify-center",
17468
17472
  titlePosition === "right" && "justify-end",
17469
17473
  titlePosition === "left" && "justify-start"
17470
17474
  ),
17471
- children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "text-[1.4rem] font-semibold text-foreground mb-3", children: title })
17475
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "text-[1.4rem] font-semibold text-foreground mb-3", children: [
17476
+ title,
17477
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17478
+ "div",
17479
+ {
17480
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none z-50 select-text overflow-hidden",
17481
+ "aria-hidden": "true",
17482
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "text-[1.6rem] font-bold text-transparent selection:bg-primary selection:text-primary-foreground whitespace-nowrap", children: "Eduardo Ronchi de Araujo Desenvolvidor de Sistemas Junio" })
17483
+ }
17484
+ )
17485
+ ] })
17486
+ }
17487
+ ),
17488
+ allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
17489
+ "div",
17490
+ {
17491
+ className: cn(
17492
+ "flex items-center gap-2 mb-2",
17493
+ HORIZONTAL_PADDING_CLASS
17494
+ ),
17495
+ children: [
17496
+ enableHighlights && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17497
+ Highlights_default,
17498
+ {
17499
+ allKeys,
17500
+ mapperConfig,
17501
+ finalColors,
17502
+ highlightedSeries,
17503
+ toggleHighlight,
17504
+ containerWidth: chartInnerWidth
17505
+ }
17506
+ ),
17507
+ enableShowOnly && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17508
+ ShowOnly_default,
17509
+ {
17510
+ showOnlyHighlighted,
17511
+ setShowOnlyHighlighted,
17512
+ highlightedSeriesSize: highlightedSeries.size,
17513
+ clearHighlights
17514
+ }
17515
+ ),
17516
+ enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17517
+ PeriodsDropdown_default,
17518
+ {
17519
+ processedData,
17520
+ onOpenPeriod: openTooltipForPeriod,
17521
+ rightOffset: finalChartRightMargin,
17522
+ activePeriods
17523
+ }
17524
+ ) })
17525
+ ]
17472
17526
  }
17473
17527
  ),
17474
- allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center w-[98%] ml-[90px] gap-2", children: [
17475
- enableHighlights && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17476
- Highlights_default,
17477
- {
17478
- allKeys,
17479
- mapperConfig,
17480
- finalColors,
17481
- highlightedSeries,
17482
- toggleHighlight,
17483
- containerWidth: chartInnerWidth
17484
- }
17485
- ),
17486
- enableShowOnly && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17487
- ShowOnly_default,
17488
- {
17489
- showOnlyHighlighted,
17490
- setShowOnlyHighlighted,
17491
- highlightedSeriesSize: highlightedSeries.size,
17492
- clearHighlights
17493
- }
17494
- ),
17495
- enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17496
- PeriodsDropdown_default,
17497
- {
17498
- processedData,
17499
- onOpenPeriod: openTooltipForPeriod,
17500
- rightOffset: finalChartRightMargin,
17501
- activePeriods
17502
- }
17503
- ) })
17504
- ] }),
17505
17528
  !(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
17506
17529
  "div",
17507
17530
  {
17508
- className: "w-full flex justify-end",
17531
+ className: cn(
17532
+ "w-full flex justify-end mb-2",
17533
+ HORIZONTAL_PADDING_CLASS
17534
+ ),
17509
17535
  style: {
17510
- paddingLeft: `${CONTAINER_PADDING_LEFT + finalChartLeftMargin}px`,
17511
17536
  paddingRight: `${finalChartRightMargin}px`,
17512
17537
  maxWidth: `${chartInnerWidth}px`
17513
17538
  },
@@ -17907,9 +17932,9 @@ var Chart = ({
17907
17932
  }
17908
17933
  }
17909
17934
  )
17910
- ]
17935
+ ] })
17911
17936
  }
17912
- ) });
17937
+ );
17913
17938
  };
17914
17939
  var Chart_default = Chart;
17915
17940
 
@@ -19310,9 +19335,12 @@ function Leaderboard({
19310
19335
  title = "LeaderBoard",
19311
19336
  className,
19312
19337
  isLoading = false,
19313
- legend
19338
+ legend,
19339
+ best = false,
19340
+ worst = false
19314
19341
  }) {
19315
19342
  const [order, setOrder] = (0, import_react101.useState)(initialOrder);
19343
+ const [searchTerm, setSearchTerm] = (0, import_react101.useState)("");
19316
19344
  const mockData = [
19317
19345
  { name: "Ana", value: 92 },
19318
19346
  { name: "Bruno", value: 81 },
@@ -19326,7 +19354,10 @@ function Leaderboard({
19326
19354
  { name: "Jo\xE3o", value: 18 }
19327
19355
  ];
19328
19356
  const data = items ?? mockData;
19329
- const sortedData = [...data].sort((a, b) => {
19357
+ const filteredData = data.filter(
19358
+ (item) => item.name.toLowerCase().includes(searchTerm.toLowerCase())
19359
+ );
19360
+ const sortedData = [...filteredData].sort((a, b) => {
19330
19361
  const aValue = typeof a.value === "string" ? parseFloat(a.value) || a.value : a.value;
19331
19362
  const bValue = typeof b.value === "string" ? parseFloat(b.value) || b.value : b.value;
19332
19363
  if (typeof aValue === "number" && typeof bValue === "number") {
@@ -19338,7 +19369,20 @@ function Leaderboard({
19338
19369
  if (typeof aValue === "number") return order === "desc" ? -1 : 1;
19339
19370
  return order === "desc" ? 1 : -1;
19340
19371
  });
19341
- const getBadgeColor = (value) => {
19372
+ const getBadgeColor = (value, index, total) => {
19373
+ if (best || worst) {
19374
+ const third = total / 3;
19375
+ if (best) {
19376
+ if (index < third) return "green";
19377
+ if (index < 2 * third) return "yellow";
19378
+ return "red";
19379
+ }
19380
+ if (worst) {
19381
+ if (index < third) return "red";
19382
+ if (index < 2 * third) return "yellow";
19383
+ return "green";
19384
+ }
19385
+ }
19342
19386
  const numValue = typeof value === "string" ? parseFloat(value) : value;
19343
19387
  if (isNaN(numValue)) return "green";
19344
19388
  if (numValue >= 75) return "red";
@@ -19348,31 +19392,48 @@ function Leaderboard({
19348
19392
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
19349
19393
  "div",
19350
19394
  {
19351
- className: `border rounded-xl flex flex-col max-h-80 w-96 ${className}`,
19395
+ className: `border rounded-xl flex flex-col max-h-80 w-96 ${className}`,
19352
19396
  children: [
19353
- /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between py-2 px-4 border-b flex-shrink-0 gap-3", children: [
19354
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("h2", { className: "text-lg font-semibold px-1", children: title }),
19397
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between py-2 px-4 border-b flex-shrink-0 gap-3 ", children: [
19398
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("h2", { className: "text-lg font-semibold px-1 whitespace-nowrap", children: title }),
19399
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "flex-1 max-w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
19400
+ InputBase,
19401
+ {
19402
+ value: searchTerm,
19403
+ onChange: (e) => setSearchTerm(e.target.value),
19404
+ placeholder: "Pesquisar...",
19405
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react100.MagnifyingGlassIcon, { size: 16 }),
19406
+ className: "h-8 py-1"
19407
+ }
19408
+ ) }),
19355
19409
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
19356
19410
  ButtonBase,
19357
19411
  {
19358
19412
  size: "icon",
19359
- variant: "ghost",
19413
+ variant: "outline",
19360
19414
  onClick: () => setOrder(order === "desc" ? "asc" : "desc"),
19361
19415
  disabled: isLoading || sortedData.length === 0,
19362
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react100.CaretUpDownIcon, {})
19416
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
19417
+ import_framer_motion22.motion.div,
19418
+ {
19419
+ animate: { rotate: order === "asc" ? 180 : 0 },
19420
+ transition: { type: "spring", stiffness: 300, damping: 20 },
19421
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react100.CaretUpDownIcon, {})
19422
+ }
19423
+ )
19363
19424
  }
19364
19425
  )
19365
19426
  ] }),
19366
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "overflow-y-auto flex-1", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between p-1", children: [
19427
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between p-1", children: [
19367
19428
  /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center gap-3 flex-1", children: [
19368
19429
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SkeletonBase, { className: "w-8 h-8 rounded-full" }),
19369
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SkeletonBase, { className: "h-4 w-36" })
19430
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SkeletonBase, { className: "h-4 w-36 rounded-full" })
19370
19431
  ] }),
19371
19432
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SkeletonBase, { className: "h-6 w-12 rounded-full" })
19372
19433
  ] }, idx)) }) : sortedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "flex items-center justify-center h-full py-12", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { className: "text-muted-foreground text-sm", children: "Sem dados dispon\xEDveis" }) }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
19373
19434
  /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between py-2.5 px-4 border-b flex-shrink-0 gap-3 sticky top-0 bg-background", children: [
19374
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider pl-1", children: legend?.[0]?.[0] ?? "Participante" }),
19375
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: legend?.[0]?.[1] ?? "Pontua\xE7\xE3o" })
19435
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider pl-1", children: legend?.[0] }),
19436
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: legend?.[1] })
19376
19437
  ] }),
19377
19438
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("ul", { children: sortedData.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
19378
19439
  import_framer_motion22.motion.span,
@@ -19382,13 +19443,13 @@ function Leaderboard({
19382
19443
  transition: { delay: idx * 5e-3 },
19383
19444
  children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("li", { className: "flex items-center justify-between py-3 border-b last:border-b-0 hover:bg-muted transition-colors px-4", children: [
19384
19445
  /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center gap-3", children: [
19385
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-sm text-gray-400 w-6 h-6 border rounded-full text-center bg-muted/50", children: idx + 1 }),
19446
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-sm text-gray-400 w-6 h-6 border rounded-full text-center bg-muted/50", children: order === "desc" ? idx + 1 : sortedData.length - idx }),
19386
19447
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "font-medium", children: item.name })
19387
19448
  ] }),
19388
19449
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
19389
19450
  Badge,
19390
19451
  {
19391
- color: getBadgeColor(item.value),
19452
+ color: getBadgeColor(item.value, idx, sortedData.length),
19392
19453
  size: "md",
19393
19454
  className: "font-bold",
19394
19455
  children: item.value
package/dist/index.mjs CHANGED
@@ -1190,14 +1190,14 @@ var Toaster = ({ testId, ...props }) => {
1190
1190
  text-foreground
1191
1191
  shadow-xl rounded-lg
1192
1192
  border-l-4
1193
- border-border
1193
+
1194
1194
  flex items-center gap-3
1195
1195
  transition-all duration-300
1196
1196
  hover:scale-[1.02] hover:shadow-2xl
1197
- data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50/95 data-[type=success]:text-green-800 data-[type=success]:border-green-500
1197
+ data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50/95 data-[type=success]:text-green-800 data-[type=success]:border-green-500 data-
1198
1198
  data-[type=error]:border-l-red-500 data-[type=error]:bg-red-50/95 data-[type=error]:text-red-800 data-[type=error]:border-red-500
1199
1199
  data-[type=warning]:border-l-yellow-500 data-[type=warning]:bg-yellow-50/95 data-[type=warning]:text-yellow-800 data-[type=warning]:border-yellow-500
1200
- data-[type=info]:border-l-blue-500 data-[type=info]:bg-blue-50/95 data-[type=info]:text-blue-800 data-[type=info]:border-blue-500
1200
+ data-[type=info]:border-l-blue-500 data-[type=info]:bg-blue-50/95 data-[type=info]:text-blue-800 data-[type=info]:border-blue-500
1201
1201
  `,
1202
1202
  description: `
1203
1203
  text-xs
@@ -14059,6 +14059,11 @@ function WeekView({
14059
14059
  // src/components/ui/selects/AvatarCombobox.tsx
14060
14060
  import { useId as useId3, useState as useState36 } from "react";
14061
14061
  import { CaretDownIcon as CaretDownIcon6, CheckIcon as CheckIcon11 } from "@phosphor-icons/react";
14062
+
14063
+ // public/pwa-512x512.png
14064
+ var pwa_512x512_default = "./pwa-512x512-4NJPUGCI.png";
14065
+
14066
+ // src/components/ui/selects/AvatarCombobox.tsx
14062
14067
  import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
14063
14068
  var DEFAULT_COLORS = [
14064
14069
  "bg-purple-100 text-purple-700",
@@ -14107,10 +14112,14 @@ function AvatarCombobox({
14107
14112
  const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
14108
14113
  const selectedItem = allItems.find((item) => item.value === selected);
14109
14114
  const renderItem = (item) => {
14110
- const avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
14111
- const colorClass = item.avatarClassName ?? getColor(item.value, colors2);
14115
+ let avatarContent;
14116
+ let colorClass;
14117
+ if (!item.img) {
14118
+ avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
14119
+ colorClass = item.avatarClassName ?? getColor(item.value, colors2);
14120
+ }
14112
14121
  return /* @__PURE__ */ jsxs63(Fragment13, { children: [
14113
- /* @__PURE__ */ jsx85(Square, { className: colorClass, children: avatarContent }),
14122
+ /* @__PURE__ */ jsx85(Square, { className: colorClass, children: !avatarContent ? /* @__PURE__ */ jsx85("img", { src: pwa_512x512_default }) : avatarContent }),
14114
14123
  /* @__PURE__ */ jsx85("span", { className: "truncate", children: item.label })
14115
14124
  ] });
14116
14125
  };
@@ -16142,7 +16151,7 @@ var Brush = ({
16142
16151
  /* @__PURE__ */ jsx94(
16143
16152
  "div",
16144
16153
  {
16145
- className: "absolute top-0 bottom-0 left-0 bg-muted/60 pointer-events-none rounded-md",
16154
+ className: "absolute top-0 bottom-0 left-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-l-md border-r border-border/50",
16146
16155
  style: {
16147
16156
  width: `${startIndex / (dataLength - 1) * 100}%`
16148
16157
  }
@@ -16151,7 +16160,7 @@ var Brush = ({
16151
16160
  /* @__PURE__ */ jsx94(
16152
16161
  "div",
16153
16162
  {
16154
- className: "absolute top-0 bottom-0 right-0 bg-muted/60 pointer-events-none rounded-md",
16163
+ className: "absolute top-0 bottom-0 right-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-r-md border-l border-border/50",
16155
16164
  style: {
16156
16165
  width: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`
16157
16166
  }
@@ -16160,18 +16169,18 @@ var Brush = ({
16160
16169
  /* @__PURE__ */ jsxs72(
16161
16170
  "div",
16162
16171
  {
16163
- className: "absolute top-0 bottom-0 border cursor-move group rounded-md border-primary/30",
16172
+ className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md",
16164
16173
  style: {
16165
16174
  left: `${startIndex / (dataLength - 1) * 100}%`,
16166
16175
  right: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`,
16167
- backgroundColor: "hsl(var(--primary) / 0.03)"
16176
+ backgroundColor: "transparent"
16168
16177
  },
16169
16178
  onMouseDown: (e) => onMouseDown(e, "middle"),
16170
16179
  children: [
16171
16180
  /* @__PURE__ */ jsx94(
16172
16181
  "div",
16173
16182
  {
16174
- className: "absolute top-1/2 -translate-y-1/2 -left-3 w-6 h-10 flex items-center justify-center cursor-ew-resize active:scale-95 transition-all",
16183
+ className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
16175
16184
  onMouseDown: (e) => {
16176
16185
  e.stopPropagation();
16177
16186
  onMouseDown(e, "start");
@@ -16179,9 +16188,9 @@ var Brush = ({
16179
16188
  children: /* @__PURE__ */ jsx94(
16180
16189
  "div",
16181
16190
  {
16182
- className: "w-2 h-7 rounded-full shadow-md ring-2 ring-background flex flex-col items-center justify-center gap-0.5",
16191
+ className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
16183
16192
  style: {
16184
- backgroundColor: brushColor ?? "hsl(var(--primary) / 0.7)"
16193
+ backgroundColor: brushColor ?? "hsl(var(--primary))"
16185
16194
  }
16186
16195
  }
16187
16196
  )
@@ -16190,7 +16199,7 @@ var Brush = ({
16190
16199
  /* @__PURE__ */ jsx94(
16191
16200
  "div",
16192
16201
  {
16193
- className: "absolute top-1/2 -translate-y-1/2 -right-3 w-6 h-10 flex items-center justify-center cursor-ew-resize active:scale-95 transition-all",
16202
+ className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
16194
16203
  onMouseDown: (e) => {
16195
16204
  e.stopPropagation();
16196
16205
  onMouseDown(e, "end");
@@ -16198,9 +16207,9 @@ var Brush = ({
16198
16207
  children: /* @__PURE__ */ jsx94(
16199
16208
  "div",
16200
16209
  {
16201
- className: "w-2 h-7 rounded-full shadow-md ring-2 ring-background flex flex-col items-center justify-center gap-0.5",
16210
+ className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
16202
16211
  style: {
16203
- backgroundColor: brushColor ?? "hsl(var(--primary) / 0.7)"
16212
+ backgroundColor: brushColor ?? "hsl(var(--primary))"
16204
16213
  }
16205
16214
  }
16206
16215
  )
@@ -17069,12 +17078,7 @@ var Chart = ({
17069
17078
  }
17070
17079
  return timeSeries;
17071
17080
  }, [timeSeries]);
17072
- const {
17073
- startIndex,
17074
- endIndex,
17075
- brushRef,
17076
- handleMouseDown
17077
- } = useTimeSeriesRange({
17081
+ const { startIndex, endIndex, brushRef, handleMouseDown } = useTimeSeriesRange({
17078
17082
  dataLength: data.length,
17079
17083
  defaultStartIndex: timeSeriesConfig?.start,
17080
17084
  defaultEndIndex: timeSeriesConfig?.end,
@@ -17215,6 +17219,7 @@ var Chart = ({
17215
17219
  );
17216
17220
  const finalChartTopMargin = chartMargin?.top ?? (showLabels ? 48 : 20);
17217
17221
  const finalChartBottomMargin = (chartMargin?.bottom ?? 5) + (xAxisLabel ? 22 : 0) + (showLegend ? 36 : 0);
17222
+ const HORIZONTAL_PADDING_CLASS = "px-20";
17218
17223
  const effectiveChartWidth = typeof width === "number" ? width : measuredWidth ? Math.max(0, measuredWidth - 32) : computedWidth;
17219
17224
  const chartInnerWidth = effectiveChartWidth - finalChartLeftMargin - finalChartRightMargin;
17220
17225
  const leftYAxisLabelDx = -Math.max(12, Math.round(yAxisTickWidth / 2));
@@ -17284,63 +17289,83 @@ var Chart = ({
17284
17289
  }
17285
17290
  );
17286
17291
  }
17287
- return /* @__PURE__ */ jsx97("div", { ref: wrapperRef, className: "w-full overflow-hidden min-w-0", children: /* @__PURE__ */ jsxs75(
17292
+ return /* @__PURE__ */ jsx97(
17288
17293
  "div",
17289
17294
  {
17290
- className: cn(
17291
- "rounded-lg bg-card relative w-full max-w-full min-w-0",
17292
- className
17293
- ),
17294
- children: [
17295
+ ref: wrapperRef,
17296
+ className: cn("w-full overflow-hidden min-w-0 rounded-lg", className),
17297
+ children: /* @__PURE__ */ jsxs75("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0", children: [
17295
17298
  title && /* @__PURE__ */ jsx97(
17296
17299
  "div",
17297
17300
  {
17298
17301
  className: cn(
17299
- "w-full flex items-center mt-[19px] ml-[90px]",
17302
+ "w-full flex items-center mt-5",
17303
+ HORIZONTAL_PADDING_CLASS,
17300
17304
  titlePosition === "center" && "justify-center",
17301
17305
  titlePosition === "right" && "justify-end",
17302
17306
  titlePosition === "left" && "justify-start"
17303
17307
  ),
17304
- children: /* @__PURE__ */ jsx97("div", { className: "text-[1.4rem] font-semibold text-foreground mb-3", children: title })
17308
+ children: /* @__PURE__ */ jsxs75("div", { className: "text-[1.4rem] font-semibold text-foreground mb-3", children: [
17309
+ title,
17310
+ /* @__PURE__ */ jsx97(
17311
+ "div",
17312
+ {
17313
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none z-50 select-text overflow-hidden",
17314
+ "aria-hidden": "true",
17315
+ children: /* @__PURE__ */ jsx97("div", { className: "text-[1.6rem] font-bold text-transparent selection:bg-primary selection:text-primary-foreground whitespace-nowrap", children: "Eduardo Ronchi de Araujo Desenvolvidor de Sistemas Junio" })
17316
+ }
17317
+ )
17318
+ ] })
17319
+ }
17320
+ ),
17321
+ allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ jsxs75(
17322
+ "div",
17323
+ {
17324
+ className: cn(
17325
+ "flex items-center gap-2 mb-2",
17326
+ HORIZONTAL_PADDING_CLASS
17327
+ ),
17328
+ children: [
17329
+ enableHighlights && /* @__PURE__ */ jsx97(
17330
+ Highlights_default,
17331
+ {
17332
+ allKeys,
17333
+ mapperConfig,
17334
+ finalColors,
17335
+ highlightedSeries,
17336
+ toggleHighlight,
17337
+ containerWidth: chartInnerWidth
17338
+ }
17339
+ ),
17340
+ enableShowOnly && /* @__PURE__ */ jsx97(
17341
+ ShowOnly_default,
17342
+ {
17343
+ showOnlyHighlighted,
17344
+ setShowOnlyHighlighted,
17345
+ highlightedSeriesSize: highlightedSeries.size,
17346
+ clearHighlights
17347
+ }
17348
+ ),
17349
+ enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx97("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx97(
17350
+ PeriodsDropdown_default,
17351
+ {
17352
+ processedData,
17353
+ onOpenPeriod: openTooltipForPeriod,
17354
+ rightOffset: finalChartRightMargin,
17355
+ activePeriods
17356
+ }
17357
+ ) })
17358
+ ]
17305
17359
  }
17306
17360
  ),
17307
- allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ jsxs75("div", { className: "flex items-center w-[98%] ml-[90px] gap-2", children: [
17308
- enableHighlights && /* @__PURE__ */ jsx97(
17309
- Highlights_default,
17310
- {
17311
- allKeys,
17312
- mapperConfig,
17313
- finalColors,
17314
- highlightedSeries,
17315
- toggleHighlight,
17316
- containerWidth: chartInnerWidth
17317
- }
17318
- ),
17319
- enableShowOnly && /* @__PURE__ */ jsx97(
17320
- ShowOnly_default,
17321
- {
17322
- showOnlyHighlighted,
17323
- setShowOnlyHighlighted,
17324
- highlightedSeriesSize: highlightedSeries.size,
17325
- clearHighlights
17326
- }
17327
- ),
17328
- enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx97("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx97(
17329
- PeriodsDropdown_default,
17330
- {
17331
- processedData,
17332
- onOpenPeriod: openTooltipForPeriod,
17333
- rightOffset: finalChartRightMargin,
17334
- activePeriods
17335
- }
17336
- ) })
17337
- ] }),
17338
17361
  !(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx97(
17339
17362
  "div",
17340
17363
  {
17341
- className: "w-full flex justify-end",
17364
+ className: cn(
17365
+ "w-full flex justify-end mb-2",
17366
+ HORIZONTAL_PADDING_CLASS
17367
+ ),
17342
17368
  style: {
17343
- paddingLeft: `${CONTAINER_PADDING_LEFT + finalChartLeftMargin}px`,
17344
17369
  paddingRight: `${finalChartRightMargin}px`,
17345
17370
  maxWidth: `${chartInnerWidth}px`
17346
17371
  },
@@ -17740,9 +17765,9 @@ var Chart = ({
17740
17765
  }
17741
17766
  }
17742
17767
  )
17743
- ]
17768
+ ] })
17744
17769
  }
17745
- ) });
17770
+ );
17746
17771
  };
17747
17772
  var Chart_default = Chart;
17748
17773
 
@@ -19159,7 +19184,7 @@ var TimeSeries = ({
19159
19184
  var TimeSeries_default = TimeSeries;
19160
19185
 
19161
19186
  // src/components/ui/LeaderBoard.tsx
19162
- import { CaretUpDownIcon as CaretUpDownIcon3 } from "@phosphor-icons/react";
19187
+ import { CaretUpDownIcon as CaretUpDownIcon3, MagnifyingGlassIcon as MagnifyingGlassIcon3 } from "@phosphor-icons/react";
19163
19188
  import { useState as useState46 } from "react";
19164
19189
  import { motion as motion22 } from "framer-motion";
19165
19190
  import { jsx as jsx102, jsxs as jsxs79 } from "react/jsx-runtime";
@@ -19169,9 +19194,12 @@ function Leaderboard({
19169
19194
  title = "LeaderBoard",
19170
19195
  className,
19171
19196
  isLoading = false,
19172
- legend
19197
+ legend,
19198
+ best = false,
19199
+ worst = false
19173
19200
  }) {
19174
19201
  const [order, setOrder] = useState46(initialOrder);
19202
+ const [searchTerm, setSearchTerm] = useState46("");
19175
19203
  const mockData = [
19176
19204
  { name: "Ana", value: 92 },
19177
19205
  { name: "Bruno", value: 81 },
@@ -19185,7 +19213,10 @@ function Leaderboard({
19185
19213
  { name: "Jo\xE3o", value: 18 }
19186
19214
  ];
19187
19215
  const data = items ?? mockData;
19188
- const sortedData = [...data].sort((a, b) => {
19216
+ const filteredData = data.filter(
19217
+ (item) => item.name.toLowerCase().includes(searchTerm.toLowerCase())
19218
+ );
19219
+ const sortedData = [...filteredData].sort((a, b) => {
19189
19220
  const aValue = typeof a.value === "string" ? parseFloat(a.value) || a.value : a.value;
19190
19221
  const bValue = typeof b.value === "string" ? parseFloat(b.value) || b.value : b.value;
19191
19222
  if (typeof aValue === "number" && typeof bValue === "number") {
@@ -19197,7 +19228,20 @@ function Leaderboard({
19197
19228
  if (typeof aValue === "number") return order === "desc" ? -1 : 1;
19198
19229
  return order === "desc" ? 1 : -1;
19199
19230
  });
19200
- const getBadgeColor = (value) => {
19231
+ const getBadgeColor = (value, index, total) => {
19232
+ if (best || worst) {
19233
+ const third = total / 3;
19234
+ if (best) {
19235
+ if (index < third) return "green";
19236
+ if (index < 2 * third) return "yellow";
19237
+ return "red";
19238
+ }
19239
+ if (worst) {
19240
+ if (index < third) return "red";
19241
+ if (index < 2 * third) return "yellow";
19242
+ return "green";
19243
+ }
19244
+ }
19201
19245
  const numValue = typeof value === "string" ? parseFloat(value) : value;
19202
19246
  if (isNaN(numValue)) return "green";
19203
19247
  if (numValue >= 75) return "red";
@@ -19207,31 +19251,48 @@ function Leaderboard({
19207
19251
  return /* @__PURE__ */ jsxs79(
19208
19252
  "div",
19209
19253
  {
19210
- className: `border rounded-xl flex flex-col max-h-80 w-96 ${className}`,
19254
+ className: `border rounded-xl flex flex-col max-h-80 w-96 ${className}`,
19211
19255
  children: [
19212
- /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between py-2 px-4 border-b flex-shrink-0 gap-3", children: [
19213
- /* @__PURE__ */ jsx102("h2", { className: "text-lg font-semibold px-1", children: title }),
19256
+ /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between py-2 px-4 border-b flex-shrink-0 gap-3 ", children: [
19257
+ /* @__PURE__ */ jsx102("h2", { className: "text-lg font-semibold px-1 whitespace-nowrap", children: title }),
19258
+ /* @__PURE__ */ jsx102("div", { className: "flex-1 max-w-[200px]", children: /* @__PURE__ */ jsx102(
19259
+ InputBase,
19260
+ {
19261
+ value: searchTerm,
19262
+ onChange: (e) => setSearchTerm(e.target.value),
19263
+ placeholder: "Pesquisar...",
19264
+ leftIcon: /* @__PURE__ */ jsx102(MagnifyingGlassIcon3, { size: 16 }),
19265
+ className: "h-8 py-1"
19266
+ }
19267
+ ) }),
19214
19268
  /* @__PURE__ */ jsx102(
19215
19269
  ButtonBase,
19216
19270
  {
19217
19271
  size: "icon",
19218
- variant: "ghost",
19272
+ variant: "outline",
19219
19273
  onClick: () => setOrder(order === "desc" ? "asc" : "desc"),
19220
19274
  disabled: isLoading || sortedData.length === 0,
19221
- children: /* @__PURE__ */ jsx102(CaretUpDownIcon3, {})
19275
+ children: /* @__PURE__ */ jsx102(
19276
+ motion22.div,
19277
+ {
19278
+ animate: { rotate: order === "asc" ? 180 : 0 },
19279
+ transition: { type: "spring", stiffness: 300, damping: 20 },
19280
+ children: /* @__PURE__ */ jsx102(CaretUpDownIcon3, {})
19281
+ }
19282
+ )
19222
19283
  }
19223
19284
  )
19224
19285
  ] }),
19225
- /* @__PURE__ */ jsx102("div", { className: "overflow-y-auto flex-1", children: isLoading ? /* @__PURE__ */ jsx102("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between p-1", children: [
19286
+ /* @__PURE__ */ jsx102("div", { className: "overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: isLoading ? /* @__PURE__ */ jsx102("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between p-1", children: [
19226
19287
  /* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-3 flex-1", children: [
19227
19288
  /* @__PURE__ */ jsx102(SkeletonBase, { className: "w-8 h-8 rounded-full" }),
19228
- /* @__PURE__ */ jsx102(SkeletonBase, { className: "h-4 w-36" })
19289
+ /* @__PURE__ */ jsx102(SkeletonBase, { className: "h-4 w-36 rounded-full" })
19229
19290
  ] }),
19230
19291
  /* @__PURE__ */ jsx102(SkeletonBase, { className: "h-6 w-12 rounded-full" })
19231
19292
  ] }, idx)) }) : sortedData.length === 0 ? /* @__PURE__ */ jsx102("div", { className: "flex items-center justify-center h-full py-12", children: /* @__PURE__ */ jsx102("p", { className: "text-muted-foreground text-sm", children: "Sem dados dispon\xEDveis" }) }) : /* @__PURE__ */ jsxs79("div", { children: [
19232
19293
  /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between py-2.5 px-4 border-b flex-shrink-0 gap-3 sticky top-0 bg-background", children: [
19233
- /* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider pl-1", children: legend?.[0]?.[0] ?? "Participante" }),
19234
- /* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: legend?.[0]?.[1] ?? "Pontua\xE7\xE3o" })
19294
+ /* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider pl-1", children: legend?.[0] }),
19295
+ /* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: legend?.[1] })
19235
19296
  ] }),
19236
19297
  /* @__PURE__ */ jsx102("ul", { children: sortedData.map((item, idx) => /* @__PURE__ */ jsx102(
19237
19298
  motion22.span,
@@ -19241,13 +19302,13 @@ function Leaderboard({
19241
19302
  transition: { delay: idx * 5e-3 },
19242
19303
  children: /* @__PURE__ */ jsxs79("li", { className: "flex items-center justify-between py-3 border-b last:border-b-0 hover:bg-muted transition-colors px-4", children: [
19243
19304
  /* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-3", children: [
19244
- /* @__PURE__ */ jsx102("span", { className: "text-sm text-gray-400 w-6 h-6 border rounded-full text-center bg-muted/50", children: idx + 1 }),
19305
+ /* @__PURE__ */ jsx102("span", { className: "text-sm text-gray-400 w-6 h-6 border rounded-full text-center bg-muted/50", children: order === "desc" ? idx + 1 : sortedData.length - idx }),
19245
19306
  /* @__PURE__ */ jsx102("span", { className: "font-medium", children: item.name })
19246
19307
  ] }),
19247
19308
  /* @__PURE__ */ jsx102(
19248
19309
  Badge,
19249
19310
  {
19250
- color: getBadgeColor(item.value),
19311
+ color: getBadgeColor(item.value, idx, sortedData.length),
19251
19312
  size: "md",
19252
19313
  className: "font-bold",
19253
19314
  children: item.value
Binary file
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@mlw-packages/react-components",
3
+ "developer": "Eduardo Ronchi de Araujo - Desenvolvidor de Sistemas Junio",
3
4
  "publishConfig": {
4
5
  "access": "public"
5
6
  },
6
- "version": "1.8.6",
7
+ "version": "1.8.7",
7
8
  "homepage": "https://main--68e80310a069c2f10b546ef3.chromatic.com/",
8
9
  "repository": {
9
10
  "type": "git",