create-skybridge 0.0.0-dev.1b2cb1b → 0.0.0-dev.1b3b81f
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/package.json +2 -2
- package/templates/blank/node_modules/.bin/alpic +2 -2
- package/templates/blank/node_modules/.bin/tsx +2 -2
- package/templates/blank/node_modules/.bin/vite +2 -2
- package/templates/blank/package.json +6 -6
- package/templates/blank/vite.config.ts +6 -0
- package/templates/demo/node_modules/.bin/alpic +2 -2
- package/templates/demo/node_modules/.bin/tsx +2 -2
- package/templates/demo/node_modules/.bin/vite +2 -2
- package/templates/demo/package.json +10 -10
- package/templates/demo/vite.config.ts +6 -0
- package/templates/ecom/.ladle/components.tsx +26 -0
- package/templates/ecom/.ladle/config.mjs +11 -0
- package/templates/ecom/.ladle/vite.config.ts +11 -0
- package/templates/ecom/_gitignore +1 -0
- package/templates/ecom/node_modules/.bin/alpic +2 -2
- package/templates/ecom/node_modules/.bin/ladle +21 -0
- package/templates/ecom/node_modules/.bin/vite +2 -2
- package/templates/ecom/package.json +14 -2
- package/templates/ecom/src/components/chip.css.ts +63 -0
- package/templates/ecom/src/components/chip.stories.tsx +27 -0
- package/templates/ecom/src/components/chip.tsx +49 -0
- package/templates/ecom/src/components/empty-state.stories.tsx +3 -0
- package/templates/ecom/src/components/empty-state.tsx +12 -0
- package/templates/ecom/src/components/expandable-text.css.ts +49 -0
- package/templates/ecom/src/components/expandable-text.stories.tsx +20 -0
- package/templates/ecom/src/components/expandable-text.tsx +53 -0
- package/templates/ecom/src/components/image-gallery.css.ts +172 -0
- package/templates/ecom/src/components/image-gallery.stories.tsx +30 -0
- package/templates/ecom/src/components/image-gallery.tsx +163 -0
- package/templates/ecom/src/components/product-card.css.ts +159 -0
- package/templates/ecom/src/components/product-card.stories.tsx +58 -0
- package/templates/ecom/src/components/product-card.tsx +102 -0
- package/templates/ecom/src/components/product-carousel.css.ts +134 -0
- package/templates/ecom/src/components/product-carousel.stories.tsx +64 -0
- package/templates/ecom/src/components/product-carousel.tsx +202 -0
- package/templates/ecom/src/components/variant-picker.css.ts +27 -0
- package/templates/ecom/src/components/variant-picker.stories.tsx +67 -0
- package/templates/ecom/src/components/variant-picker.tsx +70 -0
- package/templates/ecom/src/components/view-frame.css.ts +22 -0
- package/templates/ecom/src/components/view-frame.tsx +27 -0
- package/templates/ecom/src/config.ts +12 -0
- package/templates/ecom/src/design/contract.css.ts +39 -0
- package/templates/ecom/src/design/fonts.css +15 -0
- package/templates/ecom/src/design/primitives.css.ts +101 -0
- package/templates/ecom/src/design/recipes/typography.css.ts +75 -0
- package/templates/ecom/src/design/sprinkles.css.ts +128 -0
- package/templates/ecom/src/design/themes/dark.css.ts +36 -0
- package/templates/ecom/src/design/themes/light.css.ts +36 -0
- package/templates/ecom/src/design/tokens.ts +8 -0
- package/templates/ecom/src/i18n.ts +35 -0
- package/templates/ecom/src/index.css +9 -0
- package/templates/ecom/src/lib/cx.ts +9 -0
- package/templates/ecom/src/lib/format.ts +8 -55
- package/templates/ecom/src/lib/variants.ts +150 -0
- package/templates/ecom/src/server.ts +15 -97
- package/templates/ecom/src/tools/render-carousel.ts +245 -0
- package/templates/ecom/src/tools/search-products.ts +185 -0
- package/templates/ecom/src/types.ts +15 -0
- package/templates/ecom/src/views/carousel/detail/detail.css.ts +113 -0
- package/templates/ecom/src/views/carousel/detail/detail.stories.tsx +126 -0
- package/templates/ecom/src/views/carousel/detail/index.tsx +254 -0
- package/templates/ecom/src/views/carousel/index.tsx +234 -0
- package/templates/ecom/tsconfig.json +6 -0
- package/templates/ecom/vite.config.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.1b3b81f",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alpic",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/cross-spawn": "^6.0.6",
|
|
26
26
|
"typescript": "^6.0.3",
|
|
27
|
-
"vitest": "^4.1.
|
|
27
|
+
"vitest": "^4.1.10"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc",
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../alpic/bin/run.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
16
|
-
"skybridge": "^0.0.0-dev.
|
|
17
|
-
"vite": "^8.1.
|
|
16
|
+
"skybridge": "^0.0.0-dev.1b3b81f",
|
|
17
|
+
"vite": "^8.1.5"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@skybridge/devtools": "^1.2.
|
|
21
|
-
"@types/node": "^24.13.
|
|
22
|
-
"alpic": "^1.
|
|
23
|
-
"tsx": "^4.23.
|
|
20
|
+
"@skybridge/devtools": "^1.2.7",
|
|
21
|
+
"@types/node": "^24.13.3",
|
|
22
|
+
"alpic": "^1.155.0",
|
|
23
|
+
"tsx": "^4.23.1",
|
|
24
24
|
"typescript": "^6.0.3"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../alpic/bin/run.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.3_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.1_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
"deploy": "alpic deploy"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@alpic-ai/ui": "^1.
|
|
15
|
+
"@alpic-ai/ui": "^1.155.0",
|
|
16
16
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
17
|
-
"lucide-react": "^1.
|
|
17
|
+
"lucide-react": "^1.25.0",
|
|
18
18
|
"react": "^19.2.7",
|
|
19
19
|
"react-dom": "^19.2.7",
|
|
20
|
-
"skybridge": "^0.0.0-dev.
|
|
20
|
+
"skybridge": "^0.0.0-dev.1b3b81f",
|
|
21
21
|
"sonner": "^2.0.7",
|
|
22
22
|
"tw-animate-css": "^1.4.0",
|
|
23
|
-
"vite": "^8.1.
|
|
23
|
+
"vite": "^8.1.5",
|
|
24
24
|
"zod": "^4.4.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@skybridge/devtools": "^1.2.
|
|
28
|
-
"@tailwindcss/vite": "^4.3.
|
|
29
|
-
"@types/node": "^24.13.
|
|
27
|
+
"@skybridge/devtools": "^1.2.7",
|
|
28
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
29
|
+
"@types/node": "^24.13.3",
|
|
30
30
|
"@types/react": "^19.2.17",
|
|
31
31
|
"@types/react-dom": "^19.2.3",
|
|
32
32
|
"@vitejs/plugin-react": "^6.0.3",
|
|
33
|
-
"alpic": "^1.
|
|
34
|
-
"tailwindcss": "^4.3.
|
|
35
|
-
"tsx": "^4.23.
|
|
33
|
+
"alpic": "^1.155.0",
|
|
34
|
+
"tailwindcss": "^4.3.3",
|
|
35
|
+
"tsx": "^4.23.1",
|
|
36
36
|
"typescript": "^6.0.3"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
@@ -6,6 +6,12 @@ import { defineConfig } from "vite";
|
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
plugins: [skybridge(), react(), tailwindcss()],
|
|
9
|
+
server: {
|
|
10
|
+
forwardConsole: {
|
|
11
|
+
unhandledErrors: true,
|
|
12
|
+
logLevels: ["error"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
resolve: {
|
|
10
16
|
alias: {
|
|
11
17
|
"@": path.resolve(__dirname, "./src"),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GlobalProvider } from "@ladle/react";
|
|
2
|
+
import "../src/index.css";
|
|
3
|
+
import { viewFrame } from "../src/components/view-frame.css";
|
|
4
|
+
import { darkTheme, lightTheme } from "../src/design/tokens";
|
|
5
|
+
import { cx } from "../src/lib/cx";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Ladle's built-in theme toggle (sun/moon in the toolbar) drives
|
|
9
|
+
* globalState.theme. We reuse it to flip the widget's own palette, so the
|
|
10
|
+
* preview theme and the widget theme always match. The Provider applies the
|
|
11
|
+
* real ViewFrame surface (viewFrame + theme class), and index.css loads the
|
|
12
|
+
* brand @font-face rules, so stories preview against the actual frame.
|
|
13
|
+
*/
|
|
14
|
+
export const Provider: GlobalProvider = ({ children, globalState }) => {
|
|
15
|
+
const themeClass = globalState.theme === "dark" ? darkTheme : lightTheme;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className={cx(viewFrame, themeClass)}
|
|
20
|
+
data-theme={globalState.theme}
|
|
21
|
+
style={{ minHeight: "100vh", padding: 32 }}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ladle-only vite config. Intentionally omits the Skybridge plugin (which
|
|
6
|
+
* transforms MCP view boilerplate and crashes Ladle's bundler) and the
|
|
7
|
+
* @vitejs/plugin-react call (Ladle provides its own).
|
|
8
|
+
*/
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [vanillaExtractPlugin()],
|
|
11
|
+
});
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.156.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.9.0_@opentelemetry+api@1.9_1e4d6b8f8010991ae8bdea8fb1777fd0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../alpic/bin/run.js" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_1166394f95df9cef33a0930b8ede5a5f/node_modules/@ladle/react/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_1166394f95df9cef33a0930b8ede5a5f/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_1166394f95df9cef33a0930b8ede5a5f/node_modules/@ladle/react/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@ladle+react@5.1.1_@types+node@24.13.2_@types+react@19.2.17_jiti@2.7.0_lightningcss@1.3_1166394f95df9cef33a0930b8ede5a5f/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../@ladle/react/lib/cli/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../@ladle/react/lib/cli/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.5_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.9.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -9,16 +9,28 @@
|
|
|
9
9
|
"dev:tunnel": "skybridge dev --tunnel",
|
|
10
10
|
"build": "skybridge build",
|
|
11
11
|
"start": "skybridge start",
|
|
12
|
-
"deploy": "alpic deploy"
|
|
12
|
+
"deploy": "alpic deploy",
|
|
13
|
+
"ladle": "ladle serve",
|
|
14
|
+
"ladle:build": "ladle build"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"
|
|
17
|
+
"react": "^19.2.4",
|
|
18
|
+
"react-dom": "^19.2.4",
|
|
19
|
+
"skybridge": "^0.0.0-dev.1b3b81f",
|
|
16
20
|
"vite": "^8.1.3",
|
|
17
21
|
"zod": "^4.4.3"
|
|
18
22
|
},
|
|
19
23
|
"devDependencies": {
|
|
24
|
+
"@ladle/react": "^5.1.1",
|
|
20
25
|
"@skybridge/devtools": "^1.2.4",
|
|
21
26
|
"@types/node": "^24.13.2",
|
|
27
|
+
"@types/react": "^19.2.14",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"@vanilla-extract/css": "^1.20.1",
|
|
30
|
+
"@vanilla-extract/recipes": "^0.5.7",
|
|
31
|
+
"@vanilla-extract/sprinkles": "^1.6.5",
|
|
32
|
+
"@vanilla-extract/vite-plugin": "^5.2.2",
|
|
33
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
22
34
|
"alpic": "^1.147.1",
|
|
23
35
|
"tsx": "^4.23.0",
|
|
24
36
|
"typescript": "^6.0.3"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
+
import { colors, primitives } from "../design/tokens";
|
|
4
|
+
|
|
5
|
+
// A selectable pill used for option values (sizes, colors…). `selected`,
|
|
6
|
+
// `outOfStock` and `nonExistent` are driven by the variant picker from the
|
|
7
|
+
// sparse variant list.
|
|
8
|
+
// @todo: tune the chip to your brand (radius, borders, selected treatment).
|
|
9
|
+
export const chip = recipe({
|
|
10
|
+
base: {
|
|
11
|
+
display: "inline-flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
gap: primitives.space["4xs"],
|
|
14
|
+
minHeight: "44px", // touch target
|
|
15
|
+
padding: `${primitives.space["4xs"]} ${primitives.space["3xs"]}`,
|
|
16
|
+
borderRadius: primitives.radius.m,
|
|
17
|
+
border: `${primitives.stroke.thin} solid ${colors.border.subtle}`,
|
|
18
|
+
backgroundColor: colors.surface.extraLight,
|
|
19
|
+
color: colors.content.intense,
|
|
20
|
+
fontFamily: primitives.font.family.primary,
|
|
21
|
+
fontSize: primitives.font.size.s,
|
|
22
|
+
cursor: "pointer",
|
|
23
|
+
transition: "border-color 150ms ease",
|
|
24
|
+
"@media": {
|
|
25
|
+
"(prefers-reduced-motion: reduce)": { transition: "none" },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
selected: {
|
|
30
|
+
true: {
|
|
31
|
+
borderColor: colors.common.accent,
|
|
32
|
+
borderWidth: primitives.stroke.medium,
|
|
33
|
+
},
|
|
34
|
+
false: {},
|
|
35
|
+
},
|
|
36
|
+
outOfStock: {
|
|
37
|
+
// Struck but still clickable; the buy CTA carries the state.
|
|
38
|
+
true: {
|
|
39
|
+
color: colors.content.subtle,
|
|
40
|
+
textDecoration: "line-through",
|
|
41
|
+
},
|
|
42
|
+
false: {},
|
|
43
|
+
},
|
|
44
|
+
nonExistent: {
|
|
45
|
+
// Faded and non-interactive, distinct from sold out above.
|
|
46
|
+
true: {
|
|
47
|
+
opacity: 0.35,
|
|
48
|
+
cursor: "default",
|
|
49
|
+
},
|
|
50
|
+
false: {},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: { selected: false, outOfStock: false, nonExistent: false },
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Small color/material swatch shown before the label on image chips.
|
|
57
|
+
export const swatch = style({
|
|
58
|
+
width: "20px",
|
|
59
|
+
height: "20px",
|
|
60
|
+
borderRadius: primitives.radius.full,
|
|
61
|
+
objectFit: "cover",
|
|
62
|
+
display: "block",
|
|
63
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Chip } from "./chip";
|
|
2
|
+
|
|
3
|
+
const SWATCH =
|
|
4
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' fill='%233b6cf0'/%3E%3C/svg%3E";
|
|
5
|
+
|
|
6
|
+
const row = {
|
|
7
|
+
display: "flex",
|
|
8
|
+
gap: 8,
|
|
9
|
+
flexWrap: "wrap" as const,
|
|
10
|
+
maxWidth: 320,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const States = () => (
|
|
14
|
+
<div style={row}>
|
|
15
|
+
<Chip label="M" />
|
|
16
|
+
<Chip label="L" selected />
|
|
17
|
+
<Chip label="XL" outOfStock /> {/* exists, sold out: clickable */}
|
|
18
|
+
<Chip label="XXL" nonExistent /> {/* combination does not exist */}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const WithSwatch = () => (
|
|
23
|
+
<div style={row}>
|
|
24
|
+
<Chip label="Blue" media={SWATCH} selected />
|
|
25
|
+
<Chip label="Black" media={SWATCH} />
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as styles from "./chip.css";
|
|
2
|
+
|
|
3
|
+
type ChipProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
// Exists but sold out: struck-through and greyed, still clickable
|
|
7
|
+
outOfStock?: boolean;
|
|
8
|
+
// The combination does not exist at all (hole in the variant matrix):
|
|
9
|
+
// faded and non-interactive
|
|
10
|
+
nonExistent?: boolean;
|
|
11
|
+
onSelect?: () => void;
|
|
12
|
+
// Optional swatch image (e.g. one per color); omit for a plain text chip.
|
|
13
|
+
media?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* One option value as a selectable pill. Rendered as a `radio` inside the
|
|
18
|
+
* variant picker's `radiogroup`; the picker owns selection state and passes
|
|
19
|
+
* `selected`/`outOfStock`/`nonExistent` computed from the sparse variant list.
|
|
20
|
+
* An out-of-stock chip stays operable: aria-disabled announces the state to
|
|
21
|
+
* assistive tech without blocking activation. A nonexistent chip is natively
|
|
22
|
+
* disabled: the combination cannot be composed.
|
|
23
|
+
*/
|
|
24
|
+
export function Chip({
|
|
25
|
+
label,
|
|
26
|
+
selected,
|
|
27
|
+
outOfStock,
|
|
28
|
+
nonExistent,
|
|
29
|
+
onSelect,
|
|
30
|
+
media,
|
|
31
|
+
}: ChipProps) {
|
|
32
|
+
return (
|
|
33
|
+
// biome-ignore lint/a11y/useSemanticElements: custom radio; a styled button carries the swatch and availability states a native radio cannot, inside the picker radiogroup.
|
|
34
|
+
<button
|
|
35
|
+
type="button"
|
|
36
|
+
role="radio"
|
|
37
|
+
aria-checked={selected ?? false}
|
|
38
|
+
aria-disabled={outOfStock ?? false}
|
|
39
|
+
disabled={nonExistent ?? false}
|
|
40
|
+
className={styles.chip({ selected, outOfStock, nonExistent })}
|
|
41
|
+
onClick={onSelect}
|
|
42
|
+
>
|
|
43
|
+
{media ? (
|
|
44
|
+
<img className={styles.swatch} src={media} alt="" draggable={false} />
|
|
45
|
+
) : null}
|
|
46
|
+
{label}
|
|
47
|
+
</button>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { sprinkles, text } from "../design/tokens";
|
|
2
|
+
|
|
3
|
+
/** Centered message shown when there is nothing to render (e.g. no results). */
|
|
4
|
+
export function EmptyState({ message }: { message: string }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
className={sprinkles({ p: "l", textAlign: "center", color: "subtle" })}
|
|
8
|
+
>
|
|
9
|
+
<p className={text({ style: "bodyM" })}>{message}</p>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
+
import { colors, primitives } from "../design/tokens";
|
|
4
|
+
|
|
5
|
+
// @todo: collapsed height before "read more" appears. Tune to your type scale.
|
|
6
|
+
const COLLAPSED_MAX_HEIGHT = "6em";
|
|
7
|
+
|
|
8
|
+
export const container = style({
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
alignItems: "flex-start",
|
|
12
|
+
gap: primitives.space["4xs"],
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// `clamp` caps the height (applied whenever collapsed, so overflow can be
|
|
16
|
+
// measured); `fade` masks the last line to a soft cutoff instead of an ellipsis
|
|
17
|
+
// and is applied only when the text actually overflows (never on short copy).
|
|
18
|
+
export const body = recipe({
|
|
19
|
+
base: {
|
|
20
|
+
color: colors.content.intense,
|
|
21
|
+
whiteSpace: "pre-line", // preserve paragraph breaks from the source
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
clamp: {
|
|
25
|
+
true: { maxHeight: COLLAPSED_MAX_HEIGHT, overflow: "hidden" },
|
|
26
|
+
false: {},
|
|
27
|
+
},
|
|
28
|
+
fade: {
|
|
29
|
+
true: {
|
|
30
|
+
maskImage:
|
|
31
|
+
"linear-gradient(to bottom, black 0%, black 55%, transparent 100%)",
|
|
32
|
+
WebkitMaskImage:
|
|
33
|
+
"linear-gradient(to bottom, black 0%, black 55%, transparent 100%)",
|
|
34
|
+
},
|
|
35
|
+
false: {},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: { clamp: false, fade: false },
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const toggle = style({
|
|
42
|
+
padding: 0,
|
|
43
|
+
border: "none",
|
|
44
|
+
background: "none",
|
|
45
|
+
color: colors.common.accent,
|
|
46
|
+
fontFamily: primitives.font.family.primary,
|
|
47
|
+
fontSize: primitives.font.size.s,
|
|
48
|
+
cursor: "pointer",
|
|
49
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExpandableText } from "./expandable-text";
|
|
2
|
+
|
|
3
|
+
const frame = { maxWidth: 360 };
|
|
4
|
+
|
|
5
|
+
const LONG =
|
|
6
|
+
"A relaxed-fit jacket in water-repellent cotton.\n\nDropped shoulders, a two-way zip, and ribbed cuffs. Fully lined, with two zip pockets at the front and one inside. Designed to layer over a knit through the cooler months, and cut long enough to sit past the hip.";
|
|
7
|
+
|
|
8
|
+
export const Long = () => (
|
|
9
|
+
<div style={frame}>
|
|
10
|
+
<ExpandableText>{LONG}</ExpandableText>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const Short = () => (
|
|
15
|
+
<div style={frame}>
|
|
16
|
+
<ExpandableText>
|
|
17
|
+
A short description that never needs a toggle.
|
|
18
|
+
</ExpandableText>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { text } from "../design/tokens";
|
|
3
|
+
import { useLabels } from "../i18n";
|
|
4
|
+
import { cx } from "../lib/cx";
|
|
5
|
+
import * as styles from "./expandable-text.css";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Clamps long copy to a few lines with a "read more" toggle. Truncation is
|
|
9
|
+
* measured, not assumed: the toggle only appears when the text actually
|
|
10
|
+
* overflows the collapsed height, so short copy shows no button.
|
|
11
|
+
*/
|
|
12
|
+
export function ExpandableText({ children }: { children: string }) {
|
|
13
|
+
const labels = useLabels();
|
|
14
|
+
const bodyRef = useRef<HTMLParagraphElement>(null);
|
|
15
|
+
const [expanded, setExpanded] = useState(false);
|
|
16
|
+
const [overflows, setOverflows] = useState(false);
|
|
17
|
+
|
|
18
|
+
const collapsed = !expanded;
|
|
19
|
+
|
|
20
|
+
// Measure against the collapsed height (the clamp is applied whenever
|
|
21
|
+
// collapsed, so scrollHeight vs clientHeight is meaningful). Re-run when the
|
|
22
|
+
// text changes (e.g. the client switches variant) so the toggle tracks it.
|
|
23
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: children re-triggers the measure, it is not read in the body.
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
const el = bodyRef.current;
|
|
26
|
+
if (el && collapsed) {
|
|
27
|
+
setOverflows(el.scrollHeight > el.clientHeight + 1);
|
|
28
|
+
}
|
|
29
|
+
}, [children, collapsed]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className={styles.container}>
|
|
33
|
+
<p
|
|
34
|
+
ref={bodyRef}
|
|
35
|
+
className={cx(
|
|
36
|
+
text({ style: "bodyS" }),
|
|
37
|
+
styles.body({ clamp: collapsed, fade: collapsed && overflows }),
|
|
38
|
+
)}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</p>
|
|
42
|
+
{overflows ? (
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
className={styles.toggle}
|
|
46
|
+
onClick={() => setExpanded((v) => !v)}
|
|
47
|
+
>
|
|
48
|
+
{expanded ? labels.readLess : labels.readMore}
|
|
49
|
+
</button>
|
|
50
|
+
) : null}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|