@jinaan/uikit 0.1.20 → 0.1.21

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.
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,OAAO,CAAC;AAKf,eAAO,MAAM,WAAW,6HAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,8HAAwB,CAAC;AAEjD,oEAAoE;AACpE,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,+BAQvD;AAED,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB,CAClE,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,kHAwBxB,CAAC;AAGH,eAAO,MAAM,aAAa,4LA+BzB,CAAC;AAGF,eAAO,MAAM,UAAU,yLAmBrB,CAAC;AAGH,eAAO,MAAM,WAAW,0LAStB,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,OAAO,CAAC;AAKf,eAAO,MAAM,WAAW,6HAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,8HAAwB,CAAC;AAEjD,oEAAoE;AACpE,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,+BAQvD;AAED,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB,CAClE,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,kHAuBxB,CAAC;AAGH,eAAO,MAAM,aAAa,4LA+BzB,CAAC;AAGF,eAAO,MAAM,UAAU,yLAmBrB,CAAC;AAGH,eAAO,MAAM,WAAW,0LAStB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jinaan/uikit",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Reusable React and Tailwind UI components for Jinaan projects.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
2
- import { CaretRight, Check } from "@phosphor-icons/react";
2
+ import { CaretDown, CaretRight, Check } from "@phosphor-icons/react";
3
3
  import {
4
4
  createContext,
5
5
  forwardRef,
@@ -48,6 +48,22 @@ export const DropdownMenuTrigger = forwardRef<
48
48
  });
49
49
  DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
50
50
 
51
+ export const DropdownMenuChevron = forwardRef<
52
+ SVGSVGElement,
53
+ ComponentPropsWithoutRef<typeof CaretDown>
54
+ >(({ className, ...props }, ref) => (
55
+ <CaretDown
56
+ ref={ref}
57
+ aria-hidden
58
+ className={cn(
59
+ "ml-auto size-3.5 shrink-0 text-subtle transition-transform duration-200 ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none",
60
+ className,
61
+ )}
62
+ {...props}
63
+ />
64
+ ));
65
+ DropdownMenuChevron.displayName = "DropdownMenuChevron";
66
+
51
67
  export const DropdownMenuGroup = DropdownMenuPrimitive.Group;
52
68
  export const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
53
69
 
package/src/select.tsx CHANGED
@@ -41,10 +41,9 @@ export const SelectTrigger = forwardRef<
41
41
  <SelectPrimitive.Trigger
42
42
  ref={ref}
43
43
  className={cn(
44
- "flex items-center justify-between gap-2 text-sm text-fg",
44
+ "group flex items-center justify-between gap-2 text-sm text-fg",
45
45
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
46
46
  "data-disabled:cursor-not-allowed data-disabled:opacity-50",
47
- "[&>span]:truncate",
48
47
  variant === "field" &&
49
48
  "h-(--control-h-md) w-full rounded-md border border-line bg-surface px-3 focus:border-primary focus:ring-2 focus:ring-focus/30",
50
49
  variant === "inline" &&
@@ -53,9 +52,9 @@ export const SelectTrigger = forwardRef<
53
52
  )}
54
53
  {...props}
55
54
  >
56
- {children}
55
+ <span className="min-w-0 flex-1 truncate text-left">{children}</span>
57
56
  <SelectPrimitive.Icon asChild>
58
- <CaretDown className="size-3.5 text-subtle" />
57
+ <CaretDown className="ml-auto size-3.5 shrink-0 text-subtle transition-transform duration-200 ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none" />
59
58
  </SelectPrimitive.Icon>
60
59
  </SelectPrimitive.Trigger>
61
60
  ));