lattice-ui 0.4.3

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 (71) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +45 -0
  3. package/dist/cli.d.ts +1 -0
  4. package/dist/cli.js +426 -0
  5. package/dist/commands/add.d.ts +3 -0
  6. package/dist/commands/add.js +156 -0
  7. package/dist/commands/create.d.ts +23 -0
  8. package/dist/commands/create.js +351 -0
  9. package/dist/commands/doctor.d.ts +2 -0
  10. package/dist/commands/doctor.js +164 -0
  11. package/dist/commands/init.d.ts +21 -0
  12. package/dist/commands/init.js +547 -0
  13. package/dist/commands/remove.d.ts +3 -0
  14. package/dist/commands/remove.js +113 -0
  15. package/dist/commands/selection.d.ts +6 -0
  16. package/dist/commands/selection.js +27 -0
  17. package/dist/commands/upgrade.d.ts +3 -0
  18. package/dist/commands/upgrade.js +150 -0
  19. package/dist/core/errors.d.ts +21 -0
  20. package/dist/core/errors.js +52 -0
  21. package/dist/core/fs/copy.d.ts +13 -0
  22. package/dist/core/fs/copy.js +129 -0
  23. package/dist/core/fs/json.d.ts +3 -0
  24. package/dist/core/fs/json.js +163 -0
  25. package/dist/core/fs/patch.d.ts +16 -0
  26. package/dist/core/fs/patch.js +89 -0
  27. package/dist/core/logger.d.ts +27 -0
  28. package/dist/core/logger.js +166 -0
  29. package/dist/core/npm/latest.d.ts +1 -0
  30. package/dist/core/npm/latest.js +40 -0
  31. package/dist/core/output.d.ts +8 -0
  32. package/dist/core/output.js +20 -0
  33. package/dist/core/pm/detect.d.ts +18 -0
  34. package/dist/core/pm/detect.js +147 -0
  35. package/dist/core/pm/npm.d.ts +2 -0
  36. package/dist/core/pm/npm.js +48 -0
  37. package/dist/core/pm/pnpm.d.ts +2 -0
  38. package/dist/core/pm/pnpm.js +48 -0
  39. package/dist/core/pm/types.d.ts +8 -0
  40. package/dist/core/pm/types.js +2 -0
  41. package/dist/core/pm/yarn.d.ts +2 -0
  42. package/dist/core/pm/yarn.js +48 -0
  43. package/dist/core/project/findRoot.d.ts +1 -0
  44. package/dist/core/project/findRoot.js +60 -0
  45. package/dist/core/project/readPackageJson.d.ts +13 -0
  46. package/dist/core/project/readPackageJson.js +41 -0
  47. package/dist/core/project/writePackageJson.d.ts +2 -0
  48. package/dist/core/project/writePackageJson.js +41 -0
  49. package/dist/core/prompt.d.ts +23 -0
  50. package/dist/core/prompt.js +217 -0
  51. package/dist/core/registry/load.d.ts +3 -0
  52. package/dist/core/registry/load.js +59 -0
  53. package/dist/core/registry/schema.d.ts +18 -0
  54. package/dist/core/registry/schema.js +87 -0
  55. package/dist/ctx.d.ts +27 -0
  56. package/dist/ctx.js +75 -0
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.js +21 -0
  59. package/package.json +27 -0
  60. package/registry/components.json +118 -0
  61. package/registry/presets.json +6 -0
  62. package/templates/init/default.project.json.template +67 -0
  63. package/templates/init/package.json +22 -0
  64. package/templates/init/src/client/App.tsx +21 -0
  65. package/templates/init/src/client/main.client.tsx +26 -0
  66. package/templates/init/src/server/main.server.ts +3 -0
  67. package/templates/init/src/shared/constants.ts +1 -0
  68. package/templates/init/tsconfig.json +27 -0
  69. package/templates/init-lint/.prettierrc +7 -0
  70. package/templates/init-lint/eslint.config.mjs +51 -0
  71. package/templates/init-lint/package.json +19 -0
@@ -0,0 +1,118 @@
1
+ {
2
+ "packages": {
3
+ "accordion": {
4
+ "npm": "@lattice-ui/accordion",
5
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
6
+ },
7
+ "avatar": {
8
+ "npm": "@lattice-ui/avatar",
9
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
10
+ },
11
+ "checkbox": {
12
+ "npm": "@lattice-ui/checkbox",
13
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
14
+ },
15
+ "combobox": {
16
+ "npm": "@lattice-ui/combobox",
17
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
18
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
19
+ "notes": ["Combobox content can be portal-mounted via PortalProvider."]
20
+ },
21
+ "core": {
22
+ "npm": "@lattice-ui/core",
23
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
24
+ },
25
+ "dialog": {
26
+ "npm": "@lattice-ui/dialog",
27
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
28
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
29
+ "notes": ["Dialog.Content can use PortalProvider for predictable layering."]
30
+ },
31
+ "focus": {
32
+ "npm": "@lattice-ui/focus",
33
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
34
+ },
35
+ "layer": {
36
+ "npm": "@lattice-ui/layer",
37
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
38
+ },
39
+ "menu": {
40
+ "npm": "@lattice-ui/menu",
41
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
42
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
43
+ "notes": ["Menu.Content can use PortalProvider for display order control."]
44
+ },
45
+ "popover": {
46
+ "npm": "@lattice-ui/popover",
47
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
48
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
49
+ "notes": ["Popover.Content can safely manage displayOrder with PortalProvider."]
50
+ },
51
+ "popper": {
52
+ "npm": "@lattice-ui/popper",
53
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
54
+ },
55
+ "progress": {
56
+ "npm": "@lattice-ui/progress",
57
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
58
+ },
59
+ "radio-group": {
60
+ "npm": "@lattice-ui/radio-group",
61
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
62
+ },
63
+ "scroll-area": {
64
+ "npm": "@lattice-ui/scroll-area",
65
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
66
+ },
67
+ "select": {
68
+ "npm": "@lattice-ui/select",
69
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
70
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
71
+ "notes": ["Select.Content can use PortalProvider for robust overlays."]
72
+ },
73
+ "slider": {
74
+ "npm": "@lattice-ui/slider",
75
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
76
+ },
77
+ "style": {
78
+ "npm": "@lattice-ui/style",
79
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
80
+ },
81
+ "switch": {
82
+ "npm": "@lattice-ui/switch",
83
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
84
+ },
85
+ "system": {
86
+ "npm": "@lattice-ui/system",
87
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
88
+ },
89
+ "tabs": {
90
+ "npm": "@lattice-ui/tabs",
91
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
92
+ },
93
+ "text-field": {
94
+ "npm": "@lattice-ui/text-field",
95
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
96
+ },
97
+ "textarea": {
98
+ "npm": "@lattice-ui/textarea",
99
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
100
+ },
101
+ "toast": {
102
+ "npm": "@lattice-ui/toast",
103
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
104
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
105
+ "notes": ["Toast viewport can be mounted with PortalProvider for layering."]
106
+ },
107
+ "toggle-group": {
108
+ "npm": "@lattice-ui/toggle-group",
109
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"]
110
+ },
111
+ "tooltip": {
112
+ "npm": "@lattice-ui/tooltip",
113
+ "peers": ["@rbxts/react", "@rbxts/react-roblox"],
114
+ "providers": ["@lattice-ui/layer:PortalProvider?"],
115
+ "notes": ["Tooltip content can be portal-mounted for better overlap behavior."]
116
+ }
117
+ }
118
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "presets": {
3
+ "overlay": ["popover", "tooltip", "dialog", "toast"],
4
+ "form": ["checkbox", "radio-group", "switch", "text-field", "textarea"]
5
+ }
6
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "__PROJECT_NAME__",
3
+ "globIgnorePaths": ["**/package.json", "**/tsconfig.json"],
4
+ "tree": {
5
+ "$className": "DataModel",
6
+ "ServerScriptService": {
7
+ "$className": "ServerScriptService",
8
+ "TS": {
9
+ "$path": "out/server"
10
+ }
11
+ },
12
+ "ReplicatedStorage": {
13
+ "$className": "ReplicatedStorage",
14
+ "rbxts_include": {
15
+ "$path": "include",
16
+ "node_modules": {
17
+ "$className": "Folder",
18
+ "@rbxts": {
19
+ "$path": "node_modules/@rbxts"
20
+ }
21
+ }
22
+ },
23
+ "node_modules": {
24
+ "$className": "Folder",
25
+ "@lattice-ui": {
26
+ "$path": "node_modules/@lattice-ui"
27
+ },
28
+ "@rbxts": {
29
+ "$path": "node_modules/@rbxts"
30
+ },
31
+ "@rbxts-js": {
32
+ "$path": "node_modules/@rbxts-js"
33
+ }
34
+ },
35
+ "TS": {
36
+ "$path": "out/shared"
37
+ }
38
+ },
39
+ "StarterPlayer": {
40
+ "$className": "StarterPlayer",
41
+ "StarterPlayerScripts": {
42
+ "$className": "StarterPlayerScripts",
43
+ "TS": {
44
+ "$path": "out/client"
45
+ }
46
+ }
47
+ },
48
+ "Workspace": {
49
+ "$className": "Workspace",
50
+ "$properties": {
51
+ "FilteringEnabled": true
52
+ }
53
+ },
54
+ "HttpService": {
55
+ "$className": "HttpService",
56
+ "$properties": {
57
+ "HttpEnabled": true
58
+ }
59
+ },
60
+ "SoundService": {
61
+ "$className": "SoundService",
62
+ "$properties": {
63
+ "RespectFilteringEnabled": true
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "__PROJECT_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "build": "rbxtsc -p tsconfig.json",
7
+ "watch": "rbxtsc -p tsconfig.json -w",
8
+ "typecheck": "tsc -p tsconfig.json"
9
+ },
10
+ "dependencies": {
11
+ "@lattice-ui/style": "__LATTICE_STYLE_VERSION__",
12
+ "@rbxts/react": "__RBXTS_REACT_VERSION__",
13
+ "@rbxts/react-roblox": "__RBXTS_REACT_ROBLOX_VERSION__"
14
+ },
15
+ "devDependencies": {
16
+ "@lattice-ui/cli": "__LATTICE_CLI_VERSION__",
17
+ "@rbxts/compiler-types": "__RBXTS_COMPILER_TYPES_VERSION__",
18
+ "@rbxts/types": "__RBXTS_TYPES_VERSION__",
19
+ "roblox-ts": "__ROBLOX_TS_VERSION__",
20
+ "typescript": "__TYPESCRIPT_VERSION__"
21
+ }
22
+ }
@@ -0,0 +1,21 @@
1
+ import { Text } from "@lattice-ui/style";
2
+ import React from "@rbxts/react";
3
+ import { LATTICE_INIT_MESSAGE } from "../shared/constants";
4
+
5
+ export function App() {
6
+ return (
7
+ <screengui IgnoreGuiInset ResetOnSpawn={false}>
8
+ <frame BackgroundTransparency={1} Size={UDim2.fromScale(1, 1)}>
9
+ <Text
10
+ AnchorPoint={new Vector2(0.5, 0.5)}
11
+ Position={UDim2.fromScale(0.5, 0.5)}
12
+ Size={UDim2.fromOffset(420, 40)}
13
+ Text={LATTICE_INIT_MESSAGE}
14
+ TextSize={24}
15
+ TextXAlignment={Enum.TextXAlignment.Center}
16
+ TextYAlignment={Enum.TextYAlignment.Center}
17
+ />
18
+ </frame>
19
+ </screengui>
20
+ );
21
+ }
@@ -0,0 +1,26 @@
1
+ import { defaultLightTheme, ThemeProvider } from "@lattice-ui/style";
2
+ import React from "@rbxts/react";
3
+ import ReactRoblox from "@rbxts/react-roblox";
4
+ import { App } from "./App";
5
+
6
+ const Players = game.GetService("Players");
7
+ const player = Players.LocalPlayer;
8
+ if (!player) {
9
+ error("LocalPlayer is required.");
10
+ }
11
+
12
+ const playerGuiInstance = player.WaitForChild("PlayerGui");
13
+ if (!playerGuiInstance.IsA("PlayerGui")) {
14
+ error("PlayerGui is required.");
15
+ }
16
+
17
+ const container = new Instance("Folder");
18
+ container.Name = "LatticeRoot";
19
+ container.Parent = playerGuiInstance;
20
+
21
+ const root = ReactRoblox.createRoot(container);
22
+ root.render(
23
+ <ThemeProvider theme={defaultLightTheme}>
24
+ <App />
25
+ </ThemeProvider>,
26
+ );
@@ -0,0 +1,3 @@
1
+ import { LATTICE_INIT_MESSAGE } from "../shared/constants";
2
+
3
+ print(`Server script initialized: ${LATTICE_INIT_MESSAGE}`);
@@ -0,0 +1 @@
1
+ export const LATTICE_INIT_MESSAGE = "Lattice UI project initialized";
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowSyntheticDefaultImports": true,
4
+ "downlevelIteration": true,
5
+ "jsx": "react",
6
+ "jsxFactory": "React.createElement",
7
+ "jsxFragmentFactory": "React.Fragment",
8
+ "module": "commonjs",
9
+ "moduleResolution": "Node",
10
+ "noLib": true,
11
+ "resolveJsonModule": true,
12
+ "experimentalDecorators": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "moduleDetection": "force",
15
+ "strict": true,
16
+ "target": "esnext",
17
+ "typeRoots": ["node_modules/@rbxts", "node_modules/@lattice-ui"],
18
+ "types": ["types", "compiler-types"],
19
+
20
+ "rootDir": "src",
21
+ "outDir": "out",
22
+ "baseUrl": "src",
23
+ "incremental": true,
24
+ "tsBuildInfoFile": "out/tsconfig.tsbuildinfo"
25
+ },
26
+ "include": ["src"]
27
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "printWidth": 120,
3
+ "tabWidth": 2,
4
+ "trailingComma": "all",
5
+ "endOfLine": "lf",
6
+ "semi": true
7
+ }
@@ -0,0 +1,51 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { FlatCompat } from "@eslint/eslintrc";
4
+ import js from "@eslint/js";
5
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
6
+ import tsParser from "@typescript-eslint/parser";
7
+ import { defineConfig, globalIgnores } from "eslint/config";
8
+ import prettier from "eslint-plugin-prettier";
9
+ import robloxTs from "eslint-plugin-roblox-ts";
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+ const compat = new FlatCompat({
14
+ baseDirectory: __dirname,
15
+ recommendedConfig: js.configs.recommended,
16
+ allConfig: js.configs.all,
17
+ });
18
+
19
+ export default defineConfig([
20
+ globalIgnores(["out", "include"]),
21
+ {
22
+ files: ["**/*.{ts,tsx}"],
23
+ extends: compat.extends(
24
+ "eslint:recommended",
25
+ "plugin:@typescript-eslint/recommended",
26
+ "plugin:roblox-ts/recommended-legacy",
27
+ "plugin:prettier/recommended",
28
+ ),
29
+
30
+ plugins: {
31
+ "@typescript-eslint": typescriptEslint,
32
+ robloxTs,
33
+ prettier,
34
+ },
35
+
36
+ languageOptions: {
37
+ parser: tsParser,
38
+ parserOptions: {
39
+ jsx: true,
40
+ useJSXTextNode: true,
41
+ project: "./tsconfig.json",
42
+ tsconfigRootDir: __dirname,
43
+ },
44
+ },
45
+
46
+ rules: {
47
+ "prettier/prettier": "warn",
48
+ "@typescript-eslint/no-require-imports": "off",
49
+ },
50
+ },
51
+ ]);
@@ -0,0 +1,19 @@
1
+ {
2
+ "scripts": {
3
+ "lint": "eslint .",
4
+ "lint:fix": "eslint . --fix",
5
+ "format": "prettier . --write",
6
+ "format:check": "prettier . --check"
7
+ },
8
+ "devDependencies": {
9
+ "@eslint/eslintrc": "__ESLINT_ESLINTRC_VERSION__",
10
+ "@eslint/js": "__ESLINT_JS_VERSION__",
11
+ "@typescript-eslint/eslint-plugin": "__TYPESCRIPT_ESLINT_PLUGIN_VERSION__",
12
+ "@typescript-eslint/parser": "__TYPESCRIPT_ESLINT_PARSER_VERSION__",
13
+ "eslint": "__ESLINT_VERSION__",
14
+ "eslint-config-prettier": "__ESLINT_CONFIG_PRETTIER_VERSION__",
15
+ "eslint-plugin-prettier": "__ESLINT_PLUGIN_PRETTIER_VERSION__",
16
+ "eslint-plugin-roblox-ts": "__ESLINT_PLUGIN_ROBLOX_TS_VERSION__",
17
+ "prettier": "__PRETTIER_VERSION__"
18
+ }
19
+ }