@lucasvu/scope-ui 0.0.4 → 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/AI_SETUP.md +18 -4
- package/README.md +20 -6
- package/bin/scope-ui-init.mjs +306 -20
- package/dist/index.cjs +237 -15
- package/dist/index.d.cts +406 -5
- package/dist/index.d.ts +406 -5
- package/dist/index.js +236 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6646,6 +6646,7 @@ var uiAiManifest = {
|
|
|
6646
6646
|
styleImport: "@lucasvu/scope-ui/styles.css",
|
|
6647
6647
|
rules: [
|
|
6648
6648
|
"Import the stylesheet once at the app entry before rendering any component.",
|
|
6649
|
+
"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.",
|
|
6649
6650
|
"Prefer the canonical component for each intent instead of mixing legacy MainFe components.",
|
|
6650
6651
|
"Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.",
|
|
6651
6652
|
"Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.",
|
|
@@ -6862,6 +6863,212 @@ var uiAiManifest = {
|
|
|
6862
6863
|
};
|
|
6863
6864
|
|
|
6864
6865
|
// src/theme-contract.ts
|
|
6866
|
+
var uiThemePresets = [
|
|
6867
|
+
{
|
|
6868
|
+
id: "ocean",
|
|
6869
|
+
label: "Ocean Glass",
|
|
6870
|
+
description: "Blue-cyan preset with clean glass surfaces. Matches the current default visual language.",
|
|
6871
|
+
recommendedFor: [
|
|
6872
|
+
"Admin dashboards",
|
|
6873
|
+
"SaaS CRUD screens",
|
|
6874
|
+
"Projects that want the existing package look"
|
|
6875
|
+
],
|
|
6876
|
+
tokens: {
|
|
6877
|
+
light: {
|
|
6878
|
+
"--tw-background": "0 0% 100%",
|
|
6879
|
+
"--tw-foreground": "222.2 47.4% 11.2%",
|
|
6880
|
+
"--tw-primary": "221.2 83.2% 53.3%",
|
|
6881
|
+
"--tw-accent": "199 89% 48%",
|
|
6882
|
+
"--tw-success": "142.1 76.2% 36.3%",
|
|
6883
|
+
"--tw-destructive": "0 84.2% 60.2%",
|
|
6884
|
+
"--tw-border": "214.3 31.8% 91.4%",
|
|
6885
|
+
"--radius": "0.75rem",
|
|
6886
|
+
"--surface": "rgba(255, 255, 255, 0.92)",
|
|
6887
|
+
"--surface-strong": "rgba(241, 245, 249, 0.96)",
|
|
6888
|
+
"--grey": "rgba(248, 250, 252, 0.96)",
|
|
6889
|
+
"--grey-strong": "rgba(241, 245, 249, 0.98)",
|
|
6890
|
+
"--shadow-sm": "0 10px 28px -18px rgba(15, 23, 42, 0.22)",
|
|
6891
|
+
"--shadow": "0 24px 60px -28px rgba(15, 23, 42, 0.3)",
|
|
6892
|
+
"--primary-grad-from": "199 89% 48%",
|
|
6893
|
+
"--primary-grad-to": "221.2 83.2% 53.3%"
|
|
6894
|
+
},
|
|
6895
|
+
dark: {
|
|
6896
|
+
"--tw-background": "222.2 84% 4.9%",
|
|
6897
|
+
"--tw-foreground": "210 40% 98%",
|
|
6898
|
+
"--tw-primary": "217.2 91.2% 59.8%",
|
|
6899
|
+
"--tw-accent": "199 89% 48%",
|
|
6900
|
+
"--tw-success": "142.1 70.6% 45.3%",
|
|
6901
|
+
"--tw-destructive": "0 62.8% 30.6%",
|
|
6902
|
+
"--tw-border": "217.2 32.6% 17.5%",
|
|
6903
|
+
"--radius": "0.75rem",
|
|
6904
|
+
"--surface": "rgba(15, 23, 42, 0.78)",
|
|
6905
|
+
"--surface-strong": "rgba(30, 41, 59, 0.92)",
|
|
6906
|
+
"--grey": "rgba(30, 41, 59, 0.88)",
|
|
6907
|
+
"--grey-strong": "rgba(51, 65, 85, 0.92)",
|
|
6908
|
+
"--shadow-sm": "0 16px 32px -18px rgba(2, 6, 23, 0.48)",
|
|
6909
|
+
"--shadow": "0 28px 80px -32px rgba(2, 6, 23, 0.7)",
|
|
6910
|
+
"--primary-grad-from": "198.6 88.7% 48.4%",
|
|
6911
|
+
"--primary-grad-to": "221.2 83.2% 53.3%"
|
|
6912
|
+
}
|
|
6913
|
+
}
|
|
6914
|
+
},
|
|
6915
|
+
{
|
|
6916
|
+
id: "sunset",
|
|
6917
|
+
label: "Sunset Ember",
|
|
6918
|
+
description: "Warm orange-coral preset with softer cream surfaces for branded landing or growth products.",
|
|
6919
|
+
recommendedFor: [
|
|
6920
|
+
"Growth products",
|
|
6921
|
+
"Commerce backoffices",
|
|
6922
|
+
"Projects that want a warmer visual tone"
|
|
6923
|
+
],
|
|
6924
|
+
tokens: {
|
|
6925
|
+
light: {
|
|
6926
|
+
"--tw-background": "30 100% 98%",
|
|
6927
|
+
"--tw-foreground": "20 24% 14%",
|
|
6928
|
+
"--tw-primary": "14 90% 56%",
|
|
6929
|
+
"--tw-accent": "29 100% 58%",
|
|
6930
|
+
"--tw-success": "145 63% 38%",
|
|
6931
|
+
"--tw-destructive": "0 78% 58%",
|
|
6932
|
+
"--tw-border": "24 45% 89%",
|
|
6933
|
+
"--radius": "0.85rem",
|
|
6934
|
+
"--surface": "rgba(255, 247, 240, 0.92)",
|
|
6935
|
+
"--surface-strong": "rgba(255, 237, 223, 0.96)",
|
|
6936
|
+
"--grey": "rgba(255, 243, 231, 0.96)",
|
|
6937
|
+
"--grey-strong": "rgba(255, 232, 214, 0.98)",
|
|
6938
|
+
"--shadow-sm": "0 12px 30px -18px rgba(194, 65, 12, 0.18)",
|
|
6939
|
+
"--shadow": "0 28px 64px -30px rgba(154, 52, 18, 0.24)",
|
|
6940
|
+
"--primary-grad-from": "29 100% 58%",
|
|
6941
|
+
"--primary-grad-to": "14 90% 56%"
|
|
6942
|
+
},
|
|
6943
|
+
dark: {
|
|
6944
|
+
"--tw-background": "20 24% 8%",
|
|
6945
|
+
"--tw-foreground": "40 33% 96%",
|
|
6946
|
+
"--tw-primary": "18 100% 62%",
|
|
6947
|
+
"--tw-accent": "35 100% 58%",
|
|
6948
|
+
"--tw-success": "145 60% 47%",
|
|
6949
|
+
"--tw-destructive": "0 73% 52%",
|
|
6950
|
+
"--tw-border": "18 24% 22%",
|
|
6951
|
+
"--radius": "0.85rem",
|
|
6952
|
+
"--surface": "rgba(41, 24, 18, 0.84)",
|
|
6953
|
+
"--surface-strong": "rgba(59, 34, 24, 0.9)",
|
|
6954
|
+
"--grey": "rgba(70, 42, 29, 0.88)",
|
|
6955
|
+
"--grey-strong": "rgba(92, 54, 38, 0.9)",
|
|
6956
|
+
"--shadow-sm": "0 18px 36px -20px rgba(67, 20, 7, 0.48)",
|
|
6957
|
+
"--shadow": "0 30px 84px -34px rgba(67, 20, 7, 0.62)",
|
|
6958
|
+
"--primary-grad-from": "35 100% 58%",
|
|
6959
|
+
"--primary-grad-to": "18 100% 62%"
|
|
6960
|
+
}
|
|
6961
|
+
}
|
|
6962
|
+
},
|
|
6963
|
+
{
|
|
6964
|
+
id: "forest",
|
|
6965
|
+
label: "Forest Mist",
|
|
6966
|
+
description: "Emerald-teal preset with soft botanical surfaces for calmer productivity products.",
|
|
6967
|
+
recommendedFor: [
|
|
6968
|
+
"Operations tools",
|
|
6969
|
+
"Internal platforms",
|
|
6970
|
+
"Products that want a calmer green tone"
|
|
6971
|
+
],
|
|
6972
|
+
tokens: {
|
|
6973
|
+
light: {
|
|
6974
|
+
"--tw-background": "138 40% 98%",
|
|
6975
|
+
"--tw-foreground": "160 25% 14%",
|
|
6976
|
+
"--tw-primary": "158 64% 40%",
|
|
6977
|
+
"--tw-accent": "173 58% 44%",
|
|
6978
|
+
"--tw-success": "145 63% 36%",
|
|
6979
|
+
"--tw-destructive": "0 78% 58%",
|
|
6980
|
+
"--tw-border": "143 21% 88%",
|
|
6981
|
+
"--radius": "0.8rem",
|
|
6982
|
+
"--surface": "rgba(245, 252, 249, 0.92)",
|
|
6983
|
+
"--surface-strong": "rgba(232, 245, 239, 0.96)",
|
|
6984
|
+
"--grey": "rgba(240, 248, 244, 0.96)",
|
|
6985
|
+
"--grey-strong": "rgba(225, 240, 232, 0.98)",
|
|
6986
|
+
"--shadow-sm": "0 12px 28px -18px rgba(5, 86, 66, 0.18)",
|
|
6987
|
+
"--shadow": "0 26px 62px -30px rgba(6, 78, 59, 0.24)",
|
|
6988
|
+
"--primary-grad-from": "173 58% 44%",
|
|
6989
|
+
"--primary-grad-to": "158 64% 40%"
|
|
6990
|
+
},
|
|
6991
|
+
dark: {
|
|
6992
|
+
"--tw-background": "164 35% 8%",
|
|
6993
|
+
"--tw-foreground": "144 35% 96%",
|
|
6994
|
+
"--tw-primary": "160 70% 46%",
|
|
6995
|
+
"--tw-accent": "174 72% 45%",
|
|
6996
|
+
"--tw-success": "145 68% 46%",
|
|
6997
|
+
"--tw-destructive": "0 70% 52%",
|
|
6998
|
+
"--tw-border": "160 20% 20%",
|
|
6999
|
+
"--radius": "0.8rem",
|
|
7000
|
+
"--surface": "rgba(16, 36, 31, 0.84)",
|
|
7001
|
+
"--surface-strong": "rgba(21, 51, 44, 0.9)",
|
|
7002
|
+
"--grey": "rgba(24, 61, 52, 0.88)",
|
|
7003
|
+
"--grey-strong": "rgba(31, 77, 65, 0.9)",
|
|
7004
|
+
"--shadow-sm": "0 18px 34px -20px rgba(1, 44, 34, 0.48)",
|
|
7005
|
+
"--shadow": "0 30px 82px -34px rgba(1, 44, 34, 0.6)",
|
|
7006
|
+
"--primary-grad-from": "174 72% 45%",
|
|
7007
|
+
"--primary-grad-to": "160 70% 46%"
|
|
7008
|
+
}
|
|
7009
|
+
}
|
|
7010
|
+
},
|
|
7011
|
+
{
|
|
7012
|
+
id: "graphite",
|
|
7013
|
+
label: "Graphite Pulse",
|
|
7014
|
+
description: "Neutral slate preset with restrained blue accents for products that need a steadier enterprise tone.",
|
|
7015
|
+
recommendedFor: [
|
|
7016
|
+
"Enterprise admin panels",
|
|
7017
|
+
"B2B internal tools",
|
|
7018
|
+
"Projects that want a more neutral interface"
|
|
7019
|
+
],
|
|
7020
|
+
tokens: {
|
|
7021
|
+
light: {
|
|
7022
|
+
"--tw-background": "220 18% 97%",
|
|
7023
|
+
"--tw-foreground": "222 24% 14%",
|
|
7024
|
+
"--tw-primary": "221 24% 32%",
|
|
7025
|
+
"--tw-accent": "198 83% 44%",
|
|
7026
|
+
"--tw-success": "160 56% 38%",
|
|
7027
|
+
"--tw-destructive": "0 72% 54%",
|
|
7028
|
+
"--tw-border": "218 17% 86%",
|
|
7029
|
+
"--radius": "0.7rem",
|
|
7030
|
+
"--surface": "rgba(248, 250, 252, 0.94)",
|
|
7031
|
+
"--surface-strong": "rgba(226, 232, 240, 0.96)",
|
|
7032
|
+
"--grey": "rgba(241, 245, 249, 0.98)",
|
|
7033
|
+
"--grey-strong": "rgba(226, 232, 240, 0.99)",
|
|
7034
|
+
"--shadow-sm": "0 12px 30px -20px rgba(15, 23, 42, 0.18)",
|
|
7035
|
+
"--shadow": "0 28px 66px -30px rgba(15, 23, 42, 0.24)",
|
|
7036
|
+
"--primary-grad-from": "198 83% 44%",
|
|
7037
|
+
"--primary-grad-to": "221 24% 32%"
|
|
7038
|
+
},
|
|
7039
|
+
dark: {
|
|
7040
|
+
"--tw-background": "222 32% 8%",
|
|
7041
|
+
"--tw-foreground": "210 25% 96%",
|
|
7042
|
+
"--tw-primary": "210 24% 82%",
|
|
7043
|
+
"--tw-accent": "192 92% 52%",
|
|
7044
|
+
"--tw-success": "158 64% 45%",
|
|
7045
|
+
"--tw-destructive": "0 72% 56%",
|
|
7046
|
+
"--tw-border": "217 19% 24%",
|
|
7047
|
+
"--radius": "0.7rem",
|
|
7048
|
+
"--surface": "rgba(15, 23, 42, 0.82)",
|
|
7049
|
+
"--surface-strong": "rgba(30, 41, 59, 0.92)",
|
|
7050
|
+
"--grey": "rgba(30, 41, 59, 0.9)",
|
|
7051
|
+
"--grey-strong": "rgba(51, 65, 85, 0.92)",
|
|
7052
|
+
"--shadow-sm": "0 18px 38px -22px rgba(2, 6, 23, 0.48)",
|
|
7053
|
+
"--shadow": "0 32px 88px -34px rgba(2, 6, 23, 0.68)",
|
|
7054
|
+
"--primary-grad-from": "192 92% 52%",
|
|
7055
|
+
"--primary-grad-to": "210 24% 82%"
|
|
7056
|
+
}
|
|
7057
|
+
}
|
|
7058
|
+
}
|
|
7059
|
+
];
|
|
7060
|
+
var uiDefaultThemePreset = uiThemePresets[0];
|
|
7061
|
+
function createThemePresetCssExample(themePreset) {
|
|
7062
|
+
const renderBlock = (tokens) => Object.entries(tokens).map(([token, value]) => ` ${token}: ${value};`).join("\n");
|
|
7063
|
+
return `:root {
|
|
7064
|
+
${renderBlock(themePreset.tokens.light)}
|
|
7065
|
+
}
|
|
7066
|
+
|
|
7067
|
+
.dark,
|
|
7068
|
+
[data-ui-theme='dark'] {
|
|
7069
|
+
${renderBlock(themePreset.tokens.dark)}
|
|
7070
|
+
}`;
|
|
7071
|
+
}
|
|
6865
7072
|
var uiThemeContract = {
|
|
6866
7073
|
packageName: "@lucasvu/scope-ui",
|
|
6867
7074
|
importOrder: [
|
|
@@ -6873,8 +7080,11 @@ var uiThemeContract = {
|
|
|
6873
7080
|
dark: [".dark", "[data-ui-theme='dark']"]
|
|
6874
7081
|
},
|
|
6875
7082
|
overrideFile: "src/styles/ui-theme.css",
|
|
7083
|
+
defaultPreset: uiDefaultThemePreset.id,
|
|
7084
|
+
presets: uiThemePresets,
|
|
6876
7085
|
rules: [
|
|
6877
7086
|
"Import the package stylesheet before your project theme override stylesheet.",
|
|
7087
|
+
"Choose one approved preset and keep the entire project on that preset instead of mixing palettes page by page.",
|
|
6878
7088
|
"Override tokens in one shared theme file instead of scattering colors across components.",
|
|
6879
7089
|
"Use :root for the default light theme and .dark or [data-ui-theme='dark'] for dark theme.",
|
|
6880
7090
|
"Only override tokens declared here. Do not patch component internals unless you are extending the library.",
|
|
@@ -6886,7 +7096,7 @@ var uiThemeContract = {
|
|
|
6886
7096
|
description: "Base app background in HSL triplet format.",
|
|
6887
7097
|
defaultLight: "0 0% 100%",
|
|
6888
7098
|
defaultDark: "222.2 84% 4.9%",
|
|
6889
|
-
usedBy: ["
|
|
7099
|
+
usedBy: ["body background", "Input fallback", "page background"]
|
|
6890
7100
|
},
|
|
6891
7101
|
{
|
|
6892
7102
|
name: "--tw-foreground",
|
|
@@ -6930,6 +7140,13 @@ var uiThemeContract = {
|
|
|
6930
7140
|
defaultDark: "217.2 32.6% 17.5%",
|
|
6931
7141
|
usedBy: ["Input", "Select", "Card", "DataTable"]
|
|
6932
7142
|
},
|
|
7143
|
+
{
|
|
7144
|
+
name: "--radius",
|
|
7145
|
+
description: "Shared component radius.",
|
|
7146
|
+
defaultLight: "0.75rem",
|
|
7147
|
+
defaultDark: "0.75rem",
|
|
7148
|
+
usedBy: ["Button", "Input", "Card", "Tabs"]
|
|
7149
|
+
},
|
|
6933
7150
|
{
|
|
6934
7151
|
name: "--surface",
|
|
6935
7152
|
description: "Default surface background as a CSS color.",
|
|
@@ -6958,6 +7175,20 @@ var uiThemeContract = {
|
|
|
6958
7175
|
defaultDark: "rgba(51, 65, 85, 0.92)",
|
|
6959
7176
|
usedBy: ["DataTable row hover"]
|
|
6960
7177
|
},
|
|
7178
|
+
{
|
|
7179
|
+
name: "--shadow-sm",
|
|
7180
|
+
description: "Small elevation shadow.",
|
|
7181
|
+
defaultLight: "0 10px 28px -18px rgba(15, 23, 42, 0.22)",
|
|
7182
|
+
defaultDark: "0 16px 32px -18px rgba(2, 6, 23, 0.48)",
|
|
7183
|
+
usedBy: ["Tabs", "Pagination", "subtle elevation"]
|
|
7184
|
+
},
|
|
7185
|
+
{
|
|
7186
|
+
name: "--shadow",
|
|
7187
|
+
description: "Primary elevation shadow.",
|
|
7188
|
+
defaultLight: "0 24px 60px -28px rgba(15, 23, 42, 0.3)",
|
|
7189
|
+
defaultDark: "0 28px 80px -32px rgba(2, 6, 23, 0.7)",
|
|
7190
|
+
usedBy: ["Card", "Button emphasis", "floating surfaces"]
|
|
7191
|
+
},
|
|
6961
7192
|
{
|
|
6962
7193
|
name: "--text",
|
|
6963
7194
|
description: "Generic text color alias as a CSS color.",
|
|
@@ -6994,26 +7225,15 @@ var uiThemeContract = {
|
|
|
6994
7225
|
usedBy: ["Button variant create"]
|
|
6995
7226
|
}
|
|
6996
7227
|
],
|
|
6997
|
-
exampleCss:
|
|
6998
|
-
--tw-primary: 12 88% 56%;
|
|
6999
|
-
--tw-accent: 24 95% 52%;
|
|
7000
|
-
--primary-grad-from: 24 95% 52%;
|
|
7001
|
-
--primary-grad-to: 12 88% 56%;
|
|
7002
|
-
--surface: rgba(255, 248, 240, 0.92);
|
|
7003
|
-
}
|
|
7004
|
-
|
|
7005
|
-
.dark {
|
|
7006
|
-
--tw-primary: 18 100% 62%;
|
|
7007
|
-
--tw-accent: 35 100% 58%;
|
|
7008
|
-
--surface: rgba(24, 24, 27, 0.82);
|
|
7009
|
-
}`
|
|
7228
|
+
exampleCss: createThemePresetCssExample(uiDefaultThemePreset)
|
|
7010
7229
|
};
|
|
7011
7230
|
var uiProjectAiRules = [
|
|
7012
7231
|
"Use @lucasvu/scope-ui as the default UI library.",
|
|
7013
7232
|
"Import @lucasvu/scope-ui/styles.css once at the app entry.",
|
|
7014
7233
|
"Import the project override theme file after the package stylesheet.",
|
|
7234
|
+
"Stay inside the approved theme preset declared by the project and do not invent a second palette.",
|
|
7015
7235
|
"Read uiAiManifest to choose the correct component by intent before coding.",
|
|
7016
|
-
"Read uiThemeContract before changing colors, shadows, or theme behavior.",
|
|
7236
|
+
"Read uiThemeContract before changing colors, shadows, radius, or theme behavior.",
|
|
7017
7237
|
"Prefer root exports and avoid MainFe unless the task explicitly targets a legacy screen."
|
|
7018
7238
|
];
|
|
7019
7239
|
|
|
@@ -7074,5 +7294,7 @@ exports.defaultPermissionChecker = defaultPermissionChecker;
|
|
|
7074
7294
|
exports.filterSidebarItems = filterSidebarItems;
|
|
7075
7295
|
exports.hasActiveDescendant = hasActiveDescendant;
|
|
7076
7296
|
exports.uiAiManifest = uiAiManifest;
|
|
7297
|
+
exports.uiDefaultThemePreset = uiDefaultThemePreset;
|
|
7077
7298
|
exports.uiProjectAiRules = uiProjectAiRules;
|
|
7078
7299
|
exports.uiThemeContract = uiThemeContract;
|
|
7300
|
+
exports.uiThemePresets = uiThemePresets;
|