@cratis/scene.blueprint.default 4.30.0 → 4.32.0

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.
Files changed (163) hide show
  1. package/ComponentName.ts +12 -0
  2. package/defaultBlueprint.ts +2 -1
  3. package/defaultBlueprintComponentMetadata.ts +2 -0
  4. package/defaultBlueprintComponents.ts +5 -0
  5. package/dist/cjs/ComponentName.js +4 -0
  6. package/dist/cjs/ComponentName.js.map +1 -1
  7. package/dist/cjs/defaultBlueprint.js +9 -5
  8. package/dist/cjs/defaultBlueprint.js.map +1 -1
  9. package/dist/cjs/defaultBlueprintComponentMetadata.js +8 -0
  10. package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
  11. package/dist/cjs/defaultBlueprintComponents.js +13 -1
  12. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  13. package/dist/cjs/foundation/ActionButton.js +33 -0
  14. package/dist/cjs/foundation/ActionButton.js.map +1 -0
  15. package/dist/cjs/foundation/ComponentState.js +42 -0
  16. package/dist/cjs/foundation/ComponentState.js.map +1 -0
  17. package/dist/cjs/foundation/EmptyState.js +31 -0
  18. package/dist/cjs/foundation/EmptyState.js.map +1 -0
  19. package/dist/cjs/foundation/FoundationIcon.js +58 -0
  20. package/dist/cjs/foundation/FoundationIcon.js.map +1 -0
  21. package/dist/cjs/foundation/FoundationStates.js +62 -0
  22. package/dist/cjs/foundation/FoundationStates.js.map +1 -0
  23. package/dist/cjs/foundation/PermissionRule.js +22 -0
  24. package/dist/cjs/foundation/PermissionRule.js.map +1 -0
  25. package/dist/cjs/foundation/StatCard.js +61 -0
  26. package/dist/cjs/foundation/StatCard.js.map +1 -0
  27. package/dist/cjs/foundation/StateFrame.js +200 -0
  28. package/dist/cjs/foundation/StateFrame.js.map +1 -0
  29. package/dist/cjs/foundation/StatusChip.js +64 -0
  30. package/dist/cjs/foundation/StatusChip.js.map +1 -0
  31. package/dist/cjs/foundation/TrendChip.js +93 -0
  32. package/dist/cjs/foundation/TrendChip.js.map +1 -0
  33. package/dist/cjs/foundation/formatting.js +85 -0
  34. package/dist/cjs/foundation/formatting.js.map +1 -0
  35. package/dist/cjs/foundation/foundationComponentMetadata.js +41 -0
  36. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -0
  37. package/dist/cjs/foundation/foundationDescriptors.js +232 -0
  38. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -0
  39. package/dist/cjs/foundation/foundationSamples.js +71 -0
  40. package/dist/cjs/foundation/foundationSamples.js.map +1 -0
  41. package/dist/cjs/foundation/foundationStrings.js +105 -0
  42. package/dist/cjs/foundation/foundationStrings.js.map +1 -0
  43. package/dist/cjs/index.js +52 -0
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/themes/dark.js +9 -1
  46. package/dist/cjs/themes/dark.js.map +1 -1
  47. package/dist/cjs/themes/light.js +10 -2
  48. package/dist/cjs/themes/light.js.map +1 -1
  49. package/dist/esm/ComponentName.d.ts +5 -1
  50. package/dist/esm/ComponentName.d.ts.map +1 -1
  51. package/dist/esm/ComponentName.js +4 -0
  52. package/dist/esm/ComponentName.js.map +1 -1
  53. package/dist/esm/defaultBlueprint.d.ts.map +1 -1
  54. package/dist/esm/defaultBlueprint.js +9 -5
  55. package/dist/esm/defaultBlueprint.js.map +1 -1
  56. package/dist/esm/defaultBlueprintComponentMetadata.d.ts.map +1 -1
  57. package/dist/esm/defaultBlueprintComponentMetadata.js +8 -0
  58. package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
  59. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  60. package/dist/esm/defaultBlueprintComponents.js +13 -1
  61. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  62. package/dist/esm/foundation/ActionButton.d.ts +13 -0
  63. package/dist/esm/foundation/ActionButton.d.ts.map +1 -0
  64. package/dist/esm/foundation/ActionButton.js +31 -0
  65. package/dist/esm/foundation/ActionButton.js.map +1 -0
  66. package/dist/esm/foundation/ComponentState.d.ts +12 -0
  67. package/dist/esm/foundation/ComponentState.d.ts.map +1 -0
  68. package/dist/esm/foundation/ComponentState.js +38 -0
  69. package/dist/esm/foundation/ComponentState.js.map +1 -0
  70. package/dist/esm/foundation/EmptyState.d.ts +3 -0
  71. package/dist/esm/foundation/EmptyState.d.ts.map +1 -0
  72. package/dist/esm/foundation/EmptyState.js +29 -0
  73. package/dist/esm/foundation/EmptyState.js.map +1 -0
  74. package/dist/esm/foundation/Foundation.stories.d.ts +21 -0
  75. package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -0
  76. package/dist/esm/foundation/Foundation.stories.js +18 -0
  77. package/dist/esm/foundation/Foundation.stories.js.map +1 -0
  78. package/dist/esm/foundation/FoundationIcon.d.ts +7 -0
  79. package/dist/esm/foundation/FoundationIcon.d.ts.map +1 -0
  80. package/dist/esm/foundation/FoundationIcon.js +55 -0
  81. package/dist/esm/foundation/FoundationIcon.js.map +1 -0
  82. package/dist/esm/foundation/FoundationStates.d.ts +8 -0
  83. package/dist/esm/foundation/FoundationStates.d.ts.map +1 -0
  84. package/dist/esm/foundation/FoundationStates.js +60 -0
  85. package/dist/esm/foundation/FoundationStates.js.map +1 -0
  86. package/dist/esm/foundation/PermissionRule.d.ts +8 -0
  87. package/dist/esm/foundation/PermissionRule.d.ts.map +1 -0
  88. package/dist/esm/foundation/PermissionRule.js +19 -0
  89. package/dist/esm/foundation/PermissionRule.js.map +1 -0
  90. package/dist/esm/foundation/StatCard.d.ts +3 -0
  91. package/dist/esm/foundation/StatCard.d.ts.map +1 -0
  92. package/dist/esm/foundation/StatCard.js +59 -0
  93. package/dist/esm/foundation/StatCard.js.map +1 -0
  94. package/dist/esm/foundation/StateFrame.d.ts +15 -0
  95. package/dist/esm/foundation/StateFrame.d.ts.map +1 -0
  96. package/dist/esm/foundation/StateFrame.js +197 -0
  97. package/dist/esm/foundation/StateFrame.js.map +1 -0
  98. package/dist/esm/foundation/StatusChip.d.ts +13 -0
  99. package/dist/esm/foundation/StatusChip.d.ts.map +1 -0
  100. package/dist/esm/foundation/StatusChip.js +59 -0
  101. package/dist/esm/foundation/StatusChip.js.map +1 -0
  102. package/dist/esm/foundation/TrendChip.d.ts +18 -0
  103. package/dist/esm/foundation/TrendChip.d.ts.map +1 -0
  104. package/dist/esm/foundation/TrendChip.js +88 -0
  105. package/dist/esm/foundation/TrendChip.js.map +1 -0
  106. package/dist/esm/foundation/formatting.d.ts +13 -0
  107. package/dist/esm/foundation/formatting.d.ts.map +1 -0
  108. package/dist/esm/foundation/formatting.js +78 -0
  109. package/dist/esm/foundation/formatting.js.map +1 -0
  110. package/dist/esm/foundation/foundationComponentMetadata.d.ts +3 -0
  111. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -0
  112. package/dist/esm/foundation/foundationComponentMetadata.js +39 -0
  113. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -0
  114. package/dist/esm/foundation/foundationDescriptors.d.ts +6 -0
  115. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -0
  116. package/dist/esm/foundation/foundationDescriptors.js +227 -0
  117. package/dist/esm/foundation/foundationDescriptors.js.map +1 -0
  118. package/dist/esm/foundation/foundationSamples.d.ts +10 -0
  119. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -0
  120. package/dist/esm/foundation/foundationSamples.js +68 -0
  121. package/dist/esm/foundation/foundationSamples.js.map +1 -0
  122. package/dist/esm/foundation/foundationStrings.d.ts +78 -0
  123. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -0
  124. package/dist/esm/foundation/foundationStrings.js +101 -0
  125. package/dist/esm/foundation/foundationStrings.js.map +1 -0
  126. package/dist/esm/foundation/index.d.ts +16 -0
  127. package/dist/esm/foundation/index.d.ts.map +1 -0
  128. package/dist/esm/foundation/index.js +16 -0
  129. package/dist/esm/foundation/index.js.map +1 -0
  130. package/dist/esm/gallery/widgets.js +1 -1
  131. package/dist/esm/index.d.ts +1 -0
  132. package/dist/esm/index.d.ts.map +1 -1
  133. package/dist/esm/index.js +15 -0
  134. package/dist/esm/index.js.map +1 -1
  135. package/dist/esm/themes/dark.d.ts.map +1 -1
  136. package/dist/esm/themes/dark.js +9 -1
  137. package/dist/esm/themes/dark.js.map +1 -1
  138. package/dist/esm/themes/light.d.ts.map +1 -1
  139. package/dist/esm/themes/light.js +10 -2
  140. package/dist/esm/themes/light.js.map +1 -1
  141. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  142. package/foundation/ActionButton.tsx +39 -0
  143. package/foundation/ComponentState.ts +53 -0
  144. package/foundation/EmptyState.tsx +22 -0
  145. package/foundation/Foundation.stories.tsx +30 -0
  146. package/foundation/FoundationIcon.tsx +49 -0
  147. package/foundation/FoundationStates.tsx +46 -0
  148. package/foundation/PermissionRule.ts +26 -0
  149. package/foundation/StatCard.tsx +44 -0
  150. package/foundation/StateFrame.tsx +126 -0
  151. package/foundation/StatusChip.tsx +51 -0
  152. package/foundation/TrendChip.tsx +78 -0
  153. package/foundation/formatting.ts +69 -0
  154. package/foundation/foundationComponentMetadata.ts +17 -0
  155. package/foundation/foundationDescriptors.ts +119 -0
  156. package/foundation/foundationSamples.ts +44 -0
  157. package/foundation/foundationStrings.ts +112 -0
  158. package/foundation/index.ts +18 -0
  159. package/index.ts +1 -0
  160. package/package.json +9 -8
  161. package/shell/layout.css +241 -0
  162. package/themes/dark.ts +8 -0
  163. package/themes/light.ts +9 -1
package/ComponentName.ts CHANGED
@@ -57,4 +57,16 @@ export enum ComponentName {
57
57
 
58
58
  /** Switches between the layout modes. */
59
59
  LayoutModeSwitcher = 'layoutModeSwitcher',
60
+
61
+ /** An icon, a headline, a hint and one primary action: what a region says when it has nothing to show. */
62
+ EmptyState = 'emptyState',
63
+
64
+ /** One key figure with its label, trend and comparison period. */
65
+ StatCard = 'statCard',
66
+
67
+ /** A change drawn as a direction, a magnitude and whether it is good. */
68
+ TrendChip = 'trendChip',
69
+
70
+ /** A status as a semantic color, an icon and its text. */
71
+ StatusChip = 'statusChip',
60
72
  }
@@ -5,6 +5,7 @@ import { PackageKind, ScenePackage } from '@cratis/scene.model';
5
5
  import { ScenePackageBundle, describeComponents } from '@cratis/scene.react';
6
6
  import { ComponentName } from './ComponentName';
7
7
  import { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata';
8
+ import { foundationDescriptors } from './foundation';
8
9
  import { defaultBlueprintComponents } from './defaultBlueprintComponents';
9
10
  import { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';
10
11
  import { LayoutName, defaultLayouts } from './layouts';
@@ -66,5 +67,5 @@ export const defaultBlueprint: ScenePackageBundle = {
66
67
  dialogTemplates: galleryDialogTemplates,
67
68
  screens: galleryScreens,
68
69
  themes: defaultBlueprintThemes,
69
- descriptors: describeComponents(defaultBlueprintManifest.name, [], defaultBlueprintComponentMetadata),
70
+ descriptors: describeComponents(defaultBlueprintManifest.name, foundationDescriptors, defaultBlueprintComponentMetadata),
70
71
  };
@@ -2,10 +2,12 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
4
  import { ComponentCategory } from '@cratis/scene.model';
5
+ import { foundationComponentMetadata } from './foundation';
5
6
  import { ComponentMetadata, componentMetadata as m, navigationDesignMode } from '@cratis/scene.react';
6
7
 
7
8
  /** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */
8
9
  export const defaultBlueprintComponentMetadata: Record<string, ComponentMetadata> = {
10
+ ...foundationComponentMetadata,
9
11
  appShell: m('Application shell', ComponentCategory.Layout, 'app-window', ['layout', 'frame', 'chrome']),
10
12
  fullPageShell: m('Full page shell', ComponentCategory.Layout, 'maximize', ['layout', 'fullscreen', 'frame']),
11
13
  topbar: m('Topbar', ComponentCategory.Navigation, 'panel-top', ['header', 'top bar', 'navigation'], 'Tp', navigationDesignMode()),
@@ -4,6 +4,7 @@
4
4
  import { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';
5
5
  import { ComponentName } from './ComponentName';
6
6
  import { defaultBlueprintName } from './packageName';
7
+ import { EmptyState, StatCard, StatusChip, TrendChip } from './foundation';
7
8
  import {
8
9
  AppShell,
9
10
  Breadcrumb,
@@ -48,4 +49,8 @@ export const defaultBlueprintComponents: ComponentRegistry = {
48
49
  [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,
49
50
  [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,
50
51
  [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,
52
+ [componentRegistryKey(defaultBlueprintName, ComponentName.EmptyState)]: EmptyState,
53
+ [componentRegistryKey(defaultBlueprintName, ComponentName.StatCard)]: StatCard,
54
+ [componentRegistryKey(defaultBlueprintName, ComponentName.TrendChip)]: TrendChip,
55
+ [componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip,
51
56
  };
@@ -26,6 +26,10 @@
26
26
  /** The signed-in user's avatar and menu. */ ComponentName["UserMenu"] = "userMenu";
27
27
  /** Switches between the themes a host offers. */ ComponentName["ThemeSwitcher"] = "themeSwitcher";
28
28
  /** Switches between the layout modes. */ ComponentName["LayoutModeSwitcher"] = "layoutModeSwitcher";
29
+ /** An icon, a headline, a hint and one primary action: what a region says when it has nothing to show. */ ComponentName["EmptyState"] = "emptyState";
30
+ /** One key figure with its label, trend and comparison period. */ ComponentName["StatCard"] = "statCard";
31
+ /** A change drawn as a direction, a magnitude and whether it is good. */ ComponentName["TrendChip"] = "trendChip";
32
+ /** A status as a semantic color, an icon and its text. */ ComponentName["StatusChip"] = "statusChip";
29
33
  return ComponentName;
30
34
  }({});
31
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;6GAC8F,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8FAGf,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oEAG1B,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wEAGI,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;8BAG1C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGwC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG9B,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;wCAGA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;yDAGiB,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uFAG8B,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mDAGpC,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;sEAGmB,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;2BAG3C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;iDAGsB,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;sDAGK,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;8CAGR,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;AA9C/BA,IAAAA,OAAAA,aAAAA;AAgDX,CAAA,CAAA,EAAA;;"}
1
+ {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n\n /** An icon, a headline, a hint and one primary action: what a region says when it has nothing to show. */\n EmptyState = 'emptyState',\n\n /** One key figure with its label, trend and comparison period. */\n StatCard = 'statCard',\n\n /** A change drawn as a direction, a magnitude and whether it is good. */\n TrendChip = 'trendChip',\n\n /** A status as a semantic color, an icon and its text. */\n StatusChip = 'statusChip',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;6GAC8F,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8FAGf,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oEAG1B,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wEAGI,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;8BAG1C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGwC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG9B,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;wCAGA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;yDAGiB,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uFAG8B,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mDAGpC,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;sEAGmB,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;2BAG3C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;iDAGsB,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;sDAGK,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;8CAGR,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;+GAGiE,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uEAGxC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8EAGO,aAAA,CAAA,WAAA,CAAA,GAAA,WAAA;+DAGf,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;AA1DhDA,IAAAA,OAAAA,aAAAA;AA4DX,CAAA,CAAA,EAAA;;"}
@@ -4,7 +4,15 @@ var scene_model = require('@cratis/scene.model');
4
4
  var scene_react = require('@cratis/scene.react');
5
5
  var ComponentName = require('./ComponentName.js');
6
6
  var defaultBlueprintComponentMetadata = require('./defaultBlueprintComponentMetadata.js');
7
+ require('./foundation/ComponentState.js');
8
+ require('react/jsx-runtime');
9
+ var foundationDescriptors = require('./foundation/foundationDescriptors.js');
10
+ require('./foundation/foundationComponentMetadata.js');
11
+ require('./foundation/foundationSamples.js');
7
12
  var defaultBlueprintComponents = require('./defaultBlueprintComponents.js');
13
+ var packageName = require('./packageName.js');
14
+ var defaultBlueprintThemes = require('./themes/defaultBlueprintThemes.js');
15
+ require('react');
8
16
  require('./gallery/elements.js');
9
17
  require('./gallery/navigation.js');
10
18
  var LayoutName = require('./layouts/LayoutName.js');
@@ -12,10 +20,6 @@ require('./layouts/shellComponents.js');
12
20
  require('./layouts/appShell.js');
13
21
  require('./layouts/fullPage.js');
14
22
  var defaultLayouts = require('./layouts/defaultLayouts.js');
15
- var packageName = require('./packageName.js');
16
- var defaultBlueprintThemes = require('./themes/defaultBlueprintThemes.js');
17
- require('react/jsx-runtime');
18
- require('react');
19
23
  require('./gallery/nesting.js');
20
24
  require('./gallery/workspaceTemplates.js');
21
25
  require('./gallery/supportTemplates.js');
@@ -88,7 +92,7 @@ require('./gallery/GalleryScreenPreview.js');
88
92
  dialogTemplates: dialogTemplates.galleryDialogTemplates,
89
93
  screens: screens.galleryScreens,
90
94
  themes: defaultBlueprintThemes.defaultBlueprintThemes,
91
- descriptors: scene_react.describeComponents(defaultBlueprintManifest.name, [], defaultBlueprintComponentMetadata.defaultBlueprintComponentMetadata)
95
+ descriptors: scene_react.describeComponents(defaultBlueprintManifest.name, foundationDescriptors.foundationDescriptors, defaultBlueprintComponentMetadata.defaultBlueprintComponentMetadata)
92
96
  };
93
97
 
94
98
  exports.defaultBlueprint = defaultBlueprint;
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprint.js","sources":["../../defaultBlueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle, describeComponents } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata';\nimport { defaultBlueprintComponents } from './defaultBlueprintComponents';\nimport { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';\nimport { LayoutName, defaultLayouts } from './layouts';\nimport { defaultBlueprintName } from './packageName';\nimport { defaultBlueprintThemes } from './themes';\n\n/**\n * The default blueprint's declaration.\n *\n * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that\n * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside\n * them, the components that fill their slots, and the themes that color all of it. Picking the parts\n * separately is how an application ends up with a sidebar from one design language and a form from\n * another.\n *\n * The dependency list is what makes a blueprint honest about what it is built from. This one declares\n * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and\n * Cratis Components, which its screen templates fill their content with. A profile that activated this\n * blueprint without them would render a shell whose every control was a dashed red placeholder, and\n * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when\n * someone opens the page.\n *\n * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen\n * template, not a layout, and is listed as one.\n */\nexport const defaultBlueprintManifest: ScenePackage = {\n name: defaultBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'PrimeReact' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: Object.values(LayoutName),\n screenTemplates: galleryScreenTemplates.map(template => template.name),\n dialogTemplates: galleryDialogTemplates.map(template => template.name),\n themes: defaultBlueprintThemes.map(theme => theme.name),\n displayName: 'Cratis Default Blueprint',\n description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',\n module: '@cratis/scene.blueprint.default',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The default blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a component the bundle never registered renders as a\n * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.\n *\n * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the\n * content that fills it, so a preview boots them through the real engine as a working miniature\n * application rather than a set of pictures.\n */\nexport const defaultBlueprint: ScenePackageBundle = {\n manifest: defaultBlueprintManifest,\n components: defaultBlueprintComponents,\n layouts: defaultLayouts,\n screenTemplates: galleryScreenTemplates,\n dialogTemplates: galleryDialogTemplates,\n screens: galleryScreens,\n themes: defaultBlueprintThemes,\n descriptors: describeComponents(defaultBlueprintManifest.name, [], defaultBlueprintComponentMetadata),\n};\n"],"names":["defaultBlueprintManifest","name","defaultBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","LayoutName","screenTemplates","galleryScreenTemplates","map","template","dialogTemplates","galleryDialogTemplates","themes","defaultBlueprintThemes","theme","displayName","description","module","license","licenseUrl","defaultBlueprint","manifest","defaultBlueprintComponents","defaultLayouts","screens","galleryScreens","descriptors","describeComponents","defaultBlueprintComponentMetadata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAYA;;;;;;;;;;;;;;;;;;UAmBaA,wBAAAA,GAAyC;IAClDC,IAAAA,EAAMC,gCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAAa,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACrEO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,2BAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,qBAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,+BAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uCAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,8CAAuBL,GAAG,CAACM,CAAAA,KAAAA,GAASA,MAAMrB,IAAI,CAAA;IACtDsB,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,4HAAA;IACbC,MAAAA,EAAQ,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,qDAAAA;IACZlB,OAAAA,EAASmB,6BAAAA;IACTjB,eAAAA,EAAiBC,8BAAAA;IACjBG,eAAAA,EAAiBC,sCAAAA;IACjBa,OAAAA,EAASC,sBAAAA;IACTb,MAAAA,EAAQC,6CAAAA;AACRa,IAAAA,WAAAA,EAAaC,8BAAAA,CAAmBnC,wBAAAA,CAAyBC,IAAI,EAAE,EAAE,EAAEmC,mEAAAA;AACvE;;;"}
1
+ {"version":3,"file":"defaultBlueprint.js","sources":["../../defaultBlueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle, describeComponents } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata';\nimport { foundationDescriptors } from './foundation';\nimport { defaultBlueprintComponents } from './defaultBlueprintComponents';\nimport { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';\nimport { LayoutName, defaultLayouts } from './layouts';\nimport { defaultBlueprintName } from './packageName';\nimport { defaultBlueprintThemes } from './themes';\n\n/**\n * The default blueprint's declaration.\n *\n * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that\n * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside\n * them, the components that fill their slots, and the themes that color all of it. Picking the parts\n * separately is how an application ends up with a sidebar from one design language and a form from\n * another.\n *\n * The dependency list is what makes a blueprint honest about what it is built from. This one declares\n * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and\n * Cratis Components, which its screen templates fill their content with. A profile that activated this\n * blueprint without them would render a shell whose every control was a dashed red placeholder, and\n * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when\n * someone opens the page.\n *\n * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen\n * template, not a layout, and is listed as one.\n */\nexport const defaultBlueprintManifest: ScenePackage = {\n name: defaultBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'PrimeReact' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: Object.values(LayoutName),\n screenTemplates: galleryScreenTemplates.map(template => template.name),\n dialogTemplates: galleryDialogTemplates.map(template => template.name),\n themes: defaultBlueprintThemes.map(theme => theme.name),\n displayName: 'Cratis Default Blueprint',\n description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',\n module: '@cratis/scene.blueprint.default',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The default blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a component the bundle never registered renders as a\n * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.\n *\n * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the\n * content that fills it, so a preview boots them through the real engine as a working miniature\n * application rather than a set of pictures.\n */\nexport const defaultBlueprint: ScenePackageBundle = {\n manifest: defaultBlueprintManifest,\n components: defaultBlueprintComponents,\n layouts: defaultLayouts,\n screenTemplates: galleryScreenTemplates,\n dialogTemplates: galleryDialogTemplates,\n screens: galleryScreens,\n themes: defaultBlueprintThemes,\n descriptors: describeComponents(defaultBlueprintManifest.name, foundationDescriptors, defaultBlueprintComponentMetadata),\n};\n"],"names":["defaultBlueprintManifest","name","defaultBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","LayoutName","screenTemplates","galleryScreenTemplates","map","template","dialogTemplates","galleryDialogTemplates","themes","defaultBlueprintThemes","theme","displayName","description","module","license","licenseUrl","defaultBlueprint","manifest","defaultBlueprintComponents","defaultLayouts","screens","galleryScreens","descriptors","describeComponents","foundationDescriptors","defaultBlueprintComponentMetadata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;;;;;;;;;;;;;UAmBaA,wBAAAA,GAAyC;IAClDC,IAAAA,EAAMC,gCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAAa,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACrEO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,2BAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,qBAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,+BAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uCAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,8CAAuBL,GAAG,CAACM,CAAAA,KAAAA,GAASA,MAAMrB,IAAI,CAAA;IACtDsB,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,4HAAA;IACbC,MAAAA,EAAQ,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,qDAAAA;IACZlB,OAAAA,EAASmB,6BAAAA;IACTjB,eAAAA,EAAiBC,8BAAAA;IACjBG,eAAAA,EAAiBC,sCAAAA;IACjBa,OAAAA,EAASC,sBAAAA;IACTb,MAAAA,EAAQC,6CAAAA;AACRa,IAAAA,WAAAA,EAAaC,8BAAAA,CAAmBnC,wBAAAA,CAAyBC,IAAI,EAAEmC,2CAAAA,EAAuBC,mEAAAA;AAC1F;;;"}
@@ -1,11 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  var scene_model = require('@cratis/scene.model');
4
+ require('./foundation/ComponentState.js');
5
+ require('react/jsx-runtime');
6
+ require('./foundation/foundationDescriptors.js');
7
+ var foundationComponentMetadata = require('./foundation/foundationComponentMetadata.js');
8
+ require('./foundation/foundationSamples.js');
4
9
  var scene_react = require('@cratis/scene.react');
10
+ require('./defaultBlueprintComponents.js');
11
+ require('react');
5
12
 
6
13
  // Copyright (c) Cratis. All rights reserved.
7
14
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
15
  /** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */ const defaultBlueprintComponentMetadata = {
16
+ ...foundationComponentMetadata.foundationComponentMetadata,
9
17
  appShell: scene_react.componentMetadata('Application shell', scene_model.ComponentCategory.Layout, 'app-window', [
10
18
  'layout',
11
19
  'frame',
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprintComponentMetadata.js","sources":["../../defaultBlueprintComponentMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentCategory } from '@cratis/scene.model';\nimport { ComponentMetadata, componentMetadata as m, navigationDesignMode } from '@cratis/scene.react';\n\n/** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */\nexport const defaultBlueprintComponentMetadata: Record<string, ComponentMetadata> = {\n appShell: m('Application shell', ComponentCategory.Layout, 'app-window', ['layout', 'frame', 'chrome']),\n fullPageShell: m('Full page shell', ComponentCategory.Layout, 'maximize', ['layout', 'fullscreen', 'frame']),\n topbar: m('Topbar', ComponentCategory.Navigation, 'panel-top', ['header', 'top bar', 'navigation'], 'Tp', navigationDesignMode()),\n sidebar: m('Side bar', ComponentCategory.Navigation, 'panel-left', ['navigation', 'menu', 'side panel'], 'Sb', navigationDesignMode({ sidebar: true })),\n menu: m('Menu', ComponentCategory.Navigation, 'menu', ['navigation', 'list', 'links']),\n menuItem: m('Menu item', ComponentCategory.Navigation, 'minus', ['link', 'entry', 'navigation']),\n breadcrumb: m('Breadcrumbs', ComponentCategory.Navigation, 'chevron-right', ['trail', 'path', 'navigation']),\n footer: m('Footer', ComponentCategory.Layout, 'panel-bottom', ['bottom', 'page footer']),\n rightPanel: m('Right panel', ComponentCategory.Layout, 'panel-right', ['side panel', 'drawer', 'aside']),\n configPanel: m('Config panel', ComponentCategory.Layout, 'settings', ['settings', 'layout options', 'preferences']),\n pageHeader: m('Page header', ComponentCategory.Layout, 'heading', ['title', 'header', 'page title']),\n mask: m('Mask', ComponentCategory.Feedback, 'layers', ['overlay', 'scrim', 'backdrop']),\n logo: m('Logo', ComponentCategory.DataDisplay, 'badge', ['brand', 'identity', 'image']),\n userMenu: m('User menu', ComponentCategory.Actions, 'circle-user', ['account', 'profile', 'sign out']),\n themeSwitcher: m('Theme switcher', ComponentCategory.Actions, 'palette', ['theme', 'dark mode', 'colors']),\n layoutModeSwitcher: m('Layout mode switcher', ComponentCategory.Actions, 'layout-dashboard', ['layout', 'mode', 'navigation style']),\n};\n"],"names":["defaultBlueprintComponentMetadata","appShell","m","ComponentCategory","Layout","fullPageShell","topbar","Navigation","navigationDesignMode","sidebar","menu","menuItem","breadcrumb","footer","rightPanel","configPanel","pageHeader","mask","Feedback","logo","DataDisplay","userMenu","Actions","themeSwitcher","layoutModeSwitcher"],"mappings":";;;;;AAAA;AACA;AAKA,6HACO,MAAMA,iCAAAA,GAAuE;AAChFC,IAAAA,QAAAA,EAAUC,6BAAAA,CAAE,mBAAA,EAAqBC,6BAAAA,CAAkBC,MAAM,EAAE,YAAA,EAAc;AAAC,QAAA,QAAA;AAAU,QAAA,OAAA;AAAS,QAAA;AAAS,KAAA,CAAA;AACtGC,IAAAA,aAAAA,EAAeH,6BAAAA,CAAE,iBAAA,EAAmBC,6BAAAA,CAAkBC,MAAM,EAAE,UAAA,EAAY;AAAC,QAAA,QAAA;AAAU,QAAA,YAAA;AAAc,QAAA;AAAQ,KAAA,CAAA;AAC3GE,IAAAA,MAAAA,EAAQJ,6BAAAA,CAAE,QAAA,EAAUC,6BAAAA,CAAkBI,UAAU,EAAE,WAAA,EAAa;AAAC,QAAA,QAAA;AAAU,QAAA,SAAA;AAAW,QAAA;AAAa,KAAA,EAAE,IAAA,EAAMC,gCAAAA,EAAAA,CAAAA;AAC1GC,IAAAA,OAAAA,EAASP,6BAAAA,CAAE,UAAA,EAAYC,6BAAAA,CAAkBI,UAAU,EAAE,YAAA,EAAc;AAAC,QAAA,YAAA;AAAc,QAAA,MAAA;AAAQ,QAAA;AAAa,KAAA,EAAE,MAAMC,gCAAAA,CAAqB;QAAEC,OAAAA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BAAAA,CAAkBe,QAAQ,EAAE,QAAA,EAAU;AAAC,QAAA,SAAA;AAAW,QAAA,OAAA;AAAS,QAAA;AAAW,KAAA,CAAA;AACtFC,IAAAA,IAAAA,EAAMjB,6BAAAA,CAAE,MAAA,EAAQC,6BAAAA,CAAkBiB,WAAW,EAAE,OAAA,EAAS;AAAC,QAAA,OAAA;AAAS,QAAA,UAAA;AAAY,QAAA;AAAQ,KAAA,CAAA;AACtFC,IAAAA,QAAAA,EAAUnB,6BAAAA,CAAE,WAAA,EAAaC,6BAAAA,CAAkBmB,OAAO,EAAE,aAAA,EAAe;AAAC,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA;AAAW,KAAA,CAAA;AACrGC,IAAAA,aAAAA,EAAerB,6BAAAA,CAAE,gBAAA,EAAkBC,6BAAAA,CAAkBmB,OAAO,EAAE,SAAA,EAAW;AAAC,QAAA,OAAA;AAAS,QAAA,WAAA;AAAa,QAAA;AAAS,KAAA,CAAA;AACzGE,IAAAA,kBAAAA,EAAoBtB,6BAAAA,CAAE,sBAAA,EAAwBC,6BAAAA,CAAkBmB,OAAO,EAAE,kBAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,MAAA;AAAQ,QAAA;AAAmB,KAAA;AACvI;;"}
1
+ {"version":3,"file":"defaultBlueprintComponentMetadata.js","sources":["../../defaultBlueprintComponentMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentCategory } from '@cratis/scene.model';\nimport { foundationComponentMetadata } from './foundation';\nimport { ComponentMetadata, componentMetadata as m, navigationDesignMode } from '@cratis/scene.react';\n\n/** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */\nexport const defaultBlueprintComponentMetadata: Record<string, ComponentMetadata> = {\n ...foundationComponentMetadata,\n appShell: m('Application shell', ComponentCategory.Layout, 'app-window', ['layout', 'frame', 'chrome']),\n fullPageShell: m('Full page shell', ComponentCategory.Layout, 'maximize', ['layout', 'fullscreen', 'frame']),\n topbar: m('Topbar', ComponentCategory.Navigation, 'panel-top', ['header', 'top bar', 'navigation'], 'Tp', navigationDesignMode()),\n sidebar: m('Side bar', ComponentCategory.Navigation, 'panel-left', ['navigation', 'menu', 'side panel'], 'Sb', navigationDesignMode({ sidebar: true })),\n menu: m('Menu', ComponentCategory.Navigation, 'menu', ['navigation', 'list', 'links']),\n menuItem: m('Menu item', ComponentCategory.Navigation, 'minus', ['link', 'entry', 'navigation']),\n breadcrumb: m('Breadcrumbs', ComponentCategory.Navigation, 'chevron-right', ['trail', 'path', 'navigation']),\n footer: m('Footer', ComponentCategory.Layout, 'panel-bottom', ['bottom', 'page footer']),\n rightPanel: m('Right panel', ComponentCategory.Layout, 'panel-right', ['side panel', 'drawer', 'aside']),\n configPanel: m('Config panel', ComponentCategory.Layout, 'settings', ['settings', 'layout options', 'preferences']),\n pageHeader: m('Page header', ComponentCategory.Layout, 'heading', ['title', 'header', 'page title']),\n mask: m('Mask', ComponentCategory.Feedback, 'layers', ['overlay', 'scrim', 'backdrop']),\n logo: m('Logo', ComponentCategory.DataDisplay, 'badge', ['brand', 'identity', 'image']),\n userMenu: m('User menu', ComponentCategory.Actions, 'circle-user', ['account', 'profile', 'sign out']),\n themeSwitcher: m('Theme switcher', ComponentCategory.Actions, 'palette', ['theme', 'dark mode', 'colors']),\n layoutModeSwitcher: m('Layout mode switcher', ComponentCategory.Actions, 'layout-dashboard', ['layout', 'mode', 'navigation style']),\n};\n"],"names":["defaultBlueprintComponentMetadata","foundationComponentMetadata","appShell","m","ComponentCategory","Layout","fullPageShell","topbar","Navigation","navigationDesignMode","sidebar","menu","menuItem","breadcrumb","footer","rightPanel","configPanel","pageHeader","mask","Feedback","logo","DataDisplay","userMenu","Actions","themeSwitcher","layoutModeSwitcher"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAMA,6HACO,MAAMA,iCAAAA,GAAuE;AAChF,IAAA,GAAGC,uDAA2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AAkBC,6BAAAA,CAAkBmB,OAAO,EAAE,SAAA,EAAW;AAAC,QAAA,OAAA;AAAS,QAAA,WAAA;AAAa,QAAA;AAAS,KAAA,CAAA;AACzGE,IAAAA,kBAAAA,EAAoBtB,6BAAAA,CAAE,sBAAA,EAAwBC,6BAAAA,CAAkBmB,OAAO,EAAE,kBAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,MAAA;AAAQ,QAAA;AAAmB,KAAA;AACvI;;"}
@@ -3,7 +3,15 @@
3
3
  var scene_react = require('@cratis/scene.react');
4
4
  var ComponentName = require('./ComponentName.js');
5
5
  var packageName = require('./packageName.js');
6
+ require('./foundation/ComponentState.js');
6
7
  require('react/jsx-runtime');
8
+ var EmptyState = require('./foundation/EmptyState.js');
9
+ var TrendChip = require('./foundation/TrendChip.js');
10
+ var StatusChip = require('./foundation/StatusChip.js');
11
+ var StatCard = require('./foundation/StatCard.js');
12
+ require('./foundation/foundationDescriptors.js');
13
+ require('./foundation/foundationComponentMetadata.js');
14
+ require('./foundation/foundationSamples.js');
7
15
  require('react');
8
16
  var AppShell = require('./shell/AppShell.js');
9
17
  var FullPageShell = require('./shell/FullPageShell.js');
@@ -47,7 +55,11 @@ var LayoutModeSwitcher = require('./shell/LayoutModeSwitcher.js');
47
55
  [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Logo)]: Logo.Logo,
48
56
  [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.UserMenu)]: UserMenu.UserMenu,
49
57
  [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.ThemeSwitcher)]: ThemeSwitcher.ThemeSwitcher,
50
- [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher.LayoutModeSwitcher
58
+ [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher.LayoutModeSwitcher,
59
+ [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.EmptyState)]: EmptyState.EmptyState,
60
+ [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.StatCard)]: StatCard.StatCard,
61
+ [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.TrendChip)]: TrendChip.TrendChip,
62
+ [scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.StatusChip)]: StatusChip.StatusChip
51
63
  };
52
64
 
53
65
  exports.defaultBlueprintComponents = defaultBlueprintComponents;
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprintComponents.js","sources":["../../defaultBlueprintComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintName } from './packageName';\nimport {\n AppShell,\n Breadcrumb,\n ConfigPanel,\n Footer,\n FullPageShell,\n LayoutModeSwitcher,\n Logo,\n Mask,\n Menu,\n MenuItem,\n PageHeader,\n RightPanel,\n Sidebar,\n ThemeSwitcher,\n Topbar,\n UserMenu,\n} from './shell';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n */\nexport const defaultBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,\n [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,\n [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,\n};\n"],"names":["defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","ComponentName","AppShell","FullPageShell","Topbar","Sidebar","Menu","MenuItem","Breadcrumb","Footer","RightPanel","ConfigPanel","PageHeader","Mask","Logo","UserMenu","ThemeSwitcher","LayoutModeSwitcher"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAwBA;;;;;;;UAQaA,0BAAAA,GAAgD;AACzD,IAAA,CAACC,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcC,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACH,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcE,aAAa,IAAIA,2BAAAA;AAC3E,IAAA,CAACJ,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcG,MAAM,IAAIA,aAAAA;AACpE,IAAA,CAACL,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcI,OAAO,IAAIA,eAAAA;AACrE,IAAA,CAACN,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcK,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACP,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcM,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACR,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcO,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACT,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcQ,MAAM,IAAIA,aAAAA;AACpE,IAAA,CAACV,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcS,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACX,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcU,WAAW,IAAIA,uBAAAA;AACzE,IAAA,CAACZ,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcW,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACb,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcY,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACd,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAca,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACf,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcc,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAAChB,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAce,aAAa,IAAIA,2BAAAA;AAC3E,IAAA,CAACjB,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcgB,kBAAkB,IAAIA;AACpF;;"}
1
+ {"version":3,"file":"defaultBlueprintComponents.js","sources":["../../defaultBlueprintComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintName } from './packageName';\nimport { EmptyState, StatCard, StatusChip, TrendChip } from './foundation';\nimport {\n AppShell,\n Breadcrumb,\n ConfigPanel,\n Footer,\n FullPageShell,\n LayoutModeSwitcher,\n Logo,\n Mask,\n Menu,\n MenuItem,\n PageHeader,\n RightPanel,\n Sidebar,\n ThemeSwitcher,\n Topbar,\n UserMenu,\n} from './shell';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n */\nexport const defaultBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,\n [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,\n [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.EmptyState)]: EmptyState,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatCard)]: StatCard,\n [componentRegistryKey(defaultBlueprintName, ComponentName.TrendChip)]: TrendChip,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip,\n};\n"],"names":["defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","ComponentName","AppShell","FullPageShell","Topbar","Sidebar","Menu","MenuItem","Breadcrumb","Footer","RightPanel","ConfigPanel","PageHeader","Mask","Logo","UserMenu","ThemeSwitcher","LayoutModeSwitcher","EmptyState","StatCard","TrendChip","StatusChip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAyBA;;;;;;;UAQaA,0BAAAA,GAAgD;AACzD,IAAA,CAACC,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcC,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACH,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcE,aAAa,IAAIA,2BAAAA;AAC3E,IAAA,CAACJ,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcG,MAAM,IAAIA,aAAAA;AACpE,IAAA,CAACL,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcI,OAAO,IAAIA,eAAAA;AACrE,IAAA,CAACN,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcK,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACP,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcM,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACR,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcO,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACT,gCAAAA,CAAq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issionRule.js');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * The one button every foundation component starts an action with, so the permission rule of spec Part B 1.5 is honoured in one place:
10
+ * hidden renders nothing; disabled stays focusable-by-description (`aria-disabled`) and carries the reason, rather than a bare
11
+ * greyed control nobody can explain.
12
+ */ function ActionButton({ rule = PermissionRule.PermissionRule.Enabled, disabledReason, onClick, emphasis = 'primary', children }) {
13
+ if (rule === PermissionRule.PermissionRule.Hidden) return undefined;
14
+ const disabled = rule === PermissionRule.PermissionRule.Disabled;
15
+ return /*#__PURE__*/ jsxRuntime.jsxs("button", {
16
+ type: "button",
17
+ className: "foundation-button",
18
+ "data-emphasis": emphasis,
19
+ "aria-disabled": disabled || undefined,
20
+ title: disabled ? disabledReason : undefined,
21
+ onClick: disabled ? undefined : onClick,
22
+ children: [
23
+ children,
24
+ disabled && /*#__PURE__*/ jsxRuntime.jsx("span", {
25
+ className: "foundation-visually-hidden",
26
+ children: `. ${disabledReason}`
27
+ })
28
+ ]
29
+ });
30
+ }
31
+
32
+ exports.ActionButton = ActionButton;
33
+ //# sourceMappingURL=ActionButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButton.js","sources":["../../../foundation/ActionButton.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ReactNode } from 'react';\nimport { PermissionRule } from './PermissionRule';\n\nexport interface ActionButtonProps {\n /** The permission rule that decides whether the control works, refuses or is not rendered. */\n rule?: PermissionRule;\n\n /** Why the control is disabled, announced and shown as its tooltip. */\n disabledReason: string;\n\n /** What the control does when pressed. */\n onClick?: (event: { stopPropagation(): void }) => void;\n\n /** The emphasis of the button. */\n emphasis?: 'primary' | 'secondary' | 'quiet';\n\n children: ReactNode;\n}\n\n/**\n * The one button every foundation component starts an action with, so the permission rule of spec Part B 1.5 is honoured in one place:\n * hidden renders nothing; disabled stays focusable-by-description (`aria-disabled`) and carries the reason, rather than a bare\n * greyed control nobody can explain.\n */\nexport function ActionButton({ rule = PermissionRule.Enabled, disabledReason, onClick, emphasis = 'primary', children }: ActionButtonProps) {\n if (rule === PermissionRule.Hidden) return undefined;\n\n const disabled = rule === PermissionRule.Disabled;\n return (\n <button type='button' className='foundation-button' data-emphasis={emphasis} aria-disabled={disabled || undefined}\n title={disabled ? disabledReason : undefined} onClick={disabled ? undefined : onClick}>\n {children}\n {disabled && <span className='foundation-visually-hidden'>{`. ${disabledReason}`}</span>}\n </button>\n );\n}\n"],"names":["ActionButton","rule","PermissionRule","Enabled","disabledReason","onClick","emphasis","children","Hidden","undefined","disabled","Disabled","_jsxs","button","type","className","data-emphasis","aria-disabled","title","_jsx","span"],"mappings":";;;;;AAAA;AACA;AAqBA;;;;AAIC,IACM,SAASA,YAAAA,CAAa,EAAEC,IAAAA,GAAOC,8BAAeC,OAAO,EAAEC,cAAc,EAAEC,OAAO,EAAEC,QAAAA,GAAW,SAAS,EAAEC,QAAQ,EAAqB,EAAA;AACtI,IAAA,IAAIN,IAAAA,KAASC,6BAAAA,CAAeM,MAAM,EAAE,OAAOC,SAAAA;IAE3C,MAAMC,QAAAA,GAAWT,IAAAA,KAASC,6BAAAA,CAAeS,QAAQ;AACjD,IAAA,qBACIC,eAAA,CAACC,QAAAA,EAAAA;QAAOC,IAAAA,EAAK,QAAA;QAASC,SAAAA,EAAU,mBAAA;QAAoBC,eAAAA,EAAeV,QAAAA;AAAUW,QAAAA,eAAAA,EAAeP,QAAAA,IAAYD,SAAAA;AACpGS,QAAAA,KAAAA,EAAOR,WAAWN,cAAAA,GAAiBK,SAAAA;AAAWJ,QAAAA,OAAAA,EAASK,WAAWD,SAAAA,GAAYJ,OAAAA;;AAC7EE,YAAAA,QAAAA;AACAG,YAAAA,QAAAA,kBAAYS,cAAA,CAACC,MAAAA,EAAAA;gBAAKL,SAAAA,EAAU,4BAAA;0BAA8B,CAAC,EAAE,EAAEX,cAAAA,CAAAA;;;;AAG5E;;"}
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The visual states every data-showing foundation component defines (spec Part B 1.4).
7
+ *
8
+ * A template is only worth choosing if it looks right in all of them: an application spends real time loading, empty, failing
9
+ * and not allowed, and a component that only draws its populated self has not been finished.
10
+ */ var ComponentState = /*#__PURE__*/ function(ComponentState) {
11
+ /** The data is there and drawn. */ ComponentState["Ready"] = "ready";
12
+ /** The data has not answered yet: a skeleton in the shape of the content, never a spinner alone. */ ComponentState["Loading"] = "loading";
13
+ /** The data answered with nothing: an explanation and the primary action. */ ComponentState["Empty"] = "empty";
14
+ /** The data could not be loaded: a message and a retry. */ ComponentState["Error"] = "error";
15
+ /** The user may not see the data: what is missing, and nothing of the data. */ ComponentState["NoPermission"] = "noPermission";
16
+ /** Some regions loaded and some failed: what loaded, plus which parts did not. */ ComponentState["Partial"] = "partial";
17
+ return ComponentState;
18
+ }({});
19
+ /** Every state, in the order a preview or a story lists them. */ const componentStates = Object.values(ComponentState);
20
+ /**
21
+ * Reads the state a component is in from its properties.
22
+ *
23
+ * An explicit `state` property wins, which is how a preview forces a state. Otherwise the state follows the properties a bound
24
+ * query already publishes - the same `loading` and `error` the preview states use for tables - plus `forbidden` and
25
+ * `failedRegions`, and falls to Empty when the component has nothing to show.
26
+ *
27
+ * @param element The element being rendered.
28
+ * @param hasData Whether the component has anything to draw when it is ready.
29
+ */ function readComponentState(element, hasData) {
30
+ const { state, forbidden, error, loading, failedRegions } = element.properties;
31
+ if (typeof state === 'string' && componentStates.includes(state)) return state;
32
+ if (forbidden === true) return "noPermission";
33
+ if (typeof error === 'string' && error.length > 0) return "error";
34
+ if (loading === true) return "loading";
35
+ if (Array.isArray(failedRegions) && failedRegions.length > 0) return "partial";
36
+ return hasData ? "ready" : "empty";
37
+ }
38
+
39
+ exports.ComponentState = ComponentState;
40
+ exports.componentStates = componentStates;
41
+ exports.readComponentState = readComponentState;
42
+ //# sourceMappingURL=ComponentState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentState.js","sources":["../../../foundation/ComponentState.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\n\n/**\n * The visual states every data-showing foundation component defines (spec Part B 1.4).\n *\n * A template is only worth choosing if it looks right in all of them: an application spends real time loading, empty, failing\n * and not allowed, and a component that only draws its populated self has not been finished.\n */\nexport enum ComponentState {\n /** The data is there and drawn. */\n Ready = 'ready',\n\n /** The data has not answered yet: a skeleton in the shape of the content, never a spinner alone. */\n Loading = 'loading',\n\n /** The data answered with nothing: an explanation and the primary action. */\n Empty = 'empty',\n\n /** The data could not be loaded: a message and a retry. */\n Error = 'error',\n\n /** The user may not see the data: what is missing, and nothing of the data. */\n NoPermission = 'noPermission',\n\n /** Some regions loaded and some failed: what loaded, plus which parts did not. */\n Partial = 'partial',\n}\n\n/** Every state, in the order a preview or a story lists them. */\nexport const componentStates: readonly ComponentState[] = Object.values(ComponentState);\n\n/**\n * Reads the state a component is in from its properties.\n *\n * An explicit `state` property wins, which is how a preview forces a state. Otherwise the state follows the properties a bound\n * query already publishes - the same `loading` and `error` the preview states use for tables - plus `forbidden` and\n * `failedRegions`, and falls to Empty when the component has nothing to show.\n *\n * @param element The element being rendered.\n * @param hasData Whether the component has anything to draw when it is ready.\n */\nexport function readComponentState(element: ExternalComponent, hasData: boolean): ComponentState {\n const { state, forbidden, error, loading, failedRegions } = element.properties;\n if (typeof state === 'string' && (componentStates as readonly string[]).includes(state)) return state as ComponentState;\n if (forbidden === true) return ComponentState.NoPermission;\n if (typeof error === 'string' && error.length > 0) return ComponentState.Error;\n if (loading === true) return ComponentState.Loading;\n if (Array.isArray(failedRegions) && failedRegions.length > 0) return ComponentState.Partial;\n return hasData ? ComponentState.Ready : ComponentState.Empty;\n}\n"],"names":["ComponentState","componentStates","Object","values","readComponentState","element","hasData","state","forbidden","error","loading","failedRegions","properties","includes","length","Array","isArray"],"mappings":";;AAAA;AACA;AAIA;;;;;IAMO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;wCACyB,cAAA,CAAA,OAAA,CAAA,GAAA,OAAA;yGAGiE,cAAA,CAAA,SAAA,CAAA,GAAA,SAAA;kFAGvB,cAAA,CAAA,OAAA,CAAA,GAAA,OAAA;gEAGlB,cAAA,CAAA,OAAA,CAAA,GAAA,OAAA;oFAGoB,cAAA,CAAA,cAAA,CAAA,GAAA,cAAA;uFAGG,cAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AAhBxEA,IAAAA,OAAAA,cAAAA;AAkBX,CAAA,CAAA,EAAA;AAED,kEACO,MAAMC,kBAA6CC,MAAAA,CAAOC,MAAM,CAACH,cAAAA;AAExE;;;;;;;;;AASC,IACM,SAASI,kBAAAA,CAAmBC,OAA0B,EAAEC,OAAgB,EAAA;AAC3E,IAAA,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAEC,OAAO,EAAEC,aAAa,EAAE,GAAGN,QAAQO,UAAU;IAC9E,IAAI,OAAOL,UAAU,QAAA,IAAaN,gBAAsCY,QAAQ,CAACN,QAAQ,OAAOA,KAAAA;AAChG,IAAA,IAAIC,cAAc,IAAA,EAAM,OAAA,cAAA;AACxB,IAAA,IAAI,OAAOC,KAAAA,KAAU,QAAA,IAAYA,KAAAA,CAAMK,MAAM,GAAG,CAAA,EAAG,OAAA,OAAA;AACnD,IAAA,IAAIJ,YAAY,IAAA,EAAM,OAAA,SAAA;AACtB,IAAA,IAAIK,MAAMC,OAAO,CAACL,kBAAkBA,aAAAA,CAAcG,MAAM,GAAG,CAAA,EAAG,OAAA,SAAA;IAC9D,OAAOR,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA;AACX;;;;"}
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var StateFrame = require('./StateFrame.js');
5
+ var foundationStrings = require('./foundationStrings.js');
6
+ var formatting = require('./formatting.js');
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /**
11
+ * The empty state as a component of its own: an icon, a headline, a hint and one primary action, embeddable in any region.
12
+ *
13
+ * Every other foundation component shows this same view when it has no data, so a screen reads the same wherever nothing is
14
+ * found. Placed on its own it is what a template puts in a region that has nothing to say yet. The action starts whatever the
15
+ * element's behaviors say, and honours the `actionPermission` rule, so an empty list never offers a creation the user may not do.
16
+ */ function EmptyState({ element, interactions }) {
17
+ return /*#__PURE__*/ jsxRuntime.jsx("section", {
18
+ className: "foundation foundation-empty-state",
19
+ "data-scene-id": element.id,
20
+ "data-state": "empty",
21
+ lang: formatting.readLocale(element),
22
+ children: /*#__PURE__*/ jsxRuntime.jsx(StateFrame.EmptyStateView, {
23
+ element: element,
24
+ interactions: interactions,
25
+ strings: foundationStrings.readFoundationStrings(element)
26
+ })
27
+ });
28
+ }
29
+
30
+ exports.EmptyState = EmptyState;
31
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","sources":["../../../foundation/EmptyState.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { EmptyStateView } from './StateFrame';\nimport { readFoundationStrings } from './foundationStrings';\nimport { readLocale } from './formatting';\n\n/**\n * The empty state as a component of its own: an icon, a headline, a hint and one primary action, embeddable in any region.\n *\n * Every other foundation component shows this same view when it has no data, so a screen reads the same wherever nothing is\n * found. Placed on its own it is what a template puts in a region that has nothing to say yet. The action starts whatever the\n * element's behaviors say, and honours the `actionPermission` rule, so an empty list never offers a creation the user may not do.\n */\nexport function EmptyState({ element, interactions }: RegisteredComponentProps) {\n return (\n <section className='foundation foundation-empty-state' data-scene-id={element.id} data-state='empty' lang={readLocale(element)}>\n <EmptyStateView element={element} interactions={interactions} strings={readFoundationStrings(element)} />\n </section>\n );\n}\n"],"names":["EmptyState","element","interactions","_jsx","section","className","data-scene-id","id","data-state","lang","readLocale","EmptyStateView","strings","readFoundationStrings"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;AAMC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAAEC,YAAY,EAA4B,EAAA;AAC1E,IAAA,qBACIC,cAAA,CAACC,SAAAA,EAAAA;QAAQC,SAAAA,EAAU,mCAAA;AAAoCC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;QAAEC,YAAAA,EAAW,OAAA;AAAQC,QAAAA,IAAAA,EAAMC,qBAAAA,CAAWT,OAAAA,CAAAA;AAClH,QAAA,QAAA,gBAAAE,cAAA,CAACQ,yBAAAA,EAAAA;YAAeV,OAAAA,EAASA,OAAAA;YAASC,YAAAA,EAAcA,YAAAA;AAAcU,YAAAA,OAAAA,EAASC,uCAAAA,CAAsBZ,OAAAA;;;AAGzG;;"}
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ const paths = {
8
+ check: 'M5 13l4 4L19 7',
9
+ close: 'M6 6l12 12M18 6L6 18',
10
+ 'arrow-up': 'M12 19V5M5 12l7-7 7 7',
11
+ 'arrow-down': 'M12 5v14M5 12l7 7 7-7',
12
+ minus: 'M5 12h14',
13
+ alert: 'M12 8v5M12 16.5v.5M10.3 3.9L2.5 17.5A2 2 0 004.2 20.5h15.6a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z',
14
+ info: 'M12 11v6M12 7.5v.5M12 21a9 9 0 100-18 9 9 0 000 18z',
15
+ lock: 'M7 11V8a5 5 0 0110 0v3M6 11h12a1 1 0 011 1v8a1 1 0 01-1 1H6a1 1 0 01-1-1v-8a1 1 0 011-1z',
16
+ clock: 'M12 7v5l3 2M12 21a9 9 0 100-18 9 9 0 000 18z',
17
+ inbox: 'M3 13l3-8h12l3 8M3 13v6a1 1 0 001 1h16a1 1 0 001-1v-6M3 13h5l1 3h6l1-3h5',
18
+ refresh: 'M20 11a8 8 0 10-2.3 6.3M20 4v7h-7',
19
+ plus: 'M12 5v14M5 12h14',
20
+ 'chevron-right': 'M9 5l7 7-7 7',
21
+ 'chevron-down': 'M5 9l7 7 7-7',
22
+ upload: 'M12 16V4M7 9l5-5 5 5M4 17v2a1 1 0 001 1h14a1 1 0 001-1v-2',
23
+ file: 'M14 3H7a1 1 0 00-1 1v16a1 1 0 001 1h10a1 1 0 001-1V7l-4-4zM14 3v4h4',
24
+ user: 'M12 12a4 4 0 100-8 4 4 0 000 8zM4 21a8 8 0 0116 0',
25
+ columns: 'M4 5h16v14H4zM9.5 5v14M14.5 5v14',
26
+ filter: 'M4 5h16l-6 8v6l-4-2v-4L4 5z',
27
+ star: 'M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3z',
28
+ circle: 'M12 20a8 8 0 100-16 8 8 0 000 16z'
29
+ };
30
+ /** Whether a name is one of the icons drawn here. */ function isFoundationIcon(name) {
31
+ return name in paths;
32
+ }
33
+ /**
34
+ * One icon. It is decorative unless given a label: the meaning an icon carries is always repeated in text, so no status is
35
+ * conveyed by color or shape alone (WCAG 1.4.1).
36
+ */ function FoundationIcon({ name, label }) {
37
+ return /*#__PURE__*/ jsxRuntime.jsx("svg", {
38
+ className: "foundation-icon",
39
+ viewBox: "0 0 24 24",
40
+ width: "1em",
41
+ height: "1em",
42
+ fill: "none",
43
+ stroke: "currentColor",
44
+ strokeWidth: "2",
45
+ strokeLinecap: "round",
46
+ strokeLinejoin: "round",
47
+ "aria-hidden": label ? undefined : true,
48
+ role: label ? 'img' : undefined,
49
+ "aria-label": label,
50
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
51
+ d: paths[name]
52
+ })
53
+ });
54
+ }
55
+
56
+ exports.FoundationIcon = FoundationIcon;
57
+ exports.isFoundationIcon = isFoundationIcon;
58
+ //# sourceMappingURL=FoundationIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FoundationIcon.js","sources":["../../../foundation/FoundationIcon.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The icons the foundation components draw themselves, so none of them depends on an icon font being loaded. */\nexport type FoundationIconName =\n | 'check' | 'close' | 'arrow-up' | 'arrow-down' | 'minus' | 'alert' | 'info' | 'lock' | 'clock' | 'inbox' | 'refresh'\n | 'plus' | 'chevron-right' | 'chevron-down' | 'upload' | 'file' | 'user' | 'columns' | 'filter' | 'star' | 'circle';\n\nconst paths: Record<FoundationIconName, string> = {\n check: 'M5 13l4 4L19 7',\n close: 'M6 6l12 12M18 6L6 18',\n 'arrow-up': 'M12 19V5M5 12l7-7 7 7',\n 'arrow-down': 'M12 5v14M5 12l7 7 7-7',\n minus: 'M5 12h14',\n alert: 'M12 8v5M12 16.5v.5M10.3 3.9L2.5 17.5A2 2 0 004.2 20.5h15.6a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z',\n info: 'M12 11v6M12 7.5v.5M12 21a9 9 0 100-18 9 9 0 000 18z',\n lock: 'M7 11V8a5 5 0 0110 0v3M6 11h12a1 1 0 011 1v8a1 1 0 01-1 1H6a1 1 0 01-1-1v-8a1 1 0 011-1z',\n clock: 'M12 7v5l3 2M12 21a9 9 0 100-18 9 9 0 000 18z',\n inbox: 'M3 13l3-8h12l3 8M3 13v6a1 1 0 001 1h16a1 1 0 001-1v-6M3 13h5l1 3h6l1-3h5',\n refresh: 'M20 11a8 8 0 10-2.3 6.3M20 4v7h-7',\n plus: 'M12 5v14M5 12h14',\n 'chevron-right': 'M9 5l7 7-7 7',\n 'chevron-down': 'M5 9l7 7 7-7',\n upload: 'M12 16V4M7 9l5-5 5 5M4 17v2a1 1 0 001 1h14a1 1 0 001-1v-2',\n file: 'M14 3H7a1 1 0 00-1 1v16a1 1 0 001 1h10a1 1 0 001-1V7l-4-4zM14 3v4h4',\n user: 'M12 12a4 4 0 100-8 4 4 0 000 8zM4 21a8 8 0 0116 0',\n columns: 'M4 5h16v14H4zM9.5 5v14M14.5 5v14',\n filter: 'M4 5h16l-6 8v6l-4-2v-4L4 5z',\n star: 'M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9L12 3z',\n circle: 'M12 20a8 8 0 100-16 8 8 0 000 16z',\n};\n\n/** Whether a name is one of the icons drawn here. */\nexport function isFoundationIcon(name: string): name is FoundationIconName {\n return name in paths;\n}\n\n/**\n * One icon. It is decorative unless given a label: the meaning an icon carries is always repeated in text, so no status is\n * conveyed by color or shape alone (WCAG 1.4.1).\n */\nexport function FoundationIcon({ name, label }: { name: FoundationIconName; label?: string }) {\n return (\n <svg className='foundation-icon' viewBox='0 0 24 24' width='1em' height='1em' fill='none' stroke='currentColor' strokeWidth='2'\n strokeLinecap='round' strokeLinejoin='round' aria-hidden={label ? undefined : true} role={label ? 'img' : undefined} aria-label={label}>\n <path d={paths[name]} />\n </svg>\n );\n}\n"],"names":["paths","check","close","minus","alert","info","lock","clock","inbox","refresh","plus","upload","file","user","columns","filter","star","circle","isFoundationIcon","name","FoundationIcon","label","_jsx","svg","className","viewBox","width","height","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","aria-hidden","undefined","role","aria-label","path","d"],"mappings":";;;;AAAA;AACA;AAOA,MAAMA,KAAAA,GAA4C;IAC9CC,KAAAA,EAAO,gBAAA;IACPC,KAAAA,EAAO,sBAAA;IACP,UAAA,EAAY,uBAAA;IACZ,YAAA,EAAc,uBAAA;IACdC,KAAAA,EAAO,UAAA;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/scene.react');
5
+ var defaultBlueprintComponents = require('../defaultBlueprintComponents.js');
6
+ var packageName = require('../packageName.js');
7
+ var light = require('../themes/light.js');
8
+ var dark = require('../themes/dark.js');
9
+ require('react');
10
+ var ComponentState = require('./ComponentState.js');
11
+ var foundationSamples = require('./foundationSamples.js');
12
+
13
+ /**
14
+ * Every standard state of one foundation component side by side in one theme: the preview of spec Part B 6 ("all standard states
15
+ * implemented and previewable"), used by the stories and by the gallery.
16
+ */ function FoundationStates({ component, theme, properties, rightToLeft }) {
17
+ const Component = defaultBlueprintComponents.defaultBlueprintComponents[scene_react.componentRegistryKey(packageName.defaultBlueprintName, component)];
18
+ const sample = foundationSamples.foundationSamples[component];
19
+ const states = sample?.stateful ? ComponentState.componentStates : [
20
+ ComponentState.ComponentState.Ready
21
+ ];
22
+ return /*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneThemeProvider, {
23
+ theme: theme === 'dark' ? dark.darkTheme : light.lightTheme,
24
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
25
+ dir: rightToLeft ? 'rtl' : 'ltr',
26
+ className: "foundation-states",
27
+ style: {
28
+ display: 'grid',
29
+ gap: '1rem',
30
+ padding: '1rem',
31
+ gridTemplateColumns: 'repeat(auto-fill, minmax(18rem, 1fr))',
32
+ background: 'var(--scene-surface-background)',
33
+ color: 'var(--scene-text-color)'
34
+ },
35
+ children: states.map((state)=>/*#__PURE__*/ jsxRuntime.jsxs("figure", {
36
+ style: {
37
+ margin: 0
38
+ },
39
+ children: [
40
+ /*#__PURE__*/ jsxRuntime.jsx("figcaption", {
41
+ style: {
42
+ fontSize: '0.75rem',
43
+ textTransform: 'uppercase',
44
+ marginBlockEnd: '0.5rem'
45
+ },
46
+ children: state
47
+ }),
48
+ /*#__PURE__*/ jsxRuntime.jsx(Component, {
49
+ element: foundationSamples.foundationElement(component, {
50
+ ...sample?.properties,
51
+ ...properties
52
+ }, state === ComponentState.ComponentState.Ready ? undefined : state),
53
+ slots: {}
54
+ })
55
+ ]
56
+ }, state))
57
+ })
58
+ });
59
+ }
60
+
61
+ exports.FoundationStates = FoundationStates;
62
+ //# sourceMappingURL=FoundationStates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FoundationStates.js","sources":["../../../foundation/FoundationStates.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { componentRegistryKey, SceneThemeProvider } from '@cratis/scene.react';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { defaultBlueprintName } from '../packageName';\nimport { darkTheme, lightTheme } from '../themes';\nimport { ComponentState, componentStates } from './ComponentState';\nimport { foundationElement, foundationSamples } from './foundationSamples';\n\nexport interface FoundationStatesProps {\n /** The bare name of the foundation component. */\n component: string;\n\n /** The theme the states are drawn in. */\n theme: 'light' | 'dark';\n\n /** Properties to lay over the sample, to show a variant. */\n properties?: Record<string, unknown>;\n\n /** Whether the page reads right to left. */\n rightToLeft?: boolean;\n}\n\n/**\n * Every standard state of one foundation component side by side in one theme: the preview of spec Part B 6 (\"all standard states\n * implemented and previewable\"), used by the stories and by the gallery.\n */\nexport function FoundationStates({ component, theme, properties, rightToLeft }: FoundationStatesProps) {\n const Component = defaultBlueprintComponents[componentRegistryKey(defaultBlueprintName, component)];\n const sample = foundationSamples[component];\n const states = sample?.stateful ? componentStates : [ComponentState.Ready];\n\n return (\n <SceneThemeProvider theme={theme === 'dark' ? darkTheme : lightTheme}>\n <div dir={rightToLeft ? 'rtl' : 'ltr'} className='foundation-states' style={{ display: 'grid', gap: '1rem', padding: '1rem', gridTemplateColumns: 'repeat(auto-fill, minmax(18rem, 1fr))', background: 'var(--scene-surface-background)', color: 'var(--scene-text-color)' }}>\n {states.map(state => (\n <figure key={state} style={{ margin: 0 }}>\n <figcaption style={{ fontSize: '0.75rem', textTransform: 'uppercase', marginBlockEnd: '0.5rem' }}>{state}</figcaption>\n <Component element={foundationElement(component, { ...sample?.properties, ...properties }, state === ComponentState.Ready ? undefined : state)} slots={{}} />\n </figure>\n ))}\n </div>\n </SceneThemeProvider>\n );\n}\n"],"names":["FoundationStates","component","theme","properties","rightToLeft","Component","defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","sample","foundationSamples","states","stateful","componentStates","ComponentState","Ready","_jsx","SceneThemeProvider","darkTheme","lightTheme","div","dir","className","style","display","gap","padding","gridTemplateColumns","background","color","map","state","_jsxs","figure","margin","figcaption","fontSize","textTransform","marginBlockEnd","element","foundationElement","undefined","slots"],"mappings":";;;;;;;;;;;;AAwBA;;;IAIO,SAASA,gBAAAA,CAAiB,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAyB,EAAA;AACjG,IAAA,MAAMC,SAAAA,GAAYC,qDAA0B,CAACC,gCAAAA,CAAqBC,kCAAsBP,SAAAA,CAAAA,CAAW;IACnG,MAAMQ,MAAAA,GAASC,mCAAiB,CAACT,SAAAA,CAAU;IAC3C,MAAMU,MAAAA,GAASF,MAAAA,EAAQG,QAAAA,GAAWC,8BAAAA,GAAkB;AAACC,QAAAA,6BAAAA,CAAeC;AAAM,KAAA;AAE1E,IAAA,qBACIC,cAAA,CAACC,8BAAAA,EAAAA;QAAmBf,KAAAA,EAAOA,KAAAA,KAAU,SAASgB,cAAAA,GAAYC,gBAAAA;AACtD,QAAA,QAAA,gBAAAH,cAAA,CAACI,KAAAA,EAAAA;AAAIC,YAAAA,GAAAA,EAAKjB,cAAc,KAAA,GAAQ,KAAA;YAAOkB,SAAAA,EAAU,mBAAA;YAAoBC,KAAAA,EAAO;gBAAEC,OAAAA,EAAS,MAAA;gBAAQC,GAAAA,EAAK,MAAA;gBAAQC,OAAAA,EAAS,MAAA;gBAAQC,mBAAAA,EAAqB,uCAAA;gBAAyCC,UAAAA,EAAY,iCAAA;gBAAmCC,KAAAA,EAAO;AAA0B,aAAA;AACtQlB,YAAAA,QAAAA,EAAAA,MAAAA,CAAOmB,GAAG,CAACC,CAAAA,KAAAA,iBACRC,eAAA,CAACC,QAAAA,EAAAA;oBAAmBV,KAAAA,EAAO;wBAAEW,MAAAA,EAAQ;AAAE,qBAAA;;sCACnClB,cAAA,CAACmB,YAAAA,EAAAA;4BAAWZ,KAAAA,EAAO;gCAAEa,QAAAA,EAAU,SAAA;gCAAWC,aAAAA,EAAe,WAAA;gCAAaC,cAAAA,EAAgB;AAAS,6BAAA;AAAIP,4BAAAA,QAAAA,EAAAA;;sCACnGf,cAAA,CAACX,SAAAA,EAAAA;AAAUkC,4BAAAA,OAAAA,EAASC,oCAAkBvC,SAAAA,EAAW;AAAE,gCAAA,GAAGQ,QAAQN,UAAU;AAAE,gCAAA,GAAGA;AAAW,6BAAA,EAAG4B,KAAAA,KAAUjB,6BAAAA,CAAeC,KAAK,GAAG0B,SAAAA,GAAYV,KAAAA,CAAAA;AAAQW,4BAAAA,KAAAA,EAAO;;;AAF9IX,iBAAAA,EAAAA,KAAAA,CAAAA;;;AAQjC;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * What an action control does when the user lacks the permission it needs (spec Part B 1.5): it is shown and works, shown and
7
+ * refuses, or not shown. A template never assumes a role, so every action declares one of these and the host's permission
8
+ * evaluation sets it.
9
+ */ var PermissionRule = /*#__PURE__*/ function(PermissionRule) {
10
+ /** The control works. */ PermissionRule["Enabled"] = "enabled";
11
+ /** The control is shown but cannot be used, and says why. */ PermissionRule["Disabled"] = "disabled";
12
+ /** The control is not rendered. */ PermissionRule["Hidden"] = "hidden";
13
+ return PermissionRule;
14
+ }({});
15
+ /** Reads a permission rule from a property, defaulting to Enabled for anything that is not a rule. */ function readPermissionRule(element, property = 'permission') {
16
+ const value = element.properties[property];
17
+ return value === "disabled" || value === "hidden" ? value : "enabled";
18
+ }
19
+
20
+ exports.PermissionRule = PermissionRule;
21
+ exports.readPermissionRule = readPermissionRule;
22
+ //# sourceMappingURL=PermissionRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermissionRule.js","sources":["../../../foundation/PermissionRule.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\n\n/**\n * What an action control does when the user lacks the permission it needs (spec Part B 1.5): it is shown and works, shown and\n * refuses, or not shown. A template never assumes a role, so every action declares one of these and the host's permission\n * evaluation sets it.\n */\nexport enum PermissionRule {\n /** The control works. */\n Enabled = 'enabled',\n\n /** The control is shown but cannot be used, and says why. */\n Disabled = 'disabled',\n\n /** The control is not rendered. */\n Hidden = 'hidden',\n}\n\n/** Reads a permission rule from a property, defaulting to Enabled for anything that is not a rule. */\nexport function readPermissionRule(element: ExternalComponent, property = 'permission'): PermissionRule {\n const value = element.properties[property];\n return value === PermissionRule.Disabled || value === PermissionRule.Hidden ? value : PermissionRule.Enabled;\n}\n"],"names":["PermissionRule","readPermissionRule","element","property","value","properties"],"mappings":";;AAAA;AACA;AAIA;;;;IAKO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;8BACe,cAAA,CAAA,SAAA,CAAA,GAAA,SAAA;kEAGoC,cAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG1B,cAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AAPzBA,IAAAA,OAAAA,cAAAA;AASX,CAAA,CAAA,EAAA;AAED,uGACO,SAASC,mBAAmBC,OAA0B,EAAEC,WAAW,YAAY,EAAA;AAClF,IAAA,MAAMC,KAAAA,GAAQF,OAAAA,CAAQG,UAAU,CAACF,QAAAA,CAAS;AAC1C,IAAA,OAAOC,wBAAqCA,KAAAA,KAAAA,QAAAA,GAAkCA,KAAAA,GAAAA,SAAAA;AAClF;;;"}