@coston/ui 0.2.2 → 0.3.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/README.md CHANGED
@@ -118,6 +118,7 @@ Install only what you use.
118
118
  | Input | `@coston/ui/input` |
119
119
  | Label | `@coston/ui/label` |
120
120
  | Menubar | `@coston/ui/menubar` |
121
+ | Native Select | `@coston/ui/native-select` |
121
122
  | Navigation Menu | `@coston/ui/navigation-menu` |
122
123
  | Pagination | `@coston/ui/pagination` |
123
124
  | Popover | `@coston/ui/popover` |
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import * as class_variance_authority_types3 from "class-variance-authority/types";
4
+
5
+ //#region src/components/native-select.d.ts
6
+ declare const nativeSelectVariants: (props?: ({
7
+ size?: "default" | "sm" | null | undefined;
8
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
9
+ interface NativeSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>, VariantProps<typeof nativeSelectVariants> {}
10
+ declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
11
+ //#endregion
12
+ export { NativeSelect, NativeSelectProps, nativeSelectVariants };
13
+ //# sourceMappingURL=native-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-select.d.ts","names":[],"sources":["../../src/components/native-select.tsx"],"sourcesContent":[],"mappings":";;;;;cAaM;;IAaL,+BAAA,CAAA;AAbK,UAeW,iBAAA,SAEb,IAJH,CAIQ,KAAA,CAAM,oBAJd,CAImC,iBAJnC,CAAA,EAAA,MAAA,CAAA,EAKG,YALH,CAAA,OAKuB,oBALvB,CAAA,CAAA,CAED;cAOM,YANJ,EAMgB,KAAA,CAAA,yBANhB,CAMgB,iBANhB,GAMgB,KAAA,CAAA,aANhB,CAMgB,iBANhB,CAAA,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { cn } from "../utils-CyPJ3VV3.js";
2
+ import * as React from "react";
3
+ import { ChevronDown } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
6
+
7
+ //#region src/components/native-select.tsx
8
+ const nativeSelectVariants = cva("w-full appearance-none rounded-md border border-input bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", {
9
+ variants: { size: {
10
+ default: "h-10 pl-3 pr-8 text-sm",
11
+ sm: "h-8 pl-2.5 pr-7 text-xs"
12
+ } },
13
+ defaultVariants: { size: "default" }
14
+ });
15
+ const NativeSelect = React.forwardRef(({ className, size, children,...props }, ref) => /* @__PURE__ */ jsxs("div", {
16
+ className: cn("relative w-full", className),
17
+ children: [/* @__PURE__ */ jsx("select", {
18
+ ref,
19
+ className: nativeSelectVariants({ size }),
20
+ ...props,
21
+ children
22
+ }), /* @__PURE__ */ jsx(ChevronDown, {
23
+ "aria-hidden": "true",
24
+ className: cn("pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 opacity-50", size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4")
25
+ })]
26
+ }));
27
+ NativeSelect.displayName = "NativeSelect";
28
+
29
+ //#endregion
30
+ export { NativeSelect, nativeSelectVariants };
31
+ //# sourceMappingURL=native-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-select.js","names":[],"sources":["../../src/components/native-select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { cn } from '../lib/utils';\n\n// A styled wrapper around the platform `<select>`. Unlike the Radix-based\n// `Select`, this submits its value through native form submission (no client\n// JS, no controlled state), which makes it the right fit for server-action\n// forms and simple value pickers. Reach for `Select` when you need rich,\n// custom-rendered options. Height/text come from the `size` variant — never\n// add vertical padding, the control centers its text natively, so a fixed\n// `py-*` clips the label at smaller heights.\nconst nativeSelectVariants = cva(\n 'w-full appearance-none rounded-md border border-input bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n default: 'h-10 pl-3 pr-8 text-sm',\n sm: 'h-8 pl-2.5 pr-7 text-xs',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\nexport interface NativeSelectProps\n extends\n Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>,\n VariantProps<typeof nativeSelectVariants> {}\n\n// `className` targets the wrapper (layout/width/margins) so the chevron always\n// aligns to the control's edge; `size` styles the select itself.\nconst NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(\n ({ className, size, children, ...props }, ref) => (\n <div className={cn('relative w-full', className)}>\n <select ref={ref} className={nativeSelectVariants({ size })} {...props}>\n {children}\n </select>\n <ChevronDown\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 opacity-50',\n size === 'sm' ? 'h-3.5 w-3.5' : 'h-4 w-4'\n )}\n />\n </div>\n )\n);\nNativeSelect.displayName = 'NativeSelect';\n\nexport { NativeSelect, nativeSelectVariants };\n"],"mappings":";;;;;;;AAaA,MAAM,uBAAuB,IAC3B,oQACA;CACE,UAAU,EACR,MAAM;EACJ,SAAS;EACT,IAAI;CACL,EACF;CACD,iBAAiB,EACf,MAAM,UACP;AACF,EACF;AASD,MAAM,eAAe,MAAM,WACzB,CAAC,EAAE,WAAW,MAAM,SAAU,GAAG,OAAO,EAAE,wBACxC,KAAC;CAAI,WAAW,GAAG,mBAAmB,UAAU;4BAC9C,IAAC;EAAY;EAAK,WAAW,qBAAqB,EAAE,KAAM,EAAC;EAAE,GAAI;EAC9D;GACM,kBACT,IAAC;EACC,eAAY;EACZ,WAAW,GACT,4EACA,SAAS,OAAO,gBAAgB,UACjC;GACD;EACE,CAET;AACD,aAAa,cAAc"}
@@ -1,12 +1,12 @@
1
1
  import * as React from "react";
2
2
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
- import * as class_variance_authority_types3 from "class-variance-authority/types";
3
+ import * as class_variance_authority_types4 from "class-variance-authority/types";
4
4
 
5
5
  //#region src/components/navigation-menu.d.ts
6
6
  declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
7
7
  declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
8
8
  declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
9
- declare const navigationMenuTriggerStyle: (props?: class_variance_authority_types3.ClassProp | undefined) => string;
9
+ declare const navigationMenuTriggerStyle: (props?: class_variance_authority_types4.ClassProp | undefined) => string;
10
10
  declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
11
  declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import * as react_jsx_runtime23 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as SheetPrimitive from "@radix-ui/react-dialog";
5
- import * as class_variance_authority_types4 from "class-variance-authority/types";
5
+ import * as class_variance_authority_types5 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/components/sheet.d.ts
8
8
  declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
@@ -12,7 +12,7 @@ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
12
12
  declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
13
  declare const sheetVariants: (props?: ({
14
14
  side?: "top" | "right" | "bottom" | "left" | null | undefined;
15
- } & class_variance_authority_types4.ClassProp) | undefined) => string;
15
+ } & class_variance_authority_types5.ClassProp) | undefined) => string;
16
16
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {}
17
17
  declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
18
18
  declare const SheetHeader: {
@@ -1,17 +1,17 @@
1
1
  import * as React from "react";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
4
- import * as class_variance_authority_types5 from "class-variance-authority/types";
4
+ import * as class_variance_authority_types6 from "class-variance-authority/types";
5
5
 
6
6
  //#region src/components/toggle-group.d.ts
7
7
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
8
8
  variant?: "default" | "outline" | null | undefined;
9
9
  size?: "default" | "sm" | "lg" | null | undefined;
10
- } & class_variance_authority_types5.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
10
+ } & class_variance_authority_types6.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
11
11
  declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
12
12
  variant?: "default" | "outline" | null | undefined;
13
13
  size?: "default" | "sm" | "lg" | null | undefined;
14
- } & class_variance_authority_types5.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
14
+ } & class_variance_authority_types6.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
15
15
  //#endregion
16
16
  export { ToggleGroup, ToggleGroupItem };
17
17
  //# sourceMappingURL=toggle-group.d.ts.map
@@ -1,17 +1,17 @@
1
1
  import * as React from "react";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import * as TogglePrimitive from "@radix-ui/react-toggle";
4
- import * as class_variance_authority_types7 from "class-variance-authority/types";
4
+ import * as class_variance_authority_types8 from "class-variance-authority/types";
5
5
 
6
6
  //#region src/components/toggle.d.ts
7
7
  declare const toggleVariants: (props?: ({
8
8
  variant?: "default" | "outline" | null | undefined;
9
9
  size?: "default" | "sm" | "lg" | null | undefined;
10
- } & class_variance_authority_types7.ClassProp) | undefined) => string;
10
+ } & class_variance_authority_types8.ClassProp) | undefined) => string;
11
11
  declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
12
12
  variant?: "default" | "outline" | null | undefined;
13
13
  size?: "default" | "sm" | "lg" | null | undefined;
14
- } & class_variance_authority_types7.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
14
+ } & class_variance_authority_types8.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
15
15
  //#endregion
16
16
  export { Toggle, toggleVariants };
17
17
  //# sourceMappingURL=toggle.d.ts.map
package/llms.txt CHANGED
@@ -145,6 +145,10 @@ Exports: Label
145
145
  Import: `@coston/ui/menubar`
146
146
  Exports: Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarShortcut
147
147
 
148
+ ### native-select
149
+ Import: `@coston/ui/native-select`
150
+ Exports: NativeSelect, nativeSelectVariants
151
+
148
152
  ### navigation-menu
149
153
  Import: `@coston/ui/navigation-menu`
150
154
  Exports: navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coston/ui",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "React UI component library built on Radix UI and Tailwind CSS",
5
5
  "type": "module",
6
6
  "sideEffects": false,