@bilursag/solidui-react 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,54 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bilursag
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ -------------------------------------------------------------------------------
24
+ Third-party notices
25
+ -------------------------------------------------------------------------------
26
+
27
+ Plush UI — https://github.com/dominikmartn/plush-ui
28
+ SolidUI's visual language and its spring easing curve are derived from Plush UI.
29
+
30
+ MIT License
31
+
32
+ Copyright (c) 2026 Dominik Martin
33
+
34
+ Permission is hereby granted, free of charge, to any person obtaining a copy
35
+ of this software and associated documentation files (the "Software"), to deal
36
+ in the Software without restriction, including without limitation the rights
37
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
38
+ copies of the Software, and to permit persons to whom the Software is
39
+ furnished to do so, subject to the following conditions:
40
+
41
+ The above copyright notice and this permission notice shall be included in
42
+ all copies or substantial portions of the Software.
43
+
44
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
49
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
50
+ SOFTWARE.
51
+
52
+ Fonts — Open Runde and Montserrat are licensed under the SIL Open Font
53
+ License 1.1. The license texts ship with @bilursag/solidui-native in assets/fonts/;
54
+ the web packages load them from @fontsource, which includes the same licenses.
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @bilursag/solidui-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [SolidUI](https://github.com/bilursag/solidui) for React and Tailwind CSS v4: Button, Input + Field, Card and Badge. Soft surfaces, pill-shaped controls, spring motion and WCAG-checked themes.
4
+
5
+ ```bash
6
+ npm install @bilursag/solidui-react
7
+ ```
8
+
9
+ ```css
10
+ /* your Tailwind entry CSS */
11
+ @import "tailwindcss";
12
+ @import "@bilursag/solidui-react/styles.css";
13
+ ```
14
+
15
+ ```tsx
16
+ import { Button } from '@bilursag/solidui-react';
17
+
18
+ <Button>Continue</Button>
19
+ ```
20
+
21
+ Re-brand with `npx @bilursag/solidui-tokens theme --brand "#0a7d5a" --out solidui-theme.css` and import that file after the styles. Full docs: https://github.com/bilursag/solidui
22
+
23
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ /**
4
+ * Pill label. For states use `success`, `warning`, `danger` or `brand`
5
+ * (tint + ink), never raw Tailwind colors (bg-green-100…), so light and dark both work.
6
+ */
7
+ export declare const badgeVariants: (props?: ({
8
+ variant?: "default" | "secondary" | "outline" | "brand" | "success" | "warning" | "danger" | "destructive" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
11
+ asChild?: boolean;
12
+ };
13
+ export declare function Badge({ className, variant, asChild, ...props }: BadgeProps): React.JSX.Element;
14
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../src/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,aAAa;;8EAuBzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnH,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAGlF"}
package/dist/badge.js ADDED
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Slot } from '@radix-ui/react-slot';
4
+ import { cva } from 'class-variance-authority';
5
+ import { cn } from './lib/cn.js';
6
+ /**
7
+ * Pill label. For states use `success`, `warning`, `danger` or `brand`
8
+ * (tint + ink), never raw Tailwind colors (bg-green-100…), so light and dark both work.
9
+ */
10
+ export const badgeVariants = cva([
11
+ 'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap',
12
+ 'rounded-pill border border-transparent px-2.5 py-0.5 font-rounded text-xs font-semibold leading-5',
13
+ 'transition-colors [&>svg]:pointer-events-none [&>svg]:size-3',
14
+ 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',
15
+ ], {
16
+ variants: {
17
+ variant: {
18
+ default: 'bg-brand text-on-brand [a&]:hover:bg-brand-hover',
19
+ secondary: 'bg-fill text-ink-2 [a&]:hover:bg-fill-strong',
20
+ outline: 'border-line bg-transparent text-ink-2 [a&]:hover:bg-fill',
21
+ brand: 'bg-brand-tint text-brand-ink',
22
+ success: 'bg-success-tint text-success-ink',
23
+ warning: 'bg-warning-tint text-warning-ink',
24
+ danger: 'bg-danger-tint text-danger-ink',
25
+ /** Alias of `danger`, for shadcn compatibility. */
26
+ destructive: 'bg-danger-tint text-danger-ink',
27
+ },
28
+ },
29
+ defaultVariants: { variant: 'default' },
30
+ });
31
+ export function Badge({ className, variant, asChild = false, ...props }) {
32
+ const Comp = asChild ? Slot : 'span';
33
+ return _jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
34
+ }
35
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","sourceRoot":"","sources":["../src/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAC9B;IACE,gGAAgG;IAChG,mGAAmG;IACnG,8DAA8D;IAC9D,oFAAoF;CACrF,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,kDAAkD;YAC3D,SAAS,EAAE,8CAA8C;YACzD,OAAO,EAAE,0DAA0D;YACnE,KAAK,EAAE,8BAA8B;YACrC,OAAO,EAAE,kCAAkC;YAC3C,OAAO,EAAE,kCAAkC;YAC3C,MAAM,EAAE,gCAAgC;YACxC,mDAAmD;YACnD,WAAW,EAAE,gCAAgC;SAC9C;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;CACxC,CACF,CAAC;AAIF,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAc;IACjF,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,KAAC,IAAI,iBAAW,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACrG,CAAC"}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ /**
4
+ * Pill button. When pressed it gives on a spring and barely bounces back
5
+ * (round ones give more); colors change with a short fade. The edge of the
6
+ * light buttons is the soft shadow, not a border.
7
+ */
8
+ export declare const buttonVariants: (props?: ({
9
+ variant?: "secondary" | "destructive" | "link" | "primary" | "surface" | "ghost" | null | undefined;
10
+ size?: "xs" | "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
11
+ block?: boolean | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
14
+ /** Renders the child (a router <Link>, for instance) with the button's styles. */
15
+ asChild?: boolean;
16
+ /** Shows a spinner, disables the button and sets aria-busy. The width does not change. */
17
+ loading?: boolean;
18
+ }
19
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
20
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../src/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;8EAiC1B,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,MAAM,uFAuBlB,CAAC"}
package/dist/button.js ADDED
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cva } from 'class-variance-authority';
6
+ import { cn } from './lib/cn.js';
7
+ /**
8
+ * Pill button. When pressed it gives on a spring and barely bounces back
9
+ * (round ones give more); colors change with a short fade. The edge of the
10
+ * light buttons is the soft shadow, not a border.
11
+ */
12
+ export const buttonVariants = cva([
13
+ 'press-spring relative inline-flex shrink-0 select-none items-center justify-center gap-2',
14
+ 'whitespace-nowrap rounded-pill font-rounded font-semibold leading-none',
15
+ 'focus-visible:focus-ring disabled:pointer-events-none disabled:not-aria-busy:opacity-45',
16
+ 'active:not-disabled:scale-[var(--sui-press-pill)] aria-busy:cursor-progress',
17
+ '[&_svg]:pointer-events-none [&_svg]:shrink-0',
18
+ ], {
19
+ variants: {
20
+ variant: {
21
+ primary: 'bg-brand text-on-brand hover:bg-brand-hover active:bg-brand-press',
22
+ secondary: 'bg-fill text-ink hover:bg-fill-strong active:bg-fill-press',
23
+ surface: 'bg-surface text-ink shadow-soft hover:shadow-raised active:bg-surface-press',
24
+ ghost: 'bg-transparent text-ink hover:bg-fill-strong active:bg-fill-press',
25
+ destructive: 'bg-danger text-on-danger hover:bg-danger-hover',
26
+ link: 'bg-transparent text-brand-ink underline-offset-4 hover:underline',
27
+ },
28
+ size: {
29
+ xs: 'h-control-xs px-3.5 text-label [&_svg:not([class*=size-])]:size-3.5',
30
+ sm: 'h-control-sm px-5 text-body-sm [&_svg:not([class*=size-])]:size-4',
31
+ md: 'h-control-md px-6 text-btn [&_svg:not([class*=size-])]:size-4.5',
32
+ lg: 'h-control-lg px-7 text-btn [&_svg:not([class*=size-])]:size-5',
33
+ icon: 'size-control-md p-0 active:not-disabled:scale-[var(--sui-press-icon)] [&_svg:not([class*=size-])]:size-5',
34
+ 'icon-sm': 'size-control-sm p-0 active:not-disabled:scale-[var(--sui-press-icon)] [&_svg:not([class*=size-])]:size-4.5',
35
+ },
36
+ block: { true: 'w-full' },
37
+ },
38
+ // Comes after `size` in the final string, so tailwind-merge keeps these
39
+ // classes: a link has no pill height or padding and does not give when pressed.
40
+ compoundVariants: [{ variant: 'link', class: 'h-auto px-0 active:not-disabled:scale-100' }],
41
+ defaultVariants: { variant: 'primary', size: 'md' },
42
+ });
43
+ export const Button = React.forwardRef(({ className, variant, size, block, asChild = false, loading = false, disabled, children, ...props }, ref) => {
44
+ const Comp = asChild ? Slot : 'button';
45
+ return (_jsx(Comp, { ref: ref, "data-slot": "button", className: cn(buttonVariants({ variant, size, block }), className), disabled: asChild ? undefined : disabled || loading, "aria-busy": loading || undefined, ...props, children: asChild ? (children) : (_jsxs(_Fragment, { children: [loading && _jsx(Spinner, {}), _jsx("span", { className: cn('inline-flex items-center gap-2', loading && 'opacity-0'), children: children })] })) }));
46
+ });
47
+ Button.displayName = 'Button';
48
+ function Spinner() {
49
+ return (_jsx("span", { "aria-hidden": true, className: "absolute inset-0 flex items-center justify-center", children: _jsx("span", { className: "size-5 animate-spin rounded-full border-2 border-current border-r-transparent" }) }));
50
+ }
51
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../src/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,0FAA0F;IAC1F,wEAAwE;IACxE,yFAAyF;IACzF,6EAA6E;IAC7E,8CAA8C;CAC/C,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,mEAAmE;YAC5E,SAAS,EAAE,4DAA4D;YACvE,OAAO,EAAE,6EAA6E;YACtF,KAAK,EAAE,mEAAmE;YAC1E,WAAW,EAAE,gDAAgD;YAC7D,IAAI,EAAE,kEAAkE;SACzE;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,qEAAqE;YACzE,EAAE,EAAE,mEAAmE;YACvE,EAAE,EAAE,iEAAiE;YACrE,EAAE,EAAE,+DAA+D;YACnE,IAAI,EAAE,0GAA0G;YAChH,SAAS,EAAE,4GAA4G;SACxH;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;IACD,wEAAwE;IACxE,gFAAgF;IAChF,gBAAgB,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC;IAC3F,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;CACpD,CACF,CAAC;AAWF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3G,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvC,OAAO,CACL,KAAC,IAAI,IACH,GAAG,EAAE,GAAG,eACE,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,EAClE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,IAAI,OAAO,eACxC,OAAO,IAAI,SAAS,KAC3B,KAAK,YAER,OAAO,CAAC,CAAC,CAAC,CACT,QAAQ,CACT,CAAC,CAAC,CAAC,CACF,8BACG,OAAO,IAAI,KAAC,OAAO,KAAG,EACvB,eAAM,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,OAAO,IAAI,WAAW,CAAC,YAAG,QAAQ,GAAQ,IAC/F,CACJ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,SAAS,OAAO;IACd,OAAO,CACL,oCAAkB,SAAS,EAAC,mDAAmD,YAC7E,eAAM,SAAS,EAAC,+EAA+E,GAAG,GAC7F,CACR,CAAC;AACJ,CAAC"}
package/dist/card.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ /**
4
+ * Card: a surface with a large radius and a soft shadow (no border).
5
+ * `muted` = gray fill without shadow (to group things inside another card);
6
+ * `brand` = brand color with on-brand text (highlights).
7
+ * `interactive` lifts on hover and gives when pressed (use it with asChild + a link).
8
+ */
9
+ export declare const cardVariants: (props?: ({
10
+ variant?: "default" | "brand" | "muted" | null | undefined;
11
+ padding?: "none" | "sm" | "md" | "lg" | null | undefined;
12
+ interactive?: boolean | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
15
+ asChild?: boolean;
16
+ }
17
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
18
+ export declare function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
19
+ export declare function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): React.JSX.Element;
20
+ export declare function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
21
+ export declare function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
22
+ export declare function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
23
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;8EAkBvB,CAAC;AAEH,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,kFAYhB,CAAC;AAGF,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,qBAEvF;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,qBAE1F;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,qBAElG;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,qBAExF;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,qBAEvF"}
package/dist/card.js ADDED
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cva } from 'class-variance-authority';
6
+ import { cn } from './lib/cn.js';
7
+ /**
8
+ * Card: a surface with a large radius and a soft shadow (no border).
9
+ * `muted` = gray fill without shadow (to group things inside another card);
10
+ * `brand` = brand color with on-brand text (highlights).
11
+ * `interactive` lifts on hover and gives when pressed (use it with asChild + a link).
12
+ */
13
+ export const cardVariants = cva('flex flex-col rounded-card font-rounded text-ink', {
14
+ variants: {
15
+ variant: {
16
+ default: 'bg-surface shadow-soft',
17
+ muted: 'bg-fill',
18
+ brand: 'bg-brand text-on-brand [&_[data-slot=card-description]]:text-on-brand/80',
19
+ },
20
+ padding: {
21
+ none: '',
22
+ sm: 'gap-3 p-4',
23
+ md: 'gap-4 p-6',
24
+ lg: 'gap-5 p-8',
25
+ },
26
+ interactive: {
27
+ true: 'press-spring cursor-pointer hover:shadow-raised active:scale-[0.985] focus-visible:focus-ring',
28
+ },
29
+ },
30
+ defaultVariants: { variant: 'default', padding: 'md' },
31
+ });
32
+ export const Card = React.forwardRef(({ className, variant, padding, interactive, asChild, ...props }, ref) => {
33
+ const Comp = asChild ? Slot : 'div';
34
+ return (_jsx(Comp, { ref: ref, "data-slot": "card", className: cn(cardVariants({ variant, padding, interactive }), className), ...props }));
35
+ });
36
+ Card.displayName = 'Card';
37
+ export function CardHeader({ className, ...props }) {
38
+ return _jsx("div", { "data-slot": "card-header", className: cn('flex flex-col gap-1.5', className), ...props });
39
+ }
40
+ export function CardTitle({ className, ...props }) {
41
+ return _jsx("h3", { "data-slot": "card-title", className: cn('font-rounded text-heading font-semibold', className), ...props });
42
+ }
43
+ export function CardDescription({ className, ...props }) {
44
+ return _jsx("p", { "data-slot": "card-description", className: cn('text-body-sm font-medium text-ink-2', className), ...props });
45
+ }
46
+ export function CardContent({ className, ...props }) {
47
+ return _jsx("div", { "data-slot": "card-content", className: cn('flex flex-col gap-3', className), ...props });
48
+ }
49
+ export function CardFooter({ className, ...props }) {
50
+ return _jsx("div", { "data-slot": "card-footer", className: cn('mt-auto flex items-center gap-3 pt-2', className), ...props });
51
+ }
52
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,kDAAkD,EAAE;IAClF,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,wBAAwB;YACjC,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,0EAA0E;SAClF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,EAAE;YACR,EAAE,EAAE,WAAW;YACf,EAAE,EAAE,WAAW;YACf,EAAE,EAAE,WAAW;SAChB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,+FAA+F;SACtG;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;CACvD,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACpC,OAAO,CACL,KAAC,IAAI,IACH,GAAG,EAAE,GAAG,eACE,MAAM,EAChB,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,CAAC,KACrE,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAE1B,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC;IACtF,OAAO,2BAAe,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACvG,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA4C;IACzF,OAAO,0BAAc,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACvH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8C;IACjG,OAAO,yBAAa,kBAAkB,EAAC,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC;IACvF,OAAO,2BAAe,cAAc,EAAC,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC;IACtF,OAAO,2BAAe,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACtH,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { Button, buttonVariants, type ButtonProps } from './button.js';
2
+ export { Badge, badgeVariants, type BadgeProps } from './badge.js';
3
+ export { Input, Field, type InputProps, type FieldProps } from './input.js';
4
+ export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, cardVariants, type CardProps, } from './card.js';
5
+ export { cn } from './lib/cn.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EACL,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EACrE,YAAY,EAAE,KAAK,SAAS,GAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { Button, buttonVariants } from './button.js';
2
+ export { Badge, badgeVariants } from './badge.js';
3
+ export { Input, Field } from './input.js';
4
+ export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, cardVariants, } from './card.js';
5
+ export { cn } from './lib/cn.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAoB,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAoC,MAAM,YAAY,CAAC;AAC5E,OAAO,EACL,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EACrE,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Text field on a gray fill, no border. On focus it turns into a white surface
4
+ * with the raised shadow and the focus ring; when invalid, a red ring.
5
+ * `leading`/`trailing` take an icon or a small button (show password, for instance).
6
+ *
7
+ * `className` goes to the wrapper (which is what looks like "the field"), and the
8
+ * <input> inherits its typography: `font-mono`, `uppercase`, `text-2xl`,
9
+ * `text-center`… all work through className.
10
+ */
11
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
12
+ size?: 'sm' | 'md' | 'lg';
13
+ invalid?: boolean;
14
+ leading?: React.ReactNode;
15
+ trailing?: React.ReactNode;
16
+ }
17
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
18
+ export interface FieldProps {
19
+ label: React.ReactNode;
20
+ /** Help text under the field. */
21
+ hint?: React.ReactNode;
22
+ /** Error message; also marks the control as invalid. */
23
+ error?: React.ReactNode;
24
+ /** Marks the field as optional. `true` shows "(optional)"; pass text to translate it. */
25
+ optional?: boolean | React.ReactNode;
26
+ id?: string;
27
+ className?: string;
28
+ children: React.ReactNode;
29
+ }
30
+ export declare function Field({ label, hint, error, optional, id, className, children }: FieldProps): React.JSX.Element;
31
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAID,eAAO,MAAM,KAAK,qFAmCjB,CAAC;AAOF,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,iCAAiC;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,wDAAwD;IACxD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,UAAU,qBAyB1F"}
package/dist/input.js ADDED
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { cn } from './lib/cn.js';
5
+ const heights = { sm: 'h-control-sm', md: 'h-control-md', lg: 'h-control-lg' };
6
+ export const Input = React.forwardRef(({ className, size = 'md', invalid, leading, trailing, disabled, ...props }, ref) => {
7
+ const field = React.useContext(FieldContext);
8
+ const isInvalid = invalid ?? field?.invalid ?? false;
9
+ return (_jsxs("div", { "data-slot": "input", "data-invalid": isInvalid || undefined, "data-disabled": disabled || undefined, className: cn('group/input press-spring flex w-full items-center gap-2.5 rounded-row bg-fill px-4', 'font-rounded text-body font-medium text-ink', 'hover:bg-fill-strong', 'has-[input:focus-visible]:bg-surface has-[input:focus-visible]:shadow-raised', 'has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-focus has-[input:focus-visible]:outline-offset-0', 'data-invalid:outline-2 data-invalid:outline-danger data-invalid:outline-offset-0', 'data-disabled:opacity-45 data-disabled:pointer-events-none', heights[size], className), children: [leading && _jsx("span", { className: "flex shrink-0 text-ink-2 [&_svg]:size-5", children: leading }), _jsx("input", { ref: ref, id: props.id ?? field?.id, "aria-invalid": isInvalid || undefined, "aria-describedby": props['aria-describedby'] ?? field?.describedBy, disabled: disabled, className: "h-full min-w-0 flex-1 bg-transparent [font:inherit] [letter-spacing:inherit] [text-align:inherit] [text-transform:inherit] text-inherit outline-none placeholder:text-ink-3", ...props }), trailing && _jsx("span", { className: "flex shrink-0 text-ink-2 [&_svg]:size-5", children: trailing })] }));
10
+ });
11
+ Input.displayName = 'Input';
12
+ const FieldContext = React.createContext(null);
13
+ export function Field({ label, hint, error, optional, id, className, children }) {
14
+ const autoId = React.useId();
15
+ const fieldId = id ?? `field-${autoId}`;
16
+ const messageId = `${fieldId}-msg`;
17
+ const message = error ?? hint;
18
+ return (_jsx(FieldContext.Provider, { value: { id: fieldId, describedBy: message ? messageId : undefined, invalid: !!error }, children: _jsxs("div", { "data-slot": "field", className: cn('flex flex-col gap-2 font-rounded', className), children: [_jsxs("label", { htmlFor: fieldId, className: "px-1 text-label font-semibold text-ink", children: [label, optional && _jsx("span", { className: "ml-1 font-medium text-ink-2", children: optional === true ? '(optional)' : optional })] }), children, message && (_jsx("p", { id: messageId, role: error ? 'alert' : undefined, className: cn('px-1 text-caption font-medium', error ? 'text-danger-ink' : 'text-ink-2'), children: message }))] }) }));
19
+ }
20
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /** Joins classes and resolves Tailwind conflicts (the last one wins), aware of SolidUI's tokens. */
3
+ export declare function cn(...inputs: ClassValue[]): string;
4
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAmB7C,oGAAoG;AACpG,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/dist/lib/cn.js ADDED
@@ -0,0 +1,22 @@
1
+ import { clsx } from 'clsx';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ import { radius, size, typeScale } from '@bilursag/solidui-tokens';
4
+ // tailwind-merge has to know the theme's own names; otherwise it mistakes
5
+ // `text-btn` (a size) for a color and drops `text-on-brand`, for instance.
6
+ const twMerge = extendTailwindMerge({
7
+ extend: {
8
+ theme: {
9
+ radius: Object.keys(radius),
10
+ shadow: ['soft', 'raised', 'overlay'],
11
+ spacing: Object.keys(size),
12
+ text: Object.keys(typeScale),
13
+ font: ['rounded', 'heading'],
14
+ tracking: ['heading'],
15
+ },
16
+ },
17
+ });
18
+ /** Joins classes and resolves Tailwind conflicts (the last one wins), aware of SolidUI's tokens. */
19
+ export function cn(...inputs) {
20
+ return twMerge(clsx(inputs));
21
+ }
22
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAEnE,0EAA0E;AAC1E,2EAA2E;AAC3E,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAClC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;YACrC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YAC5B,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YAC5B,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;CACF,CAAC,CAAC;AAEH,oGAAoG;AACpG,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
package/no-fonts.css ADDED
@@ -0,0 +1,8 @@
1
+ /*
2
+ * SolidUI without the bundled fonts. Set your own stacks with a theme
3
+ * (npx @bilursag/solidui-tokens theme --font "…" --heading "…") or by overriding
4
+ * --sui-font-rounded and --sui-font-heading.
5
+ */
6
+ @import "@bilursag/solidui-tokens/web.css";
7
+
8
+ @source "./dist";
package/package.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@bilursag/solidui-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "SolidUI for React and Tailwind CSS v4: soft, borderless, pill-shaped components with WCAG-checked themes.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "*.css"
9
+ ],
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./styles.css": "./styles.css",
18
+ "./no-fonts.css": "./no-fonts.css",
19
+ "./package.json": "./package.json"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "src",
24
+ "styles.css",
25
+ "no-fonts.css"
26
+ ],
27
+ "scripts": {
28
+ "build": "rm -rf dist && tsc -p .",
29
+ "typecheck": "tsc -p . --noEmit"
30
+ },
31
+ "dependencies": {
32
+ "@fontsource-variable/montserrat": "^5.2.0",
33
+ "@fontsource/open-runde": "^5.2.0",
34
+ "@radix-ui/react-slot": "^1.2.3",
35
+ "@bilursag/solidui-tokens": "0.1.0",
36
+ "class-variance-authority": "^0.7.1",
37
+ "clsx": "^2.1.1",
38
+ "tailwind-merge": "^3.3.1"
39
+ },
40
+ "peerDependencies": {
41
+ "react": ">=18",
42
+ "react-dom": ">=18"
43
+ },
44
+ "devDependencies": {
45
+ "@types/react": "~19.3.0",
46
+ "react": "19.3.0"
47
+ },
48
+ "keywords": [
49
+ "react",
50
+ "ui",
51
+ "components",
52
+ "design-system",
53
+ "tailwindcss",
54
+ "shadcn",
55
+ "accessible"
56
+ ],
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/bilursag/solidui.git",
60
+ "directory": "packages/react"
61
+ },
62
+ "homepage": "https://github.com/bilursag/solidui#readme",
63
+ "bugs": "https://github.com/bilursag/solidui/issues",
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "author": "bilursag"
68
+ }
package/src/badge.tsx ADDED
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+ import { cn } from './lib/cn.js';
5
+
6
+ /**
7
+ * Pill label. For states use `success`, `warning`, `danger` or `brand`
8
+ * (tint + ink), never raw Tailwind colors (bg-green-100…), so light and dark both work.
9
+ */
10
+ export const badgeVariants = cva(
11
+ [
12
+ 'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap',
13
+ 'rounded-pill border border-transparent px-2.5 py-0.5 font-rounded text-xs font-semibold leading-5',
14
+ 'transition-colors [&>svg]:pointer-events-none [&>svg]:size-3',
15
+ 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',
16
+ ],
17
+ {
18
+ variants: {
19
+ variant: {
20
+ default: 'bg-brand text-on-brand [a&]:hover:bg-brand-hover',
21
+ secondary: 'bg-fill text-ink-2 [a&]:hover:bg-fill-strong',
22
+ outline: 'border-line bg-transparent text-ink-2 [a&]:hover:bg-fill',
23
+ brand: 'bg-brand-tint text-brand-ink',
24
+ success: 'bg-success-tint text-success-ink',
25
+ warning: 'bg-warning-tint text-warning-ink',
26
+ danger: 'bg-danger-tint text-danger-ink',
27
+ /** Alias of `danger`, for shadcn compatibility. */
28
+ destructive: 'bg-danger-tint text-danger-ink',
29
+ },
30
+ },
31
+ defaultVariants: { variant: 'default' },
32
+ },
33
+ );
34
+
35
+ export type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean };
36
+
37
+ export function Badge({ className, variant, asChild = false, ...props }: BadgeProps) {
38
+ const Comp = asChild ? Slot : 'span';
39
+ return <Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />;
40
+ }
package/src/button.tsx ADDED
@@ -0,0 +1,88 @@
1
+ 'use client';
2
+ import * as React from 'react';
3
+ import { Slot } from '@radix-ui/react-slot';
4
+ import { cva, type VariantProps } from 'class-variance-authority';
5
+ import { cn } from './lib/cn.js';
6
+
7
+ /**
8
+ * Pill button. When pressed it gives on a spring and barely bounces back
9
+ * (round ones give more); colors change with a short fade. The edge of the
10
+ * light buttons is the soft shadow, not a border.
11
+ */
12
+ export const buttonVariants = cva(
13
+ [
14
+ 'press-spring relative inline-flex shrink-0 select-none items-center justify-center gap-2',
15
+ 'whitespace-nowrap rounded-pill font-rounded font-semibold leading-none',
16
+ 'focus-visible:focus-ring disabled:pointer-events-none disabled:not-aria-busy:opacity-45',
17
+ 'active:not-disabled:scale-[var(--sui-press-pill)] aria-busy:cursor-progress',
18
+ '[&_svg]:pointer-events-none [&_svg]:shrink-0',
19
+ ],
20
+ {
21
+ variants: {
22
+ variant: {
23
+ primary: 'bg-brand text-on-brand hover:bg-brand-hover active:bg-brand-press',
24
+ secondary: 'bg-fill text-ink hover:bg-fill-strong active:bg-fill-press',
25
+ surface: 'bg-surface text-ink shadow-soft hover:shadow-raised active:bg-surface-press',
26
+ ghost: 'bg-transparent text-ink hover:bg-fill-strong active:bg-fill-press',
27
+ destructive: 'bg-danger text-on-danger hover:bg-danger-hover',
28
+ link: 'bg-transparent text-brand-ink underline-offset-4 hover:underline',
29
+ },
30
+ size: {
31
+ xs: 'h-control-xs px-3.5 text-label [&_svg:not([class*=size-])]:size-3.5',
32
+ sm: 'h-control-sm px-5 text-body-sm [&_svg:not([class*=size-])]:size-4',
33
+ md: 'h-control-md px-6 text-btn [&_svg:not([class*=size-])]:size-4.5',
34
+ lg: 'h-control-lg px-7 text-btn [&_svg:not([class*=size-])]:size-5',
35
+ icon: 'size-control-md p-0 active:not-disabled:scale-[var(--sui-press-icon)] [&_svg:not([class*=size-])]:size-5',
36
+ 'icon-sm': 'size-control-sm p-0 active:not-disabled:scale-[var(--sui-press-icon)] [&_svg:not([class*=size-])]:size-4.5',
37
+ },
38
+ block: { true: 'w-full' },
39
+ },
40
+ // Comes after `size` in the final string, so tailwind-merge keeps these
41
+ // classes: a link has no pill height or padding and does not give when pressed.
42
+ compoundVariants: [{ variant: 'link', class: 'h-auto px-0 active:not-disabled:scale-100' }],
43
+ defaultVariants: { variant: 'primary', size: 'md' },
44
+ },
45
+ );
46
+
47
+ export interface ButtonProps
48
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
49
+ VariantProps<typeof buttonVariants> {
50
+ /** Renders the child (a router <Link>, for instance) with the button's styles. */
51
+ asChild?: boolean;
52
+ /** Shows a spinner, disables the button and sets aria-busy. The width does not change. */
53
+ loading?: boolean;
54
+ }
55
+
56
+ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
57
+ ({ className, variant, size, block, asChild = false, loading = false, disabled, children, ...props }, ref) => {
58
+ const Comp = asChild ? Slot : 'button';
59
+ return (
60
+ <Comp
61
+ ref={ref}
62
+ data-slot="button"
63
+ className={cn(buttonVariants({ variant, size, block }), className)}
64
+ disabled={asChild ? undefined : disabled || loading}
65
+ aria-busy={loading || undefined}
66
+ {...props}
67
+ >
68
+ {asChild ? (
69
+ children
70
+ ) : (
71
+ <>
72
+ {loading && <Spinner />}
73
+ <span className={cn('inline-flex items-center gap-2', loading && 'opacity-0')}>{children}</span>
74
+ </>
75
+ )}
76
+ </Comp>
77
+ );
78
+ },
79
+ );
80
+ Button.displayName = 'Button';
81
+
82
+ function Spinner() {
83
+ return (
84
+ <span aria-hidden className="absolute inset-0 flex items-center justify-center">
85
+ <span className="size-5 animate-spin rounded-full border-2 border-current border-r-transparent" />
86
+ </span>
87
+ );
88
+ }
package/src/card.tsx ADDED
@@ -0,0 +1,70 @@
1
+ 'use client';
2
+ import * as React from 'react';
3
+ import { Slot } from '@radix-ui/react-slot';
4
+ import { cva, type VariantProps } from 'class-variance-authority';
5
+ import { cn } from './lib/cn.js';
6
+
7
+ /**
8
+ * Card: a surface with a large radius and a soft shadow (no border).
9
+ * `muted` = gray fill without shadow (to group things inside another card);
10
+ * `brand` = brand color with on-brand text (highlights).
11
+ * `interactive` lifts on hover and gives when pressed (use it with asChild + a link).
12
+ */
13
+ export const cardVariants = cva('flex flex-col rounded-card font-rounded text-ink', {
14
+ variants: {
15
+ variant: {
16
+ default: 'bg-surface shadow-soft',
17
+ muted: 'bg-fill',
18
+ brand: 'bg-brand text-on-brand [&_[data-slot=card-description]]:text-on-brand/80',
19
+ },
20
+ padding: {
21
+ none: '',
22
+ sm: 'gap-3 p-4',
23
+ md: 'gap-4 p-6',
24
+ lg: 'gap-5 p-8',
25
+ },
26
+ interactive: {
27
+ true: 'press-spring cursor-pointer hover:shadow-raised active:scale-[0.985] focus-visible:focus-ring',
28
+ },
29
+ },
30
+ defaultVariants: { variant: 'default', padding: 'md' },
31
+ });
32
+
33
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
34
+ asChild?: boolean;
35
+ }
36
+
37
+ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
38
+ ({ className, variant, padding, interactive, asChild, ...props }, ref) => {
39
+ const Comp = asChild ? Slot : 'div';
40
+ return (
41
+ <Comp
42
+ ref={ref}
43
+ data-slot="card"
44
+ className={cn(cardVariants({ variant, padding, interactive }), className)}
45
+ {...props}
46
+ />
47
+ );
48
+ },
49
+ );
50
+ Card.displayName = 'Card';
51
+
52
+ export function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
53
+ return <div data-slot="card-header" className={cn('flex flex-col gap-1.5', className)} {...props} />;
54
+ }
55
+
56
+ export function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {
57
+ return <h3 data-slot="card-title" className={cn('font-rounded text-heading font-semibold', className)} {...props} />;
58
+ }
59
+
60
+ export function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {
61
+ return <p data-slot="card-description" className={cn('text-body-sm font-medium text-ink-2', className)} {...props} />;
62
+ }
63
+
64
+ export function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
65
+ return <div data-slot="card-content" className={cn('flex flex-col gap-3', className)} {...props} />;
66
+ }
67
+
68
+ export function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
69
+ return <div data-slot="card-footer" className={cn('mt-auto flex items-center gap-3 pt-2', className)} {...props} />;
70
+ }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { Button, buttonVariants, type ButtonProps } from './button.js';
2
+ export { Badge, badgeVariants, type BadgeProps } from './badge.js';
3
+ export { Input, Field, type InputProps, type FieldProps } from './input.js';
4
+ export {
5
+ Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
6
+ cardVariants, type CardProps,
7
+ } from './card.js';
8
+ export { cn } from './lib/cn.js';
package/src/input.tsx ADDED
@@ -0,0 +1,103 @@
1
+ 'use client';
2
+ import * as React from 'react';
3
+ import { cn } from './lib/cn.js';
4
+
5
+ /**
6
+ * Text field on a gray fill, no border. On focus it turns into a white surface
7
+ * with the raised shadow and the focus ring; when invalid, a red ring.
8
+ * `leading`/`trailing` take an icon or a small button (show password, for instance).
9
+ *
10
+ * `className` goes to the wrapper (which is what looks like "the field"), and the
11
+ * <input> inherits its typography: `font-mono`, `uppercase`, `text-2xl`,
12
+ * `text-center`… all work through className.
13
+ */
14
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
15
+ size?: 'sm' | 'md' | 'lg';
16
+ invalid?: boolean;
17
+ leading?: React.ReactNode;
18
+ trailing?: React.ReactNode;
19
+ }
20
+
21
+ const heights = { sm: 'h-control-sm', md: 'h-control-md', lg: 'h-control-lg' } as const;
22
+
23
+ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
24
+ ({ className, size = 'md', invalid, leading, trailing, disabled, ...props }, ref) => {
25
+ const field = React.useContext(FieldContext);
26
+ const isInvalid = invalid ?? field?.invalid ?? false;
27
+ return (
28
+ <div
29
+ data-slot="input"
30
+ data-invalid={isInvalid || undefined}
31
+ data-disabled={disabled || undefined}
32
+ className={cn(
33
+ 'group/input press-spring flex w-full items-center gap-2.5 rounded-row bg-fill px-4',
34
+ 'font-rounded text-body font-medium text-ink',
35
+ 'hover:bg-fill-strong',
36
+ 'has-[input:focus-visible]:bg-surface has-[input:focus-visible]:shadow-raised',
37
+ 'has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-focus has-[input:focus-visible]:outline-offset-0',
38
+ 'data-invalid:outline-2 data-invalid:outline-danger data-invalid:outline-offset-0',
39
+ 'data-disabled:opacity-45 data-disabled:pointer-events-none',
40
+ heights[size],
41
+ className,
42
+ )}
43
+ >
44
+ {leading && <span className="flex shrink-0 text-ink-2 [&_svg]:size-5">{leading}</span>}
45
+ <input
46
+ ref={ref}
47
+ id={props.id ?? field?.id}
48
+ aria-invalid={isInvalid || undefined}
49
+ aria-describedby={props['aria-describedby'] ?? field?.describedBy}
50
+ disabled={disabled}
51
+ className="h-full min-w-0 flex-1 bg-transparent [font:inherit] [letter-spacing:inherit] [text-align:inherit] [text-transform:inherit] text-inherit outline-none placeholder:text-ink-3"
52
+ {...props}
53
+ />
54
+ {trailing && <span className="flex shrink-0 text-ink-2 [&_svg]:size-5">{trailing}</span>}
55
+ </div>
56
+ );
57
+ },
58
+ );
59
+ Input.displayName = 'Input';
60
+
61
+ // ── Field: label + control + hint/error, with ids and aria wired up ───────────
62
+ type FieldCtx = { id: string; describedBy?: string; invalid: boolean };
63
+ const FieldContext = React.createContext<FieldCtx | null>(null);
64
+
65
+ export interface FieldProps {
66
+ label: React.ReactNode;
67
+ /** Help text under the field. */
68
+ hint?: React.ReactNode;
69
+ /** Error message; also marks the control as invalid. */
70
+ error?: React.ReactNode;
71
+ /** Marks the field as optional. `true` shows "(optional)"; pass text to translate it. */
72
+ optional?: boolean | React.ReactNode;
73
+ id?: string;
74
+ className?: string;
75
+ children: React.ReactNode;
76
+ }
77
+
78
+ export function Field({ label, hint, error, optional, id, className, children }: FieldProps) {
79
+ const autoId = React.useId();
80
+ const fieldId = id ?? `field-${autoId}`;
81
+ const messageId = `${fieldId}-msg`;
82
+ const message = error ?? hint;
83
+ return (
84
+ <FieldContext.Provider value={{ id: fieldId, describedBy: message ? messageId : undefined, invalid: !!error }}>
85
+ <div data-slot="field" className={cn('flex flex-col gap-2 font-rounded', className)}>
86
+ <label htmlFor={fieldId} className="px-1 text-label font-semibold text-ink">
87
+ {label}
88
+ {optional && <span className="ml-1 font-medium text-ink-2">{optional === true ? '(optional)' : optional}</span>}
89
+ </label>
90
+ {children}
91
+ {message && (
92
+ <p
93
+ id={messageId}
94
+ role={error ? 'alert' : undefined}
95
+ className={cn('px-1 text-caption font-medium', error ? 'text-danger-ink' : 'text-ink-2')}
96
+ >
97
+ {message}
98
+ </p>
99
+ )}
100
+ </div>
101
+ </FieldContext.Provider>
102
+ );
103
+ }
package/src/lib/cn.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { clsx, type ClassValue } from 'clsx';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ import { radius, size, typeScale } from '@bilursag/solidui-tokens';
4
+
5
+ // tailwind-merge has to know the theme's own names; otherwise it mistakes
6
+ // `text-btn` (a size) for a color and drops `text-on-brand`, for instance.
7
+ const twMerge = extendTailwindMerge({
8
+ extend: {
9
+ theme: {
10
+ radius: Object.keys(radius),
11
+ shadow: ['soft', 'raised', 'overlay'],
12
+ spacing: Object.keys(size),
13
+ text: Object.keys(typeScale),
14
+ font: ['rounded', 'heading'],
15
+ tracking: ['heading'],
16
+ },
17
+ },
18
+ });
19
+
20
+ /** Joins classes and resolves Tailwind conflicts (the last one wins), aware of SolidUI's tokens. */
21
+ export function cn(...inputs: ClassValue[]) {
22
+ return twMerge(clsx(inputs));
23
+ }
package/styles.css ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ * SolidUI for the web. In your Tailwind v4 entry CSS:
3
+ * @import "tailwindcss";
4
+ * @import "@bilursag/solidui-react/styles.css";
5
+ *
6
+ * Brings the tokens (variables + @theme), the fonts, and registers this
7
+ * package as a class source so Tailwind generates the utilities it uses.
8
+ * Self-hosted fonts (no Google Fonts at build time):
9
+ * - Open Runde → text (`font-rounded`)
10
+ * - Montserrat variable → titles (`font-heading`). Each subset has a
11
+ * unicode-range, so browsers only download the ones they need.
12
+ * Using your own fonts? Import "@bilursag/solidui-react/no-fonts.css" instead.
13
+ */
14
+ @import "@fontsource/open-runde/400.css";
15
+ @import "@fontsource/open-runde/500.css";
16
+ @import "@fontsource/open-runde/600.css";
17
+ @import "@fontsource/open-runde/700.css";
18
+ @import "@fontsource-variable/montserrat/index.css";
19
+ @import "./no-fonts.css";