@aspprev/versi-ds 0.2.0 → 0.4.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.
@@ -143,9 +143,6 @@ var Modal = ({
143
143
  var Modal_default = Modal;
144
144
 
145
145
  // src/components/InputSwitch/InputSwitch.tsx
146
- import {
147
- Switch as HeadlessSwitch
148
- } from "@headlessui/react";
149
146
  import { useState } from "react";
150
147
 
151
148
  // src/components/InputSwitch/InputSwitch.style.ts
@@ -256,10 +253,16 @@ var InputSwitch_style_default = getInputSwitchStyles;
256
253
 
257
254
  // src/components/InputSwitch/InputSwitch.tsx
258
255
  import { MdCheck, MdOutlineClose as MdOutlineClose2, MdSunny, MdNightsStay } from "react-icons/md";
259
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
256
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
260
257
  var InputSwitch = (_a) => {
261
258
  var _b = _a, {
262
259
  defaultEnable: enabledByDefault,
260
+ id,
261
+ name,
262
+ value,
263
+ form,
264
+ autoFocus,
265
+ tabIndex,
263
266
  variant = "primary",
264
267
  size = "md",
265
268
  disabled,
@@ -268,6 +271,12 @@ var InputSwitch = (_a) => {
268
271
  icon: Icon
269
272
  } = _b, rest = __objRest(_b, [
270
273
  "defaultEnable",
274
+ "id",
275
+ "name",
276
+ "value",
277
+ "form",
278
+ "autoFocus",
279
+ "tabIndex",
271
280
  "variant",
272
281
  "size",
273
282
  "disabled",
@@ -290,59 +299,177 @@ var InputSwitch = (_a) => {
290
299
  }
291
300
  onChange == null ? void 0 : onChange(newState);
292
301
  };
293
- return /* @__PURE__ */ jsxs2(
294
- HeadlessSwitch,
295
- __spreadProps(__spreadValues({
296
- checked: resolvedEnabled,
297
- onChange: toggle,
298
- disabled: disabled != null ? disabled : false,
299
- className: style.Container
300
- }, rest), {
302
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
303
+ name && /* @__PURE__ */ jsx2(
304
+ "input",
305
+ {
306
+ type: "checkbox",
307
+ name,
308
+ value: value != null ? value : "on",
309
+ form,
310
+ checked: resolvedEnabled,
311
+ readOnly: true,
312
+ tabIndex: -1,
313
+ "aria-hidden": "true",
314
+ className: "sr-only"
315
+ }
316
+ ),
317
+ /* @__PURE__ */ jsxs2(
318
+ "button",
319
+ __spreadProps(__spreadValues({}, rest), {
320
+ id,
321
+ type: "button",
322
+ role: "switch",
323
+ "aria-checked": resolvedEnabled,
324
+ disabled: disabled != null ? disabled : false,
325
+ autoFocus,
326
+ tabIndex,
327
+ onClick: toggle,
328
+ className: style.Container,
329
+ children: [
330
+ variant !== "contract" && variant !== "theme" && /* @__PURE__ */ jsx2("span", { className: style.Switch, children: Icon && /* @__PURE__ */ jsx2(Icon, { "aria-hidden": "true", className: style.Icon }) }),
331
+ variant === "contract" && /* @__PURE__ */ jsxs2("span", { className: style.Switch, children: [
332
+ resolvedEnabled && /* @__PURE__ */ jsx2(MdCheck, { className: style.Icon, "aria-disabled": disabled }),
333
+ resolvedEnabled || /* @__PURE__ */ jsx2(MdOutlineClose2, { className: style.Icon, "aria-disabled": disabled })
334
+ ] }),
335
+ variant === "theme" && /* @__PURE__ */ jsxs2("span", { className: style.SwitchTheme, children: [
336
+ resolvedEnabled && /* @__PURE__ */ jsx2(
337
+ MdNightsStay,
338
+ {
339
+ className: style.IconTheme,
340
+ "aria-disabled": disabled
341
+ }
342
+ ),
343
+ resolvedEnabled || /* @__PURE__ */ jsx2(MdSunny, { className: style.IconTheme, "aria-disabled": disabled })
344
+ ] })
345
+ ]
346
+ })
347
+ )
348
+ ] });
349
+ };
350
+ var InputSwitch_default = InputSwitch;
351
+
352
+ // src/components/accessibility-preferences/ContrastPreference.tsx
353
+ import { MdContrast } from "react-icons/md";
354
+
355
+ // src/components/accessibility-preferences/PreferenceSection.tsx
356
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
357
+ function PreferenceSection({
358
+ title,
359
+ description,
360
+ icon: Icon,
361
+ children,
362
+ className
363
+ }) {
364
+ return /* @__PURE__ */ jsxs3(
365
+ "fieldset",
366
+ {
367
+ className: `rounded-md border border-border-default bg-surface-subtle p-4 tablet:p-5 ${className != null ? className : ""}`.trim(),
301
368
  children: [
302
- variant !== "contract" && variant !== "theme" && /* @__PURE__ */ jsx2("span", { className: style.Switch, children: Icon && /* @__PURE__ */ jsx2(Icon, { "aria-hidden": "true", className: style.Icon }) }),
303
- variant === "contract" && /* @__PURE__ */ jsxs2("span", { className: style.Switch, children: [
304
- resolvedEnabled && /* @__PURE__ */ jsx2(MdCheck, { className: style.Icon, "aria-disabled": disabled }),
305
- resolvedEnabled || /* @__PURE__ */ jsx2(MdOutlineClose2, { className: style.Icon, "aria-disabled": disabled })
369
+ /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: title }),
370
+ /* @__PURE__ */ jsxs3("div", { className: "mb-4 flex items-start gap-3", children: [
371
+ /* @__PURE__ */ jsx3("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary-5 text-primary-1", children: /* @__PURE__ */ jsx3(Icon, { "aria-hidden": "true", className: "h-5 w-5" }) }),
372
+ /* @__PURE__ */ jsxs3("div", { children: [
373
+ /* @__PURE__ */ jsx3("h3", { className: "font-bold", children: title }),
374
+ /* @__PURE__ */ jsx3("p", { className: "text-sm text-content-secondary", children: description })
375
+ ] })
306
376
  ] }),
307
- variant === "theme" && /* @__PURE__ */ jsxs2("span", { className: style.SwitchTheme, children: [
308
- resolvedEnabled && /* @__PURE__ */ jsx2(
309
- MdNightsStay,
310
- {
311
- className: style.IconTheme,
312
- "aria-disabled": disabled
313
- }
314
- ),
315
- resolvedEnabled || /* @__PURE__ */ jsx2(MdSunny, { className: style.IconTheme, "aria-disabled": disabled })
316
- ] })
377
+ children
317
378
  ]
318
- })
379
+ }
319
380
  );
320
- };
321
- var InputSwitch_default = InputSwitch;
381
+ }
322
382
 
323
- // src/components/accessibility-preferences/AccessibilityPreferencesPanel.tsx
324
- import { useId, useState as useState2 } from "react";
383
+ // src/components/accessibility-preferences/ContrastPreference.tsx
384
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
385
+ function ContrastPreference({
386
+ checked,
387
+ onChange,
388
+ className
389
+ }) {
390
+ return /* @__PURE__ */ jsx4(
391
+ PreferenceSection,
392
+ {
393
+ title: "Contraste",
394
+ description: "Aumente a diferencia\xE7\xE3o entre conte\xFAdo e superf\xEDcie.",
395
+ icon: MdContrast,
396
+ className,
397
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex min-h-16 items-center justify-between gap-4 rounded-sm border border-border-default bg-surface-card px-3 py-3", children: [
398
+ /* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1.5 font-semibold", children: [
399
+ /* @__PURE__ */ jsx4(MdContrast, { "aria-hidden": "true", className: "h-4 w-4" }),
400
+ "Alto contraste"
401
+ ] }),
402
+ /* @__PURE__ */ jsx4(
403
+ InputSwitch_default,
404
+ {
405
+ "aria-label": "Alternar alto contraste",
406
+ checked,
407
+ size: "lg",
408
+ onChange
409
+ }
410
+ )
411
+ ] })
412
+ }
413
+ );
414
+ }
415
+
416
+ // src/components/accessibility-preferences/FontSizePreference.tsx
417
+ import { useId } from "react";
418
+ import { MdTextFields } from "react-icons/md";
419
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
420
+ var FONT_SCALE_OPTIONS = [
421
+ { value: "standard", label: "Padr\xE3o" },
422
+ { value: "large", label: "Grande" },
423
+ { value: "extra-large", label: "Muito grande" }
424
+ ];
425
+ function FontSizePreference({
426
+ value,
427
+ onChange,
428
+ className
429
+ }) {
430
+ const groupId = useId();
431
+ return /* @__PURE__ */ jsx5(
432
+ PreferenceSection,
433
+ {
434
+ title: "Tamanho do texto",
435
+ description: "Amplie os textos para facilitar a leitura.",
436
+ icon: MdTextFields,
437
+ className,
438
+ children: /* @__PURE__ */ jsx5("div", { className: "grid gap-2", children: FONT_SCALE_OPTIONS.map((option) => /* @__PURE__ */ jsxs5(
439
+ "label",
440
+ {
441
+ className: "flex min-h-11 cursor-pointer items-center gap-3 rounded-sm border border-border-default bg-surface-card p-3 text-content-primary transition-colors hover:border-border-strong hover:bg-surface-muted",
442
+ children: [
443
+ /* @__PURE__ */ jsx5(
444
+ "input",
445
+ {
446
+ type: "radio",
447
+ name: `${groupId}-font-scale`,
448
+ value: option.value,
449
+ checked: value === option.value,
450
+ onChange: () => onChange(option.value),
451
+ className: "radio-control shrink-0"
452
+ }
453
+ ),
454
+ /* @__PURE__ */ jsx5("span", { className: "flex w-9 shrink-0 justify-center font-extrabold text-primary-1", children: "Aa" }),
455
+ /* @__PURE__ */ jsx5("span", { className: "font-semibold", children: option.label })
456
+ ]
457
+ },
458
+ option.value
459
+ )) })
460
+ }
461
+ );
462
+ }
463
+
464
+ // src/components/accessibility-preferences/ReadingPreferences.tsx
325
465
  import {
326
466
  MdAccessibilityNew,
327
467
  MdAnimation,
328
468
  MdCenterFocusStrong,
329
- MdContrast,
330
- MdLink,
331
- MdPalette,
332
- MdRestartAlt,
333
- MdTextFields
469
+ MdLink
334
470
  } from "react-icons/md";
335
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
336
- var DEFAULT_ACCESSIBILITY_PREFERENCES = {
337
- colorScheme: "light",
338
- highContrast: false,
339
- highContrastTheme: "light",
340
- fontScale: "standard",
341
- reduceMotion: false,
342
- emphasizeFocus: false,
343
- underlineLinks: false
344
- };
345
- var readingOptions = [
471
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
472
+ var READING_OPTIONS = [
346
473
  {
347
474
  key: "reduceMotion",
348
475
  label: "Reduzir anima\xE7\xF5es",
@@ -362,8 +489,107 @@ var readingOptions = [
362
489
  Icon: MdLink
363
490
  }
364
491
  ];
365
- var sectionClass = "rounded-md border border-border-default bg-surface-subtle p-4 tablet:p-5";
366
- var choiceClass = "flex min-h-11 cursor-pointer gap-3 rounded-sm border border-border-default bg-surface-card p-3 text-content-primary transition-colors hover:border-border-strong hover:bg-surface-muted";
492
+ function ReadingPreferences({
493
+ reduceMotion,
494
+ emphasizeFocus,
495
+ underlineLinks,
496
+ onChange,
497
+ className
498
+ }) {
499
+ const values = { reduceMotion, emphasizeFocus, underlineLinks };
500
+ return /* @__PURE__ */ jsx6(
501
+ PreferenceSection,
502
+ {
503
+ title: "Leitura e navega\xE7\xE3o",
504
+ description: "Ajustes para reduzir distra\xE7\xF5es e facilitar a orienta\xE7\xE3o.",
505
+ icon: MdAccessibilityNew,
506
+ className: `desktop:col-span-2 ${className != null ? className : ""}`.trim(),
507
+ children: /* @__PURE__ */ jsx6("div", { className: "grid gap-3 tablet:grid-cols-3", children: READING_OPTIONS.map(({ key, label, description, Icon }) => /* @__PURE__ */ jsxs6(
508
+ "label",
509
+ {
510
+ className: "flex min-h-11 cursor-pointer items-start gap-3 rounded-sm border border-border-default bg-surface-card p-3 text-content-primary transition-colors hover:border-border-strong hover:bg-surface-muted",
511
+ children: [
512
+ /* @__PURE__ */ jsx6(
513
+ "input",
514
+ {
515
+ type: "checkbox",
516
+ "aria-label": label,
517
+ checked: values[key],
518
+ onChange: (event) => onChange({ [key]: event.target.checked }),
519
+ className: "checkbox-control mt-1"
520
+ }
521
+ ),
522
+ /* @__PURE__ */ jsxs6("span", { children: [
523
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2 font-semibold", children: [
524
+ /* @__PURE__ */ jsx6(Icon, { "aria-hidden": "true", className: "h-5 w-5 shrink-0 text-primary-1" }),
525
+ label
526
+ ] }),
527
+ /* @__PURE__ */ jsx6("span", { className: "mt-1 block text-sm text-content-secondary", children: description })
528
+ ] })
529
+ ]
530
+ },
531
+ key
532
+ )) })
533
+ }
534
+ );
535
+ }
536
+
537
+ // src/components/accessibility-preferences/ThemePreference.tsx
538
+ import { MdPalette } from "react-icons/md";
539
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
540
+ function ThemePreference({
541
+ value,
542
+ onChange,
543
+ className
544
+ }) {
545
+ const isDark = value === "dark";
546
+ const isSystem = value === "system";
547
+ return /* @__PURE__ */ jsx7(
548
+ PreferenceSection,
549
+ {
550
+ title: "Apar\xEAncia",
551
+ description: "Tema e esquema de cores da interface.",
552
+ icon: MdPalette,
553
+ className,
554
+ children: /* @__PURE__ */ jsxs7("div", { className: "divide-y divide-border-subtle rounded-sm border border-border-default bg-surface-card px-3", children: [
555
+ /* @__PURE__ */ jsxs7("div", { className: "flex min-h-16 items-center justify-between gap-4 py-3", children: [
556
+ /* @__PURE__ */ jsxs7("span", { className: "font-semibold", children: [
557
+ "Tema ",
558
+ isDark ? "escuro" : "claro"
559
+ ] }),
560
+ /* @__PURE__ */ jsx7(
561
+ InputSwitch_default,
562
+ {
563
+ "aria-label": "Alternar tema claro ou escuro",
564
+ variant: "theme",
565
+ size: "lg",
566
+ checked: isDark,
567
+ disabled: isSystem,
568
+ onChange: (enabled) => onChange(enabled ? "dark" : "light")
569
+ }
570
+ )
571
+ ] }),
572
+ /* @__PURE__ */ jsxs7("label", { className: "flex min-h-14 cursor-pointer items-start gap-3 py-3", children: [
573
+ /* @__PURE__ */ jsx7(
574
+ "input",
575
+ {
576
+ type: "checkbox",
577
+ className: "checkbox-control mt-0.5",
578
+ checked: isSystem,
579
+ onChange: (event) => onChange(event.target.checked ? "system" : isDark ? "dark" : "light")
580
+ }
581
+ ),
582
+ /* @__PURE__ */ jsx7("span", { className: "font-semibold", children: "Usar configura\xE7\xE3o do dispositivo" })
583
+ ] })
584
+ ] })
585
+ }
586
+ );
587
+ }
588
+
589
+ // src/components/accessibility-preferences/AccessibilityPreferencesPanel.tsx
590
+ import { useState as useState2 } from "react";
591
+ import { MdAccessibilityNew as MdAccessibilityNew2, MdRestartAlt } from "react-icons/md";
592
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
367
593
  function AccessibilityPreferencesPanel({
368
594
  preferences,
369
595
  onPreferencesChange,
@@ -376,7 +602,6 @@ function AccessibilityPreferencesPanel({
376
602
  }) {
377
603
  const [internalOpen, setInternalOpen] = useState2(false);
378
604
  const [announcement, setAnnouncement] = useState2("");
379
- const titleId = useId();
380
605
  const isOpen = controlledOpen != null ? controlledOpen : internalOpen;
381
606
  const setOpen = (open) => {
382
607
  if (controlledOpen === void 0) setInternalOpen(open);
@@ -386,9 +611,8 @@ function AccessibilityPreferencesPanel({
386
611
  onPreferencesChange(changes);
387
612
  setAnnouncement(message);
388
613
  };
389
- const isDark = preferences.colorScheme === "dark";
390
- return /* @__PURE__ */ jsxs3(Fragment2, { children: [
391
- showTrigger && /* @__PURE__ */ jsxs3(
614
+ return /* @__PURE__ */ jsxs8(Fragment3, { children: [
615
+ showTrigger && /* @__PURE__ */ jsxs8(
392
616
  "button",
393
617
  {
394
618
  type: "button",
@@ -397,12 +621,12 @@ function AccessibilityPreferencesPanel({
397
621
  onClick: () => setOpen(true),
398
622
  className: `inline-flex min-h-11 items-center justify-center gap-2 rounded-sm border-2 border-action-primary-content bg-action-primary px-3 text-sm font-bold text-action-primary-content shadow-sm hover:bg-action-primary-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ${className != null ? className : ""}`.trim(),
399
623
  children: [
400
- /* @__PURE__ */ jsx3(MdAccessibilityNew, { "aria-hidden": "true", className: "h-5 w-5" }),
401
- /* @__PURE__ */ jsx3("span", { children: triggerLabel })
624
+ /* @__PURE__ */ jsx8(MdAccessibilityNew2, { "aria-hidden": "true", className: "h-5 w-5" }),
625
+ /* @__PURE__ */ jsx8("span", { children: triggerLabel })
402
626
  ]
403
627
  }
404
628
  ),
405
- /* @__PURE__ */ jsxs3(
629
+ /* @__PURE__ */ jsxs8(
406
630
  Modal_default,
407
631
  {
408
632
  isOpen,
@@ -411,130 +635,99 @@ function AccessibilityPreferencesPanel({
411
635
  showIcon: false,
412
636
  size: "large",
413
637
  children: [
414
- /* @__PURE__ */ jsx3("p", { className: "mt-2 text-center text-sm text-content-secondary", children: "As altera\xE7\xF5es s\xE3o aplicadas pelo consumidor do componente." }),
415
- /* @__PURE__ */ jsxs3("div", { className: "mt-5 grid gap-4 desktop:grid-cols-2", children: [
416
- /* @__PURE__ */ jsxs3("fieldset", { className: sectionClass, children: [
417
- /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: "Apar\xEAncia" }),
418
- /* @__PURE__ */ jsxs3("div", { className: "mb-4 flex items-start gap-3", children: [
419
- /* @__PURE__ */ jsx3("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary-5 text-primary-1", children: /* @__PURE__ */ jsx3(MdPalette, { "aria-hidden": "true", className: "h-5 w-5" }) }),
420
- /* @__PURE__ */ jsxs3("div", { children: [
421
- /* @__PURE__ */ jsx3("h3", { className: "font-bold", children: "Apar\xEAncia" }),
422
- /* @__PURE__ */ jsx3("p", { className: "text-sm text-content-secondary", children: "Tema e contraste visual." })
423
- ] })
424
- ] }),
425
- /* @__PURE__ */ jsxs3("div", { className: "divide-y divide-border-subtle rounded-sm border border-border-default bg-surface-card px-3", children: [
426
- /* @__PURE__ */ jsxs3("div", { className: "flex min-h-16 items-center justify-between gap-4 py-3", children: [
427
- /* @__PURE__ */ jsxs3("span", { className: "font-semibold", children: [
428
- "Tema ",
429
- isDark ? "escuro" : "claro"
430
- ] }),
431
- /* @__PURE__ */ jsx3(
432
- InputSwitch_default,
433
- {
434
- "aria-label": "Alternar tema claro ou escuro",
435
- variant: "theme",
436
- size: "lg",
437
- checked: isDark,
438
- disabled: preferences.colorScheme === "system",
439
- onChange: (enabled) => update(
440
- { colorScheme: enabled ? "dark" : "light", highContrastTheme: enabled ? "dark" : "light" },
441
- `Tema ${enabled ? "escuro" : "claro"} ativado.`
442
- )
443
- }
444
- )
445
- ] }),
446
- /* @__PURE__ */ jsxs3("label", { className: "flex min-h-14 cursor-pointer items-start gap-3 py-3", children: [
447
- /* @__PURE__ */ jsx3(
448
- "input",
449
- {
450
- type: "checkbox",
451
- className: "checkbox-control mt-0.5",
452
- checked: preferences.colorScheme === "system",
453
- onChange: (event) => update(
454
- { colorScheme: event.target.checked ? "system" : isDark ? "dark" : "light" },
455
- event.target.checked ? "Tema definido pelo dispositivo." : "Tema do dispositivo desativado."
456
- )
457
- }
458
- ),
459
- /* @__PURE__ */ jsx3("span", { className: "font-semibold", children: "Usar configura\xE7\xE3o do dispositivo" })
460
- ] }),
461
- /* @__PURE__ */ jsxs3("div", { className: "flex min-h-16 items-center justify-between gap-4 py-3", children: [
462
- /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1.5 font-semibold", children: [
463
- /* @__PURE__ */ jsx3(MdContrast, { "aria-hidden": "true", className: "h-4 w-4" }),
464
- "Alto contraste"
465
- ] }),
466
- /* @__PURE__ */ jsx3(
467
- InputSwitch_default,
468
- {
469
- "aria-label": "Alternar alto contraste",
470
- checked: preferences.highContrast,
471
- size: "lg",
472
- onChange: (enabled) => update({ highContrast: enabled }, `Alto contraste ${enabled ? "ativado" : "desativado"}.`)
473
- }
474
- )
475
- ] })
476
- ] })
477
- ] }),
478
- /* @__PURE__ */ jsxs3("fieldset", { className: sectionClass, children: [
479
- /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: "Tamanho do texto" }),
480
- /* @__PURE__ */ jsxs3("div", { className: "mb-4 flex items-start gap-3", children: [
481
- /* @__PURE__ */ jsx3("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary-5 text-primary-1", children: /* @__PURE__ */ jsx3(MdTextFields, { "aria-hidden": "true", className: "h-5 w-5" }) }),
482
- /* @__PURE__ */ jsxs3("div", { children: [
483
- /* @__PURE__ */ jsx3("h3", { className: "font-bold", children: "Tamanho do texto" }),
484
- /* @__PURE__ */ jsx3("p", { className: "text-sm text-content-secondary", children: "Amplie os textos para facilitar a leitura." })
485
- ] })
486
- ] }),
487
- /* @__PURE__ */ jsx3("div", { className: "grid gap-2", children: ["standard", "large", "extra-large"].map((scale) => /* @__PURE__ */ jsxs3("label", { className: `${choiceClass} items-center`, children: [
488
- /* @__PURE__ */ jsx3("input", { type: "radio", name: `${titleId}-font-scale`, value: scale, checked: preferences.fontScale === scale, onChange: () => update({ fontScale: scale }, `Tamanho do texto alterado.`), className: "radio-control shrink-0" }),
489
- /* @__PURE__ */ jsx3("span", { className: "flex w-9 shrink-0 justify-center font-extrabold text-primary-1", children: "Aa" }),
490
- /* @__PURE__ */ jsx3("span", { className: "font-semibold", children: scale === "standard" ? "Padr\xE3o" : scale === "large" ? "Grande" : "Muito grande" })
491
- ] }, scale)) })
492
- ] }),
493
- /* @__PURE__ */ jsxs3("fieldset", { className: `${sectionClass} desktop:col-span-2`, children: [
494
- /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: "Leitura e navega\xE7\xE3o" }),
495
- /* @__PURE__ */ jsxs3("div", { className: "mb-4 flex items-start gap-3", children: [
496
- /* @__PURE__ */ jsx3("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary-5 text-primary-1", children: /* @__PURE__ */ jsx3(MdAccessibilityNew, { "aria-hidden": "true", className: "h-5 w-5" }) }),
497
- /* @__PURE__ */ jsxs3("div", { children: [
498
- /* @__PURE__ */ jsx3("h3", { className: "font-bold", children: "Leitura e navega\xE7\xE3o" }),
499
- /* @__PURE__ */ jsx3("p", { className: "text-sm text-content-secondary", children: "Ajustes para reduzir distra\xE7\xF5es e facilitar a orienta\xE7\xE3o." })
500
- ] })
501
- ] }),
502
- /* @__PURE__ */ jsx3("div", { className: "grid gap-3 tablet:grid-cols-3", children: readingOptions.map(({ key, label, description, Icon }) => /* @__PURE__ */ jsxs3("label", { className: `${choiceClass} items-start`, children: [
503
- /* @__PURE__ */ jsx3("input", { type: "checkbox", checked: preferences[key], onChange: (event) => update({ [key]: event.target.checked }, `${label} ${event.target.checked ? "ativado" : "desativado"}.`), className: "checkbox-control mt-1" }),
504
- /* @__PURE__ */ jsxs3("span", { children: [
505
- /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-2 font-semibold", children: [
506
- /* @__PURE__ */ jsx3(Icon, { "aria-hidden": "true", className: "h-5 w-5 shrink-0 text-primary-1" }),
507
- label
508
- ] }),
509
- /* @__PURE__ */ jsx3("span", { className: "mt-1 block text-sm text-content-secondary", children: description })
510
- ] })
511
- ] }, key)) })
512
- ] })
638
+ /* @__PURE__ */ jsx8("p", { className: "mt-2 text-center text-sm text-content-secondary", children: "As altera\xE7\xF5es s\xE3o aplicadas pelo consumidor do componente." }),
639
+ /* @__PURE__ */ jsxs8("div", { className: "mt-5 grid gap-4 desktop:grid-cols-2", children: [
640
+ /* @__PURE__ */ jsx8(
641
+ ThemePreference,
642
+ {
643
+ value: preferences.colorScheme,
644
+ onChange: (colorScheme) => update(
645
+ __spreadValues({
646
+ colorScheme
647
+ }, colorScheme === "system" ? {} : {
648
+ highContrastTheme: colorScheme === "dark" ? "dark" : "light"
649
+ }),
650
+ `Tema ${colorScheme === "dark" ? "escuro" : colorScheme === "light" ? "claro" : "do dispositivo"} ativado.`
651
+ )
652
+ }
653
+ ),
654
+ /* @__PURE__ */ jsx8(
655
+ ContrastPreference,
656
+ {
657
+ checked: preferences.highContrast,
658
+ onChange: (highContrast) => update(
659
+ { highContrast },
660
+ `Alto contraste ${highContrast ? "ativado" : "desativado"}.`
661
+ )
662
+ }
663
+ ),
664
+ /* @__PURE__ */ jsx8(
665
+ FontSizePreference,
666
+ {
667
+ value: preferences.fontScale,
668
+ onChange: (fontScale) => update({ fontScale }, "Tamanho do texto alterado.")
669
+ }
670
+ ),
671
+ /* @__PURE__ */ jsx8(
672
+ ReadingPreferences,
673
+ {
674
+ reduceMotion: preferences.reduceMotion,
675
+ emphasizeFocus: preferences.emphasizeFocus,
676
+ underlineLinks: preferences.underlineLinks,
677
+ onChange: (changes) => {
678
+ const key = Object.keys(changes)[0];
679
+ const label = key === "reduceMotion" ? "Reduzir anima\xE7\xF5es" : key === "emphasizeFocus" ? "Destacar foco" : "Sublinhar links";
680
+ update(
681
+ changes,
682
+ `${label} ${changes[key] ? "ativado" : "desativado"}.`
683
+ );
684
+ }
685
+ }
686
+ )
513
687
  ] }),
514
- /* @__PURE__ */ jsx3("div", { className: "mt-5 flex justify-center border-t border-border-subtle pt-4 tablet:justify-start", children: /* @__PURE__ */ jsxs3("button", { type: "button", onClick: () => {
515
- onReset == null ? void 0 : onReset();
516
- setAnnouncement("Configura\xE7\xF5es padr\xE3o restauradas.");
517
- }, className: "inline-flex min-h-11 items-center gap-2 rounded-sm border-2 border-action-primary px-4 font-bold text-content-link hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring", children: [
518
- /* @__PURE__ */ jsx3(MdRestartAlt, { "aria-hidden": "true", className: "h-5 w-5" }),
519
- "Restaurar configura\xE7\xF5es padr\xE3o"
520
- ] }) }),
521
- /* @__PURE__ */ jsx3("p", { className: "sr-only", role: "status", "aria-live": "polite", children: announcement })
688
+ /* @__PURE__ */ jsx8("div", { className: "mt-5 flex justify-center border-t border-border-subtle pt-4 tablet:justify-start", children: /* @__PURE__ */ jsxs8(
689
+ "button",
690
+ {
691
+ type: "button",
692
+ onClick: () => {
693
+ onReset == null ? void 0 : onReset();
694
+ setAnnouncement("Configura\xE7\xF5es padr\xE3o restauradas.");
695
+ },
696
+ className: "inline-flex min-h-11 items-center gap-2 rounded-sm border-2 border-action-primary px-4 font-bold text-content-link hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
697
+ children: [
698
+ /* @__PURE__ */ jsx8(MdRestartAlt, { "aria-hidden": "true", className: "h-5 w-5" }),
699
+ "Restaurar configura\xE7\xF5es padr\xE3o"
700
+ ]
701
+ }
702
+ ) }),
703
+ /* @__PURE__ */ jsx8("p", { className: "sr-only", role: "status", "aria-live": "polite", children: announcement })
522
704
  ]
523
705
  }
524
706
  )
525
707
  ] });
526
708
  }
527
709
 
710
+ // src/components/accessibility-preferences/types.ts
711
+ var DEFAULT_ACCESSIBILITY_PREFERENCES = {
712
+ colorScheme: "light",
713
+ highContrast: false,
714
+ highContrastTheme: "light",
715
+ fontScale: "standard",
716
+ reduceMotion: false,
717
+ emphasizeFocus: false,
718
+ underlineLinks: false
719
+ };
720
+
528
721
  // src/components/accessibility-preferences/HighContrastToggle.tsx
529
722
  import { MdContrast as MdContrast2 } from "react-icons/md";
530
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
723
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
531
724
  function HighContrastToggle({
532
725
  checked,
533
726
  onChange,
534
727
  label = "Alto contraste",
535
728
  className
536
729
  }) {
537
- return /* @__PURE__ */ jsxs4(
730
+ return /* @__PURE__ */ jsxs9(
538
731
  "button",
539
732
  {
540
733
  type: "button",
@@ -542,9 +735,9 @@ function HighContrastToggle({
542
735
  onClick: () => onChange(!checked),
543
736
  className: `inline-flex min-h-11 items-center justify-center gap-2 rounded-sm border-2 border-action-primary-content bg-action-primary px-3 text-sm font-bold text-action-primary-content shadow-sm hover:bg-action-primary-hover active:bg-action-primary-active focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ${className != null ? className : ""}`.trim(),
544
737
  children: [
545
- /* @__PURE__ */ jsx4(MdContrast2, { "aria-hidden": "true", className: "h-5 w-5" }),
546
- /* @__PURE__ */ jsx4("span", { children: label }),
547
- /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", className: "rounded-sm bg-surface-card px-1.5 py-0.5 text-xs text-content-primary", children: checked ? "Ativado" : "Desativado" })
738
+ /* @__PURE__ */ jsx9(MdContrast2, { "aria-hidden": "true", className: "h-5 w-5" }),
739
+ /* @__PURE__ */ jsx9("span", { children: label }),
740
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "rounded-sm bg-surface-card px-1.5 py-0.5 text-xs text-content-primary", children: checked ? "Ativado" : "Desativado" })
548
741
  ]
549
742
  }
550
743
  );
@@ -553,8 +746,12 @@ function HighContrastToggle({
553
746
  export {
554
747
  Modal_default,
555
748
  InputSwitch_default,
556
- DEFAULT_ACCESSIBILITY_PREFERENCES,
749
+ ContrastPreference,
750
+ FontSizePreference,
751
+ ReadingPreferences,
752
+ ThemePreference,
557
753
  AccessibilityPreferencesPanel,
754
+ DEFAULT_ACCESSIBILITY_PREFERENCES,
558
755
  HighContrastToggle
559
756
  };
560
- //# sourceMappingURL=chunk-JSPXVXUY.js.map
757
+ //# sourceMappingURL=chunk-WOD44OEH.js.map