@jinaan/uikit 0.1.19 → 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.
- package/dist/button.d.ts.map +1 -1
- package/dist/dropdown-menu.d.ts +1 -0
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/index.js +296 -279
- package/dist/index.js.map +1 -1
- package/dist/select.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/button.tsx +10 -8
- package/src/dropdown-menu.tsx +17 -1
- package/src/select.tsx +3 -4
package/dist/select.d.ts.map
CHANGED
|
@@ -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,
|
|
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
package/src/button.tsx
CHANGED
|
@@ -122,14 +122,16 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
122
122
|
</span>
|
|
123
123
|
) : null}
|
|
124
124
|
</span>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
<span
|
|
126
|
+
data-button-spinner
|
|
127
|
+
className={cn(
|
|
128
|
+
"pointer-events-none absolute inset-0 flex items-center justify-center transition-[opacity,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
129
|
+
loading ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0",
|
|
130
|
+
)}
|
|
131
|
+
aria-hidden
|
|
132
|
+
>
|
|
133
|
+
<Spinner className={cn("text-current", icon)} />
|
|
134
|
+
</span>
|
|
133
135
|
</span>
|
|
134
136
|
)}
|
|
135
137
|
</Comp>
|
package/src/dropdown-menu.tsx
CHANGED
|
@@ -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
|
));
|