@adatechnology/conversations-ui 0.19.0 → 0.19.1

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/styles.css CHANGED
@@ -388,6 +388,10 @@
388
388
  padding: 0.5rem 0.75rem;
389
389
  font-size: 0.875rem;
390
390
  min-height: 2.75rem;
391
+ transition:
392
+ background-color 150ms ease-out,
393
+ color 150ms ease-out,
394
+ border-color 150ms ease-out;
391
395
  }
392
396
  .cv-workspace-toggle:disabled {
393
397
  opacity: 0.5;
@@ -628,6 +632,21 @@
628
632
  white-space: nowrap;
629
633
  border-radius: 0.375rem;
630
634
  padding: 0.25rem 0.5rem;
635
+ transition:
636
+ background-color 150ms ease-out,
637
+ color 150ms ease-out,
638
+ border-color 150ms ease-out;
639
+ }
640
+ .cv-workspace-chip:focus-visible,
641
+ .cv-workspace-toggle:focus-visible {
642
+ outline: 2px solid rgb(37 99 235);
643
+ outline-offset: 2px;
644
+ }
645
+ @media (prefers-reduced-motion: reduce) {
646
+ .cv-workspace-chip,
647
+ .cv-workspace-toggle {
648
+ transition: none;
649
+ }
631
650
  }
632
651
  .cv-workspace-chip--on {
633
652
  background: rgb(229 231 235);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/conversations-ui",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "WhatsApp conversation UI components — parametrizável por endpoint, tema e feature flags",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/styles.css CHANGED
@@ -355,6 +355,7 @@
355
355
  font-size: 0.875rem;
356
356
  /* 44px de área de toque em mobile — abaixo disso o dedo erra o alvo. */
357
357
  min-height: 2.75rem;
358
+ transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
358
359
  }
359
360
  .cv-workspace-toggle:disabled { opacity: 0.5; }
360
361
  .cv-workspace-toggle--on { background: rgb(37 99 235); color: #fff; border-color: rgb(37 99 235); }
@@ -575,6 +576,12 @@
575
576
  white-space: nowrap;
576
577
  border-radius: 0.375rem;
577
578
  padding: 0.25rem 0.5rem;
579
+
580
+ transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
581
+ }
582
+ .cv-workspace-chip:focus-visible, .cv-workspace-toggle:focus-visible { outline: 2px solid rgb(37 99 235); outline-offset: 2px; }
583
+ @media (prefers-reduced-motion: reduce) {
584
+ .cv-workspace-chip, .cv-workspace-toggle { transition: none; }
578
585
  }
579
586
  .cv-workspace-chip--on { background: rgb(229 231 235); }
580
587
  .dark .cv-workspace-chip--on { background: rgb(51 65 85); }
@@ -0,0 +1,34 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { join } from 'node:path'
3
+ import { describe, expect, it } from 'bun:test'
4
+
5
+ const CSS = readFileSync(join(import.meta.dir, 'styles.css'), 'utf8')
6
+
7
+ function ruleBody(selector: string): string {
8
+ const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
9
+ const match = new RegExp(`(?:^|\\n)${escaped}\\s*\\{([^}]*)\\}`).exec(CSS)
10
+ if (!match) throw new Error(`regra ${selector} não encontrada`)
11
+ return match[1] ?? ''
12
+ }
13
+
14
+ describe.each(['.cv-workspace-chip', '.cv-workspace-toggle'])('%s', (selector) => {
15
+ it('troca de cor com transição de 150 ms ease-out, sem animar layout', () => {
16
+ const body = ruleBody(selector)
17
+ expect(body).toMatch(/transition:[^;]*background-color 150ms ease-out/)
18
+ expect(body).toMatch(/transition:[^;]*color 150ms ease-out/)
19
+ expect(body).not.toMatch(/transition:[^;]*\ball\b/)
20
+ })
21
+ })
22
+
23
+ describe('chips de filtro do workspace', () => {
24
+ it('têm foco visível próprio', () => {
25
+ expect(CSS).toMatch(/\.cv-workspace-chip:focus-visible[^{]*\{[^}]*outline: 2px solid/)
26
+ expect(CSS).toContain('.cv-workspace-toggle:focus-visible')
27
+ })
28
+
29
+ it('zeram a transição com prefers-reduced-motion: reduce', () => {
30
+ expect(CSS).toMatch(
31
+ /@media \(prefers-reduced-motion: reduce\) \{\s*\.cv-workspace-chip, \.cv-workspace-toggle \{ transition: none; \}/,
32
+ )
33
+ })
34
+ })