@devalok/shilp-sutra 0.45.1 → 0.46.0
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/MIGRATION.md +836 -808
- package/dist/_chunks/chat.js +6 -6
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +5 -5
- package/dist/_chunks/image-preview.js +7 -7
- package/dist/_chunks/success.js +16 -16
- package/dist/composed/activity-feed.js +19 -19
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +31 -31
- package/dist/composed/deadline-indicator.js.map +1 -1
- package/dist/composed/emoji-picker.js +15 -15
- package/dist/composed/file-preview.js +18 -18
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.js +1 -1
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/multi-select-popover.js +1 -1
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/tokens/base.css +6 -0
- package/dist/tokens/index.css +1 -1
- package/dist/tokens/semantic.css +1 -1
- package/dist/tokens/typography.css +10 -0
- package/dist/tokens/utilities.css +6 -0
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +57 -56
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.js +1 -1
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/data-table-body.js +27 -27
- package/dist/ui/data-table-card.js +20 -20
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +40 -36
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +37 -36
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/radio.js +1 -1
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/sidebar.js +7 -7
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +48 -47
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/surface.d.ts +46 -0
- package/dist/ui/surface.d.ts.map +1 -0
- package/dist/ui/surface.js +51 -0
- package/dist/ui/surface.js.map +1 -0
- package/dist/ui/text.js +6 -6
- package/dist/ui/text.js.map +1 -1
- package/docs/components/ui/surface.md +55 -0
- package/fonts/Manrope-Variable.woff2 +0 -0
- package/llms.txt +2 -1
- package/make-kit/components/overview.md +7 -3
- package/make-kit/components/surface.md +60 -0
- package/mcp-manifest.json +91 -2
- package/package.json +6 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +2 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Hn as e } from "../_chunks/primitives.js";
|
|
2
|
+
import { t } from "../_chunks/vendor-utils.js";
|
|
3
|
+
import { cn as n } from "./lib/utils.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/ui/surface.tsx
|
|
7
|
+
var a = t("", {
|
|
8
|
+
variants: {
|
|
9
|
+
elevation: {
|
|
10
|
+
flat: "bg-surface-raised",
|
|
11
|
+
raised: "bg-surface-raised shadow-raised",
|
|
12
|
+
floating: "bg-surface-overlay shadow-floating",
|
|
13
|
+
overlay: "bg-surface-overlay shadow-overlay"
|
|
14
|
+
},
|
|
15
|
+
padding: {
|
|
16
|
+
none: "",
|
|
17
|
+
sm: "p-ds-04",
|
|
18
|
+
md: "p-ds-05",
|
|
19
|
+
lg: "p-ds-06"
|
|
20
|
+
},
|
|
21
|
+
radius: {
|
|
22
|
+
none: "rounded-none",
|
|
23
|
+
control: "rounded-control",
|
|
24
|
+
surface: "rounded-surface",
|
|
25
|
+
overlay: "rounded-overlay",
|
|
26
|
+
pill: "rounded-pill"
|
|
27
|
+
},
|
|
28
|
+
bordered: {
|
|
29
|
+
true: "border border-surface-border-strong",
|
|
30
|
+
false: ""
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
elevation: "raised",
|
|
35
|
+
padding: "none",
|
|
36
|
+
radius: "surface",
|
|
37
|
+
bordered: !1
|
|
38
|
+
}
|
|
39
|
+
}), o = r.forwardRef(({ className: t, elevation: r, padding: o, radius: s, bordered: c, asChild: l = !1, ...u }, d) => (typeof process < "u" && process.env.NODE_ENV !== "production" && c && (r ?? "raised") !== "flat" && console.warn("[shilp-sutra] <Surface> combines `bordered` with a raised `elevation` — the double-edge anti-pattern. Pick one: use elevation=\"flat\" with `bordered`, or drop `bordered` and let the elevation carry the edge."), /* @__PURE__ */ i(l ? e : "div", {
|
|
40
|
+
ref: d,
|
|
41
|
+
className: n(a({
|
|
42
|
+
elevation: r,
|
|
43
|
+
padding: o,
|
|
44
|
+
radius: s,
|
|
45
|
+
bordered: c
|
|
46
|
+
}), t),
|
|
47
|
+
...u
|
|
48
|
+
})));
|
|
49
|
+
o.displayName = "Surface";
|
|
50
|
+
//#endregion
|
|
51
|
+
export { o as Surface, a as surfaceVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.js","names":[],"sources":["../../src/ui/surface.tsx"],"sourcesContent":["// @server-safe\nimport { Slot } from '@primitives/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from './lib/utils'\n\n// Bundlers (Vite, Next.js, webpack) define process.env.NODE_ENV; guard for raw ESM.\ndeclare const process: { env: { NODE_ENV?: string } } | undefined\n\nconst surfaceVariants = cva('', {\n variants: {\n // Elevation binds a surface-bg token to a shadow token — the one axis that\n // matters. `flat` sits on the page with no shadow (pair with `bordered` for a\n // Carbon-Tile edge); `raised` is the card level; `floating`/`overlay` are the\n // popover/menu/toast levels. bg + shadow always move together, so there is no\n // way to produce an un-tokened surface.\n elevation: {\n flat: 'bg-surface-raised',\n raised: 'bg-surface-raised shadow-raised',\n floating: 'bg-surface-overlay shadow-floating',\n overlay: 'bg-surface-overlay shadow-overlay',\n },\n // Simple, symmetric all-side padding — NOT Card's gap model. This is what keeps\n // Surface low-level: a plain box you can drop content into. Reach for Card when\n // you want the header/content/footer slot rhythm.\n padding: {\n none: '',\n sm: 'p-ds-04',\n md: 'p-ds-05',\n lg: 'p-ds-06',\n },\n radius: {\n none: 'rounded-none',\n control: 'rounded-control',\n surface: 'rounded-surface',\n overlay: 'rounded-overlay',\n pill: 'rounded-pill',\n },\n // Border-led edge (Carbon-Tile style). Meant for `elevation=\"flat\"`; combining it\n // with a shadowed elevation is the double-edge anti-pattern and dev-warns below.\n bordered: {\n true: 'border border-surface-border-strong',\n false: '',\n },\n },\n defaultVariants: {\n elevation: 'raised',\n padding: 'none',\n radius: 'surface',\n bordered: false,\n },\n})\n\nexport interface SurfaceProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof surfaceVariants> {\n /** Render as the passed child element (Radix Slot) instead of a `div` — wrap a link,\n * section, or `motion.div` without adding a wrapper node. */\n asChild?: boolean\n}\n\n/**\n * Surface — the low-level elevated container primitive.\n *\n * The building block every panel, card, popover, and toast surface sits on. It owns\n * exactly one job: paint a tokened surface (background + shadow), with optional radius,\n * padding, and border. It has no slots, no color axis, and no motion — those belong to\n * the components composed on top of it (Card = Surface + gap-model padding + slots).\n *\n * **Elevation:** `flat` (bg, no shadow — pair with `bordered`) | `raised` (card level,\n * default) | `floating` (toasts, floating toolbars) | `overlay` (popovers, menus, dialogs).\n *\n * **Padding:** `none` (default) | `sm` (12px) | `md` (16px) | `lg` (24px) — simple all-side.\n *\n * **Edge vs. elevation:** use a shadow (`raised`/`floating`/`overlay`) OR a `bordered`\n * `flat` — never both (the double-edge anti-pattern; dev-warns).\n *\n * @example\n * // A raised panel with comfortable padding:\n * <Surface elevation=\"raised\" padding=\"md\">…</Surface>\n *\n * @example\n * // An on-page, border-led tile (no shadow):\n * <Surface elevation=\"flat\" bordered padding=\"sm\">…</Surface>\n *\n * @example\n * // Wrap a link as the surface itself:\n * <Surface asChild elevation=\"raised\" padding=\"sm\">\n * <a href=\"/upgrade\">…</a>\n * </Surface>\n */\nconst Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n (\n { className, elevation, padding, radius, bordered, asChild = false, ...props },\n ref,\n ) => {\n if (\n typeof process !== 'undefined' &&\n process?.env.NODE_ENV !== 'production' &&\n bordered &&\n (elevation ?? 'raised') !== 'flat'\n ) {\n console.warn(\n '[shilp-sutra] <Surface> combines `bordered` with a raised `elevation` — the double-edge anti-pattern. Pick one: use elevation=\"flat\" with `bordered`, or drop `bordered` and let the elevation carry the edge.',\n )\n }\n const Comp = asChild ? Slot : 'div'\n return (\n <Comp\n ref={ref}\n className={cn(\n surfaceVariants({ elevation, padding, radius, bordered }),\n className,\n )}\n {...props}\n />\n )\n },\n)\nSurface.displayName = 'Surface'\n\nexport { Surface, surfaceVariants }\n"],"mappings":";;;;;;AAUA,IAAM,IAAkB,EAAI,IAAI;CAC9B,UAAU;EAMR,WAAW;GACT,MAAM;GACN,QAAQ;GACR,UAAU;GACV,SAAS;GACV;EAID,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,QAAQ;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACT,SAAS;GACT,MAAM;GACP;EAGD,UAAU;GACR,MAAM;GACN,OAAO;GACR;EACF;CACD,iBAAiB;EACf,WAAW;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACX;CACF,CAAC,EAwCI,IAAU,EAAM,YAElB,EAAE,cAAW,cAAW,YAAS,WAAQ,aAAU,aAAU,IAAO,GAAG,KACvE,OAGE,OAAO,UAAY,OAAA,QAAA,IAAA,aACO,gBAC1B,MACC,KAAa,cAAc,UAE5B,QAAQ,KACN,mNACD,EAID,kBAFW,IAAU,IAAO,OAE5B;CACO;CACL,WAAW,EACT,EAAgB;EAAE;EAAW;EAAS;EAAQ;EAAU,CAAC,EACzD,EACD;CACD,GAAI;CACJ,CAAA,EAGP;AACD,EAAQ,cAAc"}
|
package/dist/ui/text.js
CHANGED
|
@@ -4,12 +4,12 @@ import * as n from "react";
|
|
|
4
4
|
//#region src/ui/text.tsx
|
|
5
5
|
var r = e("font-sans", {
|
|
6
6
|
variants: { variant: {
|
|
7
|
-
"heading-2xl": "text-[length:var(--typo-heading-2xl-size)] font-[number:var(--typo-heading-2xl-weight)] leading-[var(--typo-heading-2xl-leading)] tracking-[var(--typo-heading-2xl-tracking)]",
|
|
8
|
-
"heading-xl": "text-[length:var(--typo-heading-xl-size)] font-[number:var(--typo-heading-xl-weight)] leading-[var(--typo-heading-xl-leading)] tracking-[var(--typo-heading-xl-tracking)]",
|
|
9
|
-
"heading-lg": "text-[length:var(--typo-heading-lg-size)] font-[number:var(--typo-heading-lg-weight)] leading-[var(--typo-heading-lg-leading)] tracking-[var(--typo-heading-lg-tracking)]",
|
|
10
|
-
"heading-md": "text-[length:var(--typo-heading-md-size)] font-[number:var(--typo-heading-md-weight)] leading-[var(--typo-heading-md-leading)] tracking-[var(--typo-heading-md-tracking)]",
|
|
11
|
-
"heading-sm": "text-[length:var(--typo-heading-sm-size)] font-[number:var(--typo-heading-sm-weight)] leading-[var(--typo-heading-sm-leading)] tracking-[var(--typo-heading-sm-tracking)]",
|
|
12
|
-
"heading-xs": "text-[length:var(--typo-heading-xs-size)] font-[number:var(--typo-heading-xs-weight)] leading-[var(--typo-heading-xs-leading)] tracking-[var(--typo-heading-xs-tracking)]",
|
|
7
|
+
"heading-2xl": "font-display text-[length:var(--typo-heading-2xl-size)] font-[number:var(--typo-heading-2xl-weight)] leading-[var(--typo-heading-2xl-leading)] tracking-[var(--typo-heading-2xl-tracking)]",
|
|
8
|
+
"heading-xl": "font-display text-[length:var(--typo-heading-xl-size)] font-[number:var(--typo-heading-xl-weight)] leading-[var(--typo-heading-xl-leading)] tracking-[var(--typo-heading-xl-tracking)]",
|
|
9
|
+
"heading-lg": "font-display text-[length:var(--typo-heading-lg-size)] font-[number:var(--typo-heading-lg-weight)] leading-[var(--typo-heading-lg-leading)] tracking-[var(--typo-heading-lg-tracking)]",
|
|
10
|
+
"heading-md": "font-display text-[length:var(--typo-heading-md-size)] font-[number:var(--typo-heading-md-weight)] leading-[var(--typo-heading-md-leading)] tracking-[var(--typo-heading-md-tracking)]",
|
|
11
|
+
"heading-sm": "font-display text-[length:var(--typo-heading-sm-size)] font-[number:var(--typo-heading-sm-weight)] leading-[var(--typo-heading-sm-leading)] tracking-[var(--typo-heading-sm-tracking)]",
|
|
12
|
+
"heading-xs": "font-display text-[length:var(--typo-heading-xs-size)] font-[number:var(--typo-heading-xs-weight)] leading-[var(--typo-heading-xs-leading)] tracking-[var(--typo-heading-xs-tracking)]",
|
|
13
13
|
"body-lg": "text-[length:var(--typo-body-lg-size)] font-[number:var(--typo-body-lg-weight)] leading-[var(--typo-body-lg-leading)] tracking-[var(--typo-body-lg-tracking)]",
|
|
14
14
|
"body-md": "text-[length:var(--typo-body-md-size)] font-[number:var(--typo-body-md-weight)] leading-[var(--typo-body-md-leading)] tracking-[var(--typo-body-md-tracking)]",
|
|
15
15
|
"body-sm": "text-[length:var(--typo-body-sm-size)] font-[number:var(--typo-body-sm-weight)] leading-[var(--typo-body-sm-leading)] tracking-[var(--typo-body-sm-tracking)]",
|
package/dist/ui/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../src/ui/text.tsx"],"sourcesContent":["// @server-safe\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from './lib/utils'\n\nconst textVariants = cva('font-sans', {\n variants: {\n variant: {\n 'heading-2xl': 'text-[length:var(--typo-heading-2xl-size)] font-[number:var(--typo-heading-2xl-weight)] leading-[var(--typo-heading-2xl-leading)] tracking-[var(--typo-heading-2xl-tracking)]',\n 'heading-xl': 'text-[length:var(--typo-heading-xl-size)] font-[number:var(--typo-heading-xl-weight)] leading-[var(--typo-heading-xl-leading)] tracking-[var(--typo-heading-xl-tracking)]',\n 'heading-lg': 'text-[length:var(--typo-heading-lg-size)] font-[number:var(--typo-heading-lg-weight)] leading-[var(--typo-heading-lg-leading)] tracking-[var(--typo-heading-lg-tracking)]',\n 'heading-md': 'text-[length:var(--typo-heading-md-size)] font-[number:var(--typo-heading-md-weight)] leading-[var(--typo-heading-md-leading)] tracking-[var(--typo-heading-md-tracking)]',\n 'heading-sm': 'text-[length:var(--typo-heading-sm-size)] font-[number:var(--typo-heading-sm-weight)] leading-[var(--typo-heading-sm-leading)] tracking-[var(--typo-heading-sm-tracking)]',\n 'heading-xs': 'text-[length:var(--typo-heading-xs-size)] font-[number:var(--typo-heading-xs-weight)] leading-[var(--typo-heading-xs-leading)] tracking-[var(--typo-heading-xs-tracking)]',\n 'body-lg': 'text-[length:var(--typo-body-lg-size)] font-[number:var(--typo-body-lg-weight)] leading-[var(--typo-body-lg-leading)] tracking-[var(--typo-body-lg-tracking)]',\n 'body-md': 'text-[length:var(--typo-body-md-size)] font-[number:var(--typo-body-md-weight)] leading-[var(--typo-body-md-leading)] tracking-[var(--typo-body-md-tracking)]',\n 'body-sm': 'text-[length:var(--typo-body-sm-size)] font-[number:var(--typo-body-sm-weight)] leading-[var(--typo-body-sm-leading)] tracking-[var(--typo-body-sm-tracking)]',\n 'body-xs': 'text-[length:var(--typo-body-xs-size)] font-[number:var(--typo-body-xs-weight)] leading-[var(--typo-body-xs-leading)] tracking-[var(--typo-body-xs-tracking)]',\n 'label-lg': 'text-[length:var(--typo-label-lg-size)] font-[number:var(--typo-label-lg-weight)] leading-[var(--typo-label-lg-leading)] tracking-[var(--typo-label-lg-tracking)] uppercase',\n 'label-md': 'text-[length:var(--typo-label-md-size)] font-[number:var(--typo-label-md-weight)] leading-[var(--typo-label-md-leading)] tracking-[var(--typo-label-md-tracking)] uppercase',\n 'label-sm': 'text-[length:var(--typo-label-sm-size)] font-[number:var(--typo-label-sm-weight)] leading-[var(--typo-label-sm-leading)] tracking-[var(--typo-label-sm-tracking)] uppercase',\n 'label-xs': 'text-[length:var(--typo-label-xs-size)] font-[number:var(--typo-label-xs-weight)] leading-[var(--typo-label-xs-leading)] tracking-[var(--typo-label-xs-tracking)] uppercase',\n caption: 'text-[length:var(--typo-caption-size)] font-[number:var(--typo-caption-weight)] leading-[var(--typo-caption-leading)] tracking-[var(--typo-caption-tracking)]',\n overline: 'text-[length:var(--typo-overline-size)] font-[number:var(--typo-overline-weight)] leading-[var(--typo-overline-leading)] tracking-[var(--typo-overline-tracking)] uppercase',\n code: 'text-[length:var(--typo-code-size)] font-[number:var(--typo-code-weight)] leading-[var(--typo-code-leading)] tracking-[var(--typo-code-tracking)] font-mono',\n 'label-plain-lg': 'text-[length:var(--typo-label-plain-lg-size)] font-[number:var(--typo-label-plain-lg-weight)] leading-[var(--typo-label-plain-lg-leading)] tracking-[var(--typo-label-plain-lg-tracking)]',\n 'label-plain-md': 'text-[length:var(--typo-label-plain-md-size)] font-[number:var(--typo-label-plain-md-weight)] leading-[var(--typo-label-plain-md-leading)] tracking-[var(--typo-label-plain-md-tracking)]',\n 'label-plain-sm': 'text-[length:var(--typo-label-plain-sm-size)] font-[number:var(--typo-label-plain-sm-weight)] leading-[var(--typo-label-plain-sm-leading)] tracking-[var(--typo-label-plain-sm-tracking)]',\n },\n },\n defaultVariants: {\n variant: 'body-md',\n },\n})\n\ntype TextVariant = NonNullable<VariantProps<typeof textVariants>['variant']>\n\nconst defaultElementMap: Record<TextVariant, keyof React.JSX.IntrinsicElements> = {\n 'heading-2xl': 'h1',\n 'heading-xl': 'h2',\n 'heading-lg': 'h3',\n 'heading-md': 'h4',\n 'heading-sm': 'h5',\n 'heading-xs': 'h6',\n 'body-lg': 'p',\n 'body-md': 'p',\n 'body-sm': 'p',\n 'body-xs': 'p',\n 'label-lg': 'span',\n 'label-md': 'span',\n 'label-sm': 'span',\n 'label-xs': 'span',\n caption: 'span',\n overline: 'span',\n code: 'code',\n 'label-plain-lg': 'span',\n 'label-plain-md': 'span',\n 'label-plain-sm': 'span',\n}\n\n/**\n * Props for Text — a polymorphic typography component covering the full type scale:\n * headings, body, labels, captions, and overlines — with automatic semantic HTML element selection.\n *\n * **Variants (grouped):**\n * - Headings: `heading-2xl` → `h1`, `heading-xl` → `h2`, `heading-lg` → `h3`, etc.\n * - Body: `body-lg` | `body-md` (default) | `body-sm` | `body-xs` → `<p>`\n * - Labels: `label-lg` | `label-md` | `label-sm` | `label-xs` → `<span>` (uppercase)\n * - Misc: `caption` | `overline` → `<span>` (overline is uppercase)\n *\n * **`as` prop:** Override the rendered element. E.g. `<Text variant=\"heading-lg\" as=\"div\">` renders\n * `<div class=\"text-heading-lg ...\">` — useful when you need heading styles on a non-heading element.\n *\n * @example\n * // Page heading:\n * <Text variant=\"heading-2xl\">Welcome to Shilp Sutra</Text>\n *\n * @example\n * // Section label (uppercase, small):\n * <Text variant=\"label-sm\" className=\"text-surface-fg-muted\">Recent activity</Text>\n *\n * @example\n * // Body copy with custom element (renders as <span> for inline use):\n * <Text variant=\"body-sm\" as=\"span\" className=\"text-surface-fg-muted\">\n * Last updated 3 hours ago\n * </Text>\n *\n * @example\n * // Caption under an image or figure:\n * <Text variant=\"caption\" className=\"text-surface-fg-subtle\">Figure 1: System architecture</Text>\n * // These are just a few ways — feel free to combine props creatively!\n */\ntype TextProps<T extends React.ElementType = 'p'> = {\n variant?: TextVariant\n as?: T\n className?: string\n children?: React.ReactNode\n} & Omit<React.ComponentPropsWithRef<T>, 'as' | 'variant' | 'className' | 'children'>\n\n// Polymorphic component type — preserves T across the call site so element-\n// specific props (e.g. `htmlFor` on `as=\"label\"`, `href` on `as=\"a\"`) typecheck.\n// React.forwardRef can't keep a generic parameter live at its export, so we\n// type the implementation loosely and cast the public export to a generic\n// callable. Standard polymorphic-component pattern (same shape as Radix).\ntype TextComponent = (<T extends React.ElementType = 'p'>(\n props: TextProps<T> & { ref?: React.ComponentPropsWithRef<T>['ref'] },\n) => React.ReactElement | null) & { displayName?: string }\n\nconst TextImpl = React.forwardRef<HTMLElement, TextProps>(\n ({ variant = 'body-md', as, className, children, ...props }, ref) => {\n const Component = as || defaultElementMap[variant] || 'p'\n return React.createElement(\n Component,\n { ref, className: cn(textVariants({ variant }), className), ...props },\n children,\n )\n },\n)\nTextImpl.displayName = 'Text'\n\nconst Text = TextImpl as unknown as TextComponent\n\nexport { Text, type TextProps, type TextVariant,textVariants }\n"],"mappings":";;;;AAMA,IAAM,IAAe,EAAI,aAAa;CACpC,UAAU,EACR,SAAS;EACP,eAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,WAAe;EACf,WAAe;EACf,WAAe;EACf,WAAe;EACf,YAAe;EACf,YAAe;EACf,YAAe;EACf,YAAe;EACf,SAAe;EACf,UAAe;EACf,MAAmB;EACnB,kBAAmB;EACnB,kBAAmB;EACnB,kBAAmB;EACpB,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CAAC,EAII,IAA4E;CAChF,eAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,WAAe;CACf,WAAe;CACf,WAAe;CACf,WAAe;CACf,YAAe;CACf,YAAe;CACf,YAAe;CACf,YAAe;CACf,SAAe;CACf,UAAe;CACf,MAAmB;CACnB,kBAAmB;CACnB,kBAAmB;CACnB,kBAAmB;CACpB,EAkDK,IAAW,EAAM,YACpB,EAAE,aAAU,WAAW,OAAI,cAAW,aAAU,GAAG,KAAS,MAAQ;CACnE,IAAM,IAAY,KAAM,EAAkB,MAAY;AACtD,QAAO,EAAM,cACX,GACA;EAAE;EAAK,WAAW,EAAG,EAAa,EAAE,YAAS,CAAC,EAAE,EAAU;EAAE,GAAG;EAAO,EACtE,EACD;EAEJ;AACD,EAAS,cAAc;AAEvB,IAAM,IAAO"}
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/ui/text.tsx"],"sourcesContent":["// @server-safe\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from './lib/utils'\n\nconst textVariants = cva('font-sans', {\n variants: {\n variant: {\n 'heading-2xl': 'font-display text-[length:var(--typo-heading-2xl-size)] font-[number:var(--typo-heading-2xl-weight)] leading-[var(--typo-heading-2xl-leading)] tracking-[var(--typo-heading-2xl-tracking)]',\n 'heading-xl': 'font-display text-[length:var(--typo-heading-xl-size)] font-[number:var(--typo-heading-xl-weight)] leading-[var(--typo-heading-xl-leading)] tracking-[var(--typo-heading-xl-tracking)]',\n 'heading-lg': 'font-display text-[length:var(--typo-heading-lg-size)] font-[number:var(--typo-heading-lg-weight)] leading-[var(--typo-heading-lg-leading)] tracking-[var(--typo-heading-lg-tracking)]',\n 'heading-md': 'font-display text-[length:var(--typo-heading-md-size)] font-[number:var(--typo-heading-md-weight)] leading-[var(--typo-heading-md-leading)] tracking-[var(--typo-heading-md-tracking)]',\n 'heading-sm': 'font-display text-[length:var(--typo-heading-sm-size)] font-[number:var(--typo-heading-sm-weight)] leading-[var(--typo-heading-sm-leading)] tracking-[var(--typo-heading-sm-tracking)]',\n 'heading-xs': 'font-display text-[length:var(--typo-heading-xs-size)] font-[number:var(--typo-heading-xs-weight)] leading-[var(--typo-heading-xs-leading)] tracking-[var(--typo-heading-xs-tracking)]',\n 'body-lg': 'text-[length:var(--typo-body-lg-size)] font-[number:var(--typo-body-lg-weight)] leading-[var(--typo-body-lg-leading)] tracking-[var(--typo-body-lg-tracking)]',\n 'body-md': 'text-[length:var(--typo-body-md-size)] font-[number:var(--typo-body-md-weight)] leading-[var(--typo-body-md-leading)] tracking-[var(--typo-body-md-tracking)]',\n 'body-sm': 'text-[length:var(--typo-body-sm-size)] font-[number:var(--typo-body-sm-weight)] leading-[var(--typo-body-sm-leading)] tracking-[var(--typo-body-sm-tracking)]',\n 'body-xs': 'text-[length:var(--typo-body-xs-size)] font-[number:var(--typo-body-xs-weight)] leading-[var(--typo-body-xs-leading)] tracking-[var(--typo-body-xs-tracking)]',\n 'label-lg': 'text-[length:var(--typo-label-lg-size)] font-[number:var(--typo-label-lg-weight)] leading-[var(--typo-label-lg-leading)] tracking-[var(--typo-label-lg-tracking)] uppercase',\n 'label-md': 'text-[length:var(--typo-label-md-size)] font-[number:var(--typo-label-md-weight)] leading-[var(--typo-label-md-leading)] tracking-[var(--typo-label-md-tracking)] uppercase',\n 'label-sm': 'text-[length:var(--typo-label-sm-size)] font-[number:var(--typo-label-sm-weight)] leading-[var(--typo-label-sm-leading)] tracking-[var(--typo-label-sm-tracking)] uppercase',\n 'label-xs': 'text-[length:var(--typo-label-xs-size)] font-[number:var(--typo-label-xs-weight)] leading-[var(--typo-label-xs-leading)] tracking-[var(--typo-label-xs-tracking)] uppercase',\n caption: 'text-[length:var(--typo-caption-size)] font-[number:var(--typo-caption-weight)] leading-[var(--typo-caption-leading)] tracking-[var(--typo-caption-tracking)]',\n overline: 'text-[length:var(--typo-overline-size)] font-[number:var(--typo-overline-weight)] leading-[var(--typo-overline-leading)] tracking-[var(--typo-overline-tracking)] uppercase',\n code: 'text-[length:var(--typo-code-size)] font-[number:var(--typo-code-weight)] leading-[var(--typo-code-leading)] tracking-[var(--typo-code-tracking)] font-mono',\n 'label-plain-lg': 'text-[length:var(--typo-label-plain-lg-size)] font-[number:var(--typo-label-plain-lg-weight)] leading-[var(--typo-label-plain-lg-leading)] tracking-[var(--typo-label-plain-lg-tracking)]',\n 'label-plain-md': 'text-[length:var(--typo-label-plain-md-size)] font-[number:var(--typo-label-plain-md-weight)] leading-[var(--typo-label-plain-md-leading)] tracking-[var(--typo-label-plain-md-tracking)]',\n 'label-plain-sm': 'text-[length:var(--typo-label-plain-sm-size)] font-[number:var(--typo-label-plain-sm-weight)] leading-[var(--typo-label-plain-sm-leading)] tracking-[var(--typo-label-plain-sm-tracking)]',\n },\n },\n defaultVariants: {\n variant: 'body-md',\n },\n})\n\ntype TextVariant = NonNullable<VariantProps<typeof textVariants>['variant']>\n\nconst defaultElementMap: Record<TextVariant, keyof React.JSX.IntrinsicElements> = {\n 'heading-2xl': 'h1',\n 'heading-xl': 'h2',\n 'heading-lg': 'h3',\n 'heading-md': 'h4',\n 'heading-sm': 'h5',\n 'heading-xs': 'h6',\n 'body-lg': 'p',\n 'body-md': 'p',\n 'body-sm': 'p',\n 'body-xs': 'p',\n 'label-lg': 'span',\n 'label-md': 'span',\n 'label-sm': 'span',\n 'label-xs': 'span',\n caption: 'span',\n overline: 'span',\n code: 'code',\n 'label-plain-lg': 'span',\n 'label-plain-md': 'span',\n 'label-plain-sm': 'span',\n}\n\n/**\n * Props for Text — a polymorphic typography component covering the full type scale:\n * headings, body, labels, captions, and overlines — with automatic semantic HTML element selection.\n *\n * **Variants (grouped):**\n * - Headings: `heading-2xl` → `h1`, `heading-xl` → `h2`, `heading-lg` → `h3`, etc.\n * - Body: `body-lg` | `body-md` (default) | `body-sm` | `body-xs` → `<p>`\n * - Labels: `label-lg` | `label-md` | `label-sm` | `label-xs` → `<span>` (uppercase)\n * - Misc: `caption` | `overline` → `<span>` (overline is uppercase)\n *\n * **`as` prop:** Override the rendered element. E.g. `<Text variant=\"heading-lg\" as=\"div\">` renders\n * `<div class=\"text-heading-lg ...\">` — useful when you need heading styles on a non-heading element.\n *\n * @example\n * // Page heading:\n * <Text variant=\"heading-2xl\">Welcome to Shilp Sutra</Text>\n *\n * @example\n * // Section label (uppercase, small):\n * <Text variant=\"label-sm\" className=\"text-surface-fg-muted\">Recent activity</Text>\n *\n * @example\n * // Body copy with custom element (renders as <span> for inline use):\n * <Text variant=\"body-sm\" as=\"span\" className=\"text-surface-fg-muted\">\n * Last updated 3 hours ago\n * </Text>\n *\n * @example\n * // Caption under an image or figure:\n * <Text variant=\"caption\" className=\"text-surface-fg-subtle\">Figure 1: System architecture</Text>\n * // These are just a few ways — feel free to combine props creatively!\n */\ntype TextProps<T extends React.ElementType = 'p'> = {\n variant?: TextVariant\n as?: T\n className?: string\n children?: React.ReactNode\n} & Omit<React.ComponentPropsWithRef<T>, 'as' | 'variant' | 'className' | 'children'>\n\n// Polymorphic component type — preserves T across the call site so element-\n// specific props (e.g. `htmlFor` on `as=\"label\"`, `href` on `as=\"a\"`) typecheck.\n// React.forwardRef can't keep a generic parameter live at its export, so we\n// type the implementation loosely and cast the public export to a generic\n// callable. Standard polymorphic-component pattern (same shape as Radix).\ntype TextComponent = (<T extends React.ElementType = 'p'>(\n props: TextProps<T> & { ref?: React.ComponentPropsWithRef<T>['ref'] },\n) => React.ReactElement | null) & { displayName?: string }\n\nconst TextImpl = React.forwardRef<HTMLElement, TextProps>(\n ({ variant = 'body-md', as, className, children, ...props }, ref) => {\n const Component = as || defaultElementMap[variant] || 'p'\n return React.createElement(\n Component,\n { ref, className: cn(textVariants({ variant }), className), ...props },\n children,\n )\n },\n)\nTextImpl.displayName = 'Text'\n\nconst Text = TextImpl as unknown as TextComponent\n\nexport { Text, type TextProps, type TextVariant,textVariants }\n"],"mappings":";;;;AAMA,IAAM,IAAe,EAAI,aAAa;CACpC,UAAU,EACR,SAAS;EACP,eAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,cAAe;EACf,WAAe;EACf,WAAe;EACf,WAAe;EACf,WAAe;EACf,YAAe;EACf,YAAe;EACf,YAAe;EACf,YAAe;EACf,SAAe;EACf,UAAe;EACf,MAAmB;EACnB,kBAAmB;EACnB,kBAAmB;EACnB,kBAAmB;EACpB,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CAAC,EAII,IAA4E;CAChF,eAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,cAAe;CACf,WAAe;CACf,WAAe;CACf,WAAe;CACf,WAAe;CACf,YAAe;CACf,YAAe;CACf,YAAe;CACf,YAAe;CACf,SAAe;CACf,UAAe;CACf,MAAmB;CACnB,kBAAmB;CACnB,kBAAmB;CACnB,kBAAmB;CACpB,EAkDK,IAAW,EAAM,YACpB,EAAE,aAAU,WAAW,OAAI,cAAW,aAAU,GAAG,KAAS,MAAQ;CACnE,IAAM,IAAY,KAAM,EAAkB,MAAY;AACtD,QAAO,EAAM,cACX,GACA;EAAE;EAAK,WAAW,EAAG,EAAa,EAAE,YAAS,CAAC,EAAE,EAAU;EAAE,GAAG;EAAO,EACtE,EACD;EAEJ;AACD,EAAS,cAAc;AAEvB,IAAM,IAAO"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Surface
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/surface
|
|
4
|
+
- Server-safe: Yes
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
The low-level elevated container primitive. Owns background + shadow + radius + optional padding and border — nothing else. Card, Popover, Toast, Sheet, and other surfaces compose it.
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
### Surface
|
|
11
|
+
elevation: "flat" | "raised" | "floating" | "overlay"
|
|
12
|
+
padding: "none" | "sm" | "md" | "lg"
|
|
13
|
+
radius: "none" | "control" | "surface" | "overlay" | "pill"
|
|
14
|
+
bordered: "true" | "false"
|
|
15
|
+
asChild: boolean — render as the passed child element (Radix Slot) instead of a div
|
|
16
|
+
|
|
17
|
+
## Defaults
|
|
18
|
+
Surface: elevation="raised", padding="none", radius="surface", bordered=false
|
|
19
|
+
|
|
20
|
+
## Elevation
|
|
21
|
+
flat — bg-surface-raised, no shadow (pair with `bordered` for an on-page tile)
|
|
22
|
+
raised — bg-surface-raised + shadow-raised (card level)
|
|
23
|
+
floating — bg-surface-overlay + shadow-floating (toasts, floating toolbars)
|
|
24
|
+
overlay — bg-surface-overlay + shadow-overlay (popovers, menus, dialogs)
|
|
25
|
+
|
|
26
|
+
## Padding
|
|
27
|
+
none=0 · sm=ds-04 (12px) · md=ds-05 (16px) · lg=ds-06 (24px) — simple all-side (not Card's gap model)
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
```jsx
|
|
31
|
+
// Raised panel with padding
|
|
32
|
+
<Surface elevation="raised" padding="md">…</Surface>
|
|
33
|
+
|
|
34
|
+
// On-page, border-led tile (no shadow)
|
|
35
|
+
<Surface elevation="flat" bordered padding="sm">…</Surface>
|
|
36
|
+
|
|
37
|
+
// The whole surface is a link
|
|
38
|
+
<Surface asChild elevation="raised" padding="sm">
|
|
39
|
+
<a href="/upgrade">Upgrade to Pro</a>
|
|
40
|
+
</Surface>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Composability
|
|
44
|
+
- Server-safe — renders in RSC trees.
|
|
45
|
+
- The base layer: `Card` = Surface + gap-model padding + color edge + header/content/footer slots. Reach for Card when you want that slot rhythm; reach for Surface for a plain elevated box.
|
|
46
|
+
- `asChild` merges the surface classes onto your own element (a link, section, or `motion.div`) with no extra wrapper node.
|
|
47
|
+
- Padding is symmetric all-side. For asymmetric or gap-model spacing, use Card or add your own utilities via `className`.
|
|
48
|
+
|
|
49
|
+
## Gotchas
|
|
50
|
+
- **Edge OR elevation, never both.** Combining `bordered` with a shadowed elevation (raised/floating/overlay) is the double-edge anti-pattern and dev-warns. Use `elevation="flat"` with `bordered`, or drop `bordered` and let the shadow be the edge.
|
|
51
|
+
- `flat` still uses `bg-surface-raised` (a card without a shadow), not the page background — it is a surface, not a hole.
|
|
52
|
+
|
|
53
|
+
## Changes
|
|
54
|
+
### Unreleased
|
|
55
|
+
- **Added** Initial release — `elevation` / `padding` / `radius` / `bordered` / `asChild`. The low-level surface primitive that Card and other surfaces compose.
|
|
Binary file
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @devalok/shilp-sutra
|
|
2
2
|
|
|
3
|
-
> Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.
|
|
3
|
+
> Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.46.0.
|
|
4
4
|
> Built on the same primitives as shadcn/ui but with DIFFERENT prop APIs — never guess from shadcn knowledge; verify every prop.
|
|
5
5
|
> This file is a ROUTER: it tells you what exists and where to get details. Do not look for prop tables here — fetch them per component (MCP tool or per-component doc file below).
|
|
6
6
|
|
|
@@ -100,6 +100,7 @@ Format: `[name](doc path): summary`. Import paths follow `@devalok/shilp-sutra/<
|
|
|
100
100
|
- [stat-flash](docs/components/ui/stat-flash.md)
|
|
101
101
|
- [status-dot](docs/components/ui/status-dot.md)
|
|
102
102
|
- [stepper](docs/components/ui/stepper.md)
|
|
103
|
+
- [surface](docs/components/ui/surface.md): The low-level elevated container primitive
|
|
103
104
|
- [switch](docs/components/ui/switch.md)
|
|
104
105
|
- [table](docs/components/ui/table.md)
|
|
105
106
|
- [table-row-link](docs/components/ui/table-row-link.md)
|
|
@@ -144,8 +144,11 @@ Page wrapper?
|
|
|
144
144
|
Vertical / horizontal stack?
|
|
145
145
|
→ <Stack direction="col|row" gap="ds-*">
|
|
146
146
|
|
|
147
|
-
A
|
|
148
|
-
→ <
|
|
147
|
+
A plain elevated box (no slots)?
|
|
148
|
+
→ <Surface elevation="raised" padding="md"> — the low-level surface Card is built on
|
|
149
|
+
|
|
150
|
+
A card / panel (header / content / footer rhythm)?
|
|
151
|
+
→ <Card> — Surface + gap-model padding + slots
|
|
149
152
|
→ <Card variant="..."> — tinted by color prop
|
|
150
153
|
|
|
151
154
|
A grid?
|
|
@@ -261,6 +264,7 @@ Code?
|
|
|
261
264
|
|---|---|
|
|
262
265
|
| Container | `/ui/container` |
|
|
263
266
|
| Stack | `/ui/stack` |
|
|
267
|
+
| Surface | `/ui/surface` |
|
|
264
268
|
| Card | `/ui/card` |
|
|
265
269
|
| AspectRatio | `/ui/aspect-ratio` |
|
|
266
270
|
| Separator | `/ui/separator` |
|
|
@@ -305,4 +309,4 @@ Code?
|
|
|
305
309
|
|
|
306
310
|
## Per-component guides
|
|
307
311
|
|
|
308
|
-
See `components/{button|card|input|dialog|badge|select|tabs|toast|form|table|dropdown-menu|popover|text|stack|icon}.md` for prop tables, examples, and rules.
|
|
312
|
+
See `components/{button|card|surface|input|dialog|badge|select|tabs|toast|form|table|dropdown-menu|popover|text|stack|icon}.md` for prop tables, examples, and rules.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Surface
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Surface } from '@devalok/shilp-sutra/ui/surface'
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The low-level elevated container. It paints a tokened surface — background + shadow + radius, with optional padding and border — and nothing else. Card, Popover, Toast, and Sheet are built on it.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- You need a plain elevated box (a promo, a callout, a small panel) and don't need Card's header/content/footer slots.
|
|
12
|
+
- You're building a new component that sits on a surface — compose `Surface`, never hand-roll `bg-surface-raised … shadow-raised`.
|
|
13
|
+
|
|
14
|
+
Use `<Card>` instead when you want the gap-model padding rhythm and the `CardHeader`/`CardContent`/`CardFooter` slots. Use raw utilities for nothing — if it's a surface, it's a `Surface`.
|
|
15
|
+
|
|
16
|
+
## Elevation — and which to pick
|
|
17
|
+
|
|
18
|
+
| `elevation` | Surface | Use for |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `flat` | `bg-surface-raised`, no shadow | On-page tiles. Pair with `bordered` for an edge. |
|
|
21
|
+
| `raised` *(default)* | `bg-surface-raised` + `shadow-raised` | Cards, panels — anything sitting on the page. |
|
|
22
|
+
| `floating` | `bg-surface-overlay` + `shadow-floating` | Toasts, floating toolbars. |
|
|
23
|
+
| `overlay` | `bg-surface-overlay` + `shadow-overlay` | Popovers, menus, dialogs. |
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Notes |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `elevation` | `flat \| raised \| floating \| overlay` | `raised` | bg + shadow together. |
|
|
30
|
+
| `padding` | `none \| sm \| md \| lg` | `none` | Simple all-side: 0 / 12 / 16 / 24px. Not Card's gap model. |
|
|
31
|
+
| `radius` | `none \| control \| surface \| overlay \| pill` | `surface` | Maps `rounded-*` tokens. |
|
|
32
|
+
| `bordered` | `boolean` | `false` | Border-led edge. Only for `flat` — see Rules. |
|
|
33
|
+
| `asChild` | `boolean` | `false` | Render as the child element (Slot). |
|
|
34
|
+
|
|
35
|
+
Plus all native `div` props. Server-safe; forwards ref.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
// Raised panel with padding
|
|
41
|
+
<Surface elevation="raised" padding="md">…</Surface>
|
|
42
|
+
|
|
43
|
+
// On-page, border-led tile (no shadow)
|
|
44
|
+
<Surface elevation="flat" bordered padding="sm">…</Surface>
|
|
45
|
+
|
|
46
|
+
// Overlay chrome
|
|
47
|
+
<Surface elevation="overlay" padding="sm" radius="overlay">…</Surface>
|
|
48
|
+
|
|
49
|
+
// The whole surface is a link — no wrapper node
|
|
50
|
+
<Surface asChild elevation="raised" padding="sm">
|
|
51
|
+
<a href="/upgrade">Upgrade to Pro</a>
|
|
52
|
+
</Surface>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
|
|
57
|
+
- **Edge OR elevation, never both.** `bordered` + a shadowed `elevation` is the double-edge anti-pattern (dev-warns). Use `elevation="flat" bordered`, or drop `bordered`.
|
|
58
|
+
- `flat` is still a surface (`bg-surface-raised`), not the page — a card without a shadow, not a hole in the page.
|
|
59
|
+
- Don't reach for `Surface` when you mean `Card` — if you're rebuilding header/content/footer spacing by hand, use `Card`.
|
|
60
|
+
- Padding is symmetric. For anything asymmetric, use `className` or `Card`.
|
package/mcp-manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "./mcp-manifest.schema.json",
|
|
3
3
|
"manifestVersion": "1.0.0",
|
|
4
4
|
"package": "@devalok/shilp-sutra",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.46.0",
|
|
6
6
|
"components": {
|
|
7
7
|
"accordion": {
|
|
8
8
|
"displayName": "Accordion",
|
|
@@ -6370,6 +6370,95 @@
|
|
|
6370
6370
|
}
|
|
6371
6371
|
]
|
|
6372
6372
|
},
|
|
6373
|
+
"surface": {
|
|
6374
|
+
"displayName": "Surface",
|
|
6375
|
+
"tier": "ui",
|
|
6376
|
+
"import": "@devalok/shilp-sutra/ui/surface",
|
|
6377
|
+
"serverSafe": true,
|
|
6378
|
+
"description": "The low-level elevated container primitive. Owns background + shadow + radius + optional padding and border — nothing else. Card, Popover, Toast, Sheet, and other surfaces compose it.",
|
|
6379
|
+
"props": {
|
|
6380
|
+
"elevation": {
|
|
6381
|
+
"type": {
|
|
6382
|
+
"name": "enum",
|
|
6383
|
+
"value": [
|
|
6384
|
+
"flat",
|
|
6385
|
+
"raised",
|
|
6386
|
+
"floating",
|
|
6387
|
+
"overlay"
|
|
6388
|
+
]
|
|
6389
|
+
},
|
|
6390
|
+
"required": false,
|
|
6391
|
+
"defaultValue": "raised"
|
|
6392
|
+
},
|
|
6393
|
+
"padding": {
|
|
6394
|
+
"type": {
|
|
6395
|
+
"name": "enum",
|
|
6396
|
+
"value": [
|
|
6397
|
+
"none",
|
|
6398
|
+
"sm",
|
|
6399
|
+
"md",
|
|
6400
|
+
"lg"
|
|
6401
|
+
]
|
|
6402
|
+
},
|
|
6403
|
+
"required": false,
|
|
6404
|
+
"defaultValue": "none"
|
|
6405
|
+
},
|
|
6406
|
+
"radius": {
|
|
6407
|
+
"type": {
|
|
6408
|
+
"name": "enum",
|
|
6409
|
+
"value": [
|
|
6410
|
+
"none",
|
|
6411
|
+
"control",
|
|
6412
|
+
"surface",
|
|
6413
|
+
"overlay",
|
|
6414
|
+
"pill"
|
|
6415
|
+
]
|
|
6416
|
+
},
|
|
6417
|
+
"required": false,
|
|
6418
|
+
"defaultValue": "surface"
|
|
6419
|
+
},
|
|
6420
|
+
"bordered": {
|
|
6421
|
+
"type": {
|
|
6422
|
+
"name": "enum",
|
|
6423
|
+
"value": [
|
|
6424
|
+
"true",
|
|
6425
|
+
"false"
|
|
6426
|
+
]
|
|
6427
|
+
},
|
|
6428
|
+
"required": false,
|
|
6429
|
+
"defaultValue": false
|
|
6430
|
+
},
|
|
6431
|
+
"asChild": {
|
|
6432
|
+
"type": {
|
|
6433
|
+
"name": "object",
|
|
6434
|
+
"raw": "boolean — render as the passed child element (Radix Slot) instead of a div"
|
|
6435
|
+
},
|
|
6436
|
+
"required": false
|
|
6437
|
+
}
|
|
6438
|
+
},
|
|
6439
|
+
"composition": {
|
|
6440
|
+
"notes": [
|
|
6441
|
+
"Server-safe — renders in RSC trees.",
|
|
6442
|
+
"The base layer: `Card` = Surface + gap-model padding + color edge + header/content/footer slots. Reach for Card when you want that slot rhythm; reach for Surface for a plain elevated box.",
|
|
6443
|
+
"`asChild` merges the surface classes onto your own element (a link, section, or `motion.div`) with no extra wrapper node.",
|
|
6444
|
+
"Padding is symmetric all-side. For asymmetric or gap-model spacing, use Card or add your own utilities via `className`."
|
|
6445
|
+
]
|
|
6446
|
+
},
|
|
6447
|
+
"docPath": "docs/components/ui/surface.md",
|
|
6448
|
+
"defaults": {
|
|
6449
|
+
"elevation": "raised",
|
|
6450
|
+
"padding": "none",
|
|
6451
|
+
"radius": "surface",
|
|
6452
|
+
"bordered": false
|
|
6453
|
+
},
|
|
6454
|
+
"examples": [
|
|
6455
|
+
"// Raised panel with padding\n<Surface elevation=\"raised\" padding=\"md\">…</Surface>\n\n// On-page, border-led tile (no shadow)\n<Surface elevation=\"flat\" bordered padding=\"sm\">…</Surface>\n\n// The whole surface is a link\n<Surface asChild elevation=\"raised\" padding=\"sm\">\n <a href=\"/upgrade\">Upgrade to Pro</a>\n</Surface>"
|
|
6456
|
+
],
|
|
6457
|
+
"gotchas": [
|
|
6458
|
+
"**Edge OR elevation, never both.** Combining `bordered` with a shadowed elevation (raised/floating/overlay) is the double-edge anti-pattern and dev-warns. Use `elevation=\"flat\"` with `bordered`, or drop `bordered` and let the shadow be the edge.",
|
|
6459
|
+
"`flat` still uses `bg-surface-raised` (a card without a shadow), not the page background — it is a surface, not a hole."
|
|
6460
|
+
]
|
|
6461
|
+
},
|
|
6373
6462
|
"switch": {
|
|
6374
6463
|
"displayName": "Switch",
|
|
6375
6464
|
"tier": "ui",
|
|
@@ -11924,7 +12013,7 @@
|
|
|
11924
12013
|
},
|
|
11925
12014
|
{
|
|
11926
12015
|
"name": "--font-display",
|
|
11927
|
-
"value": "\"Inter\", system-ui, sans-serif"
|
|
12016
|
+
"value": "\"Manrope\", \"Inter\", system-ui, sans-serif"
|
|
11928
12017
|
},
|
|
11929
12018
|
{
|
|
11930
12019
|
"name": "--font-body",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devalok/shilp-sutra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Devalok Design System — accessible React components, OKLCH design tokens, and Tailwind 4 CSS-first setup. Ships with AI-agent setup recipes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Devalok Design & Strategy Studios <shilp-sutra@devalok.in>",
|
|
@@ -377,6 +377,11 @@
|
|
|
377
377
|
"import": "./dist/ui/stepper.js",
|
|
378
378
|
"default": "./dist/ui/stepper.js"
|
|
379
379
|
},
|
|
380
|
+
"./ui/surface": {
|
|
381
|
+
"types": "./dist/ui/surface.d.ts",
|
|
382
|
+
"import": "./dist/ui/surface.js",
|
|
383
|
+
"default": "./dist/ui/surface.js"
|
|
384
|
+
},
|
|
380
385
|
"./ui/switch": {
|
|
381
386
|
"types": "./dist/ui/switch.d.ts",
|
|
382
387
|
"import": "./dist/ui/switch.js",
|
package/skill/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: shilp-sutra
|
|
|
3
3
|
description: Add, configure, and use components from Devalok's shilp-sutra design system (@devalok/shilp-sutra) — a Tailwind 4 + React 19 + CVA library with 110+ accessible components, OKLCH design tokens, framer-motion animations, and per-component RSC-safe entry points. Use this skill whenever the user mentions shilp-sutra, Devalok, the @devalok npm scope, or asks to install/add/style/theme UI in any React project that already depends on the package — even if they don't name it explicitly. Use it instead of generic shadcn/ui, MUI, or Chakra knowledge when shilp-sutra is in the project. Covers Next.js (App + Pages), Vite, Astro, Remix, TanStack Start setup playbooks; component API and variant reference; brand token customization; Server Component import patterns; and a troubleshoot tree for the thirteen most common breakages.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.46.0"
|
|
7
7
|
author: Devalok Design & Strategy Studios
|
|
8
8
|
homepage: https://github.com/devalok-design/shilp-sutra
|
|
9
9
|
npm: https://www.npmjs.com/package/@devalok/shilp-sutra
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# @devalok/shilp-sutra
|
|
4
4
|
|
|
5
|
-
> Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.
|
|
5
|
+
> Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.46.0.
|
|
6
6
|
> Built on the same primitives as shadcn/ui but with DIFFERENT prop APIs — never guess from shadcn knowledge; verify every prop.
|
|
7
7
|
> This file is a ROUTER: it tells you what exists and where to get details. Do not look for prop tables here — fetch them per component (MCP tool or per-component doc file below).
|
|
8
8
|
|
|
@@ -102,6 +102,7 @@ Format: `[name](doc path): summary`. Import paths follow `@devalok/shilp-sutra/<
|
|
|
102
102
|
- [stat-flash](docs/components/ui/stat-flash.md)
|
|
103
103
|
- [status-dot](docs/components/ui/status-dot.md)
|
|
104
104
|
- [stepper](docs/components/ui/stepper.md)
|
|
105
|
+
- [surface](docs/components/ui/surface.md): The low-level elevated container primitive
|
|
105
106
|
- [switch](docs/components/ui/switch.md)
|
|
106
107
|
- [table](docs/components/ui/table.md)
|
|
107
108
|
- [table-row-link](docs/components/ui/table-row-link.md)
|