@brightlocal/ui-components 2.24.1 → 2.26.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.
Files changed (162) hide show
  1. package/README.md +3 -2
  2. package/component-meta.json +331 -91
  3. package/dist/accordion.cjs +1 -1
  4. package/dist/accordion.js +2 -2
  5. package/dist/alert-dialog.cjs +1 -1
  6. package/dist/alert-dialog.js +17 -17
  7. package/dist/alert.cjs +1 -1
  8. package/dist/alert.d.ts +23 -9
  9. package/dist/alert.d.ts.map +1 -1
  10. package/dist/alert.js +95 -87
  11. package/dist/badge.cjs +1 -1
  12. package/dist/badge.js +9 -9
  13. package/dist/blocks/input-list.cjs +2 -2
  14. package/dist/blocks/input-list.d.ts.map +1 -1
  15. package/dist/blocks/input-list.js +43 -46
  16. package/dist/blocks/sidebar.cjs +1 -1
  17. package/dist/blocks/sidebar.js +14 -14
  18. package/dist/brand-illustration-motif.cjs +1 -1
  19. package/dist/brand-illustration-motif.js +11 -11
  20. package/dist/breadcrumb.cjs +1 -1
  21. package/dist/breadcrumb.js +1 -1
  22. package/dist/button.cjs +1 -1
  23. package/dist/button.js +10 -10
  24. package/dist/card.cjs +1 -1
  25. package/dist/card.js +1 -1
  26. package/dist/carousel.cjs +1 -1
  27. package/dist/carousel.js +12 -12
  28. package/dist/checkbox.cjs +1 -1
  29. package/dist/checkbox.js +7 -7
  30. package/dist/chip.cjs +1 -1
  31. package/dist/chip.js +7 -7
  32. package/dist/combobox.cjs +1 -1
  33. package/dist/combobox.js +1 -1
  34. package/dist/data-table.cjs +1 -1
  35. package/dist/data-table.d.ts +46 -1
  36. package/dist/data-table.d.ts.map +1 -1
  37. package/dist/data-table.js +8 -1
  38. package/dist/dialog.cjs +1 -1
  39. package/dist/dialog.js +61 -61
  40. package/dist/field.cjs +1 -1
  41. package/dist/field.js +1 -1
  42. package/dist/height-transition.cjs +1 -0
  43. package/dist/height-transition.d.ts +44 -0
  44. package/dist/height-transition.d.ts.map +1 -0
  45. package/dist/height-transition.js +63 -0
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +326 -324
  50. package/dist/input-chip.cjs +1 -1
  51. package/dist/input-chip.js +2 -2
  52. package/dist/input-group.cjs +1 -1
  53. package/dist/input-group.js +15 -15
  54. package/dist/input-otp.cjs +1 -1
  55. package/dist/input-otp.js +1 -1
  56. package/dist/input.cjs +1 -1
  57. package/dist/input.js +1 -1
  58. package/dist/lib/motion.cjs +1 -0
  59. package/dist/lib/motion.d.ts +70 -0
  60. package/dist/lib/motion.d.ts.map +1 -0
  61. package/dist/lib/motion.js +25 -0
  62. package/dist/lib/utils.cjs +1 -1
  63. package/dist/lib/utils.d.ts +1 -1
  64. package/dist/lib/utils.d.ts.map +1 -1
  65. package/dist/lib/utils.js +12 -4
  66. package/dist/link.cjs +1 -1
  67. package/dist/link.d.ts +6 -5
  68. package/dist/link.d.ts.map +1 -1
  69. package/dist/link.js +69 -94
  70. package/dist/list.cjs +1 -1
  71. package/dist/list.js +10 -10
  72. package/dist/loading.cjs +1 -1
  73. package/dist/loading.d.ts.map +1 -1
  74. package/dist/loading.js +45 -47
  75. package/dist/map.cjs +1 -1
  76. package/dist/map.d.ts.map +1 -1
  77. package/dist/map.js +2 -2
  78. package/dist/menubar.cjs +1 -1
  79. package/dist/menubar.js +5 -5
  80. package/dist/navigation-menu.cjs +1 -1
  81. package/dist/navigation-menu.js +13 -13
  82. package/dist/pagination.cjs +1 -1
  83. package/dist/pagination.js +1 -1
  84. package/dist/progress.cjs +1 -1
  85. package/dist/progress.d.ts.map +1 -1
  86. package/dist/progress.js +21 -25
  87. package/dist/radio-group.cjs +1 -1
  88. package/dist/radio-group.js +12 -12
  89. package/dist/scroll-area.cjs +1 -1
  90. package/dist/scroll-area.js +11 -11
  91. package/dist/select.cjs +1 -1
  92. package/dist/select.js +12 -12
  93. package/dist/sheet.cjs +1 -1
  94. package/dist/sheet.d.ts.map +1 -1
  95. package/dist/sheet.js +54 -50
  96. package/dist/slider.cjs +1 -1
  97. package/dist/slider.js +13 -13
  98. package/dist/stepper.cjs +1 -1
  99. package/dist/stepper.js +4 -4
  100. package/dist/switch.cjs +1 -1
  101. package/dist/switch.js +5 -5
  102. package/dist/table.cjs +1 -1
  103. package/dist/table.js +2 -2
  104. package/dist/tabs.cjs +1 -1
  105. package/dist/tabs.js +1 -1
  106. package/dist/text-reveal-motion.cjs +1 -1
  107. package/dist/text-reveal-motion.d.ts.map +1 -1
  108. package/dist/text-reveal-motion.js +77 -79
  109. package/dist/textarea.cjs +1 -1
  110. package/dist/textarea.js +11 -11
  111. package/dist/toggle.cjs +1 -1
  112. package/dist/toggle.js +5 -5
  113. package/package.json +10 -4
  114. package/src/blocks/input-list.tsx +3 -6
  115. package/src/blocks/sidebar.tsx +14 -14
  116. package/src/components/accordion.tsx +2 -2
  117. package/src/components/alert-dialog.tsx +2 -2
  118. package/src/components/alert.tsx +68 -33
  119. package/src/components/badge.tsx +1 -1
  120. package/src/components/brand-illustration-motif.tsx +1 -1
  121. package/src/components/breadcrumb.tsx +1 -1
  122. package/src/components/button.tsx +2 -2
  123. package/src/components/card.tsx +1 -1
  124. package/src/components/carousel.tsx +1 -1
  125. package/src/components/checkbox.tsx +1 -1
  126. package/src/components/chip.tsx +2 -2
  127. package/src/components/combobox.tsx +1 -1
  128. package/src/components/data-table.tsx +54 -2
  129. package/src/components/dialog.tsx +3 -3
  130. package/src/components/field.tsx +1 -1
  131. package/src/components/height-transition.tsx +164 -0
  132. package/src/components/input-chip.tsx +2 -2
  133. package/src/components/input-group.tsx +2 -2
  134. package/src/components/input-otp.tsx +1 -1
  135. package/src/components/input.tsx +1 -1
  136. package/src/components/link.tsx +59 -67
  137. package/src/components/list.tsx +1 -1
  138. package/src/components/loading.tsx +2 -15
  139. package/src/components/map.tsx +3 -2
  140. package/src/components/menubar.tsx +5 -5
  141. package/src/components/navigation-menu.tsx +6 -6
  142. package/src/components/pagination.tsx +1 -1
  143. package/src/components/progress.tsx +2 -10
  144. package/src/components/radio-group.tsx +1 -1
  145. package/src/components/scroll-area.tsx +2 -2
  146. package/src/components/select.tsx +1 -1
  147. package/src/components/sheet.tsx +9 -5
  148. package/src/components/slider.tsx +1 -1
  149. package/src/components/stepper.tsx +4 -4
  150. package/src/components/switch.tsx +2 -2
  151. package/src/components/table.tsx +2 -2
  152. package/src/components/tabs.tsx +1 -1
  153. package/src/components/text-reveal-motion.tsx +3 -8
  154. package/src/components/textarea.tsx +1 -1
  155. package/src/components/toggle.tsx +1 -1
  156. package/src/index.ts +1 -0
  157. package/src/lib/motion.ts +75 -0
  158. package/src/lib/utils.ts +14 -2
  159. package/dist/browser-entry.d.ts +0 -19
  160. package/dist/browser-entry.d.ts.map +0 -1
  161. package/src/browser-entry.ts +0 -99
  162. package/src/browser-tokens.css +0 -1
@@ -3,38 +3,55 @@ import { ExternalLink } from "@brightlocal/icons";
3
3
  import { Slot, Slottable } from "@radix-ui/react-slot";
4
4
  import { cva, type VariantProps } from "class-variance-authority";
5
5
 
6
+ import {
7
+ ButtonVariants,
8
+ type ButtonVariant,
9
+ } from "@brightlocal/ui-components/button";
6
10
  import { cn } from "@brightlocal/ui-components/lib/utils";
7
11
 
8
- // Shared base for the button-styled variants (filled, outline, ghost).
9
- // Mirrors the Button component's `size="default"` look so the treatments stay
10
- // visually identical across both components.
11
- const buttonStyledBase = [
12
- "justify-center",
13
- "h-9",
14
- "px-4",
15
- "py-2",
16
- "rounded-full",
17
- "text-sm",
18
- "font-semibold",
19
- "no-underline",
20
- "whitespace-nowrap",
21
- "shrink-0",
22
- "[&_svg]:pointer-events-none",
23
- "[&_svg]:shrink-0",
24
- "transition-[color,background-color,border-color,box-shadow]",
25
- "duration-150",
26
- "ease-in-out",
27
- "focus-visible:shadow-default",
28
- ];
12
+ // Button state classes that must NOT apply to links. Unlike `:disabled`
13
+ // (inert on anchors), these selectors DO match anchors and would introduce
14
+ // styling hooks Link never had: `aria-disabled` dimming (a link would look
15
+ // disabled while staying clickable), `aria-invalid` destructive rings, and
16
+ // the persistent open-trigger highlight when a ghost/icon link is used as a
17
+ // Radix overlay trigger via asChild.
18
+ const buttonOnlyStateClasses = new Set([
19
+ "aria-disabled:opacity-50",
20
+ "aria-invalid:ring-destructive/20",
21
+ "dark:aria-invalid:ring-destructive/40",
22
+ "aria-invalid:border-destructive",
23
+ "data-[state=open]:bg-accent",
24
+ ]);
25
+
26
+ // Button-styled variants delegate to the Button component's own CVA so the
27
+ // treatments stay visually identical across both components and never drift.
28
+ // Anchors carry a browser-default underline that buttons never have, hence
29
+ // the `no-underline`.
30
+ const buttonStyledLink = (variant: ButtonVariant) =>
31
+ cn(
32
+ ButtonVariants({ variant, size: "default" })
33
+ .split(/\s+/)
34
+ .filter((cls) => cls && !buttonOnlyStateClasses.has(cls))
35
+ .join(" "),
36
+ "no-underline"
37
+ );
29
38
 
30
39
  const linkVariants = cva(
31
- // `gap-2` (spacing/2) keeps the icon–text gap consistent across all variants.
32
- ["inline-flex", "items-center", "gap-2", "cursor-pointer", "outline-none"],
40
+ // No shared base: the button-styled variants carry the Button base classes,
41
+ // and a base here would be silently overridden by them in tailwind-merge
42
+ // (last wins). Each variant is self-contained.
43
+ "",
33
44
  {
34
45
  variants: {
35
46
  variant: {
36
47
  // Inline text link (default) — the original Link styling.
48
+ // `gap-2` (spacing/2) matches the Button icon–text gap.
37
49
  inline: [
50
+ "inline-flex",
51
+ "items-center",
52
+ "gap-2",
53
+ "cursor-pointer",
54
+ "outline-none",
38
55
  "rounded-sm",
39
56
  // Color tokens (light mode: #2563EB, dark mode: #3B82F6)
40
57
  "text-link",
@@ -48,51 +65,25 @@ const linkVariants = cva(
48
65
  "visited:dark:text-link-visited-dark",
49
66
  // Transitions
50
67
  "transition-[text-decoration,text-decoration-color,text-underline-offset,color]",
51
- "duration-300",
68
+ "duration-fast",
69
+ "ease-out",
52
70
  // Focus state
53
71
  "focus-visible:shadow-default",
54
72
  ],
73
+ // Button-styled, brand CTA (matches Button `primary`).
74
+ primary: buttonStyledLink("primary"),
55
75
  // Button-styled, filled (maps to Button `secondary`).
56
- filled: [
57
- ...buttonStyledBase,
58
- "bg-secondary",
59
- "text-secondary-foreground",
60
- "hover:bg-secondary/80",
61
- ],
62
- // Button-styled, bordered. Uses the `input` border token in both modes
63
- // and keeps that border on focus (focus is the shared shadow ring only).
64
- outline: [
65
- ...buttonStyledBase,
66
- "border",
67
- "border-input",
68
- "border-solid",
69
- "bg-background",
70
- "text-foreground",
71
- "hover:bg-accent",
72
- "hover:text-accent-foreground",
73
- "dark:bg-input/30",
74
- "dark:border-input",
75
- "dark:hover:bg-input/50",
76
- "dark:hover:border-input",
77
- ],
78
- // Button-styled, transparent (maps to Button `ghost`).
79
- ghost: [
80
- ...buttonStyledBase,
81
- "bg-transparent",
82
- "text-foreground",
83
- "hover:bg-accent",
84
- ],
76
+ filled: buttonStyledLink("secondary"),
77
+ // Button-styled, bordered (matches Button `outline`). Button's outline
78
+ // declares no text color (buttons default sensibly; anchors inherit
79
+ // ambient/link colors), so links must pin `text-foreground` explicitly.
80
+ outline: cn(buttonStyledLink("outline"), "text-foreground"),
81
+ // Button-styled, transparent (matches Button `ghost`).
82
+ ghost: buttonStyledLink("ghost"),
85
83
  // Icon-only, circular. Mirrors `ghost` in a fixed 36px square
86
- // footprint for icon-only links (e.g. back navigation).
87
- // Requires an `aria-label` since there is no text content.
88
- icon: [
89
- ...buttonStyledBase,
90
- "w-9",
91
- "px-0",
92
- "bg-transparent",
93
- "text-foreground",
94
- "hover:bg-accent",
95
- ],
84
+ // footprint — the same `size-9 p-0` Button applies to icon-only
85
+ // buttons. Requires an `aria-label` since there is no text content.
86
+ icon: cn(buttonStyledLink("ghost"), "size-9 p-0"),
96
87
  },
97
88
  },
98
89
  defaultVariants: {
@@ -112,10 +103,11 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
112
103
  */
113
104
  dataHook: string;
114
105
  /**
115
- * Visual style variant. `inline` renders a standard text link; `filled`,
116
- * `outline` and `ghost` render button-styled treatments for inline actions
117
- * and high-priority navigation; `icon` renders a circular icon-only link
118
- * (provide an `aria-label` since there is no text content).
106
+ * Visual style variant. `inline` renders a standard text link; `primary`
107
+ * renders the brand CTA treatment (matches `Button variant="primary"`);
108
+ * `filled`, `outline` and `ghost` render button-styled treatments for
109
+ * inline actions and high-priority navigation; `icon` renders a circular
110
+ * icon-only link (provide an `aria-label` since there is no text content).
119
111
  * @default "inline"
120
112
  */
121
113
  variant?: LinkVariant;
@@ -19,7 +19,7 @@ const itemVariants = cva(
19
19
  "pr-2",
20
20
  "pl-4",
21
21
  "transition-colors",
22
- "duration-200",
22
+ "duration-fast",
23
23
  "ease-out",
24
24
  ],
25
25
  {
@@ -6,7 +6,7 @@ import { animate } from "framer-motion";
6
6
 
7
7
  import { cn } from "@brightlocal/ui-components/lib/utils";
8
8
  import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion";
9
- import { SETTLE_REST_DELTA } from "../lib/spring-settle";
9
+ import { SETTLE_REST_DELTA, SPRING_SETTLE } from "../lib/motion";
10
10
 
11
11
  // ---------------------------------------------------------------------------
12
12
  // Shape paths (500×500 viewBox)
@@ -46,16 +46,6 @@ const LOADING_SHAPES: string[] = [
46
46
 
47
47
  /** Pause (ms) each shape holds before morphing to the next */
48
48
  const HOLD_MS = 150;
49
- /** Spring stiffness for the morph + rotation */
50
- const STIFFNESS = 30;
51
- /**
52
- * Spring damping — higher = less oscillation.
53
- * Must stay ≥ 2×√(STIFFNESS×MASS) (≈7.75) so the spring never overshoots —
54
- * the settle trick below depends on it (see SETTLE_REST_DELTA).
55
- */
56
- const DAMPING = 9;
57
- /** Spring mass — higher = more inertia */
58
- const MASS = 0.5;
59
49
  /** Degrees of rotation per morph cycle (clockwise) */
60
50
  const ROTATION_DEG = 360;
61
51
  /** Rendered size of the loader in pixels (width and height) */
@@ -254,10 +244,7 @@ const Loading = React.forwardRef<SVGSVGElement, LoadingProps>(
254
244
  return;
255
245
  }
256
246
  const controls = animate(0, 1 + SETTLE_REST_DELTA, {
257
- type: "spring",
258
- stiffness: STIFFNESS,
259
- damping: DAMPING,
260
- mass: MASS,
247
+ ...SPRING_SETTLE,
261
248
  restDelta: SETTLE_REST_DELTA,
262
249
  onUpdate: (v: number) => {
263
250
  if (signal.cancelled) {
@@ -289,7 +289,7 @@ const mapGridPinColorMap: Record<ResolvedVariant, string> = Object.fromEntries(
289
289
  ) as Record<ResolvedVariant, string>;
290
290
 
291
291
  const mapGridPinVariants = cva(
292
- "inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-200 ease-out hover:shadow-md",
292
+ "inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-fast ease-out hover:shadow-md",
293
293
  {
294
294
  variants: {
295
295
  variant: {
@@ -827,7 +827,8 @@ const MapLocationPin = React.forwardRef<HTMLDivElement, MapLocationPinProps>(
827
827
  aria-hidden="true"
828
828
  className={cn(
829
829
  "relative flex size-full",
830
- animateIn && "animate-pop-in origin-bottom will-change-transform"
830
+ animateIn &&
831
+ "animate-emphasis-pop origin-bottom will-change-transform"
831
832
  )}
832
833
  >
833
834
  <svg
@@ -85,7 +85,7 @@ function MenubarTrigger({
85
85
  return (
86
86
  <MenubarPrimitive.Trigger
87
87
  className={cn(
88
- "text-foreground flex cursor-pointer items-center justify-center gap-2 rounded-xs px-3 py-1 text-sm font-normal transition-colors",
88
+ "text-foreground duration-fast flex cursor-pointer items-center justify-center gap-2 rounded-xs px-3 py-1 text-sm font-normal transition-colors ease-out",
89
89
  "hover:bg-accent hover:text-accent-foreground",
90
90
  "focus:bg-accent focus:text-accent-foreground focus:outline-none",
91
91
  "data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
@@ -147,7 +147,7 @@ function MenubarItem({
147
147
  return (
148
148
  <MenubarPrimitive.Item
149
149
  className={cn(
150
- "text-foreground relative flex cursor-pointer items-center justify-between rounded-sm px-2 py-1.5 text-sm font-normal transition-colors outline-none",
150
+ "text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm px-2 py-1.5 text-sm font-normal transition-colors ease-out outline-none",
151
151
  "hover:bg-accent hover:text-foreground",
152
152
  "focus:bg-accent focus:text-foreground",
153
153
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
@@ -191,7 +191,7 @@ function MenubarCheckboxItem({
191
191
  <MenubarPrimitive.CheckboxItem
192
192
  checked={checked}
193
193
  className={cn(
194
- "text-foreground relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors outline-none",
194
+ "text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors ease-out outline-none",
195
195
  "hover:bg-accent hover:text-foreground",
196
196
  "focus:bg-accent focus:text-foreground",
197
197
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
@@ -268,7 +268,7 @@ function MenubarRadioItem({
268
268
  return (
269
269
  <MenubarPrimitive.RadioItem
270
270
  className={cn(
271
- "text-foreground relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors outline-none",
271
+ "text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors ease-out outline-none",
272
272
  "hover:bg-accent hover:text-foreground",
273
273
  "focus:bg-accent focus:text-foreground",
274
274
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
@@ -381,7 +381,7 @@ function MenubarSubTrigger({
381
381
  return (
382
382
  <MenubarPrimitive.SubTrigger
383
383
  className={cn(
384
- "text-foreground flex cursor-pointer items-center justify-between rounded-xs px-2 py-1.5 text-sm font-normal transition-colors outline-none",
384
+ "text-foreground duration-fast flex cursor-pointer items-center justify-between rounded-xs px-2 py-1.5 text-sm font-normal transition-colors ease-out outline-none",
385
385
  "hover:bg-accent hover:text-foreground",
386
386
  "focus:bg-accent focus:text-foreground",
387
387
  "data-[state=open]:bg-accent data-[state=open]:text-foreground",
@@ -141,7 +141,7 @@ const NavigationMenuTrigger = React.forwardRef<
141
141
  "rounded-md px-4 py-2",
142
142
  "text-sm font-medium",
143
143
  "text-foreground",
144
- "transition-colors",
144
+ "duration-fast transition-colors ease-out",
145
145
  "hover:bg-accent hover:text-accent-foreground",
146
146
  "focus:bg-accent focus:text-accent-foreground",
147
147
  "focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none",
@@ -182,7 +182,7 @@ const NavigationMenuTrigger = React.forwardRef<
182
182
  {children}
183
183
  <ChevronDown
184
184
  aria-hidden="true"
185
- className="relative top-[1px] ml-1 transition duration-300 group-data-[state=open]:rotate-180"
185
+ className="duration-base relative top-[1px] ml-1 transition-transform ease-in-out group-data-[state=open]:rotate-180"
186
186
  size={12}
187
187
  />
188
188
  </NavigationMenuPrimitive.Trigger>
@@ -218,7 +218,7 @@ const NavigationMenuContent = React.forwardRef<
218
218
  // Match the viewport's easeOutQuint timing so the directional slide and
219
219
  // the container morph feel like one motion (kept snappy so content
220
220
  // appears without a perceptible fade-in delay).
221
- "duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]",
221
+ "duration-base ease-emphasized",
222
222
  "md:absolute md:w-auto",
223
223
  ],
224
224
  className
@@ -251,7 +251,7 @@ const NavigationMenuLink = React.forwardRef<
251
251
  className={cn(
252
252
  [
253
253
  "block rounded-md p-3 leading-none no-underline select-none",
254
- "transition-colors outline-none",
254
+ "duration-fast transition-colors ease-out outline-none",
255
255
  "hover:bg-accent hover:text-accent-foreground",
256
256
  "focus:bg-accent focus:text-accent-foreground",
257
257
  "focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none",
@@ -285,9 +285,9 @@ const NavigationMenuViewport = React.forwardRef<
285
285
  // 150ms out) so the panel and its content appear immediately rather
286
286
  // than fading in slowly. Reduced motion is neutralised globally by the
287
287
  // token preset, so no per-element motion-reduce guard is needed.
288
- "transition-[width,height] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]",
288
+ "duration-base ease-emphasized transition-[width,height]",
289
289
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
290
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-150",
290
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-fast data-[state=closed]:ease-in",
291
291
  "md:w-[var(--radix-navigation-menu-viewport-width)]",
292
292
  ],
293
293
  className
@@ -100,7 +100,7 @@ const paginationItemVariants = cva(
100
100
  "h-9 w-9",
101
101
  "rounded-full",
102
102
  "text-sm font-medium",
103
- "transition-colors duration-200 ease-out",
103
+ "transition-colors duration-fast ease-out",
104
104
  "focus-visible:outline-none focus-visible:shadow-default",
105
105
  ],
106
106
  {
@@ -6,6 +6,7 @@ import { motion } from "framer-motion";
6
6
 
7
7
  import { cn } from "@brightlocal/ui-components/lib/utils";
8
8
  import { usePrefersReducedMotion } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
9
+ import { SPRING_GENTLE } from "../lib/motion";
9
10
 
10
11
  /**
11
12
  * Brand color for the progress indicator, drawn from the shared brand palette.
@@ -195,16 +196,7 @@ const Progress = React.forwardRef<
195
196
  )}
196
197
  data-slot="progress-indicator"
197
198
  initial={false}
198
- transition={
199
- prefersReducedMotion
200
- ? { duration: 0 }
201
- : {
202
- type: "spring",
203
- stiffness: 80,
204
- damping: 20,
205
- mass: 1,
206
- }
207
- }
199
+ transition={prefersReducedMotion ? { duration: 0 } : SPRING_GENTLE}
208
200
  />
209
201
  </ProgressPrimitive.Indicator>
210
202
  </ProgressPrimitive.Root>
@@ -41,7 +41,7 @@ const radioGroupItemVariants = cva(
41
41
  );
42
42
 
43
43
  const radioCircleVariants = cva(
44
- "relative aspect-square size-4 shrink-0 rounded-full border transition-[border-color,border-width,box-shadow,background-color]",
44
+ "relative aspect-square size-4 shrink-0 rounded-full border transition-[border-color,border-width,box-shadow,background-color] duration-fast ease-out",
45
45
  {
46
46
  variants: {
47
47
  variant: {
@@ -60,7 +60,7 @@ const ScrollArea = React.forwardRef<
60
60
  {...props}
61
61
  >
62
62
  <ScrollAreaPrimitive.Viewport
63
- className="focus-visible:shadow-default size-full rounded-[inherit] p-1 transition-[color,box-shadow] outline-none"
63
+ className="focus-visible:shadow-default duration-fast size-full rounded-[inherit] p-1 transition-[color,box-shadow] ease-out outline-none"
64
64
  data-slot="scroll-area-viewport"
65
65
  tabIndex={0}
66
66
  >
@@ -123,7 +123,7 @@ const ScrollBar = React.forwardRef<
123
123
  <ScrollAreaPrimitive.ScrollAreaScrollbar
124
124
  ref={ref}
125
125
  className={cn(
126
- "flex touch-none p-px transition-colors select-none",
126
+ "duration-fast flex touch-none p-px transition-colors ease-out select-none",
127
127
  orientation === "vertical" &&
128
128
  "h-full w-2.5 border-l border-l-transparent",
129
129
  orientation === "horizontal" &&
@@ -180,7 +180,7 @@ const selectTriggerVariants = cva([
180
180
  "px-3 py-2",
181
181
 
182
182
  // Base appearance
183
- "border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]",
183
+ "border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
184
184
  "bg-neutral-50 border-neutral-300",
185
185
  "dark:bg-white/5 dark:border-white/15",
186
186
 
@@ -29,10 +29,14 @@ const sheetContentVariants = cva(
29
29
  "gap-4",
30
30
  "p-6",
31
31
  "shadow-lg",
32
- "transition",
33
- "ease-in-out",
34
- "data-[state=closed]:duration-300",
35
- "data-[state=open]:duration-500",
32
+ // Large-surface timing (DS-806): enter at duration-slow (300ms), exit ~20%
33
+ // faster — users asked for the thing to go away. Enter decelerates
34
+ // (ease-out), exit accelerates away (ease-in); these time the tw-animate
35
+ // enter/exit keyframes via --tw-duration/--tw-ease.
36
+ "ease-out",
37
+ "data-[state=closed]:ease-in",
38
+ "data-[state=open]:duration-slow",
39
+ "data-[state=closed]:duration-250",
36
40
  ],
37
41
  {
38
42
  variants: {
@@ -230,7 +234,7 @@ const SheetContent = React.forwardRef<
230
234
  {...props}
231
235
  >
232
236
  {children}
233
- <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0">
237
+ <SheetPrimitive.Close className="ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-4 right-4 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0">
234
238
  <X />
235
239
  <span className="sr-only">{closeLabel ?? "Close"}</span>
236
240
  </SheetPrimitive.Close>
@@ -169,7 +169,7 @@ const Slider = React.forwardRef<
169
169
  <SliderPrimitive.Thumb
170
170
  key={index}
171
171
  aria-label={getThumbLabel(index)}
172
- className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
172
+ className="border-primary bg-background ring-ring/50 duration-fast block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] ease-out hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
173
173
  data-slot="slider-thumb"
174
174
  />
175
175
  ))}
@@ -446,9 +446,9 @@ StepperTrigger.displayName = "StepperTrigger";
446
446
  const stepperIndicatorStyles = cva(
447
447
  [
448
448
  "relative flex size-8 shrink-0 items-center justify-center rounded-full text-xs font-medium",
449
- "transition-colors duration-200 ease-out",
449
+ "transition-colors duration-fast ease-out",
450
450
  // Hover overlay (only visible when wrapped by an interactive trigger).
451
- "after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:bg-white/10 after:opacity-0 after:transition-opacity after:duration-200 after:ease-out",
451
+ "after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:bg-white/10 after:opacity-0 after:transition-opacity after:duration-fast after:ease-out",
452
452
  "group-hover/trigger:after:opacity-100",
453
453
  // Focus ring is rendered here (around the circle) when the trigger is
454
454
  // keyboard-focused, rather than around the whole trigger.
@@ -552,7 +552,7 @@ const StepperIndicator = React.forwardRef<
552
552
  <>
553
553
  <span
554
554
  className={cn(
555
- "transition-opacity duration-200 ease-out",
555
+ "duration-fast transition-opacity ease-out",
556
556
  (state === "completed" || state === "error" || isLoading) &&
557
557
  "opacity-0"
558
558
  )}
@@ -608,7 +608,7 @@ const StepperSeparator = React.forwardRef<
608
608
  ref={ref}
609
609
  aria-hidden="true"
610
610
  className={cn(
611
- "bg-border shrink-0 rounded-full transition-colors duration-200",
611
+ "bg-border duration-fast shrink-0 rounded-full transition-colors ease-out",
612
612
  "group-data-[state=completed]/step:bg-primary",
613
613
  "group-data-[disabled=true]/step:opacity-50",
614
614
  // Horizontal + labels below: absolute connector spanning this indicator
@@ -26,7 +26,7 @@ const Switch = React.forwardRef<
26
26
  ref={ref}
27
27
  className={cn(
28
28
  "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:data-[state=unchecked]:bg-input/80 dark:focus-visible:border-neutral-500",
29
- "focus-visible:shadow-default inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none",
29
+ "focus-visible:shadow-default duration-fast inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] ease-out outline-none",
30
30
  "disabled:cursor-not-allowed disabled:opacity-50",
31
31
  "pl-[1px]",
32
32
  className
@@ -40,7 +40,7 @@ const Switch = React.forwardRef<
40
40
  <SwitchPrimitive.Thumb
41
41
  className={cn(
42
42
  "bg-background",
43
- "pointer-events-none block size-4 rounded-full ring-0 transition-transform",
43
+ "duration-base pointer-events-none block size-4 rounded-full ring-0 transition-transform ease-in-out",
44
44
  "data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
45
45
  )}
46
46
  data-slot="switch-thumb"
@@ -32,7 +32,7 @@ const tableCellVariants = cva(
32
32
  );
33
33
 
34
34
  const tableHeadVariants = cva(
35
- "h-12 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
35
+ "h-12 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-fast ease-out",
36
36
  {
37
37
  variants: {
38
38
  align: {
@@ -233,7 +233,7 @@ const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
233
233
  <tr
234
234
  ref={ref}
235
235
  className={cn(
236
- "data-[state=selected]:bg-muted transition-colors duration-150 ease-in-out",
236
+ "data-[state=selected]:bg-muted duration-fast transition-colors ease-out",
237
237
  className
238
238
  )}
239
239
  data-hook={dataHook}
@@ -207,7 +207,7 @@ function TabsTriggerInner<T extends string = string>(
207
207
  // Text color
208
208
  "text-foreground",
209
209
  // Transition with explicit duration and easing
210
- "transition-[color,box-shadow] duration-150 ease-in-out",
210
+ "duration-fast transition-[color,box-shadow] ease-out",
211
211
  // Active state
212
212
  "data-[state=active]:bg-background data-[state=active]:shadow-sm",
213
213
  // Focus state - use compound selector for active+focused to override shadow-sm with shadow-default
@@ -13,7 +13,7 @@ import { animate } from "framer-motion";
13
13
 
14
14
  import { cn } from "@brightlocal/ui-components/lib/utils";
15
15
  import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion";
16
- import { SETTLE_REST_DELTA } from "../lib/spring-settle";
16
+ import { SETTLE_REST_DELTA, SPRING_SETTLE, SPRING_SMOOTH } from "../lib/motion";
17
17
 
18
18
  // ---------------------------------------------------------------------------
19
19
  // Shape paths (500×500 viewBox)
@@ -229,9 +229,7 @@ const TextRevealMotion = React.forwardRef<
229
229
  // Internal animation defaults matching the Loading story tuning
230
230
  const shapes = DEFAULT_SHAPES;
231
231
  const rollSpeed = 0.8;
232
- const stiffness = 180;
233
- const damping = 24;
234
- const mass = 1;
232
+ const { stiffness, damping, mass } = SPRING_SMOOTH;
235
233
 
236
234
  const reducedMotion = usePrefersReducedMotion();
237
235
  const rawId = useId();
@@ -531,10 +529,7 @@ const TextRevealMotion = React.forwardRef<
531
529
  return;
532
530
  }
533
531
  const controls = animate(0, 1 + SETTLE_REST_DELTA, {
534
- type: "spring",
535
- stiffness: 30,
536
- damping: 9,
537
- mass: 0.5,
532
+ ...SPRING_SETTLE,
538
533
  restDelta: SETTLE_REST_DELTA,
539
534
  onUpdate: (v: number) => {
540
535
  if (signal.cancelled) {
@@ -8,7 +8,7 @@ const textareaVariants = cva([
8
8
  "flex w-full",
9
9
  // Appearance - Explicit background with isolation for contrast calculation
10
10
  "border border-input bg-background rounded-md",
11
- "outline-none transition-[border-color,background-color,box-shadow]",
11
+ "outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out",
12
12
  // Typography
13
13
  "text-base leading-normal font-sans",
14
14
  "text-foreground",
@@ -7,7 +7,7 @@ import { cva, type VariantProps } from "class-variance-authority";
7
7
  import { cn } from "@brightlocal/ui-components/lib/utils";
8
8
 
9
9
  const toggleVariants = cva(
10
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-150 ease-in-out whitespace-nowrap",
10
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-fast ease-out whitespace-nowrap",
11
11
  {
12
12
  variants: {
13
13
  variant: {
package/src/index.ts CHANGED
@@ -29,6 +29,7 @@ export * from "./components/dropdown-menu";
29
29
  export * from "./components/field";
30
30
  export * from "./components/global-layout";
31
31
  export * from "./components/header";
32
+ export * from "./components/height-transition";
32
33
  export * from "./components/hover-card";
33
34
  export * from "./components/input";
34
35
  export * from "./components/input-chip";