analytica-frontend-lib 1.0.72 → 1.0.73

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
@@ -4038,6 +4038,125 @@ var CardSimulado = forwardRef9(
4038
4038
  );
4039
4039
  }
4040
4040
  );
4041
+ var CardTest = forwardRef9(
4042
+ ({
4043
+ title,
4044
+ duration,
4045
+ questionsCount,
4046
+ additionalInfo,
4047
+ selected = false,
4048
+ onSelect,
4049
+ className = "",
4050
+ ...props
4051
+ }, ref) => {
4052
+ const handleClick = () => {
4053
+ if (onSelect) {
4054
+ onSelect(!selected);
4055
+ }
4056
+ };
4057
+ const handleKeyDown = (event) => {
4058
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
4059
+ event.preventDefault();
4060
+ onSelect(!selected);
4061
+ }
4062
+ };
4063
+ const isSelectable = !!onSelect;
4064
+ const getQuestionsText = (count) => {
4065
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
4066
+ return `${count} ${singular}`;
4067
+ };
4068
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
4069
+ const baseClasses = "flex flex-row items-center p-4 gap-2 w-full max-w-full bg-background shadow-soft-shadow-1 rounded-xl isolate border-0 text-left";
4070
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
4071
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
4072
+ if (isSelectable) {
4073
+ return /* @__PURE__ */ jsx23(
4074
+ "button",
4075
+ {
4076
+ ref,
4077
+ type: "button",
4078
+ className: `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim(),
4079
+ onClick: handleClick,
4080
+ onKeyDown: handleKeyDown,
4081
+ "aria-pressed": selected,
4082
+ ...props,
4083
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
4084
+ /* @__PURE__ */ jsx23(
4085
+ Text_default,
4086
+ {
4087
+ size: "md",
4088
+ weight: "bold",
4089
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
4090
+ children: title
4091
+ }
4092
+ ),
4093
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
4094
+ duration && /* @__PURE__ */ jsxs18("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
4095
+ /* @__PURE__ */ jsx23(Clock, { size: 16, className: "text-text-700" }),
4096
+ /* @__PURE__ */ jsx23(
4097
+ Text_default,
4098
+ {
4099
+ size: "sm",
4100
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
4101
+ children: duration
4102
+ }
4103
+ )
4104
+ ] }),
4105
+ /* @__PURE__ */ jsx23(
4106
+ Text_default,
4107
+ {
4108
+ size: "sm",
4109
+ className: "text-text-700 leading-[21px] flex-grow truncate",
4110
+ children: displayInfo
4111
+ }
4112
+ )
4113
+ ] })
4114
+ ] })
4115
+ }
4116
+ );
4117
+ }
4118
+ return /* @__PURE__ */ jsx23(
4119
+ "div",
4120
+ {
4121
+ ref,
4122
+ className: `${baseClasses} ${className}`.trim(),
4123
+ ...props,
4124
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
4125
+ /* @__PURE__ */ jsx23(
4126
+ Text_default,
4127
+ {
4128
+ size: "md",
4129
+ weight: "bold",
4130
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
4131
+ children: title
4132
+ }
4133
+ ),
4134
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
4135
+ duration && /* @__PURE__ */ jsxs18("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
4136
+ /* @__PURE__ */ jsx23(Clock, { size: 16, className: "text-text-700" }),
4137
+ /* @__PURE__ */ jsx23(
4138
+ Text_default,
4139
+ {
4140
+ size: "sm",
4141
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
4142
+ children: duration
4143
+ }
4144
+ )
4145
+ ] }),
4146
+ /* @__PURE__ */ jsx23(
4147
+ Text_default,
4148
+ {
4149
+ size: "sm",
4150
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
4151
+ children: displayInfo
4152
+ }
4153
+ )
4154
+ ] })
4155
+ ] })
4156
+ }
4157
+ );
4158
+ }
4159
+ );
4041
4160
 
4042
4161
  // src/components/Accordation/Accordation.tsx
4043
4162
  import { CaretRight as CaretRight2 } from "phosphor-react";