@judarn/ui 0.0.0-stage → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+
3
+ export type SDUINodeType =
4
+ | "button"
5
+ | "badge"
6
+ | "tag"
7
+ | "card"
8
+ | "data-matrix"
9
+ | "data-table"
10
+ | "text-field"
11
+ | "container"
12
+ | "text";
13
+
14
+ /** Props accepted per node type. Any other prop is rejected by `validateSDUINode`. */
15
+ export interface SDUIPropsByType {
16
+ button: { variant?: "primary" | "outline" | "secondary" | "ghost" | "accent"; size?: "sm" | "md" | "lg"; block?: boolean; disabled?: boolean; type?: "button" | "submit" | "reset"; token?: string };
17
+ badge: { variant?: "outline" | "solid" | "accent" | "accent-outline"; accentColor?: string; token?: string };
18
+ tag: { token?: string };
19
+ card: { eyebrow?: string; eyebrowCasing?: "uppercase" | "asWritten"; title?: string; flat?: boolean; compact?: boolean; token?: string };
20
+ "data-matrix": { columns?: SDUIColumn[]; rows?: SDUIRow[]; label?: string; token?: string };
21
+ "data-table": { columns?: SDUIColumn[]; rows?: SDUIRow[]; token?: string };
22
+ "text-field": { label?: string; hint?: string; error?: string; as?: "input" | "textarea" | "select"; invalid?: boolean; disabled?: boolean; labelCasing?: "uppercase" | "asWritten"; placeholder?: string; name?: string; type?: "text" | "email" | "number" | "password" | "search" | "tel" | "url"; defaultValue?: string; token?: string };
23
+ container: { token?: string };
24
+ text: { token?: string };
25
+ }
26
+
27
+ export type SDUIColumn = string | { key: string; label: string; numeric?: boolean; width?: number | string; casing?: "uppercase" | "asWritten" };
28
+ export type SDUIRow = Record<string, string | number | boolean | null>;
29
+
30
+ export interface SDUINode<T extends SDUINodeType = SDUINodeType> {
31
+ type: T;
32
+ props?: SDUIPropsByType[T];
33
+ children?: SDUINode[];
34
+ content?: string;
35
+ }
36
+
37
+ export const VALID_NODE_TYPES: Set<SDUINodeType>;
38
+ export const VALID_TOKEN_NAMES: Set<string>;
39
+ export const SDUI_PROP_ALLOWLIST: Record<SDUINodeType, Record<string, unknown>>;
40
+
41
+ export function serializeTokens(rawTokens: any): Record<string, any>;
42
+ /** Throws for an unknown node type, a prop outside the type's allowlist, or an invalid prop value. */
43
+ export function validateSDUINode(node: unknown): boolean;
44
+ export function serializeComponent<T extends SDUINodeType>(
45
+ type: T,
46
+ props?: SDUIPropsByType[T],
47
+ children?: SDUINode[],
48
+ content?: string
49
+ ): SDUINode<T>;
50
+ export function deserializeComponent(
51
+ node: SDUINode,
52
+ customComponents?: Record<string, React.ComponentType<any>>,
53
+ reactInstance?: typeof React
54
+ ): React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,84 @@
1
1
  {
2
2
  "name": "@judarn/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.7.2",
4
+ "description": "Judarn design foundation tokens and React components for the web",
5
+ "author": "Ruben Luthman",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/rubenluthman/judarn.git",
10
+ "directory": "platforms/web"
11
+ },
12
+ "homepage": "https://github.com/rubenluthman/judarn#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/rubenluthman/judarn/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "keywords": [
20
+ "design-system",
21
+ "design-tokens",
22
+ "oklch",
23
+ "react",
24
+ "tailwind",
25
+ "sdui",
26
+ "accessibility",
27
+ "wcag"
28
+ ],
29
+ "main": "dist/index.cjs",
30
+ "module": "dist/index.mjs",
31
+ "types": "dist/index.d.ts",
32
+ "files": [
33
+ "dist",
34
+ "!dist/_ds_bundle.js",
35
+ "src/tailwind.js",
36
+ "src/tailwind.d.ts",
37
+ "styles",
38
+ "LICENSE",
39
+ "README.md"
40
+ ],
41
+ "scripts": {
42
+ "build": "node scripts/build.js",
43
+ "build:tokens": "node ../../scripts/compile-tokens.js && node scripts/verify-token-presence.js",
44
+ "test": "node scripts/verify-token-presence.js && node scripts/build.js && node scripts/verify-unit.js && node scripts/verify-visual.js && node scripts/verify-sdui.js",
45
+ "test:contrast": "node scripts/verify-contrast.js",
46
+ "test:visual": "node scripts/verify-visual.js",
47
+ "test:sdui": "node scripts/verify-sdui.js",
48
+ "explorer": "open ../../tools/wada-explorer/index.html",
49
+ "prepack": "node scripts/build.js",
50
+ "prepublishOnly": "npm test"
51
+ },
52
+ "exports": {
53
+ ".": {
54
+ "types": "./dist/index.d.ts",
55
+ "import": "./dist/index.mjs",
56
+ "require": "./dist/index.cjs"
57
+ },
58
+ "./styles": "./styles/styles.css",
59
+ "./colors": "./styles/colors_and_type.css",
60
+ "./components.css": "./styles/components.css",
61
+ "./tailwind": {
62
+ "types": "./src/tailwind.d.ts",
63
+ "default": "./src/tailwind.js"
64
+ },
65
+ "./theme": "./styles/tailwind-theme.css",
66
+ "./sdui": {
67
+ "types": "./dist/sdui/index.d.ts",
68
+ "import": "./dist/sdui/index.mjs",
69
+ "require": "./dist/sdui/index.cjs"
70
+ },
71
+ "./package.json": "./package.json"
72
+ },
73
+ "peerDependencies": {
74
+ "react": ">=18.0.0"
75
+ },
76
+ "sideEffects": [
77
+ "**/*.css"
78
+ ],
79
+ "devDependencies": {
80
+ "esbuild": "^0.25.0",
81
+ "react": "^18.3.1",
82
+ "react-dom": "^18.3.1"
83
+ }
84
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Judarn Design System Tailwind Preset & Plugin
3
+ */
4
+ declare const judarnTailwindPlugin: {
5
+ (options?: any): any;
6
+ theme: {
7
+ extend: Record<string, any>;
8
+ };
9
+ };
10
+
11
+ export = judarnTailwindPlugin;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Judarn Design Foundation – Tailwind CSS Plugin & Preset
3
+ * Generated from tokens/judarn-tokens.json – do not edit directly.
4
+ */
5
+ module.exports = function judarnTailwindPlugin({ addBase, theme }) {
6
+ // Do not override global border radius to 0px; adhere to ADR-0002
7
+ };
8
+
9
+ module.exports.theme = {
10
+ extend: {
11
+ colors: {
12
+ substrate: 'var(--jd-substrate)',
13
+ 'surface-elevated': 'var(--jd-surface-elevated)',
14
+ 'surface-recessed': 'var(--jd-surface-recessed)',
15
+ 'ink-100': 'var(--jd-ink-100)',
16
+ 'ink-60': 'var(--jd-ink-60)',
17
+ 'ink-30': 'var(--jd-ink-30)',
18
+ 'signal-error': 'var(--jd-signal-error)',
19
+ accent: 'var(--accent)',
20
+ 'accent-fg': 'var(--accent-fg)',
21
+ 'accent-ink': 'var(--accent-ink)',
22
+ paper: 'var(--jd-substrate)',
23
+ },
24
+ fontFamily: {
25
+ display: 'var(--jd-font-display)',
26
+ body: 'var(--jd-font-body)',
27
+ data: 'var(--jd-font-data)',
28
+ mono: 'var(--jd-font-mono)',
29
+ },
30
+ spacing: {
31
+ half: 'var(--jd-space-half)',
32
+ '1': 'var(--jd-space-1)',
33
+ '2': 'var(--jd-space-2)',
34
+ '3': 'var(--jd-space-3)',
35
+ '4': 'var(--jd-space-4)',
36
+ touch: 'var(--jd-space-touch)',
37
+ '6': 'var(--jd-space-6)',
38
+ '8': 'var(--jd-space-8)',
39
+ '12': 'var(--jd-space-12)',
40
+ '16': 'var(--jd-space-16)',
41
+ },
42
+ borderWidth: {
43
+ rule: 'var(--jd-rule)',
44
+ 'rule-bold': 'var(--jd-rule-bold)',
45
+ 'rule-heavy': 'var(--jd-rule-heavy)',
46
+ },
47
+ borderRadius: {
48
+ subtle: 'var(--jd-radius-subtle, 6px)',
49
+ control: 'var(--jd-radius-control, 10px)',
50
+ card: 'var(--jd-radius-card, 16px)',
51
+ badge: 'var(--jd-radius-badge, 9999px)',
52
+ DEFAULT: 'var(--jd-radius-control, 10px)',
53
+ sm: 'var(--jd-radius-subtle, 6px)',
54
+ md: 'var(--jd-radius-control, 10px)',
55
+ lg: 'var(--jd-radius-card, 16px)',
56
+ xl: 'var(--jd-radius-card, 16px)',
57
+ '2xl': 'var(--jd-radius-card, 16px)',
58
+ full: 'var(--jd-radius-badge, 9999px)',
59
+ },
60
+ },
61
+ };