@vector-business-services/cristal-ds-web 0.19.0 → 0.20.0

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.cjs CHANGED
@@ -7,13 +7,14 @@ var jsxRuntime = require('react/jsx-runtime');
7
7
  var autocomplete = require('primereact/autocomplete');
8
8
  var badge = require('primereact/badge');
9
9
  var button = require('primereact/button');
10
+ var calendar = require('primereact/calendar');
11
+ var api = require('primereact/api');
10
12
  var card = require('primereact/card');
11
13
  var chart = require('primereact/chart');
12
14
  var tooltip = require('primereact/tooltip');
13
15
  var checkbox = require('primereact/checkbox');
14
16
  var chip = require('primereact/chip');
15
17
  var contextmenu = require('primereact/contextmenu');
16
- var api = require('primereact/api');
17
18
  var menu = require('primereact/menu');
18
19
  var divider = require('primereact/divider');
19
20
  var sidebar = require('primereact/sidebar');
@@ -149,7 +150,7 @@ var AutoComplete = react.forwardRef(function AutoComplete2({
149
150
  const id = inputId ?? autoId;
150
151
  const hintId = `${id}-hint`;
151
152
  const supportText = error ?? hint;
152
- const classes = [
153
+ const classes2 = [
153
154
  "cr-field",
154
155
  "cr-autocomplete",
155
156
  dropdown && "cr-autocomplete--dropdown",
@@ -159,7 +160,7 @@ var AutoComplete = react.forwardRef(function AutoComplete2({
159
160
  disabled && "cr-field--disabled",
160
161
  className
161
162
  ].filter(Boolean).join(" ");
162
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, style, children: [
163
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, style, children: [
163
164
  label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cr-field__label", htmlFor: id, children: [
164
165
  label,
165
166
  required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__required", "aria-hidden": "true", children: "*" })
@@ -216,13 +217,13 @@ var AutoComplete = react.forwardRef(function AutoComplete2({
216
217
  var Badge = react.forwardRef(function Badge2({ variant = "default", size = "large", className, children, ...props }, ref) {
217
218
  const primeRef = react.useRef(null);
218
219
  react.useImperativeHandle(ref, () => primeRef.current?.getElement());
219
- const classes = ["cr-badge", `cr-badge--${variant}`, `cr-badge--${size}`, className].filter(Boolean).join(" ");
220
+ const classes2 = ["cr-badge", `cr-badge--${variant}`, `cr-badge--${size}`, className].filter(Boolean).join(" ");
220
221
  return /* @__PURE__ */ jsxRuntime.jsx(
221
222
  badge.Badge,
222
223
  {
223
224
  unstyled: true,
224
225
  ref: primeRef,
225
- className: classes,
226
+ className: classes2,
226
227
  value: size === "small" ? null : children,
227
228
  ...props
228
229
  }
@@ -238,14 +239,14 @@ var Button = react.forwardRef(function Button2({
238
239
  children,
239
240
  ...props
240
241
  }, ref) {
241
- const classes = ["cr-button", `cr-button--${variant}`, `cr-button--${size}`, className].filter(Boolean).join(" ");
242
+ const classes2 = ["cr-button", `cr-button--${variant}`, `cr-button--${size}`, className].filter(Boolean).join(" ");
242
243
  return /* @__PURE__ */ jsxRuntime.jsxs(
243
244
  button.Button,
244
245
  {
245
246
  unstyled: true,
246
247
  ref,
247
248
  type,
248
- className: classes,
249
+ className: classes2,
249
250
  ...props,
250
251
  children: [
251
252
  leadingIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-button__icon", "aria-hidden": "true", children: leadingIcon }),
@@ -255,15 +256,202 @@ var Button = react.forwardRef(function Button2({
255
256
  }
256
257
  );
257
258
  });
259
+ var LOCALE = "cr-pt-BR";
260
+ api.addLocale(LOCALE, {
261
+ firstDayOfWeek: 0,
262
+ dayNames: [
263
+ "domingo",
264
+ "segunda-feira",
265
+ "ter\xE7a-feira",
266
+ "quarta-feira",
267
+ "quinta-feira",
268
+ "sexta-feira",
269
+ "s\xE1bado"
270
+ ],
271
+ dayNamesShort: ["dom", "seg", "ter", "qua", "qui", "sex", "s\xE1b"],
272
+ dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"],
273
+ monthNames: [
274
+ "Janeiro",
275
+ "Fevereiro",
276
+ "Mar\xE7o",
277
+ "Abril",
278
+ "Maio",
279
+ "Junho",
280
+ "Julho",
281
+ "Agosto",
282
+ "Setembro",
283
+ "Outubro",
284
+ "Novembro",
285
+ "Dezembro"
286
+ ],
287
+ monthNamesShort: [
288
+ "Jan",
289
+ "Fev",
290
+ "Mar",
291
+ "Abr",
292
+ "Mai",
293
+ "Jun",
294
+ "Jul",
295
+ "Ago",
296
+ "Set",
297
+ "Out",
298
+ "Nov",
299
+ "Dez"
300
+ ],
301
+ dateFormat: "dd/mm/yy",
302
+ weekHeader: "Sem",
303
+ today: "Hoje",
304
+ clear: "Limpar",
305
+ chooseDate: "Escolher data",
306
+ chooseMonth: "Escolher m\xEAs",
307
+ chooseYear: "Escolher ano",
308
+ prevMonth: "M\xEAs anterior",
309
+ nextMonth: "Pr\xF3ximo m\xEAs",
310
+ prevYear: "Ano anterior",
311
+ nextYear: "Pr\xF3ximo ano",
312
+ prevDecade: "D\xE9cada anterior",
313
+ nextDecade: "Pr\xF3xima d\xE9cada"
314
+ });
315
+ function seguirFocoDoDia(event) {
316
+ const dia = event.target;
317
+ if (!(dia instanceof HTMLElement) || !dia.classList.contains("cr-calendar__date")) return;
318
+ const painel = dia.closest(".cr-calendar");
319
+ const td = dia.closest("td");
320
+ const mes = dia.closest(".cr-calendar__month");
321
+ if (!painel || !td || !mes || event.relatedTarget) return;
322
+ const indice = [...painel.querySelectorAll(".cr-calendar__month")].indexOf(mes);
323
+ const { pDay, pMonth, pYear } = td.dataset;
324
+ requestAnimationFrame(() => {
325
+ if (dia.isConnected || document.activeElement !== document.body) return;
326
+ const novo = painel.querySelectorAll(".cr-calendar__month")[indice]?.querySelector(
327
+ `td[data-p-day="${pDay}"][data-p-month="${pMonth}"][data-p-year="${pYear}"] .cr-calendar__date`
328
+ );
329
+ if (novo) {
330
+ novo.tabIndex = 0;
331
+ novo.focus();
332
+ }
333
+ });
334
+ }
335
+ if (typeof document !== "undefined") document.addEventListener("focusout", seguirFocoDoDia, true);
336
+ var setas = {
337
+ prevIcon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-icon-button__icon", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretLeft, {}) }),
338
+ nextIcon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-icon-button__icon", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.CaretRight, {}) })
339
+ };
340
+ var mesmoDia = (data, dia) => data instanceof Date && data.getDate() === dia.day && data.getMonth() === dia.month && data.getFullYear() === dia.year;
341
+ var chave = (dia) => dia.year * 1e4 + dia.month * 100 + dia.day;
342
+ var chaveDe = (data) => chave({ day: data.getDate(), month: data.getMonth(), year: data.getFullYear() });
343
+ function escolhido(props, dia) {
344
+ const { value } = props;
345
+ if (value instanceof Date) return mesmoDia(value, dia);
346
+ if (!Array.isArray(value)) return false;
347
+ if (props.selectionMode === "range") {
348
+ const [inicio, fim] = value;
349
+ if (!inicio) return false;
350
+ return chave(dia) >= chaveDe(inicio) && chave(dia) <= chaveDe(fim ?? inicio);
351
+ }
352
+ return value.some((data) => mesmoDia(data, dia));
353
+ }
354
+ function noPeriodo(props, dia) {
355
+ if (props.selectionMode !== "range" || !Array.isArray(props.value)) return void 0;
356
+ const [inicio, fim] = props.value;
357
+ if (mesmoDia(inicio, dia) || mesmoDia(fim, dia)) return "cr-calendar__day--edge";
358
+ if (inicio && fim) {
359
+ const data = new Date(dia.year, dia.month, dia.day);
360
+ if (data > inicio && data < fim) return "cr-calendar__day--middle";
361
+ }
362
+ return void 0;
363
+ }
364
+ var classes = (...lista) => lista.filter(Boolean).join(" ");
365
+ function ptDoPainel(offDays = []) {
366
+ return {
367
+ groupContainer: { className: "cr-calendar__months" },
368
+ group: { className: "cr-calendar__month" },
369
+ header: { className: "cr-calendar__header" },
370
+ previousButton: {
371
+ className: "cr-icon-button cr-icon-button--tertiary cr-icon-button--xsmall"
372
+ },
373
+ nextButton: { className: "cr-icon-button cr-icon-button--tertiary cr-icon-button--xsmall" },
374
+ title: { className: "cr-calendar__title" },
375
+ // O nome dos botões do título é o texto que aparece neles (o mês e o ano), não "Escolher mês".
376
+ monthTitle: { className: "cr-calendar__title-button", "aria-label": void 0 },
377
+ yearTitle: { className: "cr-calendar__title-button", "aria-label": void 0 },
378
+ decadeTitle: { className: "cr-calendar__title-text" },
379
+ table: { className: "cr-calendar__table" },
380
+ tableHeaderCell: { className: "cr-calendar__weekday" },
381
+ day: ({ props, context }) => {
382
+ const dia = context.date;
383
+ const meses = api.localeOption("monthNames", props.locale ?? LOCALE);
384
+ return {
385
+ // O Prime põe o escolhido e o desabilitado no <span> do dia, que não tem papel: eles vão
386
+ // para a célula da grade (gridcell). O nome da célula inclui o número que aparece nela.
387
+ "aria-selected": escolhido(props, dia),
388
+ "aria-disabled": dia.selectable ? void 0 : true,
389
+ "aria-label": `${dia.day} de ${meses[dia.month]?.toLowerCase()} de ${dia.year}`,
390
+ className: classes(
391
+ "cr-calendar__day",
392
+ context.today && "cr-calendar__day--today",
393
+ context.otherMonth && "cr-calendar__day--other-month",
394
+ offDays.some((data) => mesmoDia(data, dia)) && "cr-calendar__day--off",
395
+ noPeriodo(props, dia)
396
+ )
397
+ };
398
+ },
399
+ dayLabel: ({ context }) => ({
400
+ "aria-selected": void 0,
401
+ "aria-disabled": void 0,
402
+ className: classes(
403
+ "cr-calendar__date",
404
+ context.selected && "cr-calendar__date--selected",
405
+ context.disabled && "cr-calendar__date--disabled"
406
+ )
407
+ }),
408
+ monthPicker: { className: "cr-calendar__picker cr-calendar__picker--months" },
409
+ month: ({ context }) => ({
410
+ className: classes(
411
+ "cr-calendar__option",
412
+ context.selected && "cr-calendar__option--selected",
413
+ context.disabled && "cr-calendar__option--disabled"
414
+ )
415
+ }),
416
+ yearPicker: { className: "cr-calendar__picker cr-calendar__picker--years" },
417
+ year: ({ context }) => ({
418
+ className: classes(
419
+ "cr-calendar__option",
420
+ context.selected && "cr-calendar__option--selected",
421
+ context.disabled && "cr-calendar__option--disabled"
422
+ )
423
+ })
424
+ };
425
+ }
426
+ function CalendarBase({ offDays, locale = LOCALE, className, ...props }, ref) {
427
+ return /* @__PURE__ */ jsxRuntime.jsx(
428
+ calendar.Calendar,
429
+ {
430
+ ...setas,
431
+ locale,
432
+ ...props,
433
+ ref,
434
+ inline: true,
435
+ unstyled: true,
436
+ className,
437
+ pt: {
438
+ root: { className: "cr-calendar-inline" },
439
+ panel: { className: "cr-calendar" },
440
+ ...ptDoPainel(offDays)
441
+ }
442
+ }
443
+ );
444
+ }
445
+ var Calendar = react.forwardRef(CalendarBase);
258
446
  var Card = react.forwardRef(function Card2({ padding = "xsmall", outline = false, className, style, children, ...props }, ref) {
259
- const classes = ["cr-card", `cr-card--${padding}`, outline && "cr-card--outline", className].filter(Boolean).join(" ");
447
+ const classes2 = ["cr-card", `cr-card--${padding}`, outline && "cr-card--outline", className].filter(Boolean).join(" ");
260
448
  return /* @__PURE__ */ jsxRuntime.jsx(
261
449
  card.Card,
262
450
  {
263
451
  unstyled: true,
264
452
  ref,
265
453
  pt: {
266
- root: { className: classes, style },
454
+ root: { className: classes2, style },
267
455
  body: { className: "cr-card__body" },
268
456
  content: { className: "cr-card__content" }
269
457
  },
@@ -323,11 +511,11 @@ function Tooltip({
323
511
  )
324
512
  );
325
513
  }, [target, tooltipId, describe]);
326
- const classes = ["cr-tooltip", `cr-tooltip--${type}`, className].filter(Boolean).join(" ");
514
+ const classes2 = ["cr-tooltip", `cr-tooltip--${type}`, className].filter(Boolean).join(" ");
327
515
  const pt = {
328
516
  root: (options) => {
329
517
  const side = options?.state?.position ?? position;
330
- return { className: `${classes} cr-tooltip--${side}`, "aria-hidden": false };
518
+ return { className: `${classes2} cr-tooltip--${side}`, "aria-hidden": false };
331
519
  },
332
520
  arrow: { className: "cr-tooltip__arrow" },
333
521
  text: { className: "cr-tooltip__text" }
@@ -586,8 +774,8 @@ var Chart = react.forwardRef(function Chart2({
586
774
  };
587
775
  }, [tema, yAxis, y2Axis, temDireita, series, type, stacked]);
588
776
  const card = Boolean(title || actions);
589
- const classes = ["cr-chart", card && "cr-chart--card", className].filter(Boolean).join(" ");
590
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, ref: raiz, id, className: classes, children: [
777
+ const classes2 = ["cr-chart", card && "cr-chart--card", className].filter(Boolean).join(" ");
778
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, ref: raiz, id, className: classes2, children: [
591
779
  card && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__header", children: [
592
780
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__title-row", children: [
593
781
  title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-chart__title", children: title }),
@@ -680,7 +868,7 @@ var Checkbox = react.forwardRef(function Checkbox2({
680
868
  react.useEffect(() => {
681
869
  if (inputRef.current) inputRef.current.indeterminate = indeterminate && !checked;
682
870
  }, [indeterminate, checked]);
683
- const classes = [
871
+ const classes2 = [
684
872
  "cr-checkbox",
685
873
  `cr-checkbox--${position}`,
686
874
  `cr-checkbox--label-${labelSize}`,
@@ -688,7 +876,7 @@ var Checkbox = react.forwardRef(function Checkbox2({
688
876
  disabled && "cr-checkbox--disabled",
689
877
  className
690
878
  ].filter(Boolean).join(" ");
691
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, style, children: [
879
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, style, children: [
692
880
  /* @__PURE__ */ jsxRuntime.jsx(
693
881
  checkbox.Checkbox,
694
882
  {
@@ -735,7 +923,7 @@ var Chip = react.forwardRef(function Chip2({
735
923
  className,
736
924
  ...props
737
925
  }, ref) {
738
- const classes = [
926
+ const classes2 = [
739
927
  "cr-chip",
740
928
  `cr-chip--${variant}`,
741
929
  `cr-chip--${size}`,
@@ -749,7 +937,7 @@ var Chip = react.forwardRef(function Chip2({
749
937
  {
750
938
  unstyled: true,
751
939
  pt: { root: { ref, "aria-label": void 0 } },
752
- className: classes,
940
+ className: classes2,
753
941
  label,
754
942
  "aria-disabled": disabled || void 0,
755
943
  icon: leadingIcon ? () => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-chip__icon cr-chip__icon--leading", "aria-hidden": "true", children: leadingIcon }) : void 0,
@@ -825,7 +1013,7 @@ var Menu = react.forwardRef(function Menu2({
825
1013
  template: () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cr-menu__loading", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.CircleNotch, { className: "cr-menu__spinner", "aria-hidden": "true" }) })
826
1014
  }
827
1015
  ] : itensDoPrime(model);
828
- const classes = ["cr-lista cr-menu", `cr-menu--${density}`, popup && "cr-menu--popup", className].filter(Boolean).join(" ");
1016
+ const classes2 = ["cr-lista cr-menu", `cr-menu--${density}`, popup && "cr-menu--popup", className].filter(Boolean).join(" ");
829
1017
  const pt = {
830
1018
  // O nome acessível vai na lista (role=menu); o Prime lê `ariaLabel`, mas não o declara no tipo.
831
1019
  menu: {
@@ -859,7 +1047,7 @@ var Menu = react.forwardRef(function Menu2({
859
1047
  unstyled: true,
860
1048
  ref: primeRef,
861
1049
  id,
862
- className: classes,
1050
+ className: classes2,
863
1051
  model: items,
864
1052
  popup,
865
1053
  popupAlignment,
@@ -888,9 +1076,9 @@ var ContextMenu = react.forwardRef(function ContextMenu2({
888
1076
  hide: (event) => primeRef.current?.hide(event),
889
1077
  getElement: () => primeRef.current?.getElement() ?? null
890
1078
  }));
891
- const classes = ["cr-lista cr-menu cr-context-menu", `cr-menu--${density}`, className].filter(Boolean).join(" ");
1079
+ const classes2 = ["cr-lista cr-menu cr-context-menu", `cr-menu--${density}`, className].filter(Boolean).join(" ");
892
1080
  const pt = {
893
- root: { ...props, className: classes },
1081
+ root: { ...props, className: classes2 },
894
1082
  // O nome vai na lista (o Prime dá a ela role=menubar, vertical).
895
1083
  menu: {
896
1084
  className: "cr-menu__list",
@@ -923,10 +1111,120 @@ var ContextMenu = react.forwardRef(function ContextMenu2({
923
1111
  }
924
1112
  );
925
1113
  });
1114
+ function DatePickerBase({
1115
+ variant = "outline",
1116
+ size = "large",
1117
+ label,
1118
+ hint,
1119
+ error,
1120
+ offDays,
1121
+ locale = LOCALE,
1122
+ placeholder = "dd/mm/aaaa",
1123
+ inputId,
1124
+ required,
1125
+ disabled,
1126
+ className,
1127
+ style,
1128
+ onShow,
1129
+ onHide,
1130
+ ...props
1131
+ }, ref) {
1132
+ const autoId = react.useId();
1133
+ const id = inputId ?? autoId;
1134
+ const hintId = `${id}-hint`;
1135
+ const supportText = error ?? hint;
1136
+ const pelaSeta = react.useRef(false);
1137
+ const peloTeclado = react.useRef(false);
1138
+ const calendario = react.useRef(null);
1139
+ react.useImperativeHandle(ref, () => calendario.current, []);
1140
+ const classes2 = [
1141
+ "cr-field",
1142
+ "cr-datepicker",
1143
+ `cr-field--${variant}`,
1144
+ `cr-field--${size}`,
1145
+ error && "cr-field--error",
1146
+ disabled && "cr-field--disabled",
1147
+ className
1148
+ ].filter(Boolean).join(" ");
1149
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, style, children: [
1150
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cr-field__label", htmlFor: id, children: [
1151
+ label,
1152
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__required", "aria-hidden": "true", children: "*" })
1153
+ ] }),
1154
+ /* @__PURE__ */ jsxRuntime.jsx(
1155
+ calendar.Calendar,
1156
+ {
1157
+ ...setas,
1158
+ locale,
1159
+ placeholder,
1160
+ ...props,
1161
+ ref: calendario,
1162
+ unstyled: true,
1163
+ inputId: id,
1164
+ required,
1165
+ disabled,
1166
+ showIcon: true,
1167
+ icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.CalendarDot, { "aria-hidden": "true" }),
1168
+ onShow: () => {
1169
+ if (!pelaSeta.current) document.getElementById(id)?.focus();
1170
+ pelaSeta.current = false;
1171
+ onShow?.();
1172
+ },
1173
+ onHide: () => {
1174
+ const atual = calendario.current;
1175
+ const ativo = document.activeElement;
1176
+ const semFoco = ativo === document.body || atual?.getOverlay()?.contains(ativo);
1177
+ if (peloTeclado.current && semFoco && atual) {
1178
+ atual.focus();
1179
+ atual.hide();
1180
+ }
1181
+ peloTeclado.current = false;
1182
+ pelaSeta.current = false;
1183
+ onHide?.();
1184
+ },
1185
+ pt: {
1186
+ root: { className: "cr-datepicker__root" },
1187
+ input: {
1188
+ root: {
1189
+ className: "cr-field__control cr-datepicker__input",
1190
+ "aria-describedby": supportText ? hintId : void 0,
1191
+ "aria-invalid": error ? true : void 0,
1192
+ onKeyDown: (event) => {
1193
+ if (event.code === "ArrowDown" && !calendario.current?.getOverlay()) {
1194
+ pelaSeta.current = true;
1195
+ }
1196
+ }
1197
+ }
1198
+ },
1199
+ dropdownButton: { root: { className: "cr-datepicker__button" } },
1200
+ panel: {
1201
+ className: "cr-calendar cr-datepicker__panel",
1202
+ onKeyDown: (event) => {
1203
+ if (["Enter", "NumpadEnter", "Space"].includes(event.code))
1204
+ peloTeclado.current = true;
1205
+ }
1206
+ },
1207
+ // Animação de entrada e saída (a do Prime) e o lado do painel, medido logo depois de o
1208
+ // Prime posicionar.
1209
+ transition: transicaoDoPopup(() => {
1210
+ const campo = document.getElementById(id);
1211
+ seguirLado(painelDoCampo(campo, ".cr-datepicker__panel"), campo);
1212
+ }),
1213
+ ...ptDoPainel(offDays)
1214
+ }
1215
+ }
1216
+ ),
1217
+ supportText && /* @__PURE__ */ jsxRuntime.jsxs("p", { id: hintId, className: `cr-field__hint${error ? " cr-field__hint--error" : ""}`, children: [
1218
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__hint-icon", "aria-hidden": "true", children: error ? /* @__PURE__ */ jsxRuntime.jsx(react$1.WarningCircle, {}) : /* @__PURE__ */ jsxRuntime.jsx(react$1.Info, {}) }),
1219
+ supportText
1220
+ ] })
1221
+ ] });
1222
+ }
1223
+ var DatePicker = react.forwardRef(DatePickerBase);
926
1224
  var Divider = react.forwardRef(function Divider2({ orientation = "horizontal", variant = "solid", className, style, ...props }, ref) {
927
1225
  const primeRef = react.useRef(null);
928
1226
  react.useImperativeHandle(ref, () => primeRef.current?.getElement());
929
- const classes = ["cr-divider", `cr-divider--${orientation}`, `cr-divider--${variant}`, className].filter(Boolean).join(" ");
1227
+ const classes2 = ["cr-divider", `cr-divider--${orientation}`, `cr-divider--${variant}`, className].filter(Boolean).join(" ");
930
1228
  return /* @__PURE__ */ jsxRuntime.jsx(
931
1229
  divider.Divider,
932
1230
  {
@@ -934,7 +1232,7 @@ var Divider = react.forwardRef(function Divider2({ orientation = "horizontal", v
934
1232
  ref: primeRef,
935
1233
  layout: orientation,
936
1234
  pt: {
937
- root: { className: classes, style },
1235
+ root: { className: classes2, style },
938
1236
  content: { className: "cr-divider__content" }
939
1237
  },
940
1238
  ...props
@@ -961,7 +1259,7 @@ var IconButton = react.forwardRef(function IconButton2({
961
1259
  [ref]
962
1260
  );
963
1261
  const texto = tooltip ?? props["aria-label"];
964
- const classes = [
1262
+ const classes2 = [
965
1263
  "cr-icon-button",
966
1264
  `cr-icon-button--${variant}`,
967
1265
  `cr-icon-button--${size}`,
@@ -974,7 +1272,7 @@ var IconButton = react.forwardRef(function IconButton2({
974
1272
  unstyled: true,
975
1273
  ref: ligar,
976
1274
  type,
977
- className: classes,
1275
+ className: classes2,
978
1276
  ...props,
979
1277
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-icon-button__icon", "aria-hidden": "true", children: icon })
980
1278
  }
@@ -1051,7 +1349,7 @@ var Drawer = react.forwardRef(function Drawer2({
1051
1349
  primeiro.focus();
1052
1350
  }
1053
1351
  };
1054
- const classes = [
1352
+ const classes2 = [
1055
1353
  "cr-drawer",
1056
1354
  `cr-drawer--${side}`,
1057
1355
  `cr-drawer--${behavior}`,
@@ -1076,7 +1374,7 @@ var Drawer = react.forwardRef(function Drawer2({
1076
1374
  className: `cr-drawer__mask cr-drawer__mask--${side}${modal ? "" : " cr-drawer__mask--sem-overlay"}`
1077
1375
  },
1078
1376
  root: {
1079
- className: classes,
1377
+ className: classes2,
1080
1378
  role: "dialog",
1081
1379
  "aria-modal": modal || void 0,
1082
1380
  "aria-labelledby": titleId,
@@ -1165,7 +1463,7 @@ var Input = react.forwardRef(function Input2({
1165
1463
  const inputId = id ?? autoId;
1166
1464
  const hintId = `${inputId}-hint`;
1167
1465
  const supportText = error ?? hint;
1168
- const classes = [
1466
+ const classes2 = [
1169
1467
  "cr-field",
1170
1468
  `cr-field--${variant}`,
1171
1469
  `cr-field--${size}`,
@@ -1173,7 +1471,7 @@ var Input = react.forwardRef(function Input2({
1173
1471
  disabled && "cr-field--disabled",
1174
1472
  className
1175
1473
  ].filter(Boolean).join(" ");
1176
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
1474
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, children: [
1177
1475
  label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cr-field__label", htmlFor: inputId, children: [
1178
1476
  label,
1179
1477
  required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__required", "aria-hidden": "true", children: "*" })
@@ -1223,7 +1521,7 @@ function ToolButton({ tool }) {
1223
1521
  const hasMenu = Boolean(tool.menu?.length);
1224
1522
  const hasBadge = tool.badge !== void 0 && tool.badge !== null;
1225
1523
  const name = hasBadge ? `${tool.label}, ${tool.badgeLabel ?? String(tool.badge)}` : tool.label;
1226
- const classes = [
1524
+ const classes2 = [
1227
1525
  "cr-menubar__tool",
1228
1526
  tool.showOnTablet && "cr-menubar__tool--tablet",
1229
1527
  open && "cr-menubar__tool--active"
@@ -1235,7 +1533,7 @@ function ToolButton({ tool }) {
1235
1533
  unstyled: true,
1236
1534
  ref: buttonRef,
1237
1535
  type: "button",
1238
- className: classes,
1536
+ className: classes2,
1239
1537
  "aria-label": name,
1240
1538
  "aria-haspopup": hasMenu ? "menu" : void 0,
1241
1539
  "aria-expanded": hasMenu ? open : void 0,
@@ -1339,7 +1637,7 @@ var Menubar = react.forwardRef(function Menubar2({
1339
1637
  event.preventDefault();
1340
1638
  onSearch?.(search);
1341
1639
  };
1342
- const classes = ["cr-menubar", !showSearch && "cr-menubar--no-search", className].filter(Boolean).join(" ");
1640
+ const classes2 = ["cr-menubar", !showSearch && "cr-menubar--no-search", className].filter(Boolean).join(" ");
1343
1641
  const pt = {
1344
1642
  // A área start some do layout (display: contents): o início e a busca viram colunas do grid.
1345
1643
  start: { className: "cr-menubar__start" },
@@ -1394,7 +1692,7 @@ var Menubar = react.forwardRef(function Menubar2({
1394
1692
  tools.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cr-menubar__tools", children: tools.map((tool) => /* @__PURE__ */ jsxRuntime.jsx(ToolButton, { tool }, tool.label)) }),
1395
1693
  user && /* @__PURE__ */ jsxRuntime.jsx(Profile, { user, menu: userMenu })
1396
1694
  ] }) : null;
1397
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, id, className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(
1695
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, id, className: classes2, children: /* @__PURE__ */ jsxRuntime.jsx(
1398
1696
  menubar.Menubar,
1399
1697
  {
1400
1698
  ...props,
@@ -1410,13 +1708,13 @@ var Menubar = react.forwardRef(function Menubar2({
1410
1708
  var Tag = react.forwardRef(function Tag2({ variant = "default", size = "small", icon, className, children, ...props }, ref) {
1411
1709
  const primeRef = react.useRef(null);
1412
1710
  react.useImperativeHandle(ref, () => primeRef.current?.getElement());
1413
- const classes = ["cr-tag", `cr-tag--${variant}`, `cr-tag--${size}`, className].filter(Boolean).join(" ");
1711
+ const classes2 = ["cr-tag", `cr-tag--${variant}`, `cr-tag--${size}`, className].filter(Boolean).join(" ");
1414
1712
  return /* @__PURE__ */ jsxRuntime.jsx(
1415
1713
  tag.Tag,
1416
1714
  {
1417
1715
  unstyled: true,
1418
1716
  ref: primeRef,
1419
- className: classes,
1717
+ className: classes2,
1420
1718
  icon: icon ? () => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-tag__icon", "aria-hidden": "true", children: icon }) : void 0,
1421
1719
  value: children,
1422
1720
  ...props
@@ -1506,7 +1804,7 @@ var MenuPrincipal = react.forwardRef(
1506
1804
  );
1507
1805
  anterior = entry;
1508
1806
  });
1509
- const classes = ["cr-menu-principal", popup && "cr-menu-principal--popup", className].filter(Boolean).join(" ");
1807
+ const classes2 = ["cr-menu-principal", popup && "cr-menu-principal--popup", className].filter(Boolean).join(" ");
1510
1808
  const pt = {
1511
1809
  // O nome acessível vai na lista (role=menu), como no Menu.
1512
1810
  menu: {
@@ -1533,7 +1831,7 @@ var MenuPrincipal = react.forwardRef(
1533
1831
  unstyled: true,
1534
1832
  ref: primeRef,
1535
1833
  id,
1536
- className: classes,
1834
+ className: classes2,
1537
1835
  style: popup && baseDoAlvo !== void 0 ? { "--cr-menu-principal-topo": `${baseDoAlvo}px` } : void 0,
1538
1836
  model: items,
1539
1837
  popup,
@@ -1616,7 +1914,7 @@ var Modal = react.forwardRef(function Modal2({
1616
1914
  [...body.children].forEach((child) => observer.observe(child));
1617
1915
  return () => observer.disconnect();
1618
1916
  }, [body, children]);
1619
- const classes = ["cr-modal", `cr-modal--${size}`, rolavel && "cr-modal--scrollable", className].filter(Boolean).join(" ");
1917
+ const classes2 = ["cr-modal", `cr-modal--${size}`, rolavel && "cr-modal--scrollable", className].filter(Boolean).join(" ");
1620
1918
  return /* @__PURE__ */ jsxRuntime.jsx(
1621
1919
  dialog.Dialog,
1622
1920
  {
@@ -1633,7 +1931,7 @@ var Modal = react.forwardRef(function Modal2({
1633
1931
  pt: {
1634
1932
  mask: { className: "cr-modal__mask" },
1635
1933
  root: {
1636
- className: classes,
1934
+ className: classes2,
1637
1935
  "aria-labelledby": titleId,
1638
1936
  "aria-describedby": void 0
1639
1937
  },
@@ -1724,7 +2022,7 @@ var MultiSelect = react.forwardRef(function MultiSelect2({
1724
2022
  const supportText = error ?? hint;
1725
2023
  const selected = value ?? [];
1726
2024
  const overflow = selected.length > maxChips;
1727
- const classes = [
2025
+ const classes2 = [
1728
2026
  "cr-field",
1729
2027
  `cr-field--${variant}`,
1730
2028
  `cr-field--${size}`,
@@ -1835,7 +2133,7 @@ var MultiSelect = react.forwardRef(function MultiSelect2({
1835
2133
  // Animação de entrada e saída da lista, a do Prime (comum.css).
1836
2134
  transition: transicaoDoPopup()
1837
2135
  };
1838
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
2136
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, children: [
1839
2137
  label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cr-field__label", htmlFor: inputId, children: [
1840
2138
  label,
1841
2139
  required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__required", "aria-hidden": "true", children: "*" })
@@ -1912,8 +2210,8 @@ var PageHeader = react.forwardRef(function PageHeader2({
1912
2210
  );
1913
2211
  }
1914
2212
  );
1915
- const classes = ["cr-page-header", `cr-page-header--${variant}`, className].filter(Boolean).join(" ");
1916
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: classes, ...props, children: [
2213
+ const classes2 = ["cr-page-header", `cr-page-header--${variant}`, className].filter(Boolean).join(" ");
2214
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: classes2, ...props, children: [
1917
2215
  /* @__PURE__ */ jsxRuntime.jsxs(
1918
2216
  "div",
1919
2217
  {
@@ -2013,7 +2311,7 @@ var Select = react.forwardRef(function Select2({
2013
2311
  },
2014
2312
  [ref]
2015
2313
  );
2016
- const classes = [
2314
+ const classes2 = [
2017
2315
  "cr-field",
2018
2316
  `cr-field--${variant}`,
2019
2317
  `cr-field--${size}`,
@@ -2055,7 +2353,7 @@ var Select = react.forwardRef(function Select2({
2055
2353
  }),
2056
2354
  emptyMessage: { className: "cr-lista__item cr-select__item cr-select__empty" }
2057
2355
  };
2058
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
2356
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, children: [
2059
2357
  label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cr-field__label", htmlFor: inputId, children: [
2060
2358
  label,
2061
2359
  required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__required", "aria-hidden": "true", children: "*" })
@@ -2225,13 +2523,13 @@ var Radio = react.forwardRef(function Radio2({
2225
2523
  }, ref) {
2226
2524
  const autoId = react.useId();
2227
2525
  const inputId = id ?? autoId;
2228
- const classes = [
2526
+ const classes2 = [
2229
2527
  "cr-radio",
2230
2528
  `cr-radio--label-${labelSize}`,
2231
2529
  disabled && "cr-radio--disabled",
2232
2530
  className
2233
2531
  ].filter(Boolean).join(" ");
2234
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, style, children: [
2532
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, style, children: [
2235
2533
  /* @__PURE__ */ jsxRuntime.jsx(
2236
2534
  radiobutton.RadioButton,
2237
2535
  {
@@ -2324,7 +2622,7 @@ var SegmentControl = react.forwardRef(
2324
2622
  }, ref) {
2325
2623
  const primeRef = react.useRef(null);
2326
2624
  react.useImperativeHandle(ref, () => primeRef.current?.getElement());
2327
- const classes = ["cr-segment", `cr-segment--${variant}`, className].filter(Boolean).join(" ");
2625
+ const classes2 = ["cr-segment", `cr-segment--${variant}`, className].filter(Boolean).join(" ");
2328
2626
  return /* @__PURE__ */ jsxRuntime.jsx(
2329
2627
  selectbutton.SelectButton,
2330
2628
  {
@@ -2349,7 +2647,7 @@ var SegmentControl = react.forwardRef(
2349
2647
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-segment__label", children: option.label })
2350
2648
  ] }),
2351
2649
  pt: {
2352
- root: { className: classes },
2650
+ root: { className: classes2 },
2353
2651
  button: {
2354
2652
  className: "cr-segment__item",
2355
2653
  // O Prime só ativa com a barra de espaço; um role=button responde também ao Enter.
@@ -2373,7 +2671,7 @@ var Skeleton = react.forwardRef(function Skeleton2({
2373
2671
  }, ref) {
2374
2672
  const primeRef = react.useRef(null);
2375
2673
  react.useImperativeHandle(ref, () => primeRef.current?.getElement());
2376
- const classes = [
2674
+ const classes2 = [
2377
2675
  "cr-skeleton",
2378
2676
  `cr-skeleton--${shape}`,
2379
2677
  animated && "cr-skeleton--animated",
@@ -2389,7 +2687,7 @@ var Skeleton = react.forwardRef(function Skeleton2({
2389
2687
  height,
2390
2688
  size,
2391
2689
  animation: animated ? "wave" : "none",
2392
- pt: { root: { ...props, className: classes } }
2690
+ pt: { root: { ...props, className: classes2 } }
2393
2691
  }
2394
2692
  );
2395
2693
  });
@@ -2409,14 +2707,14 @@ var Switch = react.forwardRef(function Switch2({
2409
2707
  }, ref) {
2410
2708
  const autoId = react.useId();
2411
2709
  const inputId = id ?? autoId;
2412
- const classes = [
2710
+ const classes2 = [
2413
2711
  "cr-switch",
2414
2712
  `cr-switch--${size}`,
2415
2713
  `cr-switch--label-${labelPosition}`,
2416
2714
  disabled && "cr-switch--disabled",
2417
2715
  className
2418
2716
  ].filter(Boolean).join(" ");
2419
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, style, children: [
2717
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes2, style, children: [
2420
2718
  /* @__PURE__ */ jsxRuntime.jsx(
2421
2719
  inputswitch.InputSwitch,
2422
2720
  {
@@ -2592,7 +2890,7 @@ function coluna(element, index, opcoes) {
2592
2890
  const { help, header, align, selectionMode, ...props } = element.props;
2593
2891
  const { carregando, ajustada, abrirMenu } = opcoes;
2594
2892
  const frozen = opcoes.fixada ?? props.frozen;
2595
- const chave = chaveDaColuna(element.props, index);
2893
+ const chave2 = chaveDaColuna(element.props, index);
2596
2894
  const celula = [
2597
2895
  "cr-table__cell",
2598
2896
  `cr-table__cell--${align ?? "left"}`,
@@ -2622,7 +2920,7 @@ function coluna(element, index, opcoes) {
2622
2920
  // Botão direito (ou a tecla de menu) no cabeçalho: o menu de contexto da coluna.
2623
2921
  ...abrirMenu && !selectionMode && !carregando && {
2624
2922
  onContextMenu: (event) => abrirMenu(event, {
2625
- chave,
2923
+ chave: chave2,
2626
2924
  titulo: typeof header === "string" ? header : props.field ?? "",
2627
2925
  sortField: props.sortField ?? props.field,
2628
2926
  sortable: Boolean(props.sortable),
@@ -2639,7 +2937,7 @@ function coluna(element, index, opcoes) {
2639
2937
  rowCheckbox: caixa("Selecionar linha")
2640
2938
  }
2641
2939
  },
2642
- element.key ?? chave
2940
+ element.key ?? chave2
2643
2941
  );
2644
2942
  }
2645
2943
  function TableBase({
@@ -2797,11 +3095,11 @@ function TableBase({
2797
3095
  }
2798
3096
  },
2799
3097
  children: elementos.map((element, index) => {
2800
- const chave = chaveDaColuna(element.props, index);
3098
+ const chave2 = chaveDaColuna(element.props, index);
2801
3099
  return coluna(element, index, {
2802
3100
  carregando,
2803
- fixada: fixadas[chave],
2804
- ajustada: Boolean(ajustadas[chave]),
3101
+ fixada: fixadas[chave2],
3102
+ ajustada: Boolean(ajustadas[chave2]),
2805
3103
  abrirMenu: columnMenu ? abrirMenu : void 0
2806
3104
  });
2807
3105
  })
@@ -2895,7 +3193,7 @@ function BarraDeFiltros({
2895
3193
  clearLabel
2896
3194
  }) {
2897
3195
  const chipsRef = react.useRef(null);
2898
- const [setas, setSetas] = react.useState({ esquerda: false, direita: false });
3196
+ const [setas2, setSetas] = react.useState({ esquerda: false, direita: false });
2899
3197
  const medir = react.useCallback(() => {
2900
3198
  const chips = chipsRef.current;
2901
3199
  if (!chips) return;
@@ -2918,7 +3216,7 @@ function BarraDeFiltros({
2918
3216
  behavior: "smooth"
2919
3217
  });
2920
3218
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-table-toolbar__filters", children: [
2921
- setas.esquerda && /* @__PURE__ */ jsxRuntime.jsx(
3219
+ setas2.esquerda && /* @__PURE__ */ jsxRuntime.jsx(
2922
3220
  IconButton,
2923
3221
  {
2924
3222
  variant: "tertiary",
@@ -2949,7 +3247,7 @@ function BarraDeFiltros({
2949
3247
  },
2950
3248
  `${filter.label}:${filter.value}`
2951
3249
  )) }),
2952
- setas.direita && /* @__PURE__ */ jsxRuntime.jsx(
3250
+ setas2.direita && /* @__PURE__ */ jsxRuntime.jsx(
2953
3251
  IconButton,
2954
3252
  {
2955
3253
  variant: "tertiary",
@@ -3166,12 +3464,14 @@ exports.AccordionTab = AccordionTab;
3166
3464
  exports.AutoComplete = AutoComplete;
3167
3465
  exports.Badge = Badge;
3168
3466
  exports.Button = Button;
3467
+ exports.Calendar = Calendar;
3169
3468
  exports.Card = Card;
3170
3469
  exports.Chart = Chart;
3171
3470
  exports.Checkbox = Checkbox;
3172
3471
  exports.Chip = Chip;
3173
3472
  exports.Column = Column;
3174
3473
  exports.ContextMenu = ContextMenu;
3474
+ exports.DatePicker = DatePicker;
3175
3475
  exports.Divider = Divider;
3176
3476
  exports.Drawer = Drawer;
3177
3477
  exports.IconButton = IconButton;