@better-nds/react 0.0.17 → 0.0.18

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.
@@ -0,0 +1,2 @@
1
+ "use client";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("class-variance-authority"),r=require("./_cn.cjs");let a=t.cva("flex h-full cursor-text items-center justify-center gap-2 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{variant:{solid:"bg-nds-neutral-100 text-nds-neutral-500 px-4!",transparent:""},align:{"inline-start":"order-first ps-2 has-[>button]:ms-[-0.3rem] has-[>kbd]:ms-[-0.15rem]","inline-end":"order-last pe-2 has-[>button]:me-[-0.3rem] has-[>kbd]:me-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});exports.InputGroup=function({className:t,size:a="lg",dir:n,...s}){return e.jsx("div",{dir:n,"data-slot":"input-group",role:"group",className:r.cn("group/input-group relative flex w-full min-w-0 items-center justify-center overflow-hidden rounded-sm transition-shadow",{"h-10":"lg"===a,"h-8":"md"===a},"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700","before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700 aria-invalid:before:border-nds-error-700 before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors","after:bg-nds-neutral-950 aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5","has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto","has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",t),...s})},exports.InputGroupAddon=function({className:t,align:n="inline-start",variant:s="transparent",...o}){return e.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:r.cn(a({align:n,variant:s}),t),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...o})},exports.InputGroupInput=function({className:t,...a}){return e.jsx("input",{"data-slot":"input-group-control",className:r.cn("placeholder:text-nds-neutral-500 relative h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed",t),...a})},exports.InputGroupText=function({className:t,...a}){return e.jsx("span",{className:r.cn("text-nds-neutral-500 flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",t),...a})};
2
+ //# sourceMappingURL=input-group.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-group.cjs","sources":["../src/components/input-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { VariantProps } from \"class-variance-authority\"\nimport type { ComponentProps } from \"react\"\n\nimport { cva } from \"class-variance-authority\"\n\nimport { cn } from \"../_cn\"\n\nfunction InputGroup({\n className,\n size = \"lg\",\n dir,\n ...props\n}: ComponentProps<\"div\"> & { size?: \"lg\" | \"md\" }) {\n return (\n <div\n dir={dir}\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full min-w-0 items-center justify-center overflow-hidden rounded-sm transition-shadow\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700\",\n \"before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700 aria-invalid:before:border-nds-error-700 before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors\",\n \"after:bg-nds-neutral-950 aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5\",\n \"has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto\",\n \"has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-full cursor-text items-center justify-center gap-2 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n solid: \"bg-nds-neutral-100 text-nds-neutral-500 px-4!\",\n transparent: \"\"\n },\n align: {\n \"inline-start\":\n \"order-first ps-2 has-[>button]:ms-[-0.3rem] has-[>kbd]:ms-[-0.15rem]\",\n \"inline-end\":\n \"order-last pe-2 has-[>button]:me-[-0.3rem] has-[>kbd]:me-[-0.15rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2\",\n \"block-end\":\n \"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2\"\n }\n },\n defaultVariants: {\n align: \"inline-start\"\n }\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n variant = \"transparent\",\n ...props\n}: ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n // oxlint-disable-next-line jsx_a11y/click-events-have-key-events\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align, variant }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\n// const inputGroupButtonVariants = cva(\"flex items-center gap-2 text-sm\", {\n// variants: {\n// size: {\n// xs: \"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5\",\n// sm: \"\",\n// \"icon-xs\": \"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0\",\n// \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\"\n// }\n// },\n// defaultVariants: {\n// size: \"xs\"\n// }\n// })\n\n// function InputGroupButton({\n// className,\n// type = \"button\",\n// variant = \"transparent\",\n// size = \"xs\",\n// ...props\n// }: Omit<ComponentProps<typeof Button>, \"size\"> &\n// VariantProps<typeof inputGroupButtonVariants>) {\n// return (\n// <Button\n// type={type}\n// data-size={size}\n// variant={variant}\n// className={cn(inputGroupButtonVariants({ size }), className)}\n// {...props}\n// />\n// )\n// }\n\nfunction InputGroupText({ className, ...props }: ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-nds-neutral-500 flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({ className, ...props }: ComponentProps<\"input\">) {\n return (\n <input\n data-slot=\"input-group-control\"\n className={cn(\n \"placeholder:text-nds-neutral-500 relative h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed\",\n className\n )}\n {...props}\n />\n )\n}\n\n// function InputGroupTextarea({\n// className,\n// ...props\n// }: React.ComponentProps<\"textarea\">) {\n// return (\n// <Textarea\n// data-slot=\"input-group-control\"\n// className={cn(\n// \"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent\",\n// className\n// )}\n// {...props}\n// />\n// )\n// }\n\nexport {\n InputGroup,\n InputGroupAddon,\n // InputGroupButton,\n InputGroupText,\n InputGroupInput\n // InputGroupTextarea\n}\n"],"names":["inputGroupAddonVariants","cva","variants","variant","solid","transparent","align","defaultVariants","className","size","dir","props","_jsx","div","data-slot","role","cn","data-align","onClick","e","target","closest","currentTarget","parentElement","querySelector","focus","input","span"],"mappings":"oKAuCA,IAAMA,EAA0BC,EAAAA,IAC9B,6NACA,CACEC,SAAU,CACRC,QAAS,CACPC,MAAO,gDACPC,YAAa,EACf,EACAC,MAAO,CACL,eACE,uEACF,aACE,sEACF,cACE,oGACF,YACE,kGACJ,CACF,EACAC,gBAAiB,CACfD,MAAO,cACT,CACF,sBApDF,SAAoB,CAClBE,UAAAA,CAAS,CACTC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAC4C,EAC/C,OACEC,EAAAA,GAAA,CAACC,MAAAA,CACCH,IAAKA,EACLI,YAAU,cACVC,KAAK,QACLP,UAAWQ,EAAAA,GACT,0HACA,CACE,OAAQP,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,CACT,EACA,gJACA,kTACA,8OACA,0EACA,qLACA,gMACAD,GAED,GAAGG,CAAAA,EAGV,0BA2BA,SAAyB,CACvBH,UAAAA,CAAS,CACTF,MAAAA,EAAQ,cAAc,CACtBH,QAAAA,EAAU,aAAa,CACvB,GAAGQ,EACkE,EACrE,OAEEC,EAAAA,GAAA,CAACC,MAAAA,CACCE,KAAK,QACLD,YAAU,oBACVG,aAAYX,EACZE,UAAWQ,EAAAA,GAAGhB,EAAwB,CAAEM,MAAAA,EAAOH,QAAAA,IAAYK,GAC3DU,QAAS,AAACC,IACJA,EAAGC,MAAM,CAAiBC,OAAO,CAAC,WAGtCF,EAAEG,aAAa,CAACC,aAAa,EAAEC,cAAc,UAAUC,OACzD,EACC,GAAGd,CAAAA,EAGV,0BA+CA,SAAyB,CAAEH,UAAAA,CAAS,CAAE,GAAGG,EAAgC,EACvE,OACEC,EAAAA,GAAA,CAACc,QAAAA,CACCZ,YAAU,sBACVN,UAAWQ,EAAAA,GACT,kLACAR,GAED,GAAGG,CAAAA,EAGV,yBAvBA,SAAwB,CAAEH,UAAAA,CAAS,CAAE,GAAGG,EAA+B,EACrE,OACEC,EAAAA,GAAA,CAACe,OAAAA,CACCnB,UAAWQ,EAAAA,GACT,wHACAR,GAED,GAAGG,CAAAA,EAGV"}
@@ -0,0 +1,18 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { ComponentProps } from 'react';
5
+
6
+ declare function InputGroup({ className, size, dir, ...props }: ComponentProps<"div"> & {
7
+ size?: "lg" | "md";
8
+ }): react_jsx_runtime.JSX.Element;
9
+ declare const inputGroupAddonVariants: (props?: ({
10
+ variant?: "solid" | "transparent" | null | undefined;
11
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+ declare function InputGroupAddon({ className, align, variant, ...props }: ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
14
+ declare function InputGroupText({ className, ...props }: ComponentProps<"span">): react_jsx_runtime.JSX.Element;
15
+ declare function InputGroupInput({ className, ...props }: ComponentProps<"input">): react_jsx_runtime.JSX.Element;
16
+
17
+ export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText };
18
+ //# sourceMappingURL=input-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-group.d.ts","sources":["../src/components/input-group.tsx"],"mappings":";;;;;AAIA,iBAAiB,UAAU,qCAAqC,cAAc;AAC9E;AACA,IAAI,iBAAiB,CAAC,GAAG,CAAC,OAAO;AACjC,cAAc,uBAAuB;AACrC;AACA;AACA,IAAI,8BAA8B,CAAC,SAAS;AAC5C,iBAAiB,eAAe,0CAA0C,cAAc,UAAU,YAAY,QAAQ,uBAAuB,IAAI,iBAAiB,CAAC,GAAG,CAAC,OAAO;AAC9K,iBAAiB,cAAc,0BAA0B,cAAc,WAAW,iBAAiB,CAAC,GAAG,CAAC,OAAO;AAC/G,iBAAiB,eAAe,0BAA0B,cAAc,YAAY,iBAAiB,CAAC,GAAG,CAAC,OAAO;;;;","names":[]}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{cva as e}from"class-variance-authority";import{cn as r}from"./_cn.js";function a({className:e,size:n="lg",dir:o,...s}){return t("div",{dir:o,"data-slot":"input-group",role:"group",className:r("group/input-group relative flex w-full min-w-0 items-center justify-center overflow-hidden rounded-sm transition-shadow",{"h-10":"lg"===n,"h-8":"md"===n},"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700","before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700 aria-invalid:before:border-nds-error-700 before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors","after:bg-nds-neutral-950 aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5","has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto","has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",e),...s})}let n=e("flex h-full cursor-text items-center justify-center gap-2 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{variant:{solid:"bg-nds-neutral-100 text-nds-neutral-500 px-4!",transparent:""},align:{"inline-start":"order-first ps-2 has-[>button]:ms-[-0.3rem] has-[>kbd]:ms-[-0.15rem]","inline-end":"order-last pe-2 has-[>button]:me-[-0.3rem] has-[>kbd]:me-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function o({className:e,align:a="inline-start",variant:s="transparent",...i}){return t("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:r(n({align:a,variant:s}),e),onClick:t=>{t.target.closest("button")||t.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}function s({className:e,...a}){return t("span",{className:r("text-nds-neutral-500 flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",e),...a})}function i({className:e,...a}){return t("input",{"data-slot":"input-group-control",className:r("placeholder:text-nds-neutral-500 relative h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed",e),...a})}export{a as InputGroup,o as InputGroupAddon,i as InputGroupInput,s as InputGroupText};
2
+ //# sourceMappingURL=input-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-group.js","sources":["../src/components/input-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { VariantProps } from \"class-variance-authority\"\nimport type { ComponentProps } from \"react\"\n\nimport { cva } from \"class-variance-authority\"\n\nimport { cn } from \"../_cn\"\n\nfunction InputGroup({\n className,\n size = \"lg\",\n dir,\n ...props\n}: ComponentProps<\"div\"> & { size?: \"lg\" | \"md\" }) {\n return (\n <div\n dir={dir}\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full min-w-0 items-center justify-center overflow-hidden rounded-sm transition-shadow\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700\",\n \"before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700 aria-invalid:before:border-nds-error-700 before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors\",\n \"after:bg-nds-neutral-950 aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5\",\n \"has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto\",\n \"has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-full cursor-text items-center justify-center gap-2 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n solid: \"bg-nds-neutral-100 text-nds-neutral-500 px-4!\",\n transparent: \"\"\n },\n align: {\n \"inline-start\":\n \"order-first ps-2 has-[>button]:ms-[-0.3rem] has-[>kbd]:ms-[-0.15rem]\",\n \"inline-end\":\n \"order-last pe-2 has-[>button]:me-[-0.3rem] has-[>kbd]:me-[-0.15rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2\",\n \"block-end\":\n \"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2\"\n }\n },\n defaultVariants: {\n align: \"inline-start\"\n }\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n variant = \"transparent\",\n ...props\n}: ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n // oxlint-disable-next-line jsx_a11y/click-events-have-key-events\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align, variant }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\n// const inputGroupButtonVariants = cva(\"flex items-center gap-2 text-sm\", {\n// variants: {\n// size: {\n// xs: \"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5\",\n// sm: \"\",\n// \"icon-xs\": \"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0\",\n// \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\"\n// }\n// },\n// defaultVariants: {\n// size: \"xs\"\n// }\n// })\n\n// function InputGroupButton({\n// className,\n// type = \"button\",\n// variant = \"transparent\",\n// size = \"xs\",\n// ...props\n// }: Omit<ComponentProps<typeof Button>, \"size\"> &\n// VariantProps<typeof inputGroupButtonVariants>) {\n// return (\n// <Button\n// type={type}\n// data-size={size}\n// variant={variant}\n// className={cn(inputGroupButtonVariants({ size }), className)}\n// {...props}\n// />\n// )\n// }\n\nfunction InputGroupText({ className, ...props }: ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-nds-neutral-500 flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({ className, ...props }: ComponentProps<\"input\">) {\n return (\n <input\n data-slot=\"input-group-control\"\n className={cn(\n \"placeholder:text-nds-neutral-500 relative h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed\",\n className\n )}\n {...props}\n />\n )\n}\n\n// function InputGroupTextarea({\n// className,\n// ...props\n// }: React.ComponentProps<\"textarea\">) {\n// return (\n// <Textarea\n// data-slot=\"input-group-control\"\n// className={cn(\n// \"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent\",\n// className\n// )}\n// {...props}\n// />\n// )\n// }\n\nexport {\n InputGroup,\n InputGroupAddon,\n // InputGroupButton,\n InputGroupText,\n InputGroupInput\n // InputGroupTextarea\n}\n"],"names":["InputGroup","className","size","dir","props","_jsx","div","data-slot","role","cn","inputGroupAddonVariants","cva","variants","variant","solid","transparent","align","defaultVariants","InputGroupAddon","data-align","onClick","e","target","closest","currentTarget","parentElement","querySelector","focus","InputGroupText","span","InputGroupInput","input"],"mappings":"kIASA,SAASA,EAAW,CAClBC,UAAAA,CAAS,CACTC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAC4C,EAC/C,OACEC,EAACC,MAAAA,CACCH,IAAKA,EACLI,YAAU,cACVC,KAAK,QACLP,UAAWQ,EACT,0HACA,CACE,OAAQP,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,CACT,EACA,gJACA,kTACA,8OACA,0EACA,qLACA,gMACAD,GAED,GAAGG,CAAAA,EAGV,CAEA,IAAMM,EAA0BC,EAC9B,6NACA,CACEC,SAAU,CACRC,QAAS,CACPC,MAAO,gDACPC,YAAa,EACf,EACAC,MAAO,CACL,eACE,uEACF,aACE,sEACF,cACE,oGACF,YACE,kGACJ,CACF,EACAC,gBAAiB,CACfD,MAAO,cACT,CACF,GAGF,SAASE,EAAgB,CACvBjB,UAAAA,CAAS,CACTe,MAAAA,EAAQ,cAAc,CACtBH,QAAAA,EAAU,aAAa,CACvB,GAAGT,EACkE,EACrE,OAEEC,EAACC,MAAAA,CACCE,KAAK,QACLD,YAAU,oBACVY,aAAYH,EACZf,UAAWQ,EAAGC,EAAwB,CAAEM,MAAAA,EAAOH,QAAAA,IAAYZ,GAC3DmB,QAAS,AAACC,IACJA,EAAGC,MAAM,CAAiBC,OAAO,CAAC,WAGtCF,EAAEG,aAAa,CAACC,aAAa,EAAEC,cAAc,UAAUC,OACzD,EACC,GAAGvB,CAAAA,EAGV,CAmCA,SAASwB,EAAe,CAAE3B,UAAAA,CAAS,CAAE,GAAGG,EAA+B,EACrE,OACEC,EAACwB,OAAAA,CACC5B,UAAWQ,EACT,wHACAR,GAED,GAAGG,CAAAA,EAGV,CAEA,SAAS0B,EAAgB,CAAE7B,UAAAA,CAAS,CAAE,GAAGG,EAAgC,EACvE,OACEC,EAAC0B,QAAAA,CACCxB,YAAU,sBACVN,UAAWQ,EACT,kLACAR,GAED,GAAGG,CAAAA,EAGV"}
package/dist/input.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("clsx"),r=require("./_cn.cjs"),a=t&&t.__esModule?t:{default:t};exports.Input=function({className:t,type:n,size:d="lg",dir:s,...i}){return e.jsx("div",{dir:s,className:r.cn("after:bg-nds-neutral-950 group has-aria-invalid:after:bg-nds-error-700 relative flex w-full justify-center overflow-hidden rounded-sm transition-shadow after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5 has-disabled:shadow-none has-disabled:after:w-0",{"h-10":"lg"===d,"h-8":"md"===d},t),children:e.jsx("input",{type:n,"data-slot":"input",className:a.default("bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700 border-nds-neutral-400 hover:border-nds-neutral-700 active:border-nds-neutral-400 aria-invalid:border-nds-error-700 relative w-full min-w-0 rounded-sm border ps-2 pe-4 text-base ring-0 transition-colors outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"),...i})})};
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("clsx"),t=require("./_cn.cjs"),a=r&&r.__esModule?r:{default:r};exports.Input=function({className:r,type:n,size:o="lg",dir:s,...d}){return e.jsx("div",{dir:s,className:t.cn("group relative flex w-full items-center justify-center overflow-hidden rounded-sm transition-shadow",{"h-10":"lg"===o,"h-8":"md"===o},"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700","before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700","after:bg-nds-neutral-950 has-aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5","has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0",r),children:e.jsx("input",{type:n,"data-slot":"input",className:a.default("placeholder:text-nds-neutral-500 h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"),...d})})};
2
2
  //# sourceMappingURL=input.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","sources":["../src/components/input.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\n\nimport clsx from \"clsx\"\n\nimport { cn } from \"../_cn\"\n\nfunction Input({\n className,\n type,\n size = \"lg\",\n dir,\n ...props\n}: Omit<ComponentProps<\"input\">, \"size\"> & {\n size?: \"lg\" | \"md\"\n}) {\n return (\n <div\n dir={dir}\n className={cn(\n \"after:bg-nds-neutral-950 group has-aria-invalid:after:bg-nds-error-700 relative flex w-full justify-center overflow-hidden rounded-sm transition-shadow after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5 has-disabled:shadow-none has-disabled:after:w-0\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n className\n )}\n >\n <input\n type={type}\n data-slot=\"input\"\n className={clsx(\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700 border-nds-neutral-400 hover:border-nds-neutral-700 active:border-nds-neutral-400 aria-invalid:border-nds-error-700 relative w-full min-w-0 rounded-sm border ps-2 pe-4 text-base ring-0 transition-colors outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport { Input }\n"],"names":["className","type","size","dir","props","_jsx","div","cn","children","input","data-slot","clsx"],"mappings":"iLAMA,SAAe,CACbA,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAGJ,EACC,OACEC,EAAAA,GAAA,CAACC,MAAAA,CACCH,IAAKA,EACLH,UAAWO,EAAAA,GACT,yXACA,CACE,OAAQL,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,GAETF,GAGFQ,SAAAH,EAAAA,GAAA,CAACI,QAAAA,CACCR,KAAMA,EACNS,YAAU,QACVV,UAAWW,EAAAA,OAAAA,CACT,sbAED,GAAGP,CAAAA,IAIZ"}
1
+ {"version":3,"file":"input.cjs","sources":["../src/components/input.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\n\nimport clsx from \"clsx\"\n\nimport { cn } from \"../_cn\"\n\nfunction Input({\n className,\n type,\n size = \"lg\",\n dir,\n ...props\n}: Omit<ComponentProps<\"input\">, \"size\"> & {\n size?: \"lg\" | \"md\"\n}) {\n return (\n <div\n dir={dir}\n className={cn(\n \"group relative flex w-full items-center justify-center overflow-hidden rounded-sm transition-shadow\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700\",\n \"before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700\",\n \"after:bg-nds-neutral-950 has-aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5\",\n \"has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0\",\n className\n )}\n >\n <input\n type={type}\n data-slot=\"input\"\n className={clsx(\n \"placeholder:text-nds-neutral-500 h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed\"\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport { Input }\n"],"names":["className","type","size","dir","props","_jsx","div","cn","children","input","data-slot","clsx"],"mappings":"iLAMA,SAAe,CACbA,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAGJ,EACC,OACEC,EAAAA,GAAA,CAACC,MAAAA,CACCH,IAAKA,EACLH,UAAWO,EAAAA,GACT,sGACA,CACE,OAAQL,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,GAET,gJACA,yQACA,kPACA,0EACAF,GAGFQ,SAAAH,EAAAA,GAAA,CAACI,QAAAA,CACCR,KAAMA,EACNS,YAAU,QACVV,UAAWW,EAAAA,OAAAA,CACT,0KAED,GAAGP,CAAAA,IAIZ"}
package/dist/input.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import t from"clsx";import{cn as r}from"./_cn.js";function a({className:n,type:d,size:i="lg",dir:o,...s}){return e("div",{dir:o,className:r("after:bg-nds-neutral-950 group has-aria-invalid:after:bg-nds-error-700 relative flex w-full justify-center overflow-hidden rounded-sm transition-shadow after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5 has-disabled:shadow-none has-disabled:after:w-0",{"h-10":"lg"===i,"h-8":"md"===i},n),children:e("input",{type:d,"data-slot":"input",className:t("bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700 border-nds-neutral-400 hover:border-nds-neutral-700 active:border-nds-neutral-400 aria-invalid:border-nds-error-700 relative w-full min-w-0 rounded-sm border ps-2 pe-4 text-base ring-0 transition-colors outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"),...s})})}export{a as Input};
1
+ import{jsx as e}from"react/jsx-runtime";import r from"clsx";import{cn as t}from"./_cn.js";function n({className:a,type:o,size:s="lg",dir:d,...i}){return e("div",{dir:d,className:t("group relative flex w-full items-center justify-center overflow-hidden rounded-sm transition-shadow",{"h-10":"lg"===s,"h-8":"md"===s},"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700","before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700","after:bg-nds-neutral-950 has-aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5","has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0",a),children:e("input",{type:o,"data-slot":"input",className:r("placeholder:text-nds-neutral-500 h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"),...i})})}export{n as Input};
2
2
  //# sourceMappingURL=input.js.map
package/dist/input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sources":["../src/components/input.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\n\nimport clsx from \"clsx\"\n\nimport { cn } from \"../_cn\"\n\nfunction Input({\n className,\n type,\n size = \"lg\",\n dir,\n ...props\n}: Omit<ComponentProps<\"input\">, \"size\"> & {\n size?: \"lg\" | \"md\"\n}) {\n return (\n <div\n dir={dir}\n className={cn(\n \"after:bg-nds-neutral-950 group has-aria-invalid:after:bg-nds-error-700 relative flex w-full justify-center overflow-hidden rounded-sm transition-shadow after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5 has-disabled:shadow-none has-disabled:after:w-0\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n className\n )}\n >\n <input\n type={type}\n data-slot=\"input\"\n className={clsx(\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700 border-nds-neutral-400 hover:border-nds-neutral-700 active:border-nds-neutral-400 aria-invalid:border-nds-error-700 relative w-full min-w-0 rounded-sm border ps-2 pe-4 text-base ring-0 transition-colors outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport { Input }\n"],"names":["Input","className","type","size","dir","props","_jsx","div","cn","children","input","data-slot","clsx"],"mappings":"0FAMA,SAASA,EAAM,CACbC,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAGJ,EACC,OACEC,EAACC,MAAAA,CACCH,IAAKA,EACLH,UAAWO,EACT,yXACA,CACE,OAAQL,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,GAETF,GAGFQ,SAAAH,EAACI,QAAAA,CACCR,KAAMA,EACNS,YAAU,QACVV,UAAWW,EACT,sbAED,GAAGP,CAAAA,IAIZ"}
1
+ {"version":3,"file":"input.js","sources":["../src/components/input.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\n\nimport clsx from \"clsx\"\n\nimport { cn } from \"../_cn\"\n\nfunction Input({\n className,\n type,\n size = \"lg\",\n dir,\n ...props\n}: Omit<ComponentProps<\"input\">, \"size\"> & {\n size?: \"lg\" | \"md\"\n}) {\n return (\n <div\n dir={dir}\n className={cn(\n \"group relative flex w-full items-center justify-center overflow-hidden rounded-sm transition-shadow\",\n {\n \"h-10\": size === \"lg\",\n \"h-8\": size === \"md\"\n },\n \"bg-nds-white text-nds-neutral-700 hover:text-nds-black placeholder:text-nds-neutral-500 active:bg-nds-neutral-100 active:text-nds-neutral-700\",\n \"before:pointer-events-none before:absolute before:inset-0 before:rounded-sm before:border before:transition-colors before:border-nds-neutral-400 hover:before:border-nds-neutral-700 active:before:border-nds-neutral-400 has-aria-invalid:before:border-nds-error-700\",\n \"after:bg-nds-neutral-950 has-aria-invalid:after:bg-nds-error-700 after:absolute after:bottom-0 after:h-0.5 after:w-0 after:transition-[width] after:duration-300 not-active:focus-within:shadow-md focus-within:after:w-full active:after:w-2/5\",\n \"has-disabled:opacity-50 has-disabled:shadow-none has-disabled:after:w-0\",\n className\n )}\n >\n <input\n type={type}\n data-slot=\"input\"\n className={clsx(\n \"placeholder:text-nds-neutral-500 h-full w-full min-w-0 bg-transparent ps-2 pe-4 text-base ring-0 outline-none disabled:pointer-events-none disabled:cursor-not-allowed\"\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport { Input }\n"],"names":["Input","className","type","size","dir","props","_jsx","div","cn","children","input","data-slot","clsx"],"mappings":"0FAMA,SAASA,EAAM,CACbC,UAAAA,CAAS,CACTC,KAAAA,CAAI,CACJC,KAAAA,EAAO,IAAI,CACXC,IAAAA,CAAG,CACH,GAAGC,EAGJ,EACC,OACEC,EAACC,MAAAA,CACCH,IAAKA,EACLH,UAAWO,EACT,sGACA,CACE,OAAQL,AAAS,OAATA,EACR,MAAOA,AAAS,OAATA,GAET,gJACA,yQACA,kPACA,0EACAF,GAGFQ,SAAAH,EAACI,QAAAA,CACCR,KAAMA,EACNS,YAAU,QACVV,UAAWW,EACT,0KAED,GAAGP,CAAAA,IAIZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-nds/react",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "React component library for better-nds",
5
5
  "license": "MIT",
6
6
  "sideEffects": [