@nswds/app 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # NSW Application Design System
2
+
3
+ ## Technology Stack
4
+
5
+ - ✅ [Next.js](https://nextjs.org/)
6
+ - ✅ [TypeScript](https://www.typescriptlang.org/)
7
+ - ✅ [React](https://react.dev/)
8
+
9
+ ## Styling & UI Frameworks
10
+
11
+ - ✅ [Tailwind CSS V4](https://tailwindcss.com/)
12
+ - ✅ [Radix UI](https://www.radix-ui.com/)
13
+ - ✅ [shadcn/ui](https://ui.shadcn.com/)
14
+ - ✅ [NSW Design System](https://designsystem.nsw.gov.au/)
15
+ - ✅ [next-themes](https://github.com/pacocoursey/next-themes)
16
+
17
+ ## Testing & Component Development
18
+
19
+ - ✅ [Storybook](https://storybook.js.org/)
20
+ - ✅ [Vitest](https://vitest.dev/)
21
+ - ✅ [Playwright](https://playwright.dev/)
22
+
23
+ ## Build & Developer Tools
24
+
25
+ - ✅ [ESLint](https://eslint.org/)
26
+ - ✅ [Prettier](https://prettier.io/)
27
+ - ✅ [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
28
+ - ✅ [Git Conventional Commits](https://github.com/qoomon/git-conventional-commits)
29
+ - ✅ [OpenCommit](https://github.com/di-sukharev/opencommit)
30
+ - ✅ [platisd/openai-pr-description GitHub Action](https://github.com/platisd/openai-pr-description)
31
+ - ✅ [Semantic Versioning 2.0.0](https://semver.org/)
32
+ - ✅ [semantic-release](https://github.com/semantic-release/semantic-release)
33
+ - ✅ [conventional-changelog-cli](https://github.com/conventional-changelog/conventional-changelog)
34
+
35
+ ## Security & Dependency Management
36
+
37
+ - ✅ [Snyk](https://snyk.io/)
38
+ - ✅ [Dependabot](https://github.com/dependabot)
39
+
40
+ ## CI/CD & Deployment
41
+
42
+ - ✅ [GitHub Actions](https://github.com/features/actions)
43
+ - ✅ [Vercel](https://vercel.com/)
44
+
45
+ ## Auth & Access Management
46
+
47
+ - ✅ [Auth.js](https://authjs.dev/)
48
+
49
+ ## CMS / Content
50
+
51
+ - ✅ [Sanity](https://www.sanity.io/)
52
+
53
+ ## Infrastructure & Performance
54
+
55
+ - ✅ [Cloudflare](https://www.cloudflare.com/en-au/)
56
+
57
+ ## Database & ORM
58
+
59
+ - ✅ [Neon](https://neon.tech/)
60
+ - ✅ [Turso](https://turso.tech/)
61
+ - ✅ [Drizzle ORM](https://orm.drizzle.team/)
62
+ - ✅ [Prisma](https://www.prisma.io/)
63
+
64
+ ## Email Infrastructure
65
+
66
+ - ✅ [React Email](https://react.email/)
67
+ - ✅ [Resend](https://resend.com/)
package/dist/index.cjs ADDED
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/packages/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ camelCase: () => camelCase,
34
+ cn: () => cn,
35
+ default: () => index_default,
36
+ kebabCase: () => kebabCase,
37
+ truncate: () => truncate
38
+ });
39
+ module.exports = __toCommonJS(index_exports);
40
+
41
+ // src/components/Button.tsx
42
+ var React = __toESM(require("react"), 1);
43
+ var import_react_slot = require("@radix-ui/react-slot");
44
+ var import_class_variance_authority = require("class-variance-authority");
45
+ var buttonVariants = (0, import_class_variance_authority.cva)(
46
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-zinc-950 focus-visible:ring-zinc-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:focus-visible:border-zinc-300 dark:focus-visible:ring-zinc-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
47
+ {
48
+ variants: {
49
+ variant: {
50
+ default: "bg-zinc-900 text-zinc-50 shadow-xs hover:bg-zinc-900/90 dark:bg-zinc-50 dark:text-zinc-900 dark:hover:bg-zinc-50/90",
51
+ destructive: "bg-red-500 text-white shadow-xs hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-500/60 dark:bg-red-900 dark:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40 dark:dark:bg-red-900/60",
52
+ outline: "border bg-white shadow-xs hover:bg-zinc-100 hover:text-zinc-900 dark:bg-zinc-200/30 dark:border-zinc-200 dark:hover:bg-zinc-200/50 dark:bg-zinc-950 dark:hover:bg-zinc-800 dark:hover:text-zinc-50 dark:dark:bg-zinc-800/30 dark:dark:border-zinc-800 dark:dark:hover:bg-zinc-800/50",
53
+ secondary: "bg-zinc-100 text-zinc-900 shadow-xs hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80",
54
+ ghost: "hover:bg-zinc-100 hover:text-zinc-900 dark:hover:bg-zinc-100/50 dark:hover:bg-zinc-800 dark:hover:text-zinc-50 dark:dark:hover:bg-zinc-800/50",
55
+ link: "text-zinc-900 underline-offset-4 hover:underline dark:text-zinc-50"
56
+ },
57
+ size: {
58
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
59
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
60
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
61
+ icon: "size-9"
62
+ }
63
+ },
64
+ defaultVariants: {
65
+ variant: "default",
66
+ size: "default"
67
+ }
68
+ }
69
+ );
70
+ function Button({
71
+ className,
72
+ variant,
73
+ size,
74
+ asChild = false,
75
+ ...props
76
+ }) {
77
+ const Comp = asChild ? import_react_slot.Slot : "button";
78
+ return /* @__PURE__ */ React.createElement(
79
+ Comp,
80
+ {
81
+ "data-slot": "button",
82
+ className: cn(buttonVariants({ variant, size, className })),
83
+ ...props
84
+ }
85
+ );
86
+ }
87
+
88
+ // src/lib/utils.ts
89
+ var import_clsx = require("clsx");
90
+ var import_tailwind_merge = require("tailwind-merge");
91
+ function cn(...inputs) {
92
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
93
+ }
94
+ function truncate(text, maxLength) {
95
+ if (text.length <= maxLength) {
96
+ return text;
97
+ }
98
+ return text.slice(0, maxLength) + "...";
99
+ }
100
+ function kebabCase(str) {
101
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
102
+ }
103
+ function camelCase(str) {
104
+ return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
105
+ }
106
+
107
+ // src/packages/index.ts
108
+ var moduleExports = {
109
+ Button
110
+ };
111
+ var index_default = moduleExports;
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ camelCase,
115
+ cn,
116
+ kebabCase,
117
+ truncate
118
+ });
@@ -0,0 +1,23 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { ClassValue } from 'clsx';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): React.JSX.Element;
13
+
14
+ declare function cn(...inputs: ClassValue[]): string;
15
+ declare function truncate(text: string, maxLength: number): string;
16
+ declare function kebabCase(str: string): string;
17
+ declare function camelCase(str: string): string;
18
+
19
+ declare const moduleExports: {
20
+ Button: typeof Button;
21
+ };
22
+
23
+ export { camelCase, cn, moduleExports as default, kebabCase, truncate };
@@ -0,0 +1,23 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { ClassValue } from 'clsx';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): React.JSX.Element;
13
+
14
+ declare function cn(...inputs: ClassValue[]): string;
15
+ declare function truncate(text: string, maxLength: number): string;
16
+ declare function kebabCase(str: string): string;
17
+ declare function camelCase(str: string): string;
18
+
19
+ declare const moduleExports: {
20
+ Button: typeof Button;
21
+ };
22
+
23
+ export { camelCase, cn, moduleExports as default, kebabCase, truncate };
package/dist/index.js ADDED
@@ -0,0 +1,78 @@
1
+ // src/components/Button.tsx
2
+ import * as React from "react";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { cva } from "class-variance-authority";
5
+ var buttonVariants = cva(
6
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-zinc-950 focus-visible:ring-zinc-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:focus-visible:border-zinc-300 dark:focus-visible:ring-zinc-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-zinc-900 text-zinc-50 shadow-xs hover:bg-zinc-900/90 dark:bg-zinc-50 dark:text-zinc-900 dark:hover:bg-zinc-50/90",
11
+ destructive: "bg-red-500 text-white shadow-xs hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-500/60 dark:bg-red-900 dark:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40 dark:dark:bg-red-900/60",
12
+ outline: "border bg-white shadow-xs hover:bg-zinc-100 hover:text-zinc-900 dark:bg-zinc-200/30 dark:border-zinc-200 dark:hover:bg-zinc-200/50 dark:bg-zinc-950 dark:hover:bg-zinc-800 dark:hover:text-zinc-50 dark:dark:bg-zinc-800/30 dark:dark:border-zinc-800 dark:dark:hover:bg-zinc-800/50",
13
+ secondary: "bg-zinc-100 text-zinc-900 shadow-xs hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80",
14
+ ghost: "hover:bg-zinc-100 hover:text-zinc-900 dark:hover:bg-zinc-100/50 dark:hover:bg-zinc-800 dark:hover:text-zinc-50 dark:dark:hover:bg-zinc-800/50",
15
+ link: "text-zinc-900 underline-offset-4 hover:underline dark:text-zinc-50"
16
+ },
17
+ size: {
18
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
19
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
20
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
21
+ icon: "size-9"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default"
27
+ }
28
+ }
29
+ );
30
+ function Button({
31
+ className,
32
+ variant,
33
+ size,
34
+ asChild = false,
35
+ ...props
36
+ }) {
37
+ const Comp = asChild ? Slot : "button";
38
+ return /* @__PURE__ */ React.createElement(
39
+ Comp,
40
+ {
41
+ "data-slot": "button",
42
+ className: cn(buttonVariants({ variant, size, className })),
43
+ ...props
44
+ }
45
+ );
46
+ }
47
+
48
+ // src/lib/utils.ts
49
+ import { clsx } from "clsx";
50
+ import { twMerge } from "tailwind-merge";
51
+ function cn(...inputs) {
52
+ return twMerge(clsx(inputs));
53
+ }
54
+ function truncate(text, maxLength) {
55
+ if (text.length <= maxLength) {
56
+ return text;
57
+ }
58
+ return text.slice(0, maxLength) + "...";
59
+ }
60
+ function kebabCase(str) {
61
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
62
+ }
63
+ function camelCase(str) {
64
+ return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
65
+ }
66
+
67
+ // src/packages/index.ts
68
+ var moduleExports = {
69
+ Button
70
+ };
71
+ var index_default = moduleExports;
72
+ export {
73
+ camelCase,
74
+ cn,
75
+ index_default as default,
76
+ kebabCase,
77
+ truncate
78
+ };
@@ -0,0 +1,14 @@
1
+ {
2
+ "main": "./index.cjs",
3
+ "module": "./index.js",
4
+ "types": "./index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./index.d.ts",
8
+ "import": "./index.js",
9
+ "require": "./index.cjs"
10
+ }
11
+ },
12
+ "sideEffects": false
13
+ }
14
+
package/package.json ADDED
@@ -0,0 +1,122 @@
1
+ {
2
+ "name": "@nswds/app",
3
+ "version": "0.1.10",
4
+ "main": "dist/index.cjs",
5
+ "module": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "private": false,
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build:npm": "tsup src/packages/index.ts --dts --format esm,cjs --out-dir dist --clean --external react --tsconfig tsconfig.build.json && cp dist-package.json dist/package.json",
21
+ "type-check": "tsc -b",
22
+ "format": "prettier --write .",
23
+ "dev": "next dev --turbopack",
24
+ "build": "next build",
25
+ "start": "next start",
26
+ "lint": "next lint",
27
+ "storybook": "storybook dev -p 6006",
28
+ "build-storybook": "storybook build",
29
+ "serve-storybook": "serve storybook-static",
30
+ "semantic-release": "semantic-release"
31
+ },
32
+ "dependencies": {
33
+ "@headlessui/react": "^2.2.0",
34
+ "@nswds/tokens": "^2.1.1",
35
+ "@radix-ui/react-accordion": "^1.2.3",
36
+ "@radix-ui/react-alert-dialog": "^1.1.6",
37
+ "@radix-ui/react-aspect-ratio": "^1.1.2",
38
+ "@radix-ui/react-avatar": "^1.1.3",
39
+ "@radix-ui/react-checkbox": "^1.1.4",
40
+ "@radix-ui/react-collapsible": "^1.1.3",
41
+ "@radix-ui/react-context-menu": "^2.2.6",
42
+ "@radix-ui/react-dialog": "^1.1.6",
43
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
44
+ "@radix-ui/react-hover-card": "^1.1.6",
45
+ "@radix-ui/react-label": "^2.1.2",
46
+ "@radix-ui/react-menubar": "^1.1.6",
47
+ "@radix-ui/react-navigation-menu": "^1.2.5",
48
+ "@radix-ui/react-popover": "^1.1.6",
49
+ "@radix-ui/react-progress": "^1.1.2",
50
+ "@radix-ui/react-radio-group": "^1.2.3",
51
+ "@radix-ui/react-scroll-area": "^1.2.3",
52
+ "@radix-ui/react-select": "^2.1.6",
53
+ "@radix-ui/react-separator": "^1.1.2",
54
+ "@radix-ui/react-slider": "^1.2.3",
55
+ "@radix-ui/react-slot": "^1.1.2",
56
+ "@radix-ui/react-switch": "^1.1.3",
57
+ "@radix-ui/react-tabs": "^1.1.3",
58
+ "@radix-ui/react-toggle": "^1.1.2",
59
+ "@radix-ui/react-toggle-group": "^1.1.2",
60
+ "@radix-ui/react-tooltip": "^1.1.8",
61
+ "@sindresorhus/slugify": "^2.2.1",
62
+ "@tailwindcss/postcss": "^4.0.14",
63
+ "class-variance-authority": "^0.7.1",
64
+ "clsx": "^2.1.1",
65
+ "cmdk": "^1.1.1",
66
+ "culori": "^4.0.1",
67
+ "date-fns": "^4.1.0",
68
+ "embla-carousel-react": "^8.5.2",
69
+ "lucide-react": "^0.483.0",
70
+ "next": "15.2.3",
71
+ "next-themes": "^0.4.6",
72
+ "postcss": "^8.5.3",
73
+ "react": "^19.0.0",
74
+ "react-day-picker": "^9.6.3",
75
+ "react-dom": "^19.0.0",
76
+ "react-resizable-panels": "^2.1.7",
77
+ "sonner": "^2.0.2",
78
+ "tailwind-merge": "^3.0.2",
79
+ "tailwindcss": "^4.0.14",
80
+ "tw-animate-css": "^1.2.4",
81
+ "vaul": "^1.1.2"
82
+ },
83
+ "devDependencies": {
84
+ "@chromatic-com/storybook": "^3.2.6",
85
+ "@eslint/eslintrc": "^3",
86
+ "@semantic-release/changelog": "^6.0.3",
87
+ "@semantic-release/git": "^10.0.1",
88
+ "@storybook/addon-essentials": "^8.6.7",
89
+ "@storybook/addon-onboarding": "^8.6.7",
90
+ "@storybook/blocks": "^8.6.7",
91
+ "@storybook/experimental-addon-test": "^8.6.7",
92
+ "@storybook/experimental-nextjs-vite": "^8.6.7",
93
+ "@storybook/react": "^8.6.7",
94
+ "@storybook/test": "^8.6.7",
95
+ "@tailwindcss/typography": "^0.5.16",
96
+ "@types/culori": "^2.1.1",
97
+ "@types/node": "^20",
98
+ "@types/react": "^19",
99
+ "@types/react-dom": "^19",
100
+ "@vitest/browser": "^3.0.9",
101
+ "@vitest/coverage-v8": "^3.0.9",
102
+ "eslint": "^9",
103
+ "eslint-config-next": "15.2.3",
104
+ "eslint-config-prettier": "^10.1.1",
105
+ "eslint-plugin-prettier": "^5.2.3",
106
+ "eslint-plugin-storybook": "^0.11.6",
107
+ "playwright": "^1.51.1",
108
+ "prettier": "^3.5.3",
109
+ "prettier-plugin-tailwindcss": "^0.6.11",
110
+ "semantic-release": "^24.2.3",
111
+ "storybook": "^8.6.7",
112
+ "tailwindcss-animate": "^1.0.7",
113
+ "tsup": "^8.4.0",
114
+ "typescript": "^5",
115
+ "vitest": "^3.0.9"
116
+ },
117
+ "eslintConfig": {
118
+ "extends": [
119
+ "plugin:storybook/recommended"
120
+ ]
121
+ }
122
+ }