@thesage/ui 0.0.9 → 0.0.11

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/dist/index.js CHANGED
@@ -56,6 +56,7 @@ __export(index_exports, {
56
56
  Avatar: () => Avatar,
57
57
  AvatarFallback: () => AvatarFallback,
58
58
  AvatarImage: () => AvatarImage,
59
+ BRAND: () => BRAND,
59
60
  Backgrounds: () => backgrounds_exports,
60
61
  Badge: () => Badge,
61
62
  Brand: () => Brand,
@@ -68,6 +69,8 @@ __export(index_exports, {
68
69
  BreadcrumbSeparator: () => BreadcrumbSeparator,
69
70
  Breadcrumbs: () => Breadcrumbs,
70
71
  Button: () => Button,
72
+ COMPONENT_COUNTS: () => COMPONENT_COUNTS,
73
+ COMPONENT_REGISTRY: () => COMPONENT_REGISTRY,
71
74
  Calendar: () => Calendar,
72
75
  Card: () => Card,
73
76
  CardContent: () => CardContent,
@@ -114,6 +117,7 @@ __export(index_exports, {
114
117
  ContextMenuSubTrigger: () => ContextMenuSubTrigger,
115
118
  ContextMenuTrigger: () => ContextMenuTrigger,
116
119
  CustomizerPanel: () => CustomizerPanel,
120
+ DOC_EXAMPLES: () => DOC_EXAMPLES,
117
121
  DataDisplay: () => data_display_exports,
118
122
  DataTable: () => DataTable,
119
123
  DatePicker: () => DatePicker,
@@ -187,6 +191,7 @@ __export(index_exports, {
187
191
  Label: () => Label,
188
192
  Layout: () => layout_exports,
189
193
  Link: () => Link,
194
+ MARKETING_COPY: () => MARKETING_COPY,
190
195
  Magnetic: () => Magnetic,
191
196
  Menubar: () => Menubar,
192
197
  MenubarContent: () => MenubarContent,
@@ -458,7 +463,7 @@ var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"));
458
463
  var import_class_variance_authority2 = require("class-variance-authority");
459
464
  var import_jsx_runtime3 = require("react/jsx-runtime");
460
465
  var toggleVariants = (0, import_class_variance_authority2.cva)(
461
- "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
466
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",
462
467
  {
463
468
  variants: {
464
469
  variant: {
@@ -935,8 +940,8 @@ var studioTokens = {
935
940
  }
936
941
  };
937
942
 
938
- // ../tokens/src/sage.ts
939
- var sageTokens = {
943
+ // ../tokens/src/terra.ts
944
+ var terraTokens = {
940
945
  light: {
941
946
  colors: {
942
947
  // Warm, earthy backgrounds
@@ -1088,19 +1093,19 @@ var sageTokens = {
1088
1093
  },
1089
1094
  typography: {
1090
1095
  heading: {
1091
- fontFamily: "var(--font-sage-serif)",
1096
+ fontFamily: "var(--font-terra-serif)",
1092
1097
  // Lora serif
1093
1098
  fontWeight: "600",
1094
1099
  letterSpacing: "-0.01em"
1095
1100
  },
1096
1101
  body: {
1097
- fontFamily: "var(--font-sage-sans)",
1102
+ fontFamily: "var(--font-terra-sans)",
1098
1103
  // Instrument Sans
1099
1104
  fontWeight: "400",
1100
1105
  letterSpacing: "0"
1101
1106
  },
1102
1107
  mono: {
1103
- fontFamily: "var(--font-sage-mono)",
1108
+ fontFamily: "var(--font-terra-mono)",
1104
1109
  fontWeight: "400",
1105
1110
  letterSpacing: "0"
1106
1111
  }
@@ -1277,7 +1282,7 @@ var fontFamilies = {
1277
1282
  mono: "Code blocks, technical content"
1278
1283
  }
1279
1284
  },
1280
- sage: {
1285
+ terra: {
1281
1286
  heading: "Lora",
1282
1287
  // Serif for elegance
1283
1288
  body: "Instrument Sans",
@@ -2823,7 +2828,7 @@ var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
2823
2828
  {
2824
2829
  ref,
2825
2830
  className: cn(
2826
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
2831
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground data-[disabled=true]:opacity-50",
2827
2832
  className
2828
2833
  ),
2829
2834
  ...props
@@ -2897,7 +2902,7 @@ function Combobox({
2897
2902
  ]
2898
2903
  }
2899
2904
  ) }),
2900
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Command, { children: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverContent, { className: "w-[--radix-popover-trigger-width] p-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Command, { children: [
2901
2906
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandInput, { placeholder: searchPlaceholder }),
2902
2907
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(CommandList, { children: [
2903
2908
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandEmpty, { children: emptyMessage }),
@@ -5411,7 +5416,7 @@ var DropdownMenuSubTrigger = React36.forwardRef(({ className, inset, children, .
5411
5416
  {
5412
5417
  ref,
5413
5418
  className: cn(
5414
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
5419
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-primary focus:text-primary-foreground data-[state=open]:bg-primary data-[state=open]:text-primary-foreground",
5415
5420
  inset && "pl-8",
5416
5421
  className
5417
5422
  ),
@@ -5453,7 +5458,7 @@ var DropdownMenuItem = React36.forwardRef(({ className, inset, ...props }, ref)
5453
5458
  {
5454
5459
  ref,
5455
5460
  className: cn(
5456
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5461
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5457
5462
  inset && "pl-8",
5458
5463
  className
5459
5464
  ),
@@ -5466,7 +5471,7 @@ var DropdownMenuCheckboxItem = React36.forwardRef(({ className, children, checke
5466
5471
  {
5467
5472
  ref,
5468
5473
  className: cn(
5469
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5474
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5470
5475
  className
5471
5476
  ),
5472
5477
  checked,
@@ -5483,7 +5488,7 @@ var DropdownMenuRadioItem = React36.forwardRef(({ className, children, ...props
5483
5488
  {
5484
5489
  ref,
5485
5490
  className: cn(
5486
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5491
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
5487
5492
  className
5488
5493
  ),
5489
5494
  ...props,
@@ -7889,8 +7894,15 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7889
7894
  resetCustomColors
7890
7895
  } = useCustomizer();
7891
7896
  const { theme, mode: colorMode, setTheme, setMode } = useThemeStore();
7897
+ const getDefaultPrimary = import_react28.default.useCallback((t, m) => {
7898
+ if (t === "volt") return m === "dark" ? voltTokens.dark.colors.primary : voltTokens.light.colors.primary;
7899
+ if (t === "terra") return m === "dark" ? terraTokens.dark.colors.primary : terraTokens.light.colors.primary;
7900
+ return m === "dark" ? studioTokens.dark.colors.primary : studioTokens.light.colors.primary;
7901
+ }, []);
7892
7902
  const currentPalette = getActiveColorPalette(theme, colorMode);
7893
- const [tempPrimaryColor, setTempPrimaryColor] = import_react28.default.useState(currentPalette?.primary || "#0a0a0a");
7903
+ const [tempPrimaryColor, setTempPrimaryColor] = import_react28.default.useState(
7904
+ currentPalette?.primary || getDefaultPrimary(theme, colorMode)
7905
+ );
7894
7906
  const [tempSecondaryColor, setTempSecondaryColor] = import_react28.default.useState(currentPalette?.secondary || "#5a67d8");
7895
7907
  const [tempAccentColor, setTempAccentColor] = import_react28.default.useState(currentPalette?.accent || "#ff6b35");
7896
7908
  import_react28.default.useEffect(() => {
@@ -7898,8 +7910,10 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7898
7910
  setTempPrimaryColor(currentPalette.primary);
7899
7911
  setTempSecondaryColor(currentPalette.secondary || currentPalette.primary);
7900
7912
  setTempAccentColor(currentPalette.accent || "#ff6b35");
7913
+ } else {
7914
+ setTempPrimaryColor(getDefaultPrimary(theme, colorMode));
7901
7915
  }
7902
- }, [currentPalette]);
7916
+ }, [currentPalette, theme, colorMode, getDefaultPrimary]);
7903
7917
  const handleApplyColor = () => {
7904
7918
  applyColorPalette(theme, colorMode, {
7905
7919
  primary: tempPrimaryColor,
@@ -7909,7 +7923,7 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7909
7923
  };
7910
7924
  const handleResetColors = () => {
7911
7925
  resetCustomColors(theme, colorMode);
7912
- setTempPrimaryColor("#0a0a0a");
7926
+ setTempPrimaryColor(getDefaultPrimary(theme, colorMode));
7913
7927
  setTempSecondaryColor("#5a67d8");
7914
7928
  setTempAccentColor("#ff6b35");
7915
7929
  };
@@ -7998,7 +8012,7 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7998
8012
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("label", { className: "block text-sm font-medium opacity-80 mb-3", children: "Theme" }),
7999
8013
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "grid grid-cols-3 gap-2 mb-3", children: [
8000
8014
  { id: "studio", label: "Studio", icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react18.Building2, { className: "w-4 h-4" }) },
8001
- { id: "sage", label: "Sage", icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react18.Leaf, { className: "w-4 h-4" }) },
8015
+ { id: "terra", label: "Terra", icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react18.Leaf, { className: "w-4 h-4" }) },
8002
8016
  { id: "volt", label: "Volt", icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react18.Zap, { className: "w-4 h-4" }) }
8003
8017
  ].map((t) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
8004
8018
  "button",
@@ -8024,12 +8038,12 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
8024
8038
  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { children: [
8025
8039
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "font-heading", children: "Heading:" }),
8026
8040
  " ",
8027
- theme === "studio" ? "Outfit" : theme === "sage" ? "Lora" : "Space Grotesk"
8041
+ theme === "studio" ? "Outfit" : theme === "terra" ? "Lora" : "Space Grotesk"
8028
8042
  ] }),
8029
8043
  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { children: [
8030
8044
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "font-body", children: "Body:" }),
8031
8045
  " ",
8032
- theme === "studio" ? "Manrope" : theme === "sage" ? "Instrument Sans" : "Space Grotesk"
8046
+ theme === "studio" ? "Manrope" : theme === "terra" ? "Instrument Sans" : "Space Grotesk"
8033
8047
  ] })
8034
8048
  ] })
8035
8049
  ] }),
@@ -11528,7 +11542,7 @@ var import_react39 = require("react");
11528
11542
  var import_jsx_runtime89 = require("react/jsx-runtime");
11529
11543
  var themeTokens = {
11530
11544
  studio: studioTokens,
11531
- sage: sageTokens,
11545
+ terra: terraTokens,
11532
11546
  volt: voltTokens
11533
11547
  };
11534
11548
  var fontFamilies2 = {
@@ -11537,9 +11551,9 @@ var fontFamilies2 = {
11537
11551
  body: "var(--font-studio-body)",
11538
11552
  mono: "var(--font-mono)"
11539
11553
  },
11540
- sage: {
11541
- sans: "var(--font-sage-body)",
11542
- serif: "var(--font-sage-heading)",
11554
+ terra: {
11555
+ sans: "var(--font-terra-body)",
11556
+ serif: "var(--font-terra-heading)",
11543
11557
  mono: "var(--font-mono)"
11544
11558
  },
11545
11559
  volt: {
@@ -11599,7 +11613,7 @@ function getThemeVars(theme, mode) {
11599
11613
  "--effect-shadow-md": effects?.shadow?.md || effects?.shadow?.sm || "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
11600
11614
  "--effect-shadow-lg": effects?.shadow?.lg || effects?.shadow?.md || effects?.shadow?.sm || "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
11601
11615
  // Typography - Font Families
11602
- "--font-heading": fonts?.heading || (theme === "sage" && fonts?.serif ? fonts.serif : fonts?.sans) || "var(--font-studio-heading)",
11616
+ "--font-heading": fonts?.heading || (theme === "terra" && fonts?.serif ? fonts.serif : fonts?.sans) || "var(--font-studio-heading)",
11603
11617
  "--font-body": fonts?.body || fonts?.sans || "var(--font-studio-body)",
11604
11618
  "--font-mono": fonts?.mono || "var(--font-studio-mono)",
11605
11619
  // Motion - These are accessed programmatically via tokens
@@ -11989,6 +12003,128 @@ function generateBreadcrumbs(hash, routeConfig, baseUrl = "#") {
11989
12003
  return breadcrumbs;
11990
12004
  }
11991
12005
 
12006
+ // src/component-registry.ts
12007
+ var BRAND = {
12008
+ productName: "Sage Design Engine",
12009
+ productNameShort: "Sage",
12010
+ themeNames: {
12011
+ organic: "Terra",
12012
+ technical: "Volt",
12013
+ neutral: "Studio"
12014
+ },
12015
+ tagline: "The Solopreneur's Development Stack",
12016
+ mission: "AI-Native components for velocity"
12017
+ };
12018
+ var COMPONENT_REGISTRY = {
12019
+ /**
12020
+ * Total count of all exported UI components from @thesage/ui
12021
+ */
12022
+ totalCount: 89,
12023
+ /**
12024
+ * Core categories following functional organization pattern
12025
+ * (what components DO, not abstract hierarchy)
12026
+ */
12027
+ coreCategories: {
12028
+ actions: {
12029
+ count: 5,
12030
+ description: "Components that trigger behavior",
12031
+ examples: ["Button", "Link", "Toggle", "ToggleGroup", "Magnetic"]
12032
+ },
12033
+ forms: {
12034
+ count: 18,
12035
+ description: "Components that collect user input",
12036
+ examples: ["Input", "Select", "Checkbox", "Switch", "Textarea", "ColorPicker", "SearchBar"]
12037
+ },
12038
+ navigation: {
12039
+ count: 10,
12040
+ description: "Components that help users move through content",
12041
+ examples: ["Tabs", "Breadcrumb", "Pagination", "NavigationMenu", "Command"]
12042
+ },
12043
+ overlays: {
12044
+ count: 11,
12045
+ description: "Components that display contextual content",
12046
+ examples: ["Dialog", "Tooltip", "Popover", "Drawer", "Modal", "Sheet"]
12047
+ },
12048
+ feedback: {
12049
+ count: 7,
12050
+ description: "Components that communicate system state",
12051
+ examples: ["Alert", "Toast", "Progress", "Spinner", "Skeleton"]
12052
+ },
12053
+ "data-display": {
12054
+ count: 16,
12055
+ description: "Components that present information",
12056
+ examples: ["Card", "Table", "Badge", "Avatar", "Heading", "Text", "Code", "Calendar"]
12057
+ },
12058
+ layout: {
12059
+ count: 17,
12060
+ description: "Components for spatial organization",
12061
+ examples: ["Accordion", "Separator", "Stack", "Grid", "Container", "ScrollArea"]
12062
+ }
12063
+ },
12064
+ /**
12065
+ * Specialty categories for advanced interactions and effects
12066
+ */
12067
+ specialtyCategories: {
12068
+ backgrounds: {
12069
+ count: 2,
12070
+ description: "Animated background effects",
12071
+ examples: ["WarpBackground", "FaultyTerminal"]
12072
+ },
12073
+ cursor: {
12074
+ count: 2,
12075
+ description: "Interactive cursor effects",
12076
+ examples: ["SplashCursor", "TargetCursor"]
12077
+ },
12078
+ blocks: {
12079
+ count: 1,
12080
+ description: "Composed page blocks",
12081
+ examples: ["Hero", "OpenGraphCard"]
12082
+ }
12083
+ },
12084
+ /**
12085
+ * Supporting APIs (not counted as components)
12086
+ */
12087
+ supportingAPIs: {
12088
+ providers: ["ThemeProvider"],
12089
+ hooks: ["useTheme", "useMotionPreference", "useForm"],
12090
+ utilities: ["animations", "breadcrumbs", "colors", "utils", "validation", "syntax-parser"],
12091
+ stores: ["themeStore", "customizerStore"]
12092
+ }
12093
+ };
12094
+ var COMPONENT_COUNTS = {
12095
+ core: Object.values(COMPONENT_REGISTRY.coreCategories).reduce(
12096
+ (sum, cat) => sum + cat.count,
12097
+ 0
12098
+ ),
12099
+ // 84
12100
+ specialty: Object.values(COMPONENT_REGISTRY.specialtyCategories).reduce(
12101
+ (sum, cat) => sum + cat.count,
12102
+ 0
12103
+ ),
12104
+ // 5
12105
+ total: COMPONENT_REGISTRY.totalCount
12106
+ // 89
12107
+ };
12108
+ var MARKETING_COPY = {
12109
+ short: "89 production-ready components",
12110
+ medium: "89 components across 7 core categories, plus specialty backgrounds and motion effects",
12111
+ long: "89 thoughtfully designed components organized by function: actions, forms, navigation, overlays, feedback, data display, and layout\u2014plus specialty components for backgrounds, cursor interactions, and animated effects."
12112
+ };
12113
+ var DOC_EXAMPLES = {
12114
+ // For overview sections
12115
+ overview: `${COMPONENT_COUNTS.total} components across ${Object.keys(COMPONENT_REGISTRY.coreCategories).length} core categories`,
12116
+ // For detailed breakdowns
12117
+ breakdown: `
12118
+ - **Actions** (${COMPONENT_REGISTRY.coreCategories.actions.count}): ${COMPONENT_REGISTRY.coreCategories.actions.description}
12119
+ - **Forms** (${COMPONENT_REGISTRY.coreCategories.forms.count}): ${COMPONENT_REGISTRY.coreCategories.forms.description}
12120
+ - **Navigation** (${COMPONENT_REGISTRY.coreCategories.navigation.count}): ${COMPONENT_REGISTRY.coreCategories.navigation.description}
12121
+ - **Overlays** (${COMPONENT_REGISTRY.coreCategories.overlays.count}): ${COMPONENT_REGISTRY.coreCategories.overlays.description}
12122
+ - **Feedback** (${COMPONENT_REGISTRY.coreCategories.feedback.count}): ${COMPONENT_REGISTRY.coreCategories.feedback.description}
12123
+ - **Data Display** (${COMPONENT_REGISTRY.coreCategories["data-display"].count}): ${COMPONENT_REGISTRY.coreCategories["data-display"].description}
12124
+ - **Layout** (${COMPONENT_REGISTRY.coreCategories.layout.count}): ${COMPONENT_REGISTRY.coreCategories.layout.description}
12125
+ `.trim()
12126
+ };
12127
+
11992
12128
  // src/components/actions/index.ts
11993
12129
  var actions_exports = {};
11994
12130
  __export(actions_exports, {
@@ -12330,6 +12466,7 @@ __export(providers_exports, {
12330
12466
  Avatar,
12331
12467
  AvatarFallback,
12332
12468
  AvatarImage,
12469
+ BRAND,
12333
12470
  Backgrounds,
12334
12471
  Badge,
12335
12472
  Brand,
@@ -12342,6 +12479,8 @@ __export(providers_exports, {
12342
12479
  BreadcrumbSeparator,
12343
12480
  Breadcrumbs,
12344
12481
  Button,
12482
+ COMPONENT_COUNTS,
12483
+ COMPONENT_REGISTRY,
12345
12484
  Calendar,
12346
12485
  Card,
12347
12486
  CardContent,
@@ -12388,6 +12527,7 @@ __export(providers_exports, {
12388
12527
  ContextMenuSubTrigger,
12389
12528
  ContextMenuTrigger,
12390
12529
  CustomizerPanel,
12530
+ DOC_EXAMPLES,
12391
12531
  DataDisplay,
12392
12532
  DataTable,
12393
12533
  DatePicker,
@@ -12461,6 +12601,7 @@ __export(providers_exports, {
12461
12601
  Label,
12462
12602
  Layout,
12463
12603
  Link,
12604
+ MARKETING_COPY,
12464
12605
  Magnetic,
12465
12606
  Menubar,
12466
12607
  MenubarContent,