@lucasvu/scope-ui 0.0.3 → 0.0.5

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
@@ -6624,6 +6624,7 @@ var uiAiManifest = {
6624
6624
  styleImport: "@lucasvu/scope-ui/styles.css",
6625
6625
  rules: [
6626
6626
  "Import the stylesheet once at the app entry before rendering any component.",
6627
+ "If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.",
6627
6628
  "Prefer the canonical component for each intent instead of mixing legacy MainFe components.",
6628
6629
  "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.",
6629
6630
  "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.",
@@ -6840,6 +6841,212 @@ var uiAiManifest = {
6840
6841
  };
6841
6842
 
6842
6843
  // src/theme-contract.ts
6844
+ var uiThemePresets = [
6845
+ {
6846
+ id: "ocean",
6847
+ label: "Ocean Glass",
6848
+ description: "Blue-cyan preset with clean glass surfaces. Matches the current default visual language.",
6849
+ recommendedFor: [
6850
+ "Admin dashboards",
6851
+ "SaaS CRUD screens",
6852
+ "Projects that want the existing package look"
6853
+ ],
6854
+ tokens: {
6855
+ light: {
6856
+ "--tw-background": "0 0% 100%",
6857
+ "--tw-foreground": "222.2 47.4% 11.2%",
6858
+ "--tw-primary": "221.2 83.2% 53.3%",
6859
+ "--tw-accent": "199 89% 48%",
6860
+ "--tw-success": "142.1 76.2% 36.3%",
6861
+ "--tw-destructive": "0 84.2% 60.2%",
6862
+ "--tw-border": "214.3 31.8% 91.4%",
6863
+ "--radius": "0.75rem",
6864
+ "--surface": "rgba(255, 255, 255, 0.92)",
6865
+ "--surface-strong": "rgba(241, 245, 249, 0.96)",
6866
+ "--grey": "rgba(248, 250, 252, 0.96)",
6867
+ "--grey-strong": "rgba(241, 245, 249, 0.98)",
6868
+ "--shadow-sm": "0 10px 28px -18px rgba(15, 23, 42, 0.22)",
6869
+ "--shadow": "0 24px 60px -28px rgba(15, 23, 42, 0.3)",
6870
+ "--primary-grad-from": "199 89% 48%",
6871
+ "--primary-grad-to": "221.2 83.2% 53.3%"
6872
+ },
6873
+ dark: {
6874
+ "--tw-background": "222.2 84% 4.9%",
6875
+ "--tw-foreground": "210 40% 98%",
6876
+ "--tw-primary": "217.2 91.2% 59.8%",
6877
+ "--tw-accent": "199 89% 48%",
6878
+ "--tw-success": "142.1 70.6% 45.3%",
6879
+ "--tw-destructive": "0 62.8% 30.6%",
6880
+ "--tw-border": "217.2 32.6% 17.5%",
6881
+ "--radius": "0.75rem",
6882
+ "--surface": "rgba(15, 23, 42, 0.78)",
6883
+ "--surface-strong": "rgba(30, 41, 59, 0.92)",
6884
+ "--grey": "rgba(30, 41, 59, 0.88)",
6885
+ "--grey-strong": "rgba(51, 65, 85, 0.92)",
6886
+ "--shadow-sm": "0 16px 32px -18px rgba(2, 6, 23, 0.48)",
6887
+ "--shadow": "0 28px 80px -32px rgba(2, 6, 23, 0.7)",
6888
+ "--primary-grad-from": "198.6 88.7% 48.4%",
6889
+ "--primary-grad-to": "221.2 83.2% 53.3%"
6890
+ }
6891
+ }
6892
+ },
6893
+ {
6894
+ id: "sunset",
6895
+ label: "Sunset Ember",
6896
+ description: "Warm orange-coral preset with softer cream surfaces for branded landing or growth products.",
6897
+ recommendedFor: [
6898
+ "Growth products",
6899
+ "Commerce backoffices",
6900
+ "Projects that want a warmer visual tone"
6901
+ ],
6902
+ tokens: {
6903
+ light: {
6904
+ "--tw-background": "30 100% 98%",
6905
+ "--tw-foreground": "20 24% 14%",
6906
+ "--tw-primary": "14 90% 56%",
6907
+ "--tw-accent": "29 100% 58%",
6908
+ "--tw-success": "145 63% 38%",
6909
+ "--tw-destructive": "0 78% 58%",
6910
+ "--tw-border": "24 45% 89%",
6911
+ "--radius": "0.85rem",
6912
+ "--surface": "rgba(255, 247, 240, 0.92)",
6913
+ "--surface-strong": "rgba(255, 237, 223, 0.96)",
6914
+ "--grey": "rgba(255, 243, 231, 0.96)",
6915
+ "--grey-strong": "rgba(255, 232, 214, 0.98)",
6916
+ "--shadow-sm": "0 12px 30px -18px rgba(194, 65, 12, 0.18)",
6917
+ "--shadow": "0 28px 64px -30px rgba(154, 52, 18, 0.24)",
6918
+ "--primary-grad-from": "29 100% 58%",
6919
+ "--primary-grad-to": "14 90% 56%"
6920
+ },
6921
+ dark: {
6922
+ "--tw-background": "20 24% 8%",
6923
+ "--tw-foreground": "40 33% 96%",
6924
+ "--tw-primary": "18 100% 62%",
6925
+ "--tw-accent": "35 100% 58%",
6926
+ "--tw-success": "145 60% 47%",
6927
+ "--tw-destructive": "0 73% 52%",
6928
+ "--tw-border": "18 24% 22%",
6929
+ "--radius": "0.85rem",
6930
+ "--surface": "rgba(41, 24, 18, 0.84)",
6931
+ "--surface-strong": "rgba(59, 34, 24, 0.9)",
6932
+ "--grey": "rgba(70, 42, 29, 0.88)",
6933
+ "--grey-strong": "rgba(92, 54, 38, 0.9)",
6934
+ "--shadow-sm": "0 18px 36px -20px rgba(67, 20, 7, 0.48)",
6935
+ "--shadow": "0 30px 84px -34px rgba(67, 20, 7, 0.62)",
6936
+ "--primary-grad-from": "35 100% 58%",
6937
+ "--primary-grad-to": "18 100% 62%"
6938
+ }
6939
+ }
6940
+ },
6941
+ {
6942
+ id: "forest",
6943
+ label: "Forest Mist",
6944
+ description: "Emerald-teal preset with soft botanical surfaces for calmer productivity products.",
6945
+ recommendedFor: [
6946
+ "Operations tools",
6947
+ "Internal platforms",
6948
+ "Products that want a calmer green tone"
6949
+ ],
6950
+ tokens: {
6951
+ light: {
6952
+ "--tw-background": "138 40% 98%",
6953
+ "--tw-foreground": "160 25% 14%",
6954
+ "--tw-primary": "158 64% 40%",
6955
+ "--tw-accent": "173 58% 44%",
6956
+ "--tw-success": "145 63% 36%",
6957
+ "--tw-destructive": "0 78% 58%",
6958
+ "--tw-border": "143 21% 88%",
6959
+ "--radius": "0.8rem",
6960
+ "--surface": "rgba(245, 252, 249, 0.92)",
6961
+ "--surface-strong": "rgba(232, 245, 239, 0.96)",
6962
+ "--grey": "rgba(240, 248, 244, 0.96)",
6963
+ "--grey-strong": "rgba(225, 240, 232, 0.98)",
6964
+ "--shadow-sm": "0 12px 28px -18px rgba(5, 86, 66, 0.18)",
6965
+ "--shadow": "0 26px 62px -30px rgba(6, 78, 59, 0.24)",
6966
+ "--primary-grad-from": "173 58% 44%",
6967
+ "--primary-grad-to": "158 64% 40%"
6968
+ },
6969
+ dark: {
6970
+ "--tw-background": "164 35% 8%",
6971
+ "--tw-foreground": "144 35% 96%",
6972
+ "--tw-primary": "160 70% 46%",
6973
+ "--tw-accent": "174 72% 45%",
6974
+ "--tw-success": "145 68% 46%",
6975
+ "--tw-destructive": "0 70% 52%",
6976
+ "--tw-border": "160 20% 20%",
6977
+ "--radius": "0.8rem",
6978
+ "--surface": "rgba(16, 36, 31, 0.84)",
6979
+ "--surface-strong": "rgba(21, 51, 44, 0.9)",
6980
+ "--grey": "rgba(24, 61, 52, 0.88)",
6981
+ "--grey-strong": "rgba(31, 77, 65, 0.9)",
6982
+ "--shadow-sm": "0 18px 34px -20px rgba(1, 44, 34, 0.48)",
6983
+ "--shadow": "0 30px 82px -34px rgba(1, 44, 34, 0.6)",
6984
+ "--primary-grad-from": "174 72% 45%",
6985
+ "--primary-grad-to": "160 70% 46%"
6986
+ }
6987
+ }
6988
+ },
6989
+ {
6990
+ id: "graphite",
6991
+ label: "Graphite Pulse",
6992
+ description: "Neutral slate preset with restrained blue accents for products that need a steadier enterprise tone.",
6993
+ recommendedFor: [
6994
+ "Enterprise admin panels",
6995
+ "B2B internal tools",
6996
+ "Projects that want a more neutral interface"
6997
+ ],
6998
+ tokens: {
6999
+ light: {
7000
+ "--tw-background": "220 18% 97%",
7001
+ "--tw-foreground": "222 24% 14%",
7002
+ "--tw-primary": "221 24% 32%",
7003
+ "--tw-accent": "198 83% 44%",
7004
+ "--tw-success": "160 56% 38%",
7005
+ "--tw-destructive": "0 72% 54%",
7006
+ "--tw-border": "218 17% 86%",
7007
+ "--radius": "0.7rem",
7008
+ "--surface": "rgba(248, 250, 252, 0.94)",
7009
+ "--surface-strong": "rgba(226, 232, 240, 0.96)",
7010
+ "--grey": "rgba(241, 245, 249, 0.98)",
7011
+ "--grey-strong": "rgba(226, 232, 240, 0.99)",
7012
+ "--shadow-sm": "0 12px 30px -20px rgba(15, 23, 42, 0.18)",
7013
+ "--shadow": "0 28px 66px -30px rgba(15, 23, 42, 0.24)",
7014
+ "--primary-grad-from": "198 83% 44%",
7015
+ "--primary-grad-to": "221 24% 32%"
7016
+ },
7017
+ dark: {
7018
+ "--tw-background": "222 32% 8%",
7019
+ "--tw-foreground": "210 25% 96%",
7020
+ "--tw-primary": "210 24% 82%",
7021
+ "--tw-accent": "192 92% 52%",
7022
+ "--tw-success": "158 64% 45%",
7023
+ "--tw-destructive": "0 72% 56%",
7024
+ "--tw-border": "217 19% 24%",
7025
+ "--radius": "0.7rem",
7026
+ "--surface": "rgba(15, 23, 42, 0.82)",
7027
+ "--surface-strong": "rgba(30, 41, 59, 0.92)",
7028
+ "--grey": "rgba(30, 41, 59, 0.9)",
7029
+ "--grey-strong": "rgba(51, 65, 85, 0.92)",
7030
+ "--shadow-sm": "0 18px 38px -22px rgba(2, 6, 23, 0.48)",
7031
+ "--shadow": "0 32px 88px -34px rgba(2, 6, 23, 0.68)",
7032
+ "--primary-grad-from": "192 92% 52%",
7033
+ "--primary-grad-to": "210 24% 82%"
7034
+ }
7035
+ }
7036
+ }
7037
+ ];
7038
+ var uiDefaultThemePreset = uiThemePresets[0];
7039
+ function createThemePresetCssExample(themePreset) {
7040
+ const renderBlock = (tokens) => Object.entries(tokens).map(([token, value]) => ` ${token}: ${value};`).join("\n");
7041
+ return `:root {
7042
+ ${renderBlock(themePreset.tokens.light)}
7043
+ }
7044
+
7045
+ .dark,
7046
+ [data-ui-theme='dark'] {
7047
+ ${renderBlock(themePreset.tokens.dark)}
7048
+ }`;
7049
+ }
6843
7050
  var uiThemeContract = {
6844
7051
  packageName: "@lucasvu/scope-ui",
6845
7052
  importOrder: [
@@ -6851,8 +7058,11 @@ var uiThemeContract = {
6851
7058
  dark: [".dark", "[data-ui-theme='dark']"]
6852
7059
  },
6853
7060
  overrideFile: "src/styles/ui-theme.css",
7061
+ defaultPreset: uiDefaultThemePreset.id,
7062
+ presets: uiThemePresets,
6854
7063
  rules: [
6855
7064
  "Import the package stylesheet before your project theme override stylesheet.",
7065
+ "Choose one approved preset and keep the entire project on that preset instead of mixing palettes page by page.",
6856
7066
  "Override tokens in one shared theme file instead of scattering colors across components.",
6857
7067
  "Use :root for the default light theme and .dark or [data-ui-theme='dark'] for dark theme.",
6858
7068
  "Only override tokens declared here. Do not patch component internals unless you are extending the library.",
@@ -6864,7 +7074,7 @@ var uiThemeContract = {
6864
7074
  description: "Base app background in HSL triplet format.",
6865
7075
  defaultLight: "0 0% 100%",
6866
7076
  defaultDark: "222.2 84% 4.9%",
6867
- usedBy: ["Input", "Select", "Card", "Tabs", "global surface"]
7077
+ usedBy: ["body background", "Input fallback", "page background"]
6868
7078
  },
6869
7079
  {
6870
7080
  name: "--tw-foreground",
@@ -6908,6 +7118,13 @@ var uiThemeContract = {
6908
7118
  defaultDark: "217.2 32.6% 17.5%",
6909
7119
  usedBy: ["Input", "Select", "Card", "DataTable"]
6910
7120
  },
7121
+ {
7122
+ name: "--radius",
7123
+ description: "Shared component radius.",
7124
+ defaultLight: "0.75rem",
7125
+ defaultDark: "0.75rem",
7126
+ usedBy: ["Button", "Input", "Card", "Tabs"]
7127
+ },
6911
7128
  {
6912
7129
  name: "--surface",
6913
7130
  description: "Default surface background as a CSS color.",
@@ -6936,6 +7153,20 @@ var uiThemeContract = {
6936
7153
  defaultDark: "rgba(51, 65, 85, 0.92)",
6937
7154
  usedBy: ["DataTable row hover"]
6938
7155
  },
7156
+ {
7157
+ name: "--shadow-sm",
7158
+ description: "Small elevation shadow.",
7159
+ defaultLight: "0 10px 28px -18px rgba(15, 23, 42, 0.22)",
7160
+ defaultDark: "0 16px 32px -18px rgba(2, 6, 23, 0.48)",
7161
+ usedBy: ["Tabs", "Pagination", "subtle elevation"]
7162
+ },
7163
+ {
7164
+ name: "--shadow",
7165
+ description: "Primary elevation shadow.",
7166
+ defaultLight: "0 24px 60px -28px rgba(15, 23, 42, 0.3)",
7167
+ defaultDark: "0 28px 80px -32px rgba(2, 6, 23, 0.7)",
7168
+ usedBy: ["Card", "Button emphasis", "floating surfaces"]
7169
+ },
6939
7170
  {
6940
7171
  name: "--text",
6941
7172
  description: "Generic text color alias as a CSS color.",
@@ -6972,27 +7203,16 @@ var uiThemeContract = {
6972
7203
  usedBy: ["Button variant create"]
6973
7204
  }
6974
7205
  ],
6975
- exampleCss: `:root {
6976
- --tw-primary: 12 88% 56%;
6977
- --tw-accent: 24 95% 52%;
6978
- --primary-grad-from: 24 95% 52%;
6979
- --primary-grad-to: 12 88% 56%;
6980
- --surface: rgba(255, 248, 240, 0.92);
6981
- }
6982
-
6983
- .dark {
6984
- --tw-primary: 18 100% 62%;
6985
- --tw-accent: 35 100% 58%;
6986
- --surface: rgba(24, 24, 27, 0.82);
6987
- }`
7206
+ exampleCss: createThemePresetCssExample(uiDefaultThemePreset)
6988
7207
  };
6989
7208
  var uiProjectAiRules = [
6990
7209
  "Use @lucasvu/scope-ui as the default UI library.",
6991
7210
  "Import @lucasvu/scope-ui/styles.css once at the app entry.",
6992
7211
  "Import the project override theme file after the package stylesheet.",
7212
+ "Stay inside the approved theme preset declared by the project and do not invent a second palette.",
6993
7213
  "Read uiAiManifest to choose the correct component by intent before coding.",
6994
- "Read uiThemeContract before changing colors, shadows, or theme behavior.",
7214
+ "Read uiThemeContract before changing colors, shadows, radius, or theme behavior.",
6995
7215
  "Prefer root exports and avoid MainFe unless the task explicitly targets a legacy screen."
6996
7216
  ];
6997
7217
 
6998
- export { Alert, ArgonSidebar, AsyncCombobox, Badge, Breadcrumb, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, FormControl as Control, DataTable, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, FormItem as Item, FormLabel as Label, LineClampTooltip, Loading, main_fe_exports as MainFe, FormMessage as Message, MultiSelect, NumericInput, OverflowTooltip, PageTitle, Pagination, SearchableSelect, SectionTitle, Select, Sidebar, SidebarItem, Stat, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, Textarea, Tooltip, TruncatedText, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiProjectAiRules, uiThemeContract };
7218
+ export { Alert, ArgonSidebar, AsyncCombobox, Badge, Breadcrumb, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, FormControl as Control, DataTable, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, FormItem as Item, FormLabel as Label, LineClampTooltip, Loading, main_fe_exports as MainFe, FormMessage as Message, MultiSelect, NumericInput, OverflowTooltip, PageTitle, Pagination, SearchableSelect, SectionTitle, Select, Sidebar, SidebarItem, Stat, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, Textarea, Tooltip, TruncatedText, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiThemeContract, uiThemePresets };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucasvu/scope-ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -53,4 +53,4 @@
53
53
  "tsup": "^8.5.0",
54
54
  "typescript": "^5.8.3"
55
55
  }
56
- }
56
+ }