@thesage/ui 0.0.9 → 0.0.10

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.mjs CHANGED
@@ -101,7 +101,7 @@ import * as TogglePrimitive from "@radix-ui/react-toggle";
101
101
  import { cva as cva2 } from "class-variance-authority";
102
102
  import { jsx as jsx3 } from "react/jsx-runtime";
103
103
  var toggleVariants = cva2(
104
- "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",
104
+ "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",
105
105
  {
106
106
  variants: {
107
107
  variant: {
@@ -578,8 +578,8 @@ var studioTokens = {
578
578
  }
579
579
  };
580
580
 
581
- // ../tokens/src/sage.ts
582
- var sageTokens = {
581
+ // ../tokens/src/terra.ts
582
+ var terraTokens = {
583
583
  light: {
584
584
  colors: {
585
585
  // Warm, earthy backgrounds
@@ -731,19 +731,19 @@ var sageTokens = {
731
731
  },
732
732
  typography: {
733
733
  heading: {
734
- fontFamily: "var(--font-sage-serif)",
734
+ fontFamily: "var(--font-terra-serif)",
735
735
  // Lora serif
736
736
  fontWeight: "600",
737
737
  letterSpacing: "-0.01em"
738
738
  },
739
739
  body: {
740
- fontFamily: "var(--font-sage-sans)",
740
+ fontFamily: "var(--font-terra-sans)",
741
741
  // Instrument Sans
742
742
  fontWeight: "400",
743
743
  letterSpacing: "0"
744
744
  },
745
745
  mono: {
746
- fontFamily: "var(--font-sage-mono)",
746
+ fontFamily: "var(--font-terra-mono)",
747
747
  fontWeight: "400",
748
748
  letterSpacing: "0"
749
749
  }
@@ -920,7 +920,7 @@ var fontFamilies = {
920
920
  mono: "Code blocks, technical content"
921
921
  }
922
922
  },
923
- sage: {
923
+ terra: {
924
924
  heading: "Lora",
925
925
  // Serif for elegance
926
926
  body: "Instrument Sans",
@@ -2466,7 +2466,7 @@ var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
2466
2466
  {
2467
2467
  ref,
2468
2468
  className: cn(
2469
- "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",
2469
+ "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",
2470
2470
  className
2471
2471
  ),
2472
2472
  ...props
@@ -2540,7 +2540,7 @@ function Combobox({
2540
2540
  ]
2541
2541
  }
2542
2542
  ) }),
2543
- /* @__PURE__ */ jsx13(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ jsxs4(Command, { children: [
2543
+ /* @__PURE__ */ jsx13(PopoverContent, { className: "w-[--radix-popover-trigger-width] p-0", children: /* @__PURE__ */ jsxs4(Command, { children: [
2544
2544
  /* @__PURE__ */ jsx13(CommandInput, { placeholder: searchPlaceholder }),
2545
2545
  /* @__PURE__ */ jsxs4(CommandList, { children: [
2546
2546
  /* @__PURE__ */ jsx13(CommandEmpty, { children: emptyMessage }),
@@ -5088,7 +5088,7 @@ var DropdownMenuSubTrigger = React36.forwardRef(({ className, inset, children, .
5088
5088
  {
5089
5089
  ref,
5090
5090
  className: cn(
5091
- "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",
5091
+ "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",
5092
5092
  inset && "pl-8",
5093
5093
  className
5094
5094
  ),
@@ -5130,7 +5130,7 @@ var DropdownMenuItem = React36.forwardRef(({ className, inset, ...props }, ref)
5130
5130
  {
5131
5131
  ref,
5132
5132
  className: cn(
5133
- "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",
5133
+ "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",
5134
5134
  inset && "pl-8",
5135
5135
  className
5136
5136
  ),
@@ -5143,7 +5143,7 @@ var DropdownMenuCheckboxItem = React36.forwardRef(({ className, children, checke
5143
5143
  {
5144
5144
  ref,
5145
5145
  className: cn(
5146
- "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",
5146
+ "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",
5147
5147
  className
5148
5148
  ),
5149
5149
  checked,
@@ -5160,7 +5160,7 @@ var DropdownMenuRadioItem = React36.forwardRef(({ className, children, ...props
5160
5160
  {
5161
5161
  ref,
5162
5162
  className: cn(
5163
- "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",
5163
+ "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",
5164
5164
  className
5165
5165
  ),
5166
5166
  ...props,
@@ -7572,8 +7572,15 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7572
7572
  resetCustomColors
7573
7573
  } = useCustomizer();
7574
7574
  const { theme, mode: colorMode, setTheme, setMode } = useThemeStore();
7575
+ const getDefaultPrimary = React58.useCallback((t, m) => {
7576
+ if (t === "volt") return m === "dark" ? voltTokens.dark.colors.primary : voltTokens.light.colors.primary;
7577
+ if (t === "terra") return m === "dark" ? terraTokens.dark.colors.primary : terraTokens.light.colors.primary;
7578
+ return m === "dark" ? studioTokens.dark.colors.primary : studioTokens.light.colors.primary;
7579
+ }, []);
7575
7580
  const currentPalette = getActiveColorPalette(theme, colorMode);
7576
- const [tempPrimaryColor, setTempPrimaryColor] = React58.useState(currentPalette?.primary || "#0a0a0a");
7581
+ const [tempPrimaryColor, setTempPrimaryColor] = React58.useState(
7582
+ currentPalette?.primary || getDefaultPrimary(theme, colorMode)
7583
+ );
7577
7584
  const [tempSecondaryColor, setTempSecondaryColor] = React58.useState(currentPalette?.secondary || "#5a67d8");
7578
7585
  const [tempAccentColor, setTempAccentColor] = React58.useState(currentPalette?.accent || "#ff6b35");
7579
7586
  React58.useEffect(() => {
@@ -7581,8 +7588,10 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7581
7588
  setTempPrimaryColor(currentPalette.primary);
7582
7589
  setTempSecondaryColor(currentPalette.secondary || currentPalette.primary);
7583
7590
  setTempAccentColor(currentPalette.accent || "#ff6b35");
7591
+ } else {
7592
+ setTempPrimaryColor(getDefaultPrimary(theme, colorMode));
7584
7593
  }
7585
- }, [currentPalette]);
7594
+ }, [currentPalette, theme, colorMode, getDefaultPrimary]);
7586
7595
  const handleApplyColor = () => {
7587
7596
  applyColorPalette(theme, colorMode, {
7588
7597
  primary: tempPrimaryColor,
@@ -7592,7 +7601,7 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7592
7601
  };
7593
7602
  const handleResetColors = () => {
7594
7603
  resetCustomColors(theme, colorMode);
7595
- setTempPrimaryColor("#0a0a0a");
7604
+ setTempPrimaryColor(getDefaultPrimary(theme, colorMode));
7596
7605
  setTempSecondaryColor("#5a67d8");
7597
7606
  setTempAccentColor("#ff6b35");
7598
7607
  };
@@ -7681,7 +7690,7 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7681
7690
  /* @__PURE__ */ jsx70("label", { className: "block text-sm font-medium opacity-80 mb-3", children: "Theme" }),
7682
7691
  /* @__PURE__ */ jsx70("div", { className: "grid grid-cols-3 gap-2 mb-3", children: [
7683
7692
  { id: "studio", label: "Studio", icon: /* @__PURE__ */ jsx70(Building2, { className: "w-4 h-4" }) },
7684
- { id: "sage", label: "Sage", icon: /* @__PURE__ */ jsx70(Leaf, { className: "w-4 h-4" }) },
7693
+ { id: "terra", label: "Terra", icon: /* @__PURE__ */ jsx70(Leaf, { className: "w-4 h-4" }) },
7685
7694
  { id: "volt", label: "Volt", icon: /* @__PURE__ */ jsx70(Zap, { className: "w-4 h-4" }) }
7686
7695
  ].map((t) => /* @__PURE__ */ jsxs40(
7687
7696
  "button",
@@ -7707,12 +7716,12 @@ var CustomizerPanel = ({ mode = "full", showMotionIntensity = false }) => {
7707
7716
  /* @__PURE__ */ jsxs40("div", { children: [
7708
7717
  /* @__PURE__ */ jsx70("span", { className: "font-heading", children: "Heading:" }),
7709
7718
  " ",
7710
- theme === "studio" ? "Outfit" : theme === "sage" ? "Lora" : "Space Grotesk"
7719
+ theme === "studio" ? "Outfit" : theme === "terra" ? "Lora" : "Space Grotesk"
7711
7720
  ] }),
7712
7721
  /* @__PURE__ */ jsxs40("div", { children: [
7713
7722
  /* @__PURE__ */ jsx70("span", { className: "font-body", children: "Body:" }),
7714
7723
  " ",
7715
- theme === "studio" ? "Manrope" : theme === "sage" ? "Instrument Sans" : "Space Grotesk"
7724
+ theme === "studio" ? "Manrope" : theme === "terra" ? "Instrument Sans" : "Space Grotesk"
7716
7725
  ] })
7717
7726
  ] })
7718
7727
  ] }),
@@ -11211,7 +11220,7 @@ import { useEffect as useEffect15, useState as useState15 } from "react";
11211
11220
  import { Fragment as Fragment6, jsx as jsx89 } from "react/jsx-runtime";
11212
11221
  var themeTokens = {
11213
11222
  studio: studioTokens,
11214
- sage: sageTokens,
11223
+ terra: terraTokens,
11215
11224
  volt: voltTokens
11216
11225
  };
11217
11226
  var fontFamilies2 = {
@@ -11220,9 +11229,9 @@ var fontFamilies2 = {
11220
11229
  body: "var(--font-studio-body)",
11221
11230
  mono: "var(--font-mono)"
11222
11231
  },
11223
- sage: {
11224
- sans: "var(--font-sage-body)",
11225
- serif: "var(--font-sage-heading)",
11232
+ terra: {
11233
+ sans: "var(--font-terra-body)",
11234
+ serif: "var(--font-terra-heading)",
11226
11235
  mono: "var(--font-mono)"
11227
11236
  },
11228
11237
  volt: {
@@ -11282,7 +11291,7 @@ function getThemeVars(theme, mode) {
11282
11291
  "--effect-shadow-md": effects?.shadow?.md || effects?.shadow?.sm || "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
11283
11292
  "--effect-shadow-lg": effects?.shadow?.lg || effects?.shadow?.md || effects?.shadow?.sm || "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
11284
11293
  // Typography - Font Families
11285
- "--font-heading": fonts?.heading || (theme === "sage" && fonts?.serif ? fonts.serif : fonts?.sans) || "var(--font-studio-heading)",
11294
+ "--font-heading": fonts?.heading || (theme === "terra" && fonts?.serif ? fonts.serif : fonts?.sans) || "var(--font-studio-heading)",
11286
11295
  "--font-body": fonts?.body || fonts?.sans || "var(--font-studio-body)",
11287
11296
  "--font-mono": fonts?.mono || "var(--font-studio-mono)",
11288
11297
  // Motion - These are accessed programmatically via tokens
@@ -11672,6 +11681,128 @@ function generateBreadcrumbs(hash, routeConfig, baseUrl = "#") {
11672
11681
  return breadcrumbs;
11673
11682
  }
11674
11683
 
11684
+ // src/component-registry.ts
11685
+ var BRAND = {
11686
+ productName: "Sage Design Engine",
11687
+ productNameShort: "Sage",
11688
+ themeNames: {
11689
+ organic: "Terra",
11690
+ technical: "Volt",
11691
+ neutral: "Studio"
11692
+ },
11693
+ tagline: "The Solopreneur's Development Stack",
11694
+ mission: "AI-Native components for velocity"
11695
+ };
11696
+ var COMPONENT_REGISTRY = {
11697
+ /**
11698
+ * Total count of all exported UI components from @thesage/ui
11699
+ */
11700
+ totalCount: 89,
11701
+ /**
11702
+ * Core categories following functional organization pattern
11703
+ * (what components DO, not abstract hierarchy)
11704
+ */
11705
+ coreCategories: {
11706
+ actions: {
11707
+ count: 5,
11708
+ description: "Components that trigger behavior",
11709
+ examples: ["Button", "Link", "Toggle", "ToggleGroup", "Magnetic"]
11710
+ },
11711
+ forms: {
11712
+ count: 18,
11713
+ description: "Components that collect user input",
11714
+ examples: ["Input", "Select", "Checkbox", "Switch", "Textarea", "ColorPicker", "SearchBar"]
11715
+ },
11716
+ navigation: {
11717
+ count: 10,
11718
+ description: "Components that help users move through content",
11719
+ examples: ["Tabs", "Breadcrumb", "Pagination", "NavigationMenu", "Command"]
11720
+ },
11721
+ overlays: {
11722
+ count: 11,
11723
+ description: "Components that display contextual content",
11724
+ examples: ["Dialog", "Tooltip", "Popover", "Drawer", "Modal", "Sheet"]
11725
+ },
11726
+ feedback: {
11727
+ count: 7,
11728
+ description: "Components that communicate system state",
11729
+ examples: ["Alert", "Toast", "Progress", "Spinner", "Skeleton"]
11730
+ },
11731
+ "data-display": {
11732
+ count: 16,
11733
+ description: "Components that present information",
11734
+ examples: ["Card", "Table", "Badge", "Avatar", "Heading", "Text", "Code", "Calendar"]
11735
+ },
11736
+ layout: {
11737
+ count: 17,
11738
+ description: "Components for spatial organization",
11739
+ examples: ["Accordion", "Separator", "Stack", "Grid", "Container", "ScrollArea"]
11740
+ }
11741
+ },
11742
+ /**
11743
+ * Specialty categories for advanced interactions and effects
11744
+ */
11745
+ specialtyCategories: {
11746
+ backgrounds: {
11747
+ count: 2,
11748
+ description: "Animated background effects",
11749
+ examples: ["WarpBackground", "FaultyTerminal"]
11750
+ },
11751
+ cursor: {
11752
+ count: 2,
11753
+ description: "Interactive cursor effects",
11754
+ examples: ["SplashCursor", "TargetCursor"]
11755
+ },
11756
+ blocks: {
11757
+ count: 1,
11758
+ description: "Composed page blocks",
11759
+ examples: ["Hero", "OpenGraphCard"]
11760
+ }
11761
+ },
11762
+ /**
11763
+ * Supporting APIs (not counted as components)
11764
+ */
11765
+ supportingAPIs: {
11766
+ providers: ["ThemeProvider"],
11767
+ hooks: ["useTheme", "useMotionPreference", "useForm"],
11768
+ utilities: ["animations", "breadcrumbs", "colors", "utils", "validation", "syntax-parser"],
11769
+ stores: ["themeStore", "customizerStore"]
11770
+ }
11771
+ };
11772
+ var COMPONENT_COUNTS = {
11773
+ core: Object.values(COMPONENT_REGISTRY.coreCategories).reduce(
11774
+ (sum, cat) => sum + cat.count,
11775
+ 0
11776
+ ),
11777
+ // 84
11778
+ specialty: Object.values(COMPONENT_REGISTRY.specialtyCategories).reduce(
11779
+ (sum, cat) => sum + cat.count,
11780
+ 0
11781
+ ),
11782
+ // 5
11783
+ total: COMPONENT_REGISTRY.totalCount
11784
+ // 89
11785
+ };
11786
+ var MARKETING_COPY = {
11787
+ short: "89 production-ready components",
11788
+ medium: "89 components across 7 core categories, plus specialty backgrounds and motion effects",
11789
+ 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."
11790
+ };
11791
+ var DOC_EXAMPLES = {
11792
+ // For overview sections
11793
+ overview: `${COMPONENT_COUNTS.total} components across ${Object.keys(COMPONENT_REGISTRY.coreCategories).length} core categories`,
11794
+ // For detailed breakdowns
11795
+ breakdown: `
11796
+ - **Actions** (${COMPONENT_REGISTRY.coreCategories.actions.count}): ${COMPONENT_REGISTRY.coreCategories.actions.description}
11797
+ - **Forms** (${COMPONENT_REGISTRY.coreCategories.forms.count}): ${COMPONENT_REGISTRY.coreCategories.forms.description}
11798
+ - **Navigation** (${COMPONENT_REGISTRY.coreCategories.navigation.count}): ${COMPONENT_REGISTRY.coreCategories.navigation.description}
11799
+ - **Overlays** (${COMPONENT_REGISTRY.coreCategories.overlays.count}): ${COMPONENT_REGISTRY.coreCategories.overlays.description}
11800
+ - **Feedback** (${COMPONENT_REGISTRY.coreCategories.feedback.count}): ${COMPONENT_REGISTRY.coreCategories.feedback.description}
11801
+ - **Data Display** (${COMPONENT_REGISTRY.coreCategories["data-display"].count}): ${COMPONENT_REGISTRY.coreCategories["data-display"].description}
11802
+ - **Layout** (${COMPONENT_REGISTRY.coreCategories.layout.count}): ${COMPONENT_REGISTRY.coreCategories.layout.description}
11803
+ `.trim()
11804
+ };
11805
+
11675
11806
  // src/components/actions/index.ts
11676
11807
  var actions_exports = {};
11677
11808
  __export(actions_exports, {
@@ -12012,6 +12143,7 @@ export {
12012
12143
  Avatar,
12013
12144
  AvatarFallback,
12014
12145
  AvatarImage,
12146
+ BRAND,
12015
12147
  backgrounds_exports as Backgrounds,
12016
12148
  Badge,
12017
12149
  Brand,
@@ -12024,6 +12156,8 @@ export {
12024
12156
  BreadcrumbSeparator,
12025
12157
  Breadcrumbs,
12026
12158
  Button,
12159
+ COMPONENT_COUNTS,
12160
+ COMPONENT_REGISTRY,
12027
12161
  Calendar,
12028
12162
  Card,
12029
12163
  CardContent,
@@ -12070,6 +12204,7 @@ export {
12070
12204
  ContextMenuSubTrigger,
12071
12205
  ContextMenuTrigger,
12072
12206
  CustomizerPanel,
12207
+ DOC_EXAMPLES,
12073
12208
  data_display_exports as DataDisplay,
12074
12209
  DataTable,
12075
12210
  DatePicker,
@@ -12143,6 +12278,7 @@ export {
12143
12278
  Label,
12144
12279
  layout_exports as Layout,
12145
12280
  Link,
12281
+ MARKETING_COPY,
12146
12282
  Magnetic,
12147
12283
  Menubar,
12148
12284
  MenubarContent,