@lucasvu/scope-ui 0.0.8 → 0.1.1

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.
@@ -0,0 +1 @@
1
+ export { ROOT_CLIENT_THEME_ATTRIBUTE, ROOT_COLOR_MODE_ATTRIBUTE, applyDocumentClientTheme, applyDocumentColorMode, cn, getSystemColorMode, initializeDocumentColorMode, isColorMode, subscribeToSystemColorMode, syncDocumentColorModeToSystem, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiScreenBlueprint, uiScreenBriefFields, uiThemeContract, uiThemeLayerAssets, uiThemePresets } from '../chunk-CL3F2TWE.js';
package/dist/index.cjs CHANGED
@@ -6647,7 +6647,8 @@ var uiAiManifest = {
6647
6647
  rules: [
6648
6648
  "Import the stylesheet once at the app entry before rendering any component.",
6649
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.",
6650
- "Collect the screen brief first: route url, sidebar items, active sidebar item, page title, actions, and the page-specific content schema.",
6650
+ "Collect the shell + screen brief first: layout preset, workspace label, route url, sidebar items, active sidebar item, page title, tabs/actions, and the page-specific content schema.",
6651
+ "If the project ships a generated layout preset file, keep the shell aligned with it instead of inventing a new page frame.",
6651
6652
  "Prefer the canonical component for each intent instead of mixing legacy MainFe components.",
6652
6653
  "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.",
6653
6654
  "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.",
@@ -6865,6 +6866,30 @@ var uiAiManifest = {
6865
6866
 
6866
6867
  // src/screen-blueprint.ts
6867
6868
  var uiScreenBriefFields = [
6869
+ {
6870
+ id: "layoutPreset",
6871
+ label: "Layout preset",
6872
+ description: "Shared shell preset id that locks the sidebar/topbar/page-card structure.",
6873
+ required: false,
6874
+ appliesTo: ["all"],
6875
+ example: "workspace-admin-v1"
6876
+ },
6877
+ {
6878
+ id: "workspaceLabel",
6879
+ label: "Workspace label",
6880
+ description: "Short label shown in the sidebar or workspace topbar.",
6881
+ required: false,
6882
+ appliesTo: ["all"],
6883
+ example: "Workspace"
6884
+ },
6885
+ {
6886
+ id: "timezoneLabel",
6887
+ label: "Timezone/meta label",
6888
+ description: "Short meta label shown in the top-right shell area, such as a timezone or environment.",
6889
+ required: false,
6890
+ appliesTo: ["all"],
6891
+ example: "UTC+07:00"
6892
+ },
6868
6893
  {
6869
6894
  id: "pageKind",
6870
6895
  label: "Page kind",
@@ -6921,6 +6946,22 @@ var uiScreenBriefFields = [
6921
6946
  appliesTo: ["all"],
6922
6947
  example: "Manage internal user accounts and permissions."
6923
6948
  },
6949
+ {
6950
+ id: "pageTabs",
6951
+ label: "Page tabs",
6952
+ description: "Optional segmented tabs rendered under the intro card.",
6953
+ required: false,
6954
+ appliesTo: ["all"],
6955
+ example: '[{ value: "overview", label: "Overview" }, { value: "coupons", label: "Coupons" }]'
6956
+ },
6957
+ {
6958
+ id: "activePageTab",
6959
+ label: "Active page tab",
6960
+ description: "The selected segmented tab value when tabs are present.",
6961
+ required: false,
6962
+ appliesTo: ["all"],
6963
+ example: "coupons"
6964
+ },
6924
6965
  {
6925
6966
  id: "primaryAction",
6926
6967
  label: "Primary action",
@@ -6953,6 +6994,14 @@ var uiScreenBriefFields = [
6953
6994
  appliesTo: ["list", "dashboard"],
6954
6995
  example: '[{ type: "search", label: "Search user" }, { type: "select", label: "Role" }]'
6955
6996
  },
6997
+ {
6998
+ id: "searchPlaceholder",
6999
+ label: "Search placeholder",
7000
+ description: "Placeholder text for the main toolbar search input when the shell includes one.",
7001
+ required: false,
7002
+ appliesTo: ["list", "dashboard"],
7003
+ example: "Search by coupon code"
7004
+ },
6956
7005
  {
6957
7006
  id: "tableColumns",
6958
7007
  label: "Table columns",
@@ -7017,10 +7066,11 @@ var uiScreenBlueprint = {
7017
7066
  label: "List page",
7018
7067
  frame: [
7019
7068
  "Sidebar shell",
7020
- "Breadcrumb",
7021
- "PageTitle with actions",
7069
+ "Workspace topbar",
7070
+ "Page intro card with Breadcrumb and PageTitle",
7071
+ "Optional segmented tabs",
7072
+ "Toolbar card",
7022
7073
  "Optional stats",
7023
- "Filter card",
7024
7074
  "DataTable card"
7025
7075
  ]
7026
7076
  },
@@ -7029,8 +7079,10 @@ var uiScreenBlueprint = {
7029
7079
  label: "Form page",
7030
7080
  frame: [
7031
7081
  "Sidebar shell",
7032
- "Breadcrumb",
7033
- "PageTitle with primary and cancel actions",
7082
+ "Workspace topbar",
7083
+ "Page intro card with Breadcrumb and PageTitle",
7084
+ "Optional segmented tabs",
7085
+ "Header actions",
7034
7086
  "Sectioned form cards",
7035
7087
  "Bottom action row"
7036
7088
  ]
@@ -7040,7 +7092,9 @@ var uiScreenBlueprint = {
7040
7092
  label: "Detail page",
7041
7093
  frame: [
7042
7094
  "Sidebar shell",
7043
- "Breadcrumb",
7095
+ "Workspace topbar",
7096
+ "Page intro card with Breadcrumb and PageTitle",
7097
+ "Optional segmented tabs",
7044
7098
  "PageTitle with status/actions",
7045
7099
  "Summary stats or metadata card",
7046
7100
  "Detail cards and related tables"
@@ -7051,17 +7105,18 @@ var uiScreenBlueprint = {
7051
7105
  label: "Dashboard page",
7052
7106
  frame: [
7053
7107
  "Sidebar shell",
7054
- "Breadcrumb",
7055
- "PageTitle with actions",
7108
+ "Workspace topbar",
7109
+ "Page intro card with Breadcrumb and PageTitle",
7110
+ "Optional segmented tabs",
7111
+ "Toolbar card with actions",
7056
7112
  "Stat cards row",
7057
- "Filters",
7058
7113
  "Main insight cards and tables"
7059
7114
  ]
7060
7115
  }
7061
7116
  ],
7062
7117
  workflow: [
7063
- "Collect the screen brief before coding. Do not invent sidebar items, route urls, filters, fields, or table columns if the brief is missing.",
7064
- "Use Sidebar plus Breadcrumb and PageTitle to lock the shell before building the page body.",
7118
+ "Collect the shell + screen brief before coding. Do not invent layout presets, workspace labels, sidebar items, route urls, tabs, filters, fields, or table columns if the brief is missing.",
7119
+ "Use Sidebar plus the workspace topbar and intro card to lock the shell before building the page body.",
7065
7120
  "Choose only canonical root exports from @lucasvu/scope-ui.",
7066
7121
  "Use Card and ui-grid utilities to create the frame first, then place controls and data components inside.",
7067
7122
  "Keep all palette, radius, surface, and shadow decisions in the shared ui-theme.css preset file.",
@@ -7436,15 +7491,182 @@ var uiThemeContract = {
7436
7491
  exampleCss: createThemePresetCssExample(uiDefaultThemePreset)
7437
7492
  };
7438
7493
  var uiProjectAiRules = [
7439
- "Use @lucasvu/scope-ui as the default UI library.",
7494
+ "Use @lucasvu/scope-ui as the default UI library for React projects, or @lucasvu/scope-ui/core for framework-agnostic theme/runtime usage.",
7440
7495
  "Import @lucasvu/scope-ui/styles.css once at the app entry.",
7441
- "Import the project override theme file after the package stylesheet.",
7496
+ "Import the project override theme file after the package stylesheet or bundled theme layer.",
7442
7497
  "Stay inside the approved theme preset declared by the project and do not invent a second palette.",
7443
7498
  "Read uiAiManifest to choose the correct component by intent before coding.",
7444
- "Read uiThemeContract before changing colors, shadows, radius, or theme behavior.",
7499
+ "Read uiThemeContract and uiThemeLayerAssets before changing colors, shadows, radius, or theme behavior.",
7445
7500
  "Prefer root exports and avoid MainFe unless the task explicitly targets a legacy screen."
7446
7501
  ];
7447
7502
 
7503
+ // src/theme-layer-assets.ts
7504
+ var uiThemeLayerAssets = [
7505
+ {
7506
+ id: "default",
7507
+ label: "Theme Default",
7508
+ importPath: "@lucasvu/scope-ui/themes/theme-default.css",
7509
+ activation: "global",
7510
+ description: "Global default token layer close to the legacy shared theme baseline.",
7511
+ recommendedFor: [
7512
+ "Projects that want a direct global theme layer without extra setup",
7513
+ "Legacy migrations"
7514
+ ]
7515
+ },
7516
+ {
7517
+ id: "new-main-fe",
7518
+ label: "New Main FE",
7519
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-new-main-fe.css",
7520
+ activation: "global",
7521
+ description: "Global Argon-inspired shell layer that works immediately after import.",
7522
+ recommendedFor: [
7523
+ "Admin shells",
7524
+ "Projects that want the current shared main-fe tone"
7525
+ ]
7526
+ },
7527
+ {
7528
+ id: "citrus-ink",
7529
+ label: "Citrus Ink",
7530
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-citrus-ink.css",
7531
+ activation: "data-client-theme",
7532
+ clientThemeAttributeValue: "citrus-ink",
7533
+ description: "High-contrast graphite theme with mint and citrus accents.",
7534
+ recommendedFor: ["Brand-heavy dashboards"]
7535
+ },
7536
+ {
7537
+ id: "facebook-blue",
7538
+ label: "Facebook Blue",
7539
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-facebook-blue.css",
7540
+ activation: "data-client-theme",
7541
+ clientThemeAttributeValue: "facebook-blue",
7542
+ description: "Blue-first neutral theme tuned around a familiar social palette.",
7543
+ recommendedFor: ["Blue-branded products"]
7544
+ },
7545
+ {
7546
+ id: "neo-slate",
7547
+ label: "Neo Slate",
7548
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-neo-slate.css",
7549
+ activation: "data-client-theme",
7550
+ clientThemeAttributeValue: "neo-slate",
7551
+ description: "Modern slate-indigo workspace theme with richer shell tokens.",
7552
+ recommendedFor: ["Contemporary SaaS dashboards", "Modern admin shells"]
7553
+ },
7554
+ {
7555
+ id: "siraya-brand",
7556
+ label: "Siraya Brand Sunset",
7557
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-new-main-fe-sunset.css",
7558
+ activation: "data-client-theme",
7559
+ clientThemeAttributeValue: "siraya-brand",
7560
+ description: "Warm branded shell with typography and page-slot overrides.",
7561
+ recommendedFor: ["Brand-led marketing or hybrid product shells"]
7562
+ },
7563
+ {
7564
+ id: "pure-white",
7565
+ label: "Pure White",
7566
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-pure-white.css",
7567
+ activation: "data-client-theme",
7568
+ clientThemeAttributeValue: "pure-white",
7569
+ description: "Clean white workspace theme with cobalt accents.",
7570
+ recommendedFor: ["Minimalist backoffices"]
7571
+ },
7572
+ {
7573
+ id: "siraya-vii-light",
7574
+ label: "Siraya VII Light",
7575
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-siraya-vii-light.css",
7576
+ activation: "data-client-theme",
7577
+ clientThemeAttributeValue: "siraya-vii-light",
7578
+ description: "Light brand system based on the Siraya VII palette.",
7579
+ recommendedFor: ["Brand refresh experiments"]
7580
+ },
7581
+ {
7582
+ id: "solstice-pop",
7583
+ label: "Solstice Pop",
7584
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-solstice-pop.css",
7585
+ activation: "data-client-theme",
7586
+ clientThemeAttributeValue: "solstice-pop",
7587
+ description: "Editorial warm-stone theme with stronger typography direction.",
7588
+ recommendedFor: ["Content-heavy dashboards"]
7589
+ },
7590
+ {
7591
+ id: "uat-aurora",
7592
+ label: "UAT Aurora",
7593
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-uat-aurora.css",
7594
+ activation: "data-client-theme",
7595
+ clientThemeAttributeValue: "uat-aurora",
7596
+ description: "Soft slate-blue experimental theme using the same token structure as sunset.",
7597
+ recommendedFor: ["UAT or staging environments", "Blue-toned shells"]
7598
+ },
7599
+ {
7600
+ id: "custom-crisp",
7601
+ label: "Custom Crisp",
7602
+ importPath: "@lucasvu/scope-ui/themes/theme-ui-custom-crisp.css",
7603
+ activation: "data-client-theme",
7604
+ clientThemeAttributeValue: "*",
7605
+ description: "Cross-theme typography and control crispness overrides for client-theme-driven shells.",
7606
+ recommendedFor: ["Attribute-scoped client themes that need sharper controls"]
7607
+ }
7608
+ ];
7609
+
7610
+ // src/color-mode.ts
7611
+ var ROOT_COLOR_MODE_ATTRIBUTE = "data-ui-color-mode";
7612
+ var ROOT_CLIENT_THEME_ATTRIBUTE = "data-client-theme";
7613
+ var ROOT_DARK_CLASS = "dark";
7614
+ var SYSTEM_DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
7615
+ var resolveColorModeMediaQuery = () => {
7616
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
7617
+ return null;
7618
+ }
7619
+ return window.matchMedia(SYSTEM_DARK_MEDIA_QUERY);
7620
+ };
7621
+ var isColorMode = (value) => value === "light" || value === "dark";
7622
+ var getSystemColorMode = () => resolveColorModeMediaQuery()?.matches ? "dark" : "light";
7623
+ var applyDocumentColorMode = (colorMode) => {
7624
+ if (typeof document === "undefined") {
7625
+ return;
7626
+ }
7627
+ const root = document.documentElement;
7628
+ root.classList.toggle(ROOT_DARK_CLASS, colorMode === "dark");
7629
+ root.setAttribute(ROOT_COLOR_MODE_ATTRIBUTE, colorMode);
7630
+ root.style.colorScheme = colorMode;
7631
+ };
7632
+ var initializeDocumentColorMode = (colorMode = getSystemColorMode()) => {
7633
+ applyDocumentColorMode(colorMode);
7634
+ return colorMode;
7635
+ };
7636
+ var subscribeToSystemColorMode = (listener) => {
7637
+ const mediaQuery = resolveColorModeMediaQuery();
7638
+ if (!mediaQuery) {
7639
+ return () => void 0;
7640
+ }
7641
+ const handleChange = (event) => {
7642
+ listener(event.matches ? "dark" : "light");
7643
+ };
7644
+ if (typeof mediaQuery.addEventListener === "function") {
7645
+ mediaQuery.addEventListener("change", handleChange);
7646
+ return () => mediaQuery.removeEventListener("change", handleChange);
7647
+ }
7648
+ mediaQuery.addListener(handleChange);
7649
+ return () => mediaQuery.removeListener(handleChange);
7650
+ };
7651
+ var syncDocumentColorModeToSystem = () => {
7652
+ const applySystemColorMode = (colorMode) => {
7653
+ applyDocumentColorMode(colorMode);
7654
+ };
7655
+ applySystemColorMode(getSystemColorMode());
7656
+ return subscribeToSystemColorMode(applySystemColorMode);
7657
+ };
7658
+ var applyDocumentClientTheme = (themeId) => {
7659
+ if (typeof document === "undefined") {
7660
+ return;
7661
+ }
7662
+ const root = document.documentElement;
7663
+ if (!themeId) {
7664
+ root.removeAttribute(ROOT_CLIENT_THEME_ATTRIBUTE);
7665
+ return;
7666
+ }
7667
+ root.setAttribute(ROOT_CLIENT_THEME_ATTRIBUTE, themeId);
7668
+ };
7669
+
7448
7670
  exports.Alert = Alert;
7449
7671
  exports.ArgonSidebar = ArgonSidebar;
7450
7672
  exports.AsyncCombobox = AsyncCombobox;
@@ -7482,6 +7704,8 @@ exports.NumericInput = NumericInput;
7482
7704
  exports.OverflowTooltip = OverflowTooltip;
7483
7705
  exports.PageTitle = PageTitle;
7484
7706
  exports.Pagination = Pagination;
7707
+ exports.ROOT_CLIENT_THEME_ATTRIBUTE = ROOT_CLIENT_THEME_ATTRIBUTE;
7708
+ exports.ROOT_COLOR_MODE_ATTRIBUTE = ROOT_COLOR_MODE_ATTRIBUTE;
7485
7709
  exports.SearchableSelect = SearchableSelect;
7486
7710
  exports.SectionTitle = SectionTitle;
7487
7711
  exports.Select = Select;
@@ -7497,14 +7721,22 @@ exports.Tabs = Tabs;
7497
7721
  exports.Textarea = Textarea;
7498
7722
  exports.Tooltip = Tooltip;
7499
7723
  exports.TruncatedText = TruncatedText;
7724
+ exports.applyDocumentClientTheme = applyDocumentClientTheme;
7725
+ exports.applyDocumentColorMode = applyDocumentColorMode;
7500
7726
  exports.cn = cn;
7501
7727
  exports.defaultPermissionChecker = defaultPermissionChecker;
7502
7728
  exports.filterSidebarItems = filterSidebarItems;
7729
+ exports.getSystemColorMode = getSystemColorMode;
7503
7730
  exports.hasActiveDescendant = hasActiveDescendant;
7731
+ exports.initializeDocumentColorMode = initializeDocumentColorMode;
7732
+ exports.isColorMode = isColorMode;
7733
+ exports.subscribeToSystemColorMode = subscribeToSystemColorMode;
7734
+ exports.syncDocumentColorModeToSystem = syncDocumentColorModeToSystem;
7504
7735
  exports.uiAiManifest = uiAiManifest;
7505
7736
  exports.uiDefaultThemePreset = uiDefaultThemePreset;
7506
7737
  exports.uiProjectAiRules = uiProjectAiRules;
7507
7738
  exports.uiScreenBlueprint = uiScreenBlueprint;
7508
7739
  exports.uiScreenBriefFields = uiScreenBriefFields;
7509
7740
  exports.uiThemeContract = uiThemeContract;
7741
+ exports.uiThemeLayerAssets = uiThemeLayerAssets;
7510
7742
  exports.uiThemePresets = uiThemePresets;