@maniumek/suwfrontkit 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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -2
  3. package/dist/alert/Alert.d.ts +7 -0
  4. package/dist/alert/Alert.js +20 -0
  5. package/dist/anchor/Anchor.d.ts +4 -0
  6. package/dist/anchor/Anchor.js +8 -0
  7. package/dist/appShell/AppShell.d.ts +9 -0
  8. package/dist/appShell/AppShell.js +17 -0
  9. package/dist/appShell/NavLink.d.ts +5 -0
  10. package/dist/appShell/NavLink.js +8 -0
  11. package/dist/appShell/layout.d.ts +7 -0
  12. package/dist/appShell/layout.js +6 -0
  13. package/dist/appShell/panelPreference.d.ts +2 -0
  14. package/dist/appShell/panelPreference.js +18 -0
  15. package/dist/badge/Badge.d.ts +7 -0
  16. package/dist/badge/Badge.js +20 -0
  17. package/dist/button/Button.d.ts +10 -0
  18. package/dist/button/Button.js +31 -0
  19. package/dist/classNames.d.ts +2 -0
  20. package/dist/classNames.js +5 -0
  21. package/dist/field/Field.d.ts +19 -0
  22. package/dist/field/Field.js +15 -0
  23. package/dist/index.d.ts +18 -0
  24. package/dist/index.js +18 -0
  25. package/dist/infoTip/InfoTip.d.ts +4 -0
  26. package/dist/infoTip/InfoTip.js +11 -0
  27. package/dist/input/Input.d.ts +3 -0
  28. package/dist/input/Input.js +7 -0
  29. package/dist/label/Label.d.ts +4 -0
  30. package/dist/label/Label.js +8 -0
  31. package/dist/page/Page.d.ts +8 -0
  32. package/dist/page/Page.js +6 -0
  33. package/dist/paginated/Paginated.d.ts +12 -0
  34. package/dist/paginated/Paginated.js +23 -0
  35. package/dist/paper/Paper.d.ts +7 -0
  36. package/dist/paper/Paper.js +9 -0
  37. package/dist/select/Select.d.ts +2 -0
  38. package/dist/select/Select.js +6 -0
  39. package/dist/stickyActions/StickyActions.d.ts +4 -0
  40. package/dist/stickyActions/StickyActions.js +4 -0
  41. package/dist/table/Table.d.ts +2 -0
  42. package/dist/table/Table.js +6 -0
  43. package/dist/textarea/Textarea.d.ts +3 -0
  44. package/dist/textarea/Textarea.js +7 -0
  45. package/dist/theme/palette.css +28 -0
  46. package/dist/theme/theme.css +96 -0
  47. package/package.json +82 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Manomenu
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.
package/README.md CHANGED
@@ -1,3 +1,108 @@
1
- # Temporary Holding Version
1
+ # suwfrontkit
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
+ `@maniumek/suwfrontkit`: the look of our desktop web apps in one package. Catppuccin Mocha design tokens under the
4
+ shadcn-style names the apps already use (`bg-primary`, `text-muted-foreground`, `bg-info-light`), a Tailwind 4 theme,
5
+ Inter Variable that really loads, and React 19 components: Button, Badge, Alert, Input, Textarea, Select, Label, Field,
6
+ Legend, InfoTip, Table, Paper, Panel, Page, StickyActions, Paginated, Anchor, and AppShell with NavLink.
7
+
8
+ Desktop only (16:9 and 21:9 screens), dark only. Every component is in Storybook (`just storybook`).
9
+
10
+ ## Renamed from suwfrontstyle
11
+
12
+ The package was `@maniumek/suwfrontstyle` up to 0.1.0 and is now `@maniumek/suwfrontkit`: the same code under a new
13
+ name; the old package is deprecated. An app moves over with:
14
+
15
+ ```sh
16
+ pnpm remove @maniumek/suwfrontstyle && pnpm add --save-exact @maniumek/suwfrontkit
17
+ ```
18
+
19
+ then replaces `@maniumek/suwfrontstyle` with `@maniumek/suwfrontkit` in its imports and in `minimumReleaseAgeExclude`
20
+ of its `pnpm-workspace.yaml`. The CSS entry becomes:
21
+
22
+ ```css
23
+ @import "tailwindcss";
24
+ @import "@maniumek/suwfrontkit/theme.css";
25
+ ```
26
+
27
+ ## Use it in an app
28
+
29
+ The app needs React 19, Tailwind 4.3 or newer with its Vite plugin, and pnpm.
30
+
31
+ ```sh
32
+ pnpm add --save-exact @maniumek/suwfrontkit
33
+ ```
34
+
35
+ `pnpm-workspace.yaml` of the app, so a release is installable on the day it comes out (pnpm 11 waits a day otherwise):
36
+
37
+ ```yaml
38
+ minimumReleaseAgeExclude:
39
+ - "@maniumek/suwfrontkit"
40
+ ```
41
+
42
+ The app's CSS entry (`src/index.css`) is these two lines and nothing else of the theme:
43
+
44
+ ```css
45
+ @import "tailwindcss";
46
+ @import "@maniumek/suwfrontkit/theme.css";
47
+ ```
48
+
49
+ `theme.css` brings the tokens, `color-scheme: dark`, the base styles and Inter Variable (the app's bundler serves the
50
+ woff2 from the app's own origin, so `font-src 'self'` is enough), and it tells Tailwind where the components' classes
51
+ are. Never import it inside `layer()`, `supports()` or a media query: Tailwind then refuses its `@source`.
52
+
53
+ ```tsx
54
+ import { AppShell, Button, NavLink, Page } from "@maniumek/suwfrontkit";
55
+ import { Link } from "wouter";
56
+
57
+ export function Shell({ children }: { children: React.ReactNode }) {
58
+ return (
59
+ <AppShell
60
+ header={<span className="text-lg font-bold">myapp</span>}
61
+ panel={
62
+ <nav aria-label="Main">
63
+ <NavLink asChild current>
64
+ <Link href="/">Companies</Link>
65
+ </NavLink>
66
+ </nav>
67
+ }
68
+ panelLabel="Navigation panel"
69
+ storageKey="myapp.navigation-panel"
70
+ >
71
+ {children}
72
+ </AppShell>
73
+ );
74
+ }
75
+
76
+ export function Companies() {
77
+ return <Page title="Companies" actions={<Button>Add a company</Button>} />;
78
+ }
79
+ ```
80
+
81
+ - `AppShell` remembers the collapsed panel under `storageKey` in `localStorage`; it starts expanded. It knows no router:
82
+ the app passes its own `<nav>`.
83
+ - `Page` fills the width (`width="full"`, for tables and charts on wide screens); `width="reading"` keeps forms and text at
84
+ about 80 characters.
85
+ - Pin the exact version: every change of the look is a pull request in the app, through its own tests.
86
+
87
+ ## Develop
88
+
89
+ [docs/development.md](docs/development.md): requirements, commands, working next to an app with `link:`.
90
+ Rules for changing the library: [AGENTS.md](AGENTS.md). How it is built: [docs/architecture.md](docs/architecture.md).
91
+
92
+ ## Release
93
+
94
+ Changesets and npm trusted publishing from GitHub Actions (`.github/workflows/ci.yml`): merge the "Version Packages"
95
+ pull request that CI keeps open, and CI publishes with provenance.
96
+
97
+ The first version is published by hand, once, because npm configures a trusted publisher on a package that exists:
98
+
99
+ 1. Create the public GitHub repository Manomenu/suwfrontkit and push `master`. In its Settings, Actions, General, allow
100
+ GitHub Actions to create and approve pull requests.
101
+ 2. On this machine, logged in to npm as `maniumek` with two-factor authentication: `npm login`, then
102
+ `pnpm publish --access public`. This publishes the version in `package.json` (`prepack` builds `dist/` first).
103
+ 3. On npmjs.com, the package's Settings, Trusted Publisher, GitHub Actions: organization or user `Manomenu`, repository
104
+ `suwfrontkit`, workflow filename `ci.yml`, no environment, and allow `npm publish` (new configurations allow only
105
+ staged publishing until it is ticked).
106
+ 4. Within two days (an unused configuration expires): merge the "Version Packages" pull request that CI opened from the
107
+ waiting changeset. CI publishes 0.1.0 through OIDC, with provenance.
108
+ 5. Then, in the package's Settings, Publishing access: require two-factor authentication and disallow tokens.
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "warning" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
7
+ export { Alert };
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../classNames.js";
5
+ const alertVariants = cva("w-full rounded-lg p-4 text-sm", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary-light text-primary-light-foreground",
9
+ destructive: "bg-destructive-light text-destructive-light-foreground",
10
+ warning: "bg-warning-light text-warning",
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ variant: "default",
15
+ },
16
+ });
17
+ function Alert({ className, variant, ...props }) {
18
+ return _jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props });
19
+ }
20
+ export { Alert };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ export declare function Anchor({ className, asChild, ...props }: React.ComponentProps<"a"> & {
3
+ asChild?: boolean;
4
+ }): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Slot } from "radix-ui";
4
+ import { cn } from "../classNames.js";
5
+ export function Anchor({ className, asChild = false, ...props }) {
6
+ const Comp = asChild ? Slot.Root : "a";
7
+ return _jsx(Comp, { "data-slot": "anchor", className: cn("text-anchor underline-offset-4 hover:underline", className), ...props });
8
+ }
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from "react";
2
+ export declare function AppShell({ header, panel, panelLabel, storageKey, side, children, }: {
3
+ header: ReactNode;
4
+ panel: ReactNode;
5
+ panelLabel: string;
6
+ storageKey: string;
7
+ side?: "left" | "right";
8
+ children: ReactNode;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { cn } from "../classNames.js";
4
+ import { COLLAPSED_PANEL_WIDTH, HEADER_HEIGHT, PANEL_WIDTH, panelSideClasses } from "./layout.js";
5
+ import { storeCollapsed, storedCollapsed } from "./panelPreference.js";
6
+ export function AppShell({ header, panel, panelLabel, storageKey, side = "left", children, }) {
7
+ const [collapsed, setCollapsed] = useState(() => storedCollapsed(storageKey) ?? false);
8
+ const classes = panelSideClasses(side);
9
+ return (_jsxs("div", { className: "min-h-screen", style: { "--header-height": `${String(HEADER_HEIGHT)}px` }, children: [_jsx("header", { className: "sticky top-0 z-30 flex items-center gap-3 border-b border-border bg-background px-4", style: { height: HEADER_HEIGHT }, children: header }), _jsxs("div", { className: cn("flex", classes.row), children: [_jsxs("aside", { id: "navigation-panel", className: cn("sticky flex shrink-0 flex-col gap-1 overflow-y-auto border-border bg-background p-1.5", classes.border), style: {
10
+ width: collapsed ? COLLAPSED_PANEL_WIDTH : PANEL_WIDTH,
11
+ top: HEADER_HEIGHT,
12
+ height: `calc(100vh - ${String(HEADER_HEIGHT)}px)`,
13
+ }, children: [_jsx("button", { type: "button", "aria-label": panelLabel, "aria-expanded": !collapsed, "aria-controls": "navigation-panel", title: panelLabel, className: "flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-md text-foreground hover:bg-accent/50", onClick: () => {
14
+ setCollapsed(!collapsed);
15
+ storeCollapsed(storageKey, !collapsed);
16
+ }, children: _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": "true", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M2 5h16M2 10h16M2 15h16" }) }) }), !collapsed && _jsx("div", { className: "flex min-h-0 flex-1 flex-col px-1 pb-1", children: panel })] }), _jsx("main", { className: "min-w-0 flex-1 p-4", children: children })] })] }));
17
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export declare function NavLink({ current, asChild, className, ...props }: React.ComponentProps<"a"> & {
3
+ current: boolean;
4
+ asChild?: boolean;
5
+ }): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Slot } from "radix-ui";
4
+ import { cn } from "../classNames.js";
5
+ export function NavLink({ current, asChild = false, className, ...props }) {
6
+ const Comp = asChild ? Slot.Root : "a";
7
+ return (_jsx(Comp, { "data-slot": "nav-link", "aria-current": current ? "page" : undefined, className: cn("block rounded-md px-3 py-2 text-sm text-foreground hover:bg-accent/50", current && "bg-primary-light text-primary-light-foreground", className), ...props }));
8
+ }
@@ -0,0 +1,7 @@
1
+ export declare const HEADER_HEIGHT = 60;
2
+ export declare const PANEL_WIDTH = 220;
3
+ export declare const COLLAPSED_PANEL_WIDTH = 48;
4
+ export declare function panelSideClasses(side: "left" | "right"): {
5
+ row: string;
6
+ border: string;
7
+ };
@@ -0,0 +1,6 @@
1
+ export const HEADER_HEIGHT = 60;
2
+ export const PANEL_WIDTH = 220;
3
+ export const COLLAPSED_PANEL_WIDTH = 48;
4
+ export function panelSideClasses(side) {
5
+ return side === "left" ? { row: "flex-row", border: "border-r" } : { row: "flex-row-reverse", border: "border-l" };
6
+ }
@@ -0,0 +1,2 @@
1
+ export declare function storedCollapsed(key: string): boolean | null;
2
+ export declare function storeCollapsed(key: string, collapsed: boolean): boolean;
@@ -0,0 +1,18 @@
1
+ export function storedCollapsed(key) {
2
+ try {
3
+ const stored = window.localStorage.getItem(key);
4
+ return stored === null ? null : stored === "collapsed";
5
+ }
6
+ catch {
7
+ return null;
8
+ }
9
+ }
10
+ export function storeCollapsed(key, collapsed) {
11
+ try {
12
+ window.localStorage.setItem(key, collapsed ? "collapsed" : "expanded");
13
+ return true;
14
+ }
15
+ catch {
16
+ return false;
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "warning" | "neutral" | "primary" | "success" | "danger" | "info" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export declare function Badge({ className, variant, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../classNames.js";
5
+ const badgeVariants = cva("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-bold tracking-wide whitespace-nowrap uppercase", {
6
+ variants: {
7
+ variant: {
8
+ neutral: "bg-secondary text-muted-foreground",
9
+ primary: "bg-primary-light text-primary-light-foreground",
10
+ success: "bg-success-light text-success",
11
+ warning: "bg-warning-light text-warning",
12
+ danger: "bg-destructive-light text-destructive",
13
+ info: "bg-info-light text-info",
14
+ },
15
+ },
16
+ defaultVariants: { variant: "neutral" },
17
+ });
18
+ export function Badge({ className, variant, ...props }) {
19
+ return _jsx("span", { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
20
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "link" | "outline" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "xs" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): React.JSX.Element;
10
+ export { Button };
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../classNames.js";
5
+ import { Slot } from "radix-ui";
6
+ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-semibold whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-secondary disabled:text-placeholder [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-primary text-primary-foreground hover:bg-primary-hover",
10
+ destructive: "bg-destructive-light text-destructive-light-foreground hover:bg-destructive-light-hover",
11
+ outline: "border border-input bg-secondary text-foreground hover:bg-accent",
12
+ ghost: "text-foreground hover:bg-accent",
13
+ link: "text-anchor underline-offset-4 hover:underline",
14
+ },
15
+ size: {
16
+ default: "h-9 px-[18px]",
17
+ sm: "h-[30px] px-3.5 text-[13px]",
18
+ xs: "h-6 gap-1 px-2 text-xs",
19
+ icon: "size-9",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "default",
25
+ },
26
+ });
27
+ function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
28
+ const Comp = asChild ? Slot.Root : "button";
29
+ return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
30
+ }
31
+ export { Button };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function Field({ prefix, name, label, labelHidden, hint, action, errors, children, }: {
3
+ prefix: string;
4
+ name: string;
5
+ label: string;
6
+ action?: ReactNode;
7
+ errors: string[];
8
+ children: (props: object) => ReactNode;
9
+ } & ({
10
+ hint: string;
11
+ labelHidden?: false;
12
+ } | {
13
+ labelHidden: true;
14
+ hint?: undefined;
15
+ })): import("react").JSX.Element;
16
+ export declare function Legend({ hint, children }: {
17
+ hint: string;
18
+ children: string;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { InfoTip } from "../infoTip/InfoTip.js";
3
+ import { Label } from "../label/Label.js";
4
+ export function Field({ prefix, name, label, labelHidden, hint, action, errors, children, }) {
5
+ const id = `${prefix}-${name}`;
6
+ const heading = labelHidden === true ? (_jsx(Label, { htmlFor: id, className: "sr-only", children: label })) : (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsx(Label, { htmlFor: id, children: label }), _jsx(InfoTip, { about: label, help: hint })] }));
7
+ return (_jsxs("div", { "data-field": name, className: "flex flex-col gap-2", children: [action === undefined ? (heading) : (_jsxs("div", { className: "flex min-h-[30px] items-center justify-between gap-2", children: [heading, action] })), children({
8
+ id,
9
+ "aria-invalid": errors.length > 0 || undefined,
10
+ "aria-describedby": errors.length > 0 ? `${id}-mistakes` : undefined,
11
+ }), errors.length > 0 && (_jsx("ul", { id: `${id}-mistakes`, className: "list-disc pl-4 text-sm text-destructive", children: errors.map((error) => (_jsx("li", { children: error }, error))) }))] }));
12
+ }
13
+ export function Legend({ hint, children }) {
14
+ return (_jsxs("legend", { className: "flex items-center gap-1 text-sm font-medium", children: [children, _jsx(InfoTip, { about: children, help: hint })] }));
15
+ }
@@ -0,0 +1,18 @@
1
+ export { cn } from "./classNames.js";
2
+ export { Alert } from "./alert/Alert.js";
3
+ export { Anchor } from "./anchor/Anchor.js";
4
+ export { AppShell } from "./appShell/AppShell.js";
5
+ export { NavLink } from "./appShell/NavLink.js";
6
+ export { Badge } from "./badge/Badge.js";
7
+ export { Button } from "./button/Button.js";
8
+ export { Field, Legend } from "./field/Field.js";
9
+ export { InfoTip } from "./infoTip/InfoTip.js";
10
+ export { Input } from "./input/Input.js";
11
+ export { Label } from "./label/Label.js";
12
+ export { Page } from "./page/Page.js";
13
+ export { Paginated, type Paging } from "./paginated/Paginated.js";
14
+ export { Panel, Paper } from "./paper/Paper.js";
15
+ export { Select } from "./select/Select.js";
16
+ export { StickyActions } from "./stickyActions/StickyActions.js";
17
+ export { Table } from "./table/Table.js";
18
+ export { Textarea } from "./textarea/Textarea.js";
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ export { cn } from "./classNames.js";
2
+ export { Alert } from "./alert/Alert.js";
3
+ export { Anchor } from "./anchor/Anchor.js";
4
+ export { AppShell } from "./appShell/AppShell.js";
5
+ export { NavLink } from "./appShell/NavLink.js";
6
+ export { Badge } from "./badge/Badge.js";
7
+ export { Button } from "./button/Button.js";
8
+ export { Field, Legend } from "./field/Field.js";
9
+ export { InfoTip } from "./infoTip/InfoTip.js";
10
+ export { Input } from "./input/Input.js";
11
+ export { Label } from "./label/Label.js";
12
+ export { Page } from "./page/Page.js";
13
+ export { Paginated } from "./paginated/Paginated.js";
14
+ export { Panel, Paper } from "./paper/Paper.js";
15
+ export { Select } from "./select/Select.js";
16
+ export { StickyActions } from "./stickyActions/StickyActions.js";
17
+ export { Table } from "./table/Table.js";
18
+ export { Textarea } from "./textarea/Textarea.js";
@@ -0,0 +1,4 @@
1
+ export declare function InfoTip({ about, help }: {
2
+ about: string;
3
+ help: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import { Tooltip } from "radix-ui";
4
+ export function InfoTip({ about, help }) {
5
+ const [open, setOpen] = useState(false);
6
+ const descriptionId = useId();
7
+ return (_jsx(Tooltip.Provider, { delayDuration: 150, children: _jsxs(Tooltip.Root, { open: open, onOpenChange: setOpen, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-describedby": descriptionId, onClick: (event) => {
8
+ event.preventDefault();
9
+ setOpen(true);
10
+ }, className: "inline-flex size-5 shrink-0 cursor-help items-center justify-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50", children: [_jsxs("span", { className: "sr-only", children: ["About ", about] }), _jsxs("svg", { viewBox: "0 0 16 16", className: "size-3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6.75" }), _jsx("path", { d: "M8 7.25v4M8 4.5v.5", strokeLinecap: "round" })] }), _jsx("span", { id: descriptionId, hidden: true, children: help })] }) }), _jsx(Tooltip.Portal, { children: _jsx(Tooltip.Content, { side: "right", sideOffset: 6, collisionPadding: 8, className: "z-[60] max-w-80 rounded-md border border-border bg-secondary px-3 py-2 text-sm font-normal text-secondary-foreground shadow-md", children: help }) })] }) }));
11
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
3
+ export { Input };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ function Input({ className, type, ...props }) {
5
+ return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-secondary px-3 text-sm text-foreground transition-colors outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground disabled:cursor-not-allowed disabled:text-placeholder", "focus-visible:border-primary", "aria-invalid:border-destructive", className), ...props }));
6
+ }
7
+ export { Input };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Label as LabelPrimitive } from "radix-ui";
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
4
+ export { Label };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ import { Label as LabelPrimitive } from "radix-ui";
5
+ function Label({ className, ...props }) {
6
+ return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
7
+ }
8
+ export { Label };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export declare function Page({ title, width, actions, titleAside, children, }: {
3
+ title: string;
4
+ width?: "full" | "reading";
5
+ actions?: React.ReactNode;
6
+ titleAside?: React.ReactNode;
7
+ children?: React.ReactNode;
8
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ export function Page({ title, width = "full", actions, titleAside, children, }) {
5
+ return (_jsxs("div", { "data-width": width, className: cn("flex flex-col gap-4", width === "reading" && "max-w-reading"), children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("h1", { className: "text-[26px] leading-[1.35] font-bold wrap-anywhere", children: title }), titleAside] }), actions !== undefined && _jsx("div", { className: "flex flex-wrap items-center gap-2", children: actions })] }), children] }));
6
+ }
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ export interface Paging {
3
+ page: number;
4
+ pages: number;
5
+ asking: boolean;
6
+ failure: string | null;
7
+ onMove: (page: number) => void;
8
+ }
9
+ export declare function Paginated({ paging, children }: {
10
+ paging: Paging;
11
+ children: ReactNode;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { Alert } from "../alert/Alert.js";
4
+ import { Button } from "../button/Button.js";
5
+ import { cn } from "../classNames.js";
6
+ export function Paginated({ paging, children }) {
7
+ const top = useRef(null);
8
+ if (paging.failure !== null)
9
+ return _jsx(Alert, { variant: "destructive", children: paging.failure });
10
+ if (paging.asking)
11
+ return _jsx("p", { className: "text-muted-foreground", children: "Loading\u2026" });
12
+ const { page, pages, onMove } = paging;
13
+ const move = (to) => {
14
+ top.current?.scrollIntoView({ block: "start" });
15
+ onMove(to);
16
+ };
17
+ const alone = pages <= 1;
18
+ return (_jsxs("div", { ref: top, className: "flex scroll-mt-20 flex-col gap-2", children: [children, _jsxs("div", { role: "group", "aria-label": "Pages", "aria-hidden": alone, className: cn("flex items-center justify-center gap-3 text-sm", alone && "invisible"), children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: page <= 1, onClick: () => {
19
+ move(page - 1);
20
+ }, children: "Previous" }), _jsx("span", { children: `Page ${page} of ${pages}` }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: page >= pages, onClick: () => {
21
+ move(page + 1);
22
+ }, children: "Next" })] })] }));
23
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export declare function Paper({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
3
+ export declare function Panel({ title, children, className }: {
4
+ title: string;
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ }): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ export function Paper({ className, ...props }) {
5
+ return _jsx("div", { className: cn("rounded-lg border border-border bg-card p-4", className), ...props });
6
+ }
7
+ export function Panel({ title, children, className }) {
8
+ return (_jsxs(Paper, { "aria-label": title, role: "region", className: cn("flex flex-col gap-2", className), children: [_jsx("h2", { className: "text-base font-semibold", children: title }), children] }));
9
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export declare function Select({ className, ...props }: React.ComponentProps<"select">): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ export function Select({ className, ...props }) {
5
+ return (_jsx("select", { "data-slot": "select", className: cn("h-9 min-w-0 rounded-md border border-input bg-secondary px-3 text-sm text-foreground transition-colors outline-none focus-visible:border-primary disabled:cursor-not-allowed disabled:text-placeholder aria-invalid:border-destructive", className), ...props }));
6
+ }
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function StickyActions({ children }: {
3
+ children: ReactNode;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function StickyActions({ children }) {
3
+ return _jsx("div", { className: "sticky bottom-0 z-10 flex items-center gap-2 border-t border-border bg-card py-2", children: children });
4
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ export function Table({ className, ...props }) {
5
+ return (_jsx("div", { className: "w-full overflow-x-auto", children: _jsx("table", { className: cn("w-full border-collapse text-sm [&_tbody_tr:hover]:bg-accent/40 [&_td]:border-b [&_td]:px-2.5 [&_td]:py-[7px] [&_th]:border-b [&_th]:px-2.5 [&_th]:py-[7px] [&_th]:text-left [&_th]:font-bold", className), ...props }) }));
6
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../classNames.js";
4
+ function Textarea({ className, ...props }) {
5
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn("h-48 w-full resize-none rounded-md border border-input bg-secondary px-3 py-2 font-mono text-sm text-foreground transition-colors outline-none disabled:cursor-not-allowed disabled:text-placeholder", "focus-visible:border-primary", "aria-invalid:border-destructive", className), ...props }));
6
+ }
7
+ export { Textarea };
@@ -0,0 +1,28 @@
1
+ :root {
2
+ --ctp-rosewater: #f5e0dc;
3
+ --ctp-flamingo: #f2cdcd;
4
+ --ctp-pink: #f5c2e7;
5
+ --ctp-mauve: #cba6f7;
6
+ --ctp-red: #f38ba8;
7
+ --ctp-maroon: #eba0ac;
8
+ --ctp-peach: #fab387;
9
+ --ctp-yellow: #f9e2af;
10
+ --ctp-green: #a6e3a1;
11
+ --ctp-teal: #94e2d5;
12
+ --ctp-sky: #89dceb;
13
+ --ctp-sapphire: #74c7ec;
14
+ --ctp-blue: #89b4fa;
15
+ --ctp-lavender: #b4befe;
16
+ --ctp-text: #cdd6f4;
17
+ --ctp-subtext1: #bac2de;
18
+ --ctp-subtext0: #a6adc8;
19
+ --ctp-overlay2: #9399b2;
20
+ --ctp-overlay1: #7f849c;
21
+ --ctp-overlay0: #6c7086;
22
+ --ctp-surface2: #585b70;
23
+ --ctp-surface1: #45475a;
24
+ --ctp-surface0: #313244;
25
+ --ctp-base: #1e1e2e;
26
+ --ctp-mantle: #181825;
27
+ --ctp-crust: #11111b;
28
+ }
@@ -0,0 +1,96 @@
1
+ @import "@fontsource-variable/inter/wght.css";
2
+ @import "./palette.css";
3
+
4
+ @source "../";
5
+
6
+ :root {
7
+ color-scheme: dark;
8
+ --radius: 0.5rem;
9
+ --background: var(--ctp-base);
10
+ --foreground: var(--ctp-text);
11
+ --card: var(--ctp-base);
12
+ --card-foreground: var(--ctp-text);
13
+ --primary: var(--ctp-mauve);
14
+ --primary-hover: color-mix(in srgb, var(--ctp-mauve) 80%, var(--ctp-crust));
15
+ --primary-foreground: var(--ctp-crust);
16
+ --primary-light: color-mix(in srgb, var(--ctp-mauve) 10%, var(--ctp-crust));
17
+ --primary-light-hover: color-mix(in srgb, var(--ctp-mauve) 18%, var(--ctp-crust));
18
+ --primary-light-foreground: color-mix(in srgb, var(--ctp-mauve) 14%, white);
19
+ --secondary: var(--ctp-surface0);
20
+ --secondary-foreground: var(--ctp-text);
21
+ --muted: var(--ctp-surface0);
22
+ --muted-foreground: var(--ctp-subtext0);
23
+ --placeholder: var(--ctp-overlay1);
24
+ --accent: var(--ctp-surface1);
25
+ --accent-foreground: var(--ctp-text);
26
+ --anchor: color-mix(in srgb, var(--ctp-mauve) 80%, white);
27
+ --destructive: var(--ctp-red);
28
+ --destructive-light: color-mix(in srgb, var(--ctp-red) 12%, var(--ctp-crust));
29
+ --destructive-light-hover: color-mix(in srgb, var(--ctp-red) 18%, var(--ctp-crust));
30
+ --destructive-light-foreground: color-mix(in srgb, var(--ctp-red) 14%, white);
31
+ --success: var(--ctp-green);
32
+ --success-light: color-mix(in srgb, var(--ctp-green) 12%, var(--ctp-base));
33
+ --warning: var(--ctp-yellow);
34
+ --warning-light: color-mix(in srgb, var(--ctp-yellow) 12%, var(--ctp-base));
35
+ --info: var(--ctp-blue);
36
+ --info-light: color-mix(in srgb, var(--ctp-blue) 12%, var(--ctp-base));
37
+ --border: var(--ctp-surface2);
38
+ --input: var(--ctp-surface2);
39
+ --ring: var(--ctp-mauve);
40
+ --content-reading-width: 80ch;
41
+ }
42
+
43
+ @theme inline {
44
+ --font-sans: "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
45
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
46
+ --color-background: var(--background);
47
+ --color-foreground: var(--foreground);
48
+ --color-card: var(--card);
49
+ --color-card-foreground: var(--card-foreground);
50
+ --color-primary: var(--primary);
51
+ --color-primary-hover: var(--primary-hover);
52
+ --color-primary-foreground: var(--primary-foreground);
53
+ --color-primary-light: var(--primary-light);
54
+ --color-primary-light-hover: var(--primary-light-hover);
55
+ --color-primary-light-foreground: var(--primary-light-foreground);
56
+ --color-secondary: var(--secondary);
57
+ --color-secondary-foreground: var(--secondary-foreground);
58
+ --color-muted: var(--muted);
59
+ --color-muted-foreground: var(--muted-foreground);
60
+ --color-placeholder: var(--placeholder);
61
+ --color-accent: var(--accent);
62
+ --color-accent-foreground: var(--accent-foreground);
63
+ --color-anchor: var(--anchor);
64
+ --color-destructive: var(--destructive);
65
+ --color-destructive-light: var(--destructive-light);
66
+ --color-destructive-light-hover: var(--destructive-light-hover);
67
+ --color-destructive-light-foreground: var(--destructive-light-foreground);
68
+ --color-success: var(--success);
69
+ --color-success-light: var(--success-light);
70
+ --color-warning: var(--warning);
71
+ --color-warning-light: var(--warning-light);
72
+ --color-info: var(--info);
73
+ --color-info-light: var(--info-light);
74
+ --color-border: var(--border);
75
+ --color-input: var(--input);
76
+ --color-ring: var(--ring);
77
+ --radius-sm: 4px;
78
+ --radius-md: var(--radius);
79
+ --radius-lg: var(--radius);
80
+ --container-reading: var(--content-reading-width);
81
+ }
82
+
83
+ @layer base {
84
+ * {
85
+ @apply border-border outline-ring/50;
86
+ }
87
+ html {
88
+ line-height: 1.55;
89
+ }
90
+ body {
91
+ @apply bg-background font-sans text-foreground;
92
+ }
93
+ ::placeholder {
94
+ color: var(--placeholder);
95
+ }
96
+ }
package/package.json CHANGED
@@ -1,6 +1,85 @@
1
1
  {
2
2
  "name": "@maniumek/suwfrontkit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Catppuccin Mocha design tokens, Tailwind 4 theme, Inter Variable and React components for desktop web apps",
5
+ "license": "MIT",
6
+ "author": "Manomenu",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Manomenu/suwfrontkit.git"
10
+ },
11
+ "type": "module",
12
+ "sideEffects": [
13
+ "**/*.css"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./theme.css": "./dist/theme/theme.css",
21
+ "./package.json": "./package.json"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "dependencies": {
27
+ "@fontsource-variable/inter": "5.3.0",
28
+ "class-variance-authority": "^0.7.1",
29
+ "clsx": "^2.1.1",
30
+ "radix-ui": "^1.8.1",
31
+ "tailwind-merge": "^3.7.0"
32
+ },
33
+ "peerDependencies": {
34
+ "react": "^19.3.0",
35
+ "react-dom": "^19.3.0",
36
+ "tailwindcss": "^4.3.0"
37
+ },
38
+ "devDependencies": {
39
+ "@arethetypeswrong/cli": "0.18.5",
40
+ "@axe-core/playwright": "4.14.0",
41
+ "@catppuccin/palette": "1.8.0",
42
+ "@changesets/cli": "3.0.3",
43
+ "@eslint/js": "^10.0.1",
44
+ "@playwright/test": "1.65.1",
45
+ "@storybook/addon-a11y": "10.6.7",
46
+ "@storybook/addon-vitest": "10.6.7",
47
+ "@storybook/react-vite": "10.6.7",
48
+ "@tailwindcss/vite": "4.3.5",
49
+ "@testing-library/react": "^16.3.3",
50
+ "@types/node": "^26.6.6",
51
+ "@types/react": "^19.3.0",
52
+ "@types/react-dom": "^19.3.0",
53
+ "@vitejs/plugin-react": "^6.3.0",
54
+ "@vitest/browser": "5.1.1",
55
+ "@vitest/browser-playwright": "5.1.1",
56
+ "eslint": "^10.15.0",
57
+ "eslint-import-resolver-typescript": "^4.4.5",
58
+ "eslint-plugin-boundaries": "^7.4.4",
59
+ "eslint-plugin-react-hooks": "^7.1.1",
60
+ "jsdom": "^31.0.1",
61
+ "knip": "^6.46.1",
62
+ "playwright": "1.65.1",
63
+ "prettier": "^3.10.1",
64
+ "prettier-plugin-tailwindcss": "^0.8.1",
65
+ "publint": "0.3.25",
66
+ "react": "^19.3.1",
67
+ "react-dom": "^19.3.1",
68
+ "storybook": "10.6.7",
69
+ "tailwindcss": "4.3.5",
70
+ "typescript": "5.9.3",
71
+ "typescript-eslint": "^8.73.0",
72
+ "vite": "8.3.8",
73
+ "vitest": "5.1.1"
74
+ },
75
+ "publishConfig": {
76
+ "access": "public"
77
+ },
78
+ "scripts": {
79
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/theme && cp src/theme/theme.css src/theme/palette.css dist/theme/",
80
+ "storybook": "storybook dev -p 6006 --no-open",
81
+ "build-storybook": "storybook build --quiet -o storybook-static",
82
+ "changeset": "changeset",
83
+ "release": "pnpm run build && changeset publish"
84
+ }
6
85
  }