analytica-frontend-lib 1.0.57 → 1.0.59

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
@@ -63,6 +63,14 @@ __export(src_exports, {
63
63
  SelectTrigger: () => SelectTrigger,
64
64
  SelectValue: () => SelectValue,
65
65
  SelectionButton: () => SelectionButton_default,
66
+ Skeleton: () => Skeleton,
67
+ SkeletonCard: () => SkeletonCard,
68
+ SkeletonCircle: () => SkeletonCircle,
69
+ SkeletonList: () => SkeletonList,
70
+ SkeletonRectangle: () => SkeletonRectangle,
71
+ SkeletonRounded: () => SkeletonRounded,
72
+ SkeletonTable: () => SkeletonTable,
73
+ SkeletonText: () => SkeletonText,
66
74
  Stepper: () => Stepper_default,
67
75
  Table: () => Table_default,
68
76
  Text: () => Text_default,
@@ -3724,9 +3732,16 @@ var Menu = (0, import_react13.forwardRef)(
3724
3732
  (0, import_react13.useEffect)(() => {
3725
3733
  setValue(propValue ?? defaultValue);
3726
3734
  }, [defaultValue, propValue, setValue]);
3735
+ const onValueChangeRef = (0, import_react13.useRef)(onValueChange);
3736
+ const isInitializedRef = (0, import_react13.useRef)(false);
3737
+ onValueChangeRef.current = onValueChange;
3727
3738
  (0, import_react13.useEffect)(() => {
3728
- onValueChange?.(value);
3729
- }, [value, onValueChange]);
3739
+ if (isInitializedRef.current) {
3740
+ onValueChangeRef.current?.(value);
3741
+ } else {
3742
+ isInitializedRef.current = true;
3743
+ }
3744
+ }, [value]);
3730
3745
  const baseClasses = "w-full py-2 px-6 flex flex-row items-center justify-center";
3731
3746
  const variantClasses = VARIANT_CLASSES5[variant];
3732
3747
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
@@ -3831,9 +3846,9 @@ var MenuItem = (0, import_react13.forwardRef)(
3831
3846
  {
3832
3847
  "data-variant": "breadcrumb",
3833
3848
  className: `
3834
- w-full p-2 rounded-lg hover:text-primary-600 cursor-pointer font-bold text-xs
3849
+ w-full p-2 rounded-lg hover:text-primary-600 cursor-pointer font-bold text-xs
3835
3850
  focus:outline-none focus:border-indicator-info focus:border-2
3836
- ${selectedValue === value ? "text-primary-950" : "text-text-600"}
3851
+ ${selectedValue === value ? "text-text-950" : "text-text-600"}
3837
3852
  ${className ?? ""}
3838
3853
  `,
3839
3854
  ...commonProps,
@@ -3841,8 +3856,8 @@ var MenuItem = (0, import_react13.forwardRef)(
3841
3856
  "span",
3842
3857
  {
3843
3858
  className: `
3844
- border-b border-text-600 hover:border-primary-600 text-inherit
3845
- ${selectedValue === value ? "border-b-primary-950" : "border-b-primary-600"}
3859
+ border-b border-text-600 hover:border-primary-600 text-inherit text-xs
3860
+ ${selectedValue === value ? "border-b-0 font-bold" : "border-b-primary-600"}
3846
3861
  `,
3847
3862
  children
3848
3863
  }
@@ -3966,6 +3981,58 @@ var Menu_default = Menu;
3966
3981
  var import_react14 = require("react");
3967
3982
  var import_phosphor_react13 = require("phosphor-react");
3968
3983
  var import_jsx_runtime26 = require("react/jsx-runtime");
3984
+ var CARD_BASE_CLASSES = {
3985
+ default: "w-full bg-background border border-border-50 rounded-xl",
3986
+ compact: "w-full bg-background border border-border-50 rounded-lg",
3987
+ minimal: "w-full bg-background border border-border-100 rounded-md"
3988
+ };
3989
+ var CARD_PADDING_CLASSES = {
3990
+ none: "",
3991
+ small: "p-2",
3992
+ medium: "p-4",
3993
+ large: "p-6"
3994
+ };
3995
+ var CARD_MIN_HEIGHT_CLASSES = {
3996
+ none: "",
3997
+ small: "min-h-16",
3998
+ medium: "min-h-20",
3999
+ large: "min-h-24"
4000
+ };
4001
+ var CARD_LAYOUT_CLASSES = {
4002
+ horizontal: "flex flex-row",
4003
+ vertical: "flex flex-col"
4004
+ };
4005
+ var CARD_CURSOR_CLASSES = {
4006
+ default: "",
4007
+ pointer: "cursor-pointer"
4008
+ };
4009
+ var CardBase = (0, import_react14.forwardRef)(
4010
+ ({
4011
+ children,
4012
+ variant = "default",
4013
+ layout = "horizontal",
4014
+ padding = "medium",
4015
+ minHeight = "medium",
4016
+ cursor = "default",
4017
+ className = "",
4018
+ ...props
4019
+ }, ref) => {
4020
+ const baseClasses = CARD_BASE_CLASSES[variant];
4021
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
4022
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
4023
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
4024
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
4025
+ const combinedClasses = [
4026
+ baseClasses,
4027
+ paddingClasses,
4028
+ minHeightClasses,
4029
+ layoutClasses,
4030
+ cursorClasses,
4031
+ className
4032
+ ].filter(Boolean).join(" ");
4033
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: combinedClasses, ...props, children });
4034
+ }
4035
+ );
3969
4036
  var ACTION_CARD_CLASSES = {
3970
4037
  warning: "bg-warning-background",
3971
4038
  success: "bg-success-300",
@@ -4028,7 +4095,7 @@ var CardActivesResults = (0, import_react14.forwardRef)(
4028
4095
  children: icon
4029
4096
  }
4030
4097
  ),
4031
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 font-medium uppercase text-2xs", children: title }),
4098
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text_default, { size: "2xs", weight: "medium", className: "text-text-800 uppercase", children: title }),
4032
4099
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: `text-lg font-bold ${actionSubTitleClasses}`, children: subTitle })
4033
4100
  ]
4034
4101
  }
@@ -4061,13 +4128,13 @@ var CardQuestions = (0, import_react14.forwardRef)(
4061
4128
  const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
4062
4129
  const buttonLabel = isDone ? "Ver Quest\xE3o" : "Responder";
4063
4130
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4064
- "div",
4131
+ CardBase,
4065
4132
  {
4066
4133
  ref,
4067
- className: `
4068
- w-full flex flex-row justify-between rounded-xl p-4 gap-4 bg-background border border-border-50
4069
- ${className}
4070
- `,
4134
+ layout: "horizontal",
4135
+ padding: "medium",
4136
+ minHeight: "medium",
4137
+ className: `justify-between gap-4 ${className}`,
4071
4138
  ...props,
4072
4139
  children: [
4073
4140
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "flex flex-col gap-1", children: [
@@ -4127,35 +4194,48 @@ var CardProgress = (0, import_react14.forwardRef)(
4127
4194
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-600", children: endDate })
4128
4195
  ] })
4129
4196
  ] }),
4130
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4131
- ProgressBar_default,
4132
- {
4133
- size: "medium",
4134
- showPercentage: true,
4135
- value: progress,
4136
- "data-testid": "progress-bar"
4137
- }
4138
- )
4197
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
4198
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4199
+ ProgressBar_default,
4200
+ {
4201
+ size: "small",
4202
+ value: progress,
4203
+ "data-testid": "progress-bar"
4204
+ }
4205
+ ),
4206
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4207
+ Text_default,
4208
+ {
4209
+ size: "xs",
4210
+ weight: "medium",
4211
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
4212
+ children: [
4213
+ Math.round(progress),
4214
+ "%"
4215
+ ]
4216
+ }
4217
+ )
4218
+ ] })
4139
4219
  ] }),
4140
4220
  vertical: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-text-800", children: subhead })
4141
4221
  };
4142
4222
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4143
- "div",
4223
+ CardBase,
4144
4224
  {
4145
4225
  ref,
4146
- className: `
4147
- w-full flex border border-border-50 bg-background rounded-xl
4148
- ${isHorizontal ? "flex-row h-20" : "flex-col"}
4149
- ${className}
4150
- `,
4226
+ layout: isHorizontal ? "horizontal" : "vertical",
4227
+ padding: "none",
4228
+ minHeight: "medium",
4229
+ cursor: "pointer",
4230
+ className: `${isHorizontal ? "h-20" : ""} ${className}`,
4151
4231
  ...props,
4152
4232
  children: [
4153
4233
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4154
4234
  "div",
4155
4235
  {
4156
4236
  className: `
4157
- flex justify-center items-center [&>svg]:size-8 text-text-950
4158
- ${isHorizontal ? "w-20 h-full rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
4237
+ flex justify-center items-center [&>svg]:size-6 text-text-950
4238
+ ${isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
4159
4239
  `,
4160
4240
  style: {
4161
4241
  backgroundColor: color
@@ -4171,7 +4251,7 @@ var CardProgress = (0, import_react14.forwardRef)(
4171
4251
  ${!isHorizontal && "gap-4"}
4172
4252
  `,
4173
4253
  children: [
4174
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
4254
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: header }),
4175
4255
  contentComponent[direction]
4176
4256
  ]
4177
4257
  }
@@ -4191,18 +4271,43 @@ var CardTopic = (0, import_react14.forwardRef)(
4191
4271
  ...props
4192
4272
  }, ref) => {
4193
4273
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4194
- "div",
4274
+ CardBase,
4195
4275
  {
4196
4276
  ref,
4197
- className: `w-full py-2 px-4 flex flex-col justify-center gap-2 bg-background border border-border-50 rounded-xl min-h-20 ${className}`,
4277
+ layout: "vertical",
4278
+ padding: "small",
4279
+ minHeight: "medium",
4280
+ cursor: "pointer",
4281
+ className: `justify-center gap-2 py-2 px-4 ${className}`,
4198
4282
  ...props,
4199
4283
  children: [
4200
4284
  subHead && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react14.Fragment, { children: [
4201
4285
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: text }),
4202
4286
  index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: "\u2022" })
4203
4287
  ] }, `${text} - ${index}`)) }),
4204
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-text-950 font-bold", children: header }),
4205
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ProgressBar_default, { showPercentage, value: progress })
4288
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-text-950 font-bold", children: header }),
4289
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
4290
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4291
+ ProgressBar_default,
4292
+ {
4293
+ size: "small",
4294
+ value: progress,
4295
+ "data-testid": "progress-bar"
4296
+ }
4297
+ ),
4298
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4299
+ Text_default,
4300
+ {
4301
+ size: "xs",
4302
+ weight: "medium",
4303
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
4304
+ children: [
4305
+ Math.round(progress),
4306
+ "%"
4307
+ ]
4308
+ }
4309
+ )
4310
+ ] })
4206
4311
  ]
4207
4312
  }
4208
4313
  );
@@ -4220,15 +4325,18 @@ var CardPerformance = (0, import_react14.forwardRef)(
4220
4325
  }, ref) => {
4221
4326
  const hasProgress = progress !== void 0;
4222
4327
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4223
- "div",
4328
+ CardBase,
4224
4329
  {
4225
4330
  ref,
4226
- className: `w-full min-h-20.5 flex flex-row justify-between p-4 gap-2 bg-background border border-border-50 ${className}`,
4331
+ layout: "horizontal",
4332
+ padding: "medium",
4333
+ minHeight: "large",
4334
+ className: `justify-between gap-2 ${className}`,
4227
4335
  ...props,
4228
4336
  children: [
4229
4337
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
4230
4338
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-row justify-between items-center", children: [
4231
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-md font-bold text-text-950", children: header }),
4339
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-lg font-bold text-text-950", children: header }),
4232
4340
  hasProgress && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4233
4341
  Button_default,
4234
4342
  {
@@ -4244,7 +4352,7 @@ var CardPerformance = (0, import_react14.forwardRef)(
4244
4352
  !hasProgress && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4245
4353
  import_phosphor_react13.CaretRight,
4246
4354
  {
4247
- className: "size-4.5 text-text-800",
4355
+ className: "size-4.5 text-text-800 cursor-pointer",
4248
4356
  "data-testid": "caret-icon",
4249
4357
  onClick: () => onClickButton?.(valueButton)
4250
4358
  }
@@ -4267,13 +4375,13 @@ var CardResults = (0, import_react14.forwardRef)(
4267
4375
  }, ref) => {
4268
4376
  const isRow = direction == "row";
4269
4377
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4270
- "div",
4378
+ CardBase,
4271
4379
  {
4272
4380
  ref,
4273
- className: `
4274
- w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
4275
- ${className}
4276
- `,
4381
+ layout: "horizontal",
4382
+ padding: "none",
4383
+ minHeight: "medium",
4384
+ className: `items-center pr-4 ${className}`,
4277
4385
  ...props,
4278
4386
  children: [
4279
4387
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -4296,7 +4404,7 @@ var CardResults = (0, import_react14.forwardRef)(
4296
4404
  ${isRow ? "flex-row items-center" : "flex-col"}
4297
4405
  `,
4298
4406
  children: [
4299
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
4407
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-bold text-text-950", children: header }),
4300
4408
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
4301
4409
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4302
4410
  Badge_default,
@@ -4328,7 +4436,7 @@ var CardResults = (0, import_react14.forwardRef)(
4328
4436
  ]
4329
4437
  }
4330
4438
  ),
4331
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
4439
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer" })
4332
4440
  ]
4333
4441
  }
4334
4442
  );
@@ -4337,13 +4445,13 @@ var CardResults = (0, import_react14.forwardRef)(
4337
4445
  var CardStatus = (0, import_react14.forwardRef)(
4338
4446
  ({ header, className, status, ...props }, ref) => {
4339
4447
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4340
- "div",
4448
+ CardBase,
4341
4449
  {
4342
4450
  ref,
4343
- className: `
4344
- w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
4345
- ${className}
4346
- `,
4451
+ layout: "horizontal",
4452
+ padding: "none",
4453
+ minHeight: "medium",
4454
+ className: `items-center pr-4 ${className}`,
4347
4455
  ...props,
4348
4456
  children: [
4349
4457
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
@@ -4353,7 +4461,7 @@ var CardStatus = (0, import_react14.forwardRef)(
4353
4461
  p-4 flex justify-between w-full h-full flex-row items-center
4354
4462
  `,
4355
4463
  children: [
4356
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
4464
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-bold text-text-950", children: header }),
4357
4465
  status && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
4358
4466
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4359
4467
  Badge_default,
@@ -4370,7 +4478,7 @@ var CardStatus = (0, import_react14.forwardRef)(
4370
4478
  ]
4371
4479
  }
4372
4480
  ),
4373
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
4481
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer" })
4374
4482
  ]
4375
4483
  }
4376
4484
  );
@@ -4379,15 +4487,18 @@ var CardStatus = (0, import_react14.forwardRef)(
4379
4487
  var CardSettings = (0, import_react14.forwardRef)(
4380
4488
  ({ header, className, icon, ...props }, ref) => {
4381
4489
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4382
- "div",
4490
+ CardBase,
4383
4491
  {
4384
4492
  ref,
4385
- className: `w-full p-2 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
4493
+ layout: "horizontal",
4494
+ padding: "small",
4495
+ minHeight: "none",
4496
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
4386
4497
  ...props,
4387
4498
  children: [
4388
4499
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
4389
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "w-full text-md", children: header }),
4390
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { size: 24 })
4500
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "w-full text-sm", children: header }),
4501
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { size: 24, className: "cursor-pointer" })
4391
4502
  ]
4392
4503
  }
4393
4504
  );
@@ -4396,10 +4507,13 @@ var CardSettings = (0, import_react14.forwardRef)(
4396
4507
  var CardSupport = (0, import_react14.forwardRef)(
4397
4508
  ({ header, className, direction = "col", children, ...props }, ref) => {
4398
4509
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4399
- "div",
4510
+ CardBase,
4400
4511
  {
4401
4512
  ref,
4402
- className: `w-full p-4 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
4513
+ layout: "horizontal",
4514
+ padding: "medium",
4515
+ minHeight: "none",
4516
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
4403
4517
  ...props,
4404
4518
  children: [
4405
4519
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
@@ -4409,12 +4523,12 @@ var CardSupport = (0, import_react14.forwardRef)(
4409
4523
  w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
4410
4524
  `,
4411
4525
  children: [
4412
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-text-950 font-bold", children: header }) }),
4526
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-text-950 font-bold", children: header }) }),
4413
4527
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex flex-row gap-1", children })
4414
4528
  ]
4415
4529
  }
4416
4530
  ),
4417
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "text-text-800", size: 24 })
4531
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
4418
4532
  ]
4419
4533
  }
4420
4534
  );
@@ -4435,10 +4549,14 @@ var CardForum = (0, import_react14.forwardRef)(
4435
4549
  ...props
4436
4550
  }, ref) => {
4437
4551
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4438
- "div",
4552
+ CardBase,
4439
4553
  {
4440
4554
  ref,
4441
- className: `w-auto h-auto p-4 rounded-lg flex flex-row gap-3 border border-border-100 bg-background ${className}`,
4555
+ layout: "horizontal",
4556
+ padding: "medium",
4557
+ minHeight: "none",
4558
+ variant: "minimal",
4559
+ className: `w-auto h-auto gap-3 ${className}`,
4442
4560
  ...props,
4443
4561
  children: [
4444
4562
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -4483,6 +4601,395 @@ var CardForum = (0, import_react14.forwardRef)(
4483
4601
  );
4484
4602
  }
4485
4603
  );
4604
+ var CardAudio = (0, import_react14.forwardRef)(
4605
+ ({
4606
+ src,
4607
+ title,
4608
+ onPlay,
4609
+ onPause,
4610
+ onEnded,
4611
+ onAudioTimeUpdate,
4612
+ loop = false,
4613
+ preload = "metadata",
4614
+ tracks,
4615
+ className,
4616
+ ...props
4617
+ }, ref) => {
4618
+ const [isPlaying, setIsPlaying] = (0, import_react14.useState)(false);
4619
+ const [currentTime, setCurrentTime] = (0, import_react14.useState)(0);
4620
+ const [duration, setDuration] = (0, import_react14.useState)(0);
4621
+ const [volume, setVolume] = (0, import_react14.useState)(1);
4622
+ const [showVolumeControl, setShowVolumeControl] = (0, import_react14.useState)(false);
4623
+ const audioRef = (0, import_react14.useRef)(null);
4624
+ const formatTime = (time) => {
4625
+ const minutes = Math.floor(time / 60);
4626
+ const seconds = Math.floor(time % 60);
4627
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
4628
+ };
4629
+ const handlePlayPause = () => {
4630
+ if (isPlaying) {
4631
+ audioRef.current?.pause();
4632
+ setIsPlaying(false);
4633
+ onPause?.();
4634
+ } else {
4635
+ audioRef.current?.play();
4636
+ setIsPlaying(true);
4637
+ onPlay?.();
4638
+ }
4639
+ };
4640
+ const handleTimeUpdate = () => {
4641
+ const current = audioRef.current?.currentTime ?? 0;
4642
+ const total = audioRef.current?.duration ?? 0;
4643
+ setCurrentTime(current);
4644
+ setDuration(total);
4645
+ onAudioTimeUpdate?.(current, total);
4646
+ };
4647
+ const handleLoadedMetadata = () => {
4648
+ setDuration(audioRef.current?.duration ?? 0);
4649
+ };
4650
+ const handleEnded = () => {
4651
+ setIsPlaying(false);
4652
+ setCurrentTime(0);
4653
+ onEnded?.();
4654
+ };
4655
+ const handleProgressClick = (e) => {
4656
+ const rect = e.currentTarget.getBoundingClientRect();
4657
+ const clickX = e.clientX - rect.left;
4658
+ const width = rect.width;
4659
+ const percentage = clickX / width;
4660
+ const newTime = percentage * duration;
4661
+ if (audioRef.current) {
4662
+ audioRef.current.currentTime = newTime;
4663
+ }
4664
+ setCurrentTime(newTime);
4665
+ };
4666
+ const handleVolumeChange = (e) => {
4667
+ const newVolume = parseFloat(e.target.value);
4668
+ setVolume(newVolume);
4669
+ if (audioRef.current) {
4670
+ audioRef.current.volume = newVolume;
4671
+ }
4672
+ };
4673
+ const toggleVolumeControl = () => {
4674
+ setShowVolumeControl(!showVolumeControl);
4675
+ };
4676
+ const getVolumeIcon = () => {
4677
+ if (volume === 0) {
4678
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.SpeakerSimpleX, {});
4679
+ }
4680
+ if (volume < 0.5) {
4681
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.SpeakerLow, {});
4682
+ }
4683
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.SpeakerHigh, {});
4684
+ };
4685
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
4686
+ CardBase,
4687
+ {
4688
+ ref,
4689
+ layout: "horizontal",
4690
+ padding: "medium",
4691
+ minHeight: "none",
4692
+ className: `w-auto h-14 items-center gap-2 border-none ${className}`,
4693
+ ...props,
4694
+ children: [
4695
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4696
+ "audio",
4697
+ {
4698
+ ref: audioRef,
4699
+ src,
4700
+ loop,
4701
+ preload,
4702
+ onTimeUpdate: handleTimeUpdate,
4703
+ onLoadedMetadata: handleLoadedMetadata,
4704
+ onEnded: handleEnded,
4705
+ "data-testid": "audio-element",
4706
+ "aria-label": title,
4707
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4708
+ "track",
4709
+ {
4710
+ kind: track.kind,
4711
+ src: track.src,
4712
+ srcLang: track.srcLang,
4713
+ label: track.label,
4714
+ default: track.default
4715
+ },
4716
+ track.src
4717
+ )) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4718
+ "track",
4719
+ {
4720
+ kind: "captions",
4721
+ src: "data:text/vtt;base64,",
4722
+ srcLang: "pt",
4723
+ label: "Sem legendas dispon\xEDveis"
4724
+ }
4725
+ )
4726
+ }
4727
+ ),
4728
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4729
+ "button",
4730
+ {
4731
+ type: "button",
4732
+ onClick: handlePlayPause,
4733
+ disabled: !src,
4734
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
4735
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
4736
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex gap-0.5", children: [
4737
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
4738
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
4739
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react13.Play, { size: 24 })
4740
+ }
4741
+ ),
4742
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
4743
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4744
+ "button",
4745
+ {
4746
+ type: "button",
4747
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
4748
+ onClick: handleProgressClick,
4749
+ onKeyDown: (e) => {
4750
+ if (e.key === "Enter" || e.key === " ") {
4751
+ e.preventDefault();
4752
+ handleProgressClick(
4753
+ e
4754
+ );
4755
+ }
4756
+ },
4757
+ "aria-label": "Barra de progresso do \xE1udio",
4758
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4759
+ "div",
4760
+ {
4761
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
4762
+ style: {
4763
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
4764
+ }
4765
+ }
4766
+ )
4767
+ }
4768
+ ) }),
4769
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(duration) }),
4770
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
4771
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4772
+ "button",
4773
+ {
4774
+ type: "button",
4775
+ onClick: toggleVolumeControl,
4776
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
4777
+ "aria-label": "Controle de volume",
4778
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
4779
+ }
4780
+ ),
4781
+ showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4782
+ "button",
4783
+ {
4784
+ type: "button",
4785
+ className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
4786
+ onKeyDown: (e) => {
4787
+ if (e.key === "Escape") {
4788
+ setShowVolumeControl(false);
4789
+ }
4790
+ },
4791
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4792
+ "input",
4793
+ {
4794
+ type: "range",
4795
+ min: "0",
4796
+ max: "1",
4797
+ step: "0.1",
4798
+ value: volume,
4799
+ onChange: handleVolumeChange,
4800
+ onKeyDown: (e) => {
4801
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
4802
+ e.preventDefault();
4803
+ const newVolume = Math.min(
4804
+ 1,
4805
+ Math.round((volume + 0.1) * 10) / 10
4806
+ );
4807
+ setVolume(newVolume);
4808
+ if (audioRef.current) audioRef.current.volume = newVolume;
4809
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
4810
+ e.preventDefault();
4811
+ const newVolume = Math.max(
4812
+ 0,
4813
+ Math.round((volume - 0.1) * 10) / 10
4814
+ );
4815
+ setVolume(newVolume);
4816
+ if (audioRef.current) audioRef.current.volume = newVolume;
4817
+ }
4818
+ },
4819
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
4820
+ style: {
4821
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
4822
+ },
4823
+ "aria-label": "Volume",
4824
+ "aria-valuenow": Math.round(volume * 100),
4825
+ "aria-valuemin": 0,
4826
+ "aria-valuemax": 100
4827
+ }
4828
+ )
4829
+ }
4830
+ )
4831
+ ] }),
4832
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4833
+ import_phosphor_react13.DotsThreeVertical,
4834
+ {
4835
+ size: 24,
4836
+ className: "text-text-950 cursor-pointer hover:text-primary-600"
4837
+ }
4838
+ )
4839
+ ]
4840
+ }
4841
+ );
4842
+ }
4843
+ );
4844
+
4845
+ // src/components/Skeleton/Skeleton.tsx
4846
+ var import_react15 = require("react");
4847
+ var import_jsx_runtime27 = require("react/jsx-runtime");
4848
+ var SKELETON_ANIMATION_CLASSES = {
4849
+ pulse: "animate-pulse",
4850
+ none: ""
4851
+ };
4852
+ var SKELETON_VARIANT_CLASSES = {
4853
+ text: "h-4 bg-background-200 rounded",
4854
+ circular: "bg-background-200 rounded-full",
4855
+ rectangular: "bg-background-200",
4856
+ rounded: "bg-background-200 rounded-lg"
4857
+ };
4858
+ var SPACING_CLASSES = {
4859
+ none: "",
4860
+ small: "space-y-1",
4861
+ medium: "space-y-2",
4862
+ large: "space-y-3"
4863
+ };
4864
+ var Skeleton = (0, import_react15.forwardRef)(
4865
+ ({
4866
+ variant = "text",
4867
+ width,
4868
+ height,
4869
+ animation = "pulse",
4870
+ lines = 1,
4871
+ spacing = "none",
4872
+ className = "",
4873
+ children,
4874
+ ...props
4875
+ }, ref) => {
4876
+ const animationClass = SKELETON_ANIMATION_CLASSES[animation];
4877
+ const variantClass = SKELETON_VARIANT_CLASSES[variant];
4878
+ const spacingClass = SPACING_CLASSES[spacing];
4879
+ const style = {
4880
+ width: typeof width === "number" ? `${width}px` : width,
4881
+ height: typeof height === "number" ? `${height}px` : height
4882
+ };
4883
+ if (variant === "text" && lines > 1) {
4884
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4885
+ "div",
4886
+ {
4887
+ ref,
4888
+ className: `flex flex-col ${spacingClass} ${className}`,
4889
+ ...props,
4890
+ children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4891
+ "div",
4892
+ {
4893
+ className: `${variantClass} ${animationClass}`,
4894
+ style: index === lines - 1 ? { width: "60%" } : void 0
4895
+ },
4896
+ index
4897
+ ))
4898
+ }
4899
+ );
4900
+ }
4901
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4902
+ "div",
4903
+ {
4904
+ ref,
4905
+ className: `${variantClass} ${animationClass} ${className}`,
4906
+ style,
4907
+ ...props,
4908
+ children
4909
+ }
4910
+ );
4911
+ }
4912
+ );
4913
+ var SkeletonText = (0, import_react15.forwardRef)(
4914
+ (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Skeleton, { ref, variant: "text", ...props })
4915
+ );
4916
+ var SkeletonCircle = (0, import_react15.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Skeleton, { ref, variant: "circular", ...props }));
4917
+ var SkeletonRectangle = (0, import_react15.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
4918
+ var SkeletonRounded = (0, import_react15.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
4919
+ var SkeletonCard = (0, import_react15.forwardRef)(
4920
+ ({
4921
+ showAvatar = true,
4922
+ showTitle = true,
4923
+ showDescription = true,
4924
+ showActions = true,
4925
+ lines = 2,
4926
+ className = "",
4927
+ ...props
4928
+ }, ref) => {
4929
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4930
+ "div",
4931
+ {
4932
+ ref,
4933
+ className: `w-full p-4 bg-background border border-border-200 rounded-lg ${className}`,
4934
+ ...props,
4935
+ children: [
4936
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start space-x-3", children: [
4937
+ showAvatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonCircle, { width: 40, height: 40 }),
4938
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 space-y-2", children: [
4939
+ showTitle && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonText, { width: "60%", height: 20 }),
4940
+ showDescription && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonText, { lines, spacing: "small" })
4941
+ ] })
4942
+ ] }),
4943
+ showActions && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
4944
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
4945
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonRectangle, { width: 80, height: 32 })
4946
+ ] })
4947
+ ]
4948
+ }
4949
+ );
4950
+ }
4951
+ );
4952
+ var SkeletonList = (0, import_react15.forwardRef)(
4953
+ ({
4954
+ items = 3,
4955
+ showAvatar = true,
4956
+ showTitle = true,
4957
+ showDescription = true,
4958
+ lines = 1,
4959
+ className = "",
4960
+ ...props
4961
+ }, ref) => {
4962
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: `space-y-3 ${className}`, ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
4963
+ showAvatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonCircle, { width: 32, height: 32 }),
4964
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 space-y-2", children: [
4965
+ showTitle && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonText, { width: "40%", height: 16 }),
4966
+ showDescription && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SkeletonText, { lines, spacing: "small" })
4967
+ ] })
4968
+ ] }, index)) });
4969
+ }
4970
+ );
4971
+ var SkeletonTable = (0, import_react15.forwardRef)(
4972
+ ({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
4973
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref, className: `w-full ${className}`, ...props, children: [
4974
+ showHeader && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4975
+ SkeletonText,
4976
+ {
4977
+ width: `${100 / columns}%`,
4978
+ height: 20
4979
+ },
4980
+ index
4981
+ )) }),
4982
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4983
+ SkeletonText,
4984
+ {
4985
+ width: `${100 / columns}%`,
4986
+ height: 16
4987
+ },
4988
+ colIndex
4989
+ )) }, rowIndex)) })
4990
+ ] });
4991
+ }
4992
+ );
4486
4993
  // Annotate the CommonJS export names for ESM import in node:
4487
4994
  0 && (module.exports = {
4488
4995
  Alert,
@@ -4528,6 +5035,14 @@ var CardForum = (0, import_react14.forwardRef)(
4528
5035
  SelectTrigger,
4529
5036
  SelectValue,
4530
5037
  SelectionButton,
5038
+ Skeleton,
5039
+ SkeletonCard,
5040
+ SkeletonCircle,
5041
+ SkeletonList,
5042
+ SkeletonRectangle,
5043
+ SkeletonRounded,
5044
+ SkeletonTable,
5045
+ SkeletonText,
4531
5046
  Stepper,
4532
5047
  Table,
4533
5048
  Text,