@stagewise/ui 0.27.0 → 0.29.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stagewise/ui",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "Customized shadcn/ui components built on Base UI primitives, for use across stagewise projects.",
5
5
  "type": "module",
6
6
  "license": "MIT AND OFL-1.1",
@@ -146,7 +146,7 @@ function ContextMenuSubTrigger({
146
146
  {...props}
147
147
  >
148
148
  {children}
149
- <IconChevronRightOutline18 className="ml-auto size-3" />
149
+ <IconChevronRightOutline18 className="ml-auto size-4" />
150
150
  </ContextMenuPrimitive.SubmenuTrigger>
151
151
  );
152
152
  }
@@ -120,7 +120,7 @@ function DropdownMenuSubTrigger({
120
120
  {...props}
121
121
  >
122
122
  {children}
123
- <IconChevronRightOutline18 className="ml-auto size-3" />
123
+ <IconChevronRightOutline18 className="ml-auto size-4" />
124
124
  </MenuPrimitive.SubmenuTrigger>
125
125
  );
126
126
  }
@@ -55,8 +55,13 @@ const variantClass: Record<KlexLogoVariant, string> = {
55
55
  'boxed-round': 'rounded-full',
56
56
  };
57
57
 
58
- const GHOST_PATH =
58
+ /** The mark's ghost and eyes in a 100×100 box, for drawing it inside other SVGs. */
59
+ export const KLEX_LOGO_GHOST_PATH =
59
60
  'M96.9692 39.5294C97.6935 19.2487 85.675 0 64.2162 0C38.2397 0 30.5897 17.281 28.075 36.1412C21.2985 86.9647 5.23535 89.5529 5.23535 92.9412C5.23535 94.6582 9.94124 101.176 26.4118 94.1176C33.2509 91.1866 38.8849 98.2481 44.0589 98.8235C49.5595 99.4353 52.7928 96.7746 58.1766 95.2941C64.3687 93.5913 70.0597 100 74.6472 100C90.4589 100 95.8398 71.153 96.9692 39.5294Z';
61
+ export const KLEX_LOGO_EYES = [
62
+ { cx: 64.0589, cy: 35.2942, rx: 4.70588, ry: 7.05883 },
63
+ { cx: 80.5294, cy: 35.2942, rx: 4.70588, ry: 7.05883 },
64
+ ] as const;
60
65
 
61
66
  interface KlexLogoIconProps {
62
67
  className?: string;
@@ -77,21 +82,10 @@ const KlexLogoIcon: FC<KlexLogoIconProps> = ({
77
82
  aria-hidden="true"
78
83
  data-slot="klex-logo-icon"
79
84
  >
80
- <path className={bodyClassName} d={GHOST_PATH} />
81
- <ellipse
82
- className={eyesClassName}
83
- cx="64.0589"
84
- cy="35.2942"
85
- rx="4.70588"
86
- ry="7.05883"
87
- />
88
- <ellipse
89
- className={eyesClassName}
90
- cx="80.5294"
91
- cy="35.2942"
92
- rx="4.70588"
93
- ry="7.05883"
94
- />
85
+ <path className={bodyClassName} d={KLEX_LOGO_GHOST_PATH} />
86
+ {KLEX_LOGO_EYES.map((eye) => (
87
+ <ellipse className={eyesClassName} key={eye.cx} {...eye} />
88
+ ))}
95
89
  </svg>
96
90
  );
97
91
 
@@ -72,7 +72,7 @@ function NavigationMenuTrigger({
72
72
  >
73
73
  {children}{' '}
74
74
  <IconChevronDownOutline18
75
- className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
75
+ className="relative top-px ml-1 size-4 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
76
76
  aria-hidden="true"
77
77
  />
78
78
  </NavigationMenuPrimitive.Trigger>
@@ -1,16 +1,21 @@
1
1
  'use client';
2
2
 
3
3
  import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
4
+ import { useState } from 'react';
4
5
 
5
6
  import { cn } from '../../lib/utils';
6
7
 
7
8
  function Switch({
8
9
  className,
9
10
  size = 'default',
11
+ onCheckedChange,
10
12
  ...props
11
13
  }: SwitchPrimitive.Root.Props & {
12
14
  size?: 'sm' | 'default';
13
15
  }) {
16
+ // The knob springs only once someone flips it: CSS animations also run when
17
+ // an element first renders, so a switch that loads on would slide over.
18
+ const [flipped, setFlipped] = useState(false);
14
19
  return (
15
20
  <SwitchPrimitive.Root
16
21
  data-slot="switch"
@@ -20,10 +25,18 @@ function Switch({
20
25
  className,
21
26
  )}
22
27
  {...props}
28
+ onCheckedChange={(checked, details) => {
29
+ setFlipped(true);
30
+ onCheckedChange?.(checked, details);
31
+ }}
23
32
  >
24
33
  <SwitchPrimitive.Thumb
25
34
  data-slot="switch-thumb"
26
- className="pointer-events-none block rounded-full bg-background ring-0 group-data-[size=default]/switch:h-4 group-data-[size=sm]/switch:h-3 group-data-[size=default]/switch:w-4 group-data-[size=sm]/switch:w-3 group-data-[size=default]/switch:[--knob-w:1rem] group-data-[size=sm]/switch:[--knob-w:0.75rem] group-data-[size=default]/switch:[--knob-travel:14px] group-data-[size=sm]/switch:[--knob-travel:10px] group-data-[size=default]/switch:[--track-w:30px] group-data-[size=sm]/switch:[--track-w:22px] group-data-[size=default]/switch:data-checked:translate-x-[14px] group-data-[size=sm]/switch:data-checked:translate-x-[10px] dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground group-data-checked/switch:animate-switch-knob-on group-data-unchecked/switch:animate-switch-knob-off"
35
+ className={cn(
36
+ 'pointer-events-none block rounded-full bg-background ring-0 group-data-[size=default]/switch:h-4 group-data-[size=sm]/switch:h-3 group-data-[size=default]/switch:w-4 group-data-[size=sm]/switch:w-3 group-data-[size=default]/switch:[--knob-w:1rem] group-data-[size=sm]/switch:[--knob-w:0.75rem] group-data-[size=default]/switch:[--knob-travel:14px] group-data-[size=sm]/switch:[--knob-travel:10px] group-data-[size=default]/switch:[--track-w:30px] group-data-[size=sm]/switch:[--track-w:22px] group-data-[size=default]/switch:data-checked:translate-x-[14px] group-data-[size=sm]/switch:data-checked:translate-x-[10px] dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground',
37
+ flipped &&
38
+ 'group-data-checked/switch:animate-switch-knob-on group-data-unchecked/switch:animate-switch-knob-off',
39
+ )}
27
40
  />
28
41
  </SwitchPrimitive.Root>
29
42
  );
@@ -134,7 +134,7 @@ function TraceCollapsibleTrigger({
134
134
  className="size-2.5 motion-reduce:animate-none"
135
135
  />
136
136
  ) : (
137
- <IconChevronRightOutline18 className="size-2.5" />
137
+ <IconChevronRightOutline18 className="size-3.5" />
138
138
  )}
139
139
  </TraceIcon>
140
140
  </CollapsibleTrigger>
@@ -6,12 +6,12 @@ export const IconFilterOutline18: React.FC<
6
6
  IconProps & { strokeWidth?: number }
7
7
  > = ({ strokeWidth = 1.5, ...props }) => (
8
8
  <Icon size="18px" {...props}>
9
+ {/* Three centered lines, each shorter than the one above. */}
9
10
  <path
10
- d="M2.25 3.25h13.5L10.5 9.5v4.75l-3 1V9.5L2.25 3.25Z"
11
+ d="M2.75 5h12.5M5 9h8M7.25 13h3.5"
11
12
  fill="none"
12
13
  stroke="currentColor"
13
14
  strokeLinecap="round"
14
- strokeLinejoin="round"
15
15
  strokeWidth={strokeWidth}
16
16
  />
17
17
  </Icon>
@@ -10,7 +10,7 @@ export const IconChevronDownOutline18: React.FC<
10
10
  return (
11
11
  <Icon size="18px" {...props}>
12
12
  <polyline
13
- points="15.25 6.5 9 12.75 2.75 6.5"
13
+ points="13.5 7.375 9 11.875 4.5 7.375"
14
14
  fill="none"
15
15
  stroke="currentColor"
16
16
  strokeLinecap="round"
@@ -10,7 +10,7 @@ export const IconChevronLeftOutline18: React.FC<
10
10
  return (
11
11
  <Icon size="18px" {...props}>
12
12
  <polyline
13
- points="11.5 15.25 5.25 9 11.5 2.75"
13
+ points="10.625 13.5 6.125 9 10.625 4.5"
14
14
  fill="none"
15
15
  stroke="currentColor"
16
16
  strokeLinecap="round"
@@ -10,7 +10,7 @@ export const IconChevronRightOutline18: React.FC<
10
10
  return (
11
11
  <Icon size="18px" {...props}>
12
12
  <polyline
13
- points="6.5 2.75 12.75 9 6.5 15.25"
13
+ points="7.375 4.5 11.875 9 7.375 13.5"
14
14
  fill="none"
15
15
  stroke="currentColor"
16
16
  strokeLinecap="round"
@@ -11,7 +11,7 @@ export const IconChevronUpOutline18: React.FC<IconChevronUpOutline18Props> = ({
11
11
  return (
12
12
  <Icon size="18px" {...props}>
13
13
  <polyline
14
- points="2.75 11.5 9 5.25 15.25 11.5"
14
+ points="4.5 10.625 9 6.125 13.5 10.625"
15
15
  fill="none"
16
16
  stroke="currentColor"
17
17
  strokeLinecap="round"
@@ -54,7 +54,8 @@
54
54
  }
55
55
 
56
56
  body {
57
- @apply bg-background text-foreground;
57
+ /* Grayscale smoothing on macOS, as the system UI draws its text. */
58
+ @apply bg-background text-foreground antialiased;
58
59
  }
59
60
 
60
61
  :root {