create-skybridge 0.0.0-dev.fa2b1ba → 0.0.0-dev.fa62964

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 (56) hide show
  1. package/dist/index.js +46 -24
  2. package/package.json +4 -4
  3. package/templates/blank/Dockerfile +2 -2
  4. package/templates/blank/node_modules/.bin/alpic +2 -2
  5. package/templates/blank/node_modules/.bin/tsc +2 -2
  6. package/templates/blank/node_modules/.bin/tsserver +2 -2
  7. package/templates/blank/node_modules/.bin/tsx +2 -2
  8. package/templates/blank/node_modules/.bin/vite +2 -2
  9. package/templates/blank/package.json +8 -8
  10. package/templates/demo/Dockerfile +2 -2
  11. package/templates/demo/node_modules/.bin/alpic +2 -2
  12. package/templates/demo/node_modules/.bin/tsc +2 -2
  13. package/templates/demo/node_modules/.bin/tsserver +2 -2
  14. package/templates/demo/node_modules/.bin/tsx +2 -2
  15. package/templates/demo/node_modules/.bin/vite +2 -2
  16. package/templates/demo/package.json +17 -17
  17. package/templates/ecom/.dockerignore +4 -0
  18. package/templates/ecom/.env.template +2 -0
  19. package/templates/ecom/.ladle/components.tsx +26 -0
  20. package/templates/ecom/.ladle/config.mjs +11 -0
  21. package/templates/ecom/.ladle/vite.config.ts +11 -0
  22. package/templates/ecom/AGENTS.md +2 -0
  23. package/templates/ecom/Dockerfile +53 -0
  24. package/templates/ecom/README.md +92 -0
  25. package/templates/ecom/_gitignore +9 -0
  26. package/templates/ecom/alpic.json +3 -0
  27. package/templates/ecom/node_modules/.bin/alpic +21 -0
  28. package/templates/ecom/node_modules/.bin/ladle +21 -0
  29. package/templates/ecom/node_modules/.bin/sb +21 -0
  30. package/templates/ecom/node_modules/.bin/skybridge +21 -0
  31. package/templates/ecom/node_modules/.bin/tsc +21 -0
  32. package/templates/ecom/node_modules/.bin/tsserver +21 -0
  33. package/templates/ecom/node_modules/.bin/tsx +21 -0
  34. package/templates/ecom/node_modules/.bin/vite +21 -0
  35. package/templates/ecom/package.json +41 -0
  36. package/templates/ecom/src/components/view-frame.css.ts +24 -0
  37. package/templates/ecom/src/components/view-frame.tsx +27 -0
  38. package/templates/ecom/src/config.ts +12 -0
  39. package/templates/ecom/src/design/contract.css.ts +39 -0
  40. package/templates/ecom/src/design/fonts.css +15 -0
  41. package/templates/ecom/src/design/primitives.css.ts +101 -0
  42. package/templates/ecom/src/design/recipes/typography.css.ts +75 -0
  43. package/templates/ecom/src/design/sprinkles.css.ts +128 -0
  44. package/templates/ecom/src/design/themes/dark.css.ts +36 -0
  45. package/templates/ecom/src/design/themes/light.css.ts +36 -0
  46. package/templates/ecom/src/design/tokens.ts +8 -0
  47. package/templates/ecom/src/helpers.ts +4 -0
  48. package/templates/ecom/src/index.css +9 -0
  49. package/templates/ecom/src/lib/cx.ts +9 -0
  50. package/templates/ecom/src/server.ts +43 -0
  51. package/templates/ecom/src/tools/render-carousel.ts +241 -0
  52. package/templates/ecom/src/tools/search-products.ts +182 -0
  53. package/templates/ecom/src/types.ts +13 -0
  54. package/templates/ecom/src/views/carousel/index.tsx +31 -0
  55. package/templates/ecom/tsconfig.json +11 -0
  56. package/templates/ecom/vite.config.ts +8 -0
@@ -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/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/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/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/node_modules/alpic/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/alpic@1.148.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.8.0_@opentelemetry+api@1.9_dc7708ba103efafb508db02d69c9f925/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/../alpic/bin/run.js" "$@"
19
+ else
20
+ exec node "$basedir/../alpic/bin/run.js" "$@"
21
+ fi
@@ -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_87a889c60e4b1fe9d02c5a43786e65ce/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_87a889c60e4b1fe9d02c5a43786e65ce/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_87a889c60e4b1fe9d02c5a43786e65ce/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_87a889c60e4b1fe9d02c5a43786e65ce/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
@@ -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/node_modules"
14
+ else
15
+ export NODE_PATH="/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/../skybridge/bin/run.js" "$@"
19
+ else
20
+ exec node "$basedir/../skybridge/bin/run.js" "$@"
21
+ fi
@@ -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/node_modules"
14
+ else
15
+ export NODE_PATH="/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/../skybridge/bin/run.js" "$@"
19
+ else
20
+ exec node "$basedir/../skybridge/bin/run.js" "$@"
21
+ fi
@@ -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/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/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/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/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/../typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsc" "$@"
21
+ fi
@@ -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/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/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/typescript@6.0.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@6.0.3/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/../typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsserver" "$@"
21
+ fi
@@ -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/tsx@4.23.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.0/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/tsx@4.23.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.23.0/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/../tsx/dist/cli.mjs" "$@"
19
+ else
20
+ exec node "$basedir/../tsx/dist/cli.mjs" "$@"
21
+ fi
@@ -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/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/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/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@8.1.3_@types+node@24.13.2_esbuild@0.28.1_jiti@2.7.0_terser@5.44.1_tsx@4.23.0_yaml@2.8.2/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/../vite/bin/vite.js" "$@"
19
+ else
20
+ exec node "$basedir/../vite/bin/vite.js" "$@"
21
+ fi
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "skybridge-ecom",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "description": "Skybridge MCP ecommerce template",
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "skybridge dev",
9
+ "dev:tunnel": "skybridge dev --tunnel",
10
+ "build": "skybridge build",
11
+ "start": "skybridge start",
12
+ "deploy": "alpic deploy",
13
+ "ladle": "ladle serve",
14
+ "ladle:build": "ladle build"
15
+ },
16
+ "dependencies": {
17
+ "react": "^19.2.4",
18
+ "react-dom": "^19.2.4",
19
+ "skybridge": "workspace:*",
20
+ "vite": "^8.1.3",
21
+ "zod": "^4.4.3"
22
+ },
23
+ "devDependencies": {
24
+ "@ladle/react": "^5.1.1",
25
+ "@skybridge/devtools": "^1.2.4",
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",
34
+ "alpic": "^1.147.1",
35
+ "tsx": "^4.23.0",
36
+ "typescript": "^6.0.3"
37
+ },
38
+ "engines": {
39
+ "node": ">=24.18.0"
40
+ }
41
+ }
@@ -0,0 +1,24 @@
1
+ import { globalStyle, style } from "@vanilla-extract/css";
2
+ import { colors, primitives } from "../design/tokens";
3
+
4
+ /**
5
+ * Base surface for the frame. Paints the page background (the theme's
6
+ * surface.extraLight, so light and dark each get their own solid color) and
7
+ * pins the design system's font + content color so descendants inherit from
8
+ * the DS, not from the host page (whose text color could be white on a dark
9
+ * host and make card text vanish).
10
+ */
11
+ export const viewFrame = style({
12
+ backgroundColor: colors.surface.extraLight,
13
+ color: colors.content.intense,
14
+ fontFamily: primitives.font.family.primary,
15
+ fontSize: primitives.font.size.m,
16
+ lineHeight: primitives.font.lineHeight.normal,
17
+ WebkitFontSmoothing: "antialiased",
18
+ MozOsxFontSmoothing: "grayscale",
19
+ });
20
+
21
+ // Box-sizing reset scoped to the frame subtree.
22
+ globalStyle(`${viewFrame} *, ${viewFrame} *::before, ${viewFrame} *::after`, {
23
+ boxSizing: "border-box",
24
+ });
@@ -0,0 +1,27 @@
1
+ import type { HTMLAttributes } from "react";
2
+ import { useLayout } from "skybridge/web";
3
+ import { darkTheme, lightTheme } from "../design/tokens";
4
+ import { cx } from "../lib/cx";
5
+ import { viewFrame } from "./view-frame.css";
6
+
7
+ /**
8
+ * ViewFrame: the top-level wrapper every view mounts inside. It activates the
9
+ * design system by applying the active theme class (which sets the CSS
10
+ * variables the color contract declares) and paints the base surface + font +
11
+ * content color so descendants inherit from the DS instead of the host page.
12
+ *
13
+ * It follows the host theme via useLayout(). To lock the widget to one palette
14
+ * (e.g. always light), drop useLayout and hardcode the theme class.
15
+ *
16
+ * Keep view entry files thin: render <ViewFrame> at the root and let this carry
17
+ * the theme + base-style boilerplate.
18
+ */
19
+ type ViewFrameProps = HTMLAttributes<HTMLDivElement>;
20
+
21
+ export function ViewFrame({ className, ...rest }: ViewFrameProps) {
22
+ const { theme } = useLayout();
23
+ const themeClass = theme === "dark" ? darkTheme : lightTheme;
24
+
25
+ return <div {...rest} className={cx(themeClass, viewFrame, className)} />;
26
+ }
27
+ ViewFrame.displayName = "ViewFrame";
@@ -0,0 +1,12 @@
1
+ // App-wide tuning knobs, shared by the server prompt and the tools.
2
+
3
+ // @todo: minimum number of searches the model runs before rendering. Feeds the
4
+ // prompts to enforce multi-call exploration; raise for deeper results.
5
+ export const MIN_SEARCH_ITERATIONS = 2;
6
+
7
+ // @todo: the maximum number of products the carousel shows.
8
+ export const CAROUSEL_MAX_SIZE = 6;
9
+
10
+ // A "min-max" string (e.g. "3-6") derived from CAROUSEL_MAX_SIZE, interpolated
11
+ // into the prompts to tell the model how many products to curate toward.
12
+ export const CAROUSEL_RANGE = `${Math.ceil(CAROUSEL_MAX_SIZE / 2)}-${CAROUSEL_MAX_SIZE}`;
@@ -0,0 +1,39 @@
1
+ import { createThemeContract } from "@vanilla-extract/css";
2
+
3
+ /**
4
+ * Semantic color contract. Every field must be satisfied by both
5
+ * themes/light.css.ts and themes/dark.css.ts: TypeScript errors on drift.
6
+ *
7
+ * Adding a field here forces both themes to set a value. The compiler is the
8
+ * enforcement mechanism that keeps light and dark coherent.
9
+ *
10
+ * @todo: add or remove semantic slots to fit your UI. Keep names intent-based
11
+ * (surface.subtle, content.intense), not literal (grey100): the point is that
12
+ * components reference meaning, and the theme decides the hex.
13
+ */
14
+ export const colors = createThemeContract({
15
+ surface: {
16
+ extraLight: null,
17
+ light: null,
18
+ subtle: null,
19
+ intense: null,
20
+ },
21
+ content: {
22
+ intense: null,
23
+ subtle: null,
24
+ invertIntense: null,
25
+ invertSubtle: null,
26
+ },
27
+ border: {
28
+ thin: null,
29
+ subtle: null,
30
+ intense: null,
31
+ },
32
+ common: {
33
+ accent: null,
34
+ invertAccent: null,
35
+ highlight: null,
36
+ error: null,
37
+ success: null,
38
+ },
39
+ });
@@ -0,0 +1,15 @@
1
+ /* @todo: add your brand's @font-face rules here, then point
2
+ primitives.font.family.primary at the family name. Drop the font files in
3
+ public/fonts/ so they are served under /assets/fonts/.
4
+
5
+ The template ships with the system font stack, which needs no @font-face,
6
+ so this file is empty by default. Example:
7
+
8
+ @font-face {
9
+ font-family: "My Brand";
10
+ font-style: normal;
11
+ font-weight: 400;
12
+ font-display: block;
13
+ src: url("/assets/fonts/MyBrand-Regular.woff2") format("woff2");
14
+ }
15
+ */
@@ -0,0 +1,101 @@
1
+ import { createGlobalTheme } from "@vanilla-extract/css";
2
+
3
+ /**
4
+ * Non-mode-aware design primitives: the raw scales every theme and recipe
5
+ * draws from. Values here are brand-neutral placeholders.
6
+ *
7
+ * @todo: replace these with your brand's real tokens (ideally extracted from
8
+ * a Figma design file). Change values, not the shape: the space/radius/font
9
+ * keys are referenced by sprinkles.css.ts and the recipes. Nothing outside
10
+ * this file should hard-code a hex, size, or spacing value.
11
+ */
12
+ export const primitives = createGlobalTheme(":root", {
13
+ // Spacing scale (4px based). Used for padding, margin, and gap via sprinkles.
14
+ space: {
15
+ none: "0",
16
+ "5xs": "2px",
17
+ "4xs": "4px",
18
+ "3xs": "8px",
19
+ "2xs": "12px",
20
+ xs: "16px",
21
+ s: "24px",
22
+ m: "32px",
23
+ l: "40px",
24
+ xl: "48px",
25
+ "2xl": "56px",
26
+ "3xl": "64px",
27
+ },
28
+ radius: {
29
+ none: "0",
30
+ xs: "2px",
31
+ s: "4px",
32
+ m: "8px",
33
+ l: "16px",
34
+ xl: "32px",
35
+ full: "999px",
36
+ },
37
+ font: {
38
+ family: {
39
+ // @todo: swap in your brand font (add its @font-face to fonts.css). The
40
+ // system stack is the zero-asset default.
41
+ primary:
42
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
43
+ },
44
+ weight: {
45
+ regular: "400",
46
+ medium: "500",
47
+ semibold: "600",
48
+ bold: "700",
49
+ },
50
+ size: {
51
+ xs: "12px",
52
+ s: "14px",
53
+ m: "16px",
54
+ l: "20px",
55
+ xl: "24px",
56
+ "2xl": "32px",
57
+ "3xl": "40px",
58
+ },
59
+ lineHeight: {
60
+ tight: "1.25",
61
+ normal: "1.5",
62
+ },
63
+ letterSpacing: {
64
+ default: "0",
65
+ wide: "0.5px",
66
+ },
67
+ },
68
+ stroke: {
69
+ thin: "1px",
70
+ medium: "1.5px",
71
+ thick: "2px",
72
+ },
73
+ // Raw greyscale ramp. Themes pick from these for surface/content/border.
74
+ grey: {
75
+ white: "#ffffff",
76
+ "50": "#f8f8f8",
77
+ "100": "#f2f2f2",
78
+ "200": "#e1e1e1",
79
+ "300": "#b4b4b4",
80
+ "400": "#929292",
81
+ "500": "#727272",
82
+ "600": "#636363",
83
+ "700": "#4c4c4c",
84
+ "800": "#333333",
85
+ "900": "#1a1a1a",
86
+ black: "#000000",
87
+ },
88
+ // @todo: your brand accent ramp (call-to-action, links, highlights). Steps
89
+ // named by lightness, like the grey ramp; each theme picks the shade that
90
+ // reads well on its surface (light mode the darker step, dark mode the
91
+ // lighter one). Add more steps as needed.
92
+ accent: {
93
+ "400": "#7ba0f5",
94
+ "600": "#3b6cf0",
95
+ },
96
+ // Status colors, shared across themes.
97
+ status: {
98
+ error: "#c53929",
99
+ success: "#5c7d0b",
100
+ },
101
+ });
@@ -0,0 +1,75 @@
1
+ import { recipe } from "@vanilla-extract/recipes";
2
+ import { primitives } from "../primitives.css";
3
+
4
+ /**
5
+ * The one text style, driven by variants. Call it as:
6
+ * text({ style: "headingM", weight: "medium" })
7
+ *
8
+ * `style` picks the size/line-height pair; `weight` picks the font weight.
9
+ * This is the workhorse recipe: use it for all typography rather than setting
10
+ * fontSize/fontWeight by hand.
11
+ *
12
+ * @todo: adjust the styles to your type scale. Add a component recipe (button,
13
+ * tag, card) only when a component has real variants; otherwise style with
14
+ * sprinkles or a `style()` block.
15
+ */
16
+ export const text = recipe({
17
+ base: {
18
+ fontFamily: primitives.font.family.primary,
19
+ letterSpacing: primitives.font.letterSpacing.default,
20
+ fontWeight: primitives.font.weight.regular,
21
+ margin: 0,
22
+ },
23
+ variants: {
24
+ style: {
25
+ display: {
26
+ fontSize: primitives.font.size["3xl"],
27
+ lineHeight: primitives.font.lineHeight.tight,
28
+ },
29
+ headingL: {
30
+ fontSize: primitives.font.size["2xl"],
31
+ lineHeight: primitives.font.lineHeight.tight,
32
+ },
33
+ headingM: {
34
+ fontSize: primitives.font.size.xl,
35
+ lineHeight: primitives.font.lineHeight.tight,
36
+ },
37
+ headingS: {
38
+ fontSize: primitives.font.size.l,
39
+ lineHeight: primitives.font.lineHeight.tight,
40
+ },
41
+ bodyM: {
42
+ fontSize: primitives.font.size.m,
43
+ lineHeight: primitives.font.lineHeight.normal,
44
+ },
45
+ bodyS: {
46
+ fontSize: primitives.font.size.s,
47
+ lineHeight: primitives.font.lineHeight.normal,
48
+ },
49
+ labelM: {
50
+ fontSize: primitives.font.size.m,
51
+ lineHeight: primitives.font.lineHeight.tight,
52
+ },
53
+ labelS: {
54
+ fontSize: primitives.font.size.s,
55
+ lineHeight: primitives.font.lineHeight.tight,
56
+ },
57
+ overline: {
58
+ fontSize: primitives.font.size.xs,
59
+ lineHeight: primitives.font.lineHeight.normal,
60
+ letterSpacing: primitives.font.letterSpacing.wide,
61
+ textTransform: "uppercase",
62
+ },
63
+ },
64
+ weight: {
65
+ regular: { fontWeight: primitives.font.weight.regular },
66
+ medium: { fontWeight: primitives.font.weight.medium },
67
+ semibold: { fontWeight: primitives.font.weight.semibold },
68
+ bold: { fontWeight: primitives.font.weight.bold },
69
+ },
70
+ },
71
+ defaultVariants: {
72
+ style: "bodyM",
73
+ weight: "regular",
74
+ },
75
+ });
@@ -0,0 +1,128 @@
1
+ import { createSprinkles, defineProperties } from "@vanilla-extract/sprinkles";
2
+ import { colors } from "./contract.css";
3
+ import { primitives } from "./primitives.css";
4
+
5
+ /**
6
+ * Atomic style props built on the primitives + color contract. Use sprinkles
7
+ * for one-off layout/spacing/color on an element, e.g.
8
+ * sprinkles({ display: "flex", gap: "s", color: "intense" })
9
+ *
10
+ * Structural component styling belongs in a co-located `.css.ts` `style()`
11
+ * block; sprinkles is the thin glue layer on top.
12
+ */
13
+
14
+ const spaceProperties = defineProperties({
15
+ properties: {
16
+ padding: primitives.space,
17
+ paddingTop: primitives.space,
18
+ paddingRight: primitives.space,
19
+ paddingBottom: primitives.space,
20
+ paddingLeft: primitives.space,
21
+ margin: primitives.space,
22
+ marginTop: primitives.space,
23
+ marginRight: primitives.space,
24
+ marginBottom: primitives.space,
25
+ marginLeft: primitives.space,
26
+ gap: primitives.space,
27
+ rowGap: primitives.space,
28
+ columnGap: primitives.space,
29
+ },
30
+ shorthands: {
31
+ p: ["padding"],
32
+ pt: ["paddingTop"],
33
+ pr: ["paddingRight"],
34
+ pb: ["paddingBottom"],
35
+ pl: ["paddingLeft"],
36
+ px: ["paddingLeft", "paddingRight"],
37
+ py: ["paddingTop", "paddingBottom"],
38
+ m: ["margin"],
39
+ mt: ["marginTop"],
40
+ mr: ["marginRight"],
41
+ mb: ["marginBottom"],
42
+ ml: ["marginLeft"],
43
+ mx: ["marginLeft", "marginRight"],
44
+ my: ["marginTop", "marginBottom"],
45
+ },
46
+ });
47
+
48
+ const colorProperties = defineProperties({
49
+ properties: {
50
+ backgroundColor: {
51
+ ...colors.surface,
52
+ accent: colors.common.accent,
53
+ invertAccent: colors.common.invertAccent,
54
+ highlight: colors.common.highlight,
55
+ transparent: "transparent",
56
+ },
57
+ color: {
58
+ ...colors.content,
59
+ accent: colors.common.accent,
60
+ invertAccent: colors.common.invertAccent,
61
+ highlight: colors.common.highlight,
62
+ error: colors.common.error,
63
+ success: colors.common.success,
64
+ },
65
+ borderColor: {
66
+ ...colors.border,
67
+ accent: colors.common.accent,
68
+ invertAccent: colors.common.invertAccent,
69
+ highlight: colors.common.highlight,
70
+ transparent: "transparent",
71
+ },
72
+ },
73
+ });
74
+
75
+ const radiusProperties = defineProperties({
76
+ properties: {
77
+ borderRadius: primitives.radius,
78
+ borderTopLeftRadius: primitives.radius,
79
+ borderTopRightRadius: primitives.radius,
80
+ borderBottomLeftRadius: primitives.radius,
81
+ borderBottomRightRadius: primitives.radius,
82
+ },
83
+ });
84
+
85
+ const typographyProperties = defineProperties({
86
+ properties: {
87
+ fontFamily: primitives.font.family,
88
+ fontWeight: primitives.font.weight,
89
+ fontSize: primitives.font.size,
90
+ lineHeight: primitives.font.lineHeight,
91
+ letterSpacing: primitives.font.letterSpacing,
92
+ },
93
+ });
94
+
95
+ const strokeProperties = defineProperties({
96
+ properties: {
97
+ borderWidth: primitives.stroke,
98
+ },
99
+ });
100
+
101
+ const layoutProperties = defineProperties({
102
+ properties: {
103
+ display: ["none", "flex", "inline-flex", "block", "inline-block", "grid"],
104
+ flexDirection: ["row", "column", "row-reverse", "column-reverse"],
105
+ alignItems: ["flex-start", "center", "flex-end", "stretch", "baseline"],
106
+ justifyContent: [
107
+ "flex-start",
108
+ "center",
109
+ "flex-end",
110
+ "space-between",
111
+ "space-around",
112
+ "space-evenly",
113
+ ],
114
+ flexWrap: ["wrap", "nowrap", "wrap-reverse"],
115
+ textAlign: ["left", "center", "right"],
116
+ },
117
+ });
118
+
119
+ export const sprinkles = createSprinkles(
120
+ spaceProperties,
121
+ colorProperties,
122
+ radiusProperties,
123
+ typographyProperties,
124
+ strokeProperties,
125
+ layoutProperties,
126
+ );
127
+
128
+ export type Sprinkles = Parameters<typeof sprinkles>[0];