@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
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_react = require('@cratis/scene.react');
5
+ var ComponentName = require('../ComponentName.js');
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ /**
10
+ * The category, icon, keywords and picker badge of every foundation component (CMP1), keyed by bare component name.
11
+ * The names are those of `ComponentName`; the metadata of the rest of the package lives in `defaultBlueprintComponentMetadata`.
12
+ */ const foundationComponentMetadata = {
13
+ [ComponentName.ComponentName.EmptyState]: scene_react.componentMetadata('Empty state', scene_model.ComponentCategory.Feedback, 'inbox', [
14
+ 'no data',
15
+ 'nothing',
16
+ 'blank slate',
17
+ 'zero state'
18
+ ]),
19
+ [ComponentName.ComponentName.StatCard]: scene_react.componentMetadata('Stat card', scene_model.ComponentCategory.DataDisplay, 'gauge', [
20
+ 'kpi',
21
+ 'metric',
22
+ 'figure',
23
+ 'number',
24
+ 'dashboard'
25
+ ]),
26
+ [ComponentName.ComponentName.TrendChip]: scene_react.componentMetadata('Trend chip', scene_model.ComponentCategory.DataDisplay, 'trending-up', [
27
+ 'delta',
28
+ 'change',
29
+ 'arrow',
30
+ 'comparison'
31
+ ]),
32
+ [ComponentName.ComponentName.StatusChip]: scene_react.componentMetadata('Status chip', scene_model.ComponentCategory.DataDisplay, 'badge-check', [
33
+ 'badge',
34
+ 'state',
35
+ 'tag',
36
+ 'label'
37
+ ])
38
+ };
39
+
40
+ exports.foundationComponentMetadata = foundationComponentMetadata;
41
+ //# sourceMappingURL=foundationComponentMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundationComponentMetadata.js","sources":["../../../foundation/foundationComponentMetadata.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 } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\n\n/**\n * The category, icon, keywords and picker badge of every foundation component (CMP1), keyed by bare component name.\n * The names are those of `ComponentName`; the metadata of the rest of the package lives in `defaultBlueprintComponentMetadata`.\n */\nexport const foundationComponentMetadata: Record<string, ComponentMetadata> = {\n [ComponentName.EmptyState]: m('Empty state', ComponentCategory.Feedback, 'inbox', ['no data', 'nothing', 'blank slate', 'zero state']),\n [ComponentName.StatCard]: m('Stat card', ComponentCategory.DataDisplay, 'gauge', ['kpi', 'metric', 'figure', 'number', 'dashboard']),\n [ComponentName.TrendChip]: m('Trend chip', ComponentCategory.DataDisplay, 'trending-up', ['delta', 'change', 'arrow', 'comparison']),\n [ComponentName.StatusChip]: m('Status chip', ComponentCategory.DataDisplay, 'badge-check', ['badge', 'state', 'tag', 'label']),\n};\n"],"names":["foundationComponentMetadata","ComponentName","EmptyState","m","ComponentCategory","Feedback","StatCard","DataDisplay","TrendChip","StatusChip"],"mappings":";;;;;;AAAA;AACA;AAMA;;;UAIaA,2BAAAA,GAAiE;IAC1E,CAACC,2BAAAA,CAAcC,UAAU,GAAGC,8BAAE,aAAA,EAAeC,6BAAAA,CAAkBC,QAAQ,EAAE,OAAA,EAAS;AAAC,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA,aAAA;AAAe,QAAA;AAAa,KAAA,CAAA;IACrI,CAACJ,2BAAAA,CAAcK,QAAQ,GAAGH,8BAAE,WAAA,EAAaC,6BAAAA,CAAkBG,WAAW,EAAE,OAAA,EAAS;AAAC,QAAA,KAAA;AAAO,QAAA,QAAA;AAAU,QAAA,QAAA;AAAU,QAAA,QAAA;AAAU,QAAA;AAAY,KAAA,CAAA;IACnI,CAACN,2BAAAA,CAAcO,SAAS,GAAGL,8BAAE,YAAA,EAAcC,6BAAAA,CAAkBG,WAAW,EAAE,aAAA,EAAe;AAAC,QAAA,OAAA;AAAS,QAAA,QAAA;AAAU,QAAA,OAAA;AAAS,QAAA;AAAa,KAAA,CAAA;IACnI,CAACN,2BAAAA,CAAcQ,UAAU,GAAGN,8BAAE,aAAA,EAAeC,6BAAAA,CAAkBG,WAAW,EAAE,aAAA,EAAe;AAAC,QAAA,OAAA;AAAS,QAAA,OAAA;AAAS,QAAA,KAAA;AAAO,QAAA;AAAQ,KAAA;AACjI;;"}
@@ -0,0 +1,232 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_react = require('@cratis/scene.react');
5
+ var ComponentName = require('../ComponentName.js');
6
+ var packageName = require('../packageName.js');
7
+ var ComponentState = require('./ComponentState.js');
8
+ var formatting = require('./formatting.js');
9
+ var PermissionRule = require('./PermissionRule.js');
10
+ var StatusChip = require('./StatusChip.js');
11
+
12
+ // Copyright (c) Cratis. All rights reserved.
13
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
14
+ /** Data properties take what a screen binds them to: a query's result, a data context or another component's output. */ const bindable = [
15
+ scene_model.BindingSourceKind.DataContext,
16
+ scene_model.BindingSourceKind.QueryResult,
17
+ scene_model.BindingSourceKind.ComponentProperty
18
+ ];
19
+ const text = (path, label, group, description, extra = {})=>({
20
+ path,
21
+ label,
22
+ group,
23
+ valueType: scene_model.PropertyValueType.String,
24
+ ...group === 'Data' ? {
25
+ acceptedBindingKinds: bindable
26
+ } : {},
27
+ ...description === undefined ? {} : {
28
+ description
29
+ },
30
+ ...extra
31
+ });
32
+ const number = (path, label, group, description, extra = {})=>({
33
+ path,
34
+ label,
35
+ group,
36
+ valueType: scene_model.PropertyValueType.Number,
37
+ editorKind: scene_model.PropertyEditorKind.Number,
38
+ ...group === 'Data' ? {
39
+ acceptedBindingKinds: bindable
40
+ } : {},
41
+ ...description === undefined ? {} : {
42
+ description
43
+ },
44
+ ...extra
45
+ });
46
+ const flag = (path, label, group, description, extra = {})=>({
47
+ path,
48
+ label,
49
+ group,
50
+ valueType: scene_model.PropertyValueType.Boolean,
51
+ editorKind: scene_model.PropertyEditorKind.Boolean,
52
+ ...description === undefined ? {} : {
53
+ description
54
+ },
55
+ ...extra
56
+ });
57
+ const choice = (path, label, group, values, defaultValue, description)=>({
58
+ path,
59
+ label,
60
+ group,
61
+ valueType: scene_model.PropertyValueType.Enum,
62
+ editorKind: scene_model.PropertyEditorKind.Enum,
63
+ default: defaultValue,
64
+ choices: Object.entries(values).map(([value, name])=>({
65
+ value,
66
+ label: name
67
+ })),
68
+ ...description === undefined ? {} : {
69
+ description
70
+ }
71
+ });
72
+ const list = (path, label, group, itemLabel, properties, description)=>({
73
+ path,
74
+ label,
75
+ group,
76
+ valueType: scene_model.PropertyValueType.Collection,
77
+ default: [],
78
+ item: {
79
+ label: itemLabel,
80
+ properties
81
+ },
82
+ ...description === undefined ? {} : {
83
+ description
84
+ }
85
+ });
86
+ const rule = (path, label, description)=>choice(path, label, 'Permissions', {
87
+ [PermissionRule.PermissionRule.Enabled]: 'Enabled',
88
+ [PermissionRule.PermissionRule.Disabled]: 'Disabled',
89
+ [PermissionRule.PermissionRule.Hidden]: 'Hidden'
90
+ }, PermissionRule.PermissionRule.Enabled, description);
91
+ /** The properties every data-showing foundation component shares: the standard states (spec Part B 1.4) and the cross-cutting rules of 1.5. */ const standardStateProperties = [
92
+ choice('state', 'Preview state', 'State', {
93
+ [ComponentState.ComponentState.Ready]: 'Ready',
94
+ [ComponentState.ComponentState.Loading]: 'Loading',
95
+ [ComponentState.ComponentState.Empty]: 'Empty',
96
+ [ComponentState.ComponentState.Error]: 'Error',
97
+ [ComponentState.ComponentState.NoPermission]: 'No permission',
98
+ [ComponentState.ComponentState.Partial]: 'Partial'
99
+ }, ComponentState.ComponentState.Ready, 'Forces a state so each can be designed and previewed; empty means the state follows the bound data.'),
100
+ text('error', 'Error message', 'State', 'The message of the error state; setting it puts the component in that state.'),
101
+ flag('loading', 'Loading', 'State', 'Shows the skeleton while the data has not answered.'),
102
+ flag('forbidden', 'Not allowed', 'State', 'Shows the no-permission state, which explains what is missing and shows no data.'),
103
+ text('permissionSubject', 'What access is missing', 'State', 'Names what the user cannot see in the no-permission message.'),
104
+ {
105
+ path: 'failedRegions',
106
+ label: 'Failed regions',
107
+ group: 'State',
108
+ valueType: scene_model.PropertyValueType.Json,
109
+ editorKind: scene_model.PropertyEditorKind.StringList,
110
+ default: [],
111
+ description: 'The parts that failed to load; any entry puts the component in the partial state.'
112
+ },
113
+ text('emptyHeadline', 'Empty headline', 'State'),
114
+ text('emptyHint', 'Empty hint', 'State'),
115
+ text('emptyActionLabel', 'Empty action', 'State', 'The primary action offered when there is nothing to show.'),
116
+ rule('actionPermission', 'Empty action permission', 'Whether the empty state offers its action, refuses it with a reason, or does not render it.'),
117
+ text('label', 'Label', 'Accessibility', 'The accessible name of the region.'),
118
+ text('locale', 'Locale', 'Content', 'The locale dates, numbers and currency are formatted in; empty follows the document.'),
119
+ choice('density', 'Density', 'Appearance', {
120
+ comfortable: 'Comfortable',
121
+ compact: 'Compact'
122
+ }, 'comfortable'),
123
+ {
124
+ path: 'strings',
125
+ label: 'Text overrides',
126
+ group: 'Content',
127
+ valueType: scene_model.PropertyValueType.Object,
128
+ editorKind: scene_model.PropertyEditorKind.StringMap,
129
+ description: 'Replaces the text the component says itself, for localization.'
130
+ }
131
+ ];
132
+ const key = (name)=>scene_react.componentRegistryKey(packageName.defaultBlueprintName, name);
133
+ const formats = {
134
+ [formatting.NumberFormat.Number]: 'Number',
135
+ [formatting.NumberFormat.Currency]: 'Currency',
136
+ [formatting.NumberFormat.Percent]: 'Percent',
137
+ [formatting.NumberFormat.Compact]: 'Compact'
138
+ };
139
+ /** What can be edited on the foundation components (Part B 4). Each declares the shape of its data, never values (SD1). */ const foundationDescriptors = [
140
+ {
141
+ component: key(ComponentName.ComponentName.EmptyState),
142
+ displayName: 'Empty state',
143
+ description: 'An icon, a headline, a hint and one primary action; embeddable in any region.',
144
+ properties: [
145
+ text('headline', 'Headline', 'Content', undefined, {
146
+ default: 'Nothing here yet'
147
+ }),
148
+ text('hint', 'Hint', 'Content'),
149
+ text('icon', 'Icon', 'Appearance'),
150
+ text('actionLabel', 'Primary action', 'Behavior', 'The label of the one action the state offers; its behaviors say what it does.'),
151
+ rule('actionPermission', 'Action permission', 'Whether the action works, refuses with a reason, or is not rendered.'),
152
+ text('locale', 'Locale', 'Content'),
153
+ {
154
+ path: 'strings',
155
+ label: 'Text overrides',
156
+ group: 'Content',
157
+ valueType: scene_model.PropertyValueType.Object,
158
+ editorKind: scene_model.PropertyEditorKind.StringMap
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ component: key(ComponentName.ComponentName.StatCard),
164
+ displayName: 'Stat card',
165
+ description: 'One key figure with its label, trend and the period the trend is compared to.',
166
+ properties: [
167
+ text('label', 'Label', 'Content', 'What the figure measures.', {
168
+ constraints: {
169
+ required: true
170
+ }
171
+ }),
172
+ number('value', 'Value', 'Data', 'The figure; bind it to a query result.'),
173
+ choice('format', 'Format', 'Appearance', formats, formatting.NumberFormat.Number),
174
+ text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),
175
+ number('fractionDigits', 'Fraction digits', 'Appearance'),
176
+ number('change', 'Change', 'Data', 'How much the figure moved, as a percentage; bind it to a query result.'),
177
+ choice('goodDirection', 'Good direction', 'Appearance', {
178
+ up: 'Up is good',
179
+ down: 'Down is good'
180
+ }, 'up', 'Which movement is good: a falling response time is.'),
181
+ text('comparison', 'Compared to', 'Content', 'The period the change is compared to, for example "last month".'),
182
+ ...standardStateProperties.filter((property)=>property.path !== 'label')
183
+ ]
184
+ },
185
+ {
186
+ component: key(ComponentName.ComponentName.TrendChip),
187
+ displayName: 'Trend chip',
188
+ description: 'A change drawn as a direction, a magnitude and whether the movement is good.',
189
+ properties: [
190
+ number('change', 'Change', 'Data', 'The movement; bind it to a query result.'),
191
+ choice('format', 'Format', 'Appearance', formats, formatting.NumberFormat.Percent),
192
+ choice('goodDirection', 'Good direction', 'Appearance', {
193
+ up: 'Up is good',
194
+ down: 'Down is good'
195
+ }, 'up'),
196
+ text('comparison', 'Compared to', 'Content'),
197
+ text('locale', 'Locale', 'Content'),
198
+ {
199
+ path: 'strings',
200
+ label: 'Text overrides',
201
+ group: 'Content',
202
+ valueType: scene_model.PropertyValueType.Object,
203
+ editorKind: scene_model.PropertyEditorKind.StringMap
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ component: key(ComponentName.ComponentName.StatusChip),
209
+ displayName: 'Status chip',
210
+ description: 'A status shown as a semantic color, an icon and its text; the text is always shown.',
211
+ properties: [
212
+ text('status', 'Status', 'Data', 'The status text; bind it to a query result.', {
213
+ constraints: {
214
+ required: true
215
+ }
216
+ }),
217
+ choice('tone', 'Tone', 'Appearance', {
218
+ [StatusChip.StatusTone.Success]: 'Success',
219
+ [StatusChip.StatusTone.Warning]: 'Warning',
220
+ [StatusChip.StatusTone.Danger]: 'Danger',
221
+ [StatusChip.StatusTone.Info]: 'Info',
222
+ [StatusChip.StatusTone.Neutral]: 'Neutral'
223
+ }, StatusChip.StatusTone.Neutral, 'The tone picks the icon and the theme color.')
224
+ ]
225
+ }
226
+ ];
227
+
228
+ exports.bindable = bindable;
229
+ exports.foundationDescriptors = foundationDescriptors;
230
+ exports.list = list;
231
+ exports.standardStateProperties = standardStateProperties;
232
+ //# sourceMappingURL=foundationDescriptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundationDescriptors.js","sources":["../../../foundation/foundationDescriptors.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 { BindingSourceKind, ComponentDescriptor, PropertyDescriptor, PropertyEditorKind, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ComponentState } from './ComponentState';\nimport { NumberFormat } from './formatting';\nimport { PermissionRule } from './PermissionRule';\nimport { StatusTone } from './StatusChip';\n\n/** Data properties take what a screen binds them to: a query's result, a data context or another component's output. */\nexport const bindable = [BindingSourceKind.DataContext, BindingSourceKind.QueryResult, BindingSourceKind.ComponentProperty];\n\nconst text = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.String, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst number = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Number, editorKind: PropertyEditorKind.Number, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst flag = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Boolean, editorKind: PropertyEditorKind.Boolean, ...(description === undefined ? {} : { description }), ...extra });\n\nconst choice = (path: string, label: string, group: string, values: Record<string, string>, defaultValue: string, description?: string): PropertyDescriptor =>\n ({\n path, label, group, valueType: PropertyValueType.Enum, editorKind: PropertyEditorKind.Enum, default: defaultValue,\n choices: Object.entries(values).map(([value, name]) => ({ value, label: name })), ...(description === undefined ? {} : { description }),\n });\n\nexport const list = (path: string, label: string, group: string, itemLabel: string, properties: PropertyDescriptor[], description?: string): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Collection, default: [], item: { label: itemLabel, properties }, ...(description === undefined ? {} : { description }) });\n\nconst rule = (path: string, label: string, description: string): PropertyDescriptor =>\n choice(path, label, 'Permissions', { [PermissionRule.Enabled]: 'Enabled', [PermissionRule.Disabled]: 'Disabled', [PermissionRule.Hidden]: 'Hidden' }, PermissionRule.Enabled, description);\n\n/** The properties every data-showing foundation component shares: the standard states (spec Part B 1.4) and the cross-cutting rules of 1.5. */\nexport const standardStateProperties: PropertyDescriptor[] = [\n choice('state', 'Preview state', 'State', {\n [ComponentState.Ready]: 'Ready', [ComponentState.Loading]: 'Loading', [ComponentState.Empty]: 'Empty',\n [ComponentState.Error]: 'Error', [ComponentState.NoPermission]: 'No permission', [ComponentState.Partial]: 'Partial',\n }, ComponentState.Ready, 'Forces a state so each can be designed and previewed; empty means the state follows the bound data.'),\n text('error', 'Error message', 'State', 'The message of the error state; setting it puts the component in that state.'),\n flag('loading', 'Loading', 'State', 'Shows the skeleton while the data has not answered.'),\n flag('forbidden', 'Not allowed', 'State', 'Shows the no-permission state, which explains what is missing and shows no data.'),\n text('permissionSubject', 'What access is missing', 'State', 'Names what the user cannot see in the no-permission message.'),\n { path: 'failedRegions', label: 'Failed regions', group: 'State', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.StringList, default: [], description: 'The parts that failed to load; any entry puts the component in the partial state.' },\n text('emptyHeadline', 'Empty headline', 'State'),\n text('emptyHint', 'Empty hint', 'State'),\n text('emptyActionLabel', 'Empty action', 'State', 'The primary action offered when there is nothing to show.'),\n rule('actionPermission', 'Empty action permission', 'Whether the empty state offers its action, refuses it with a reason, or does not render it.'),\n text('label', 'Label', 'Accessibility', 'The accessible name of the region.'),\n text('locale', 'Locale', 'Content', 'The locale dates, numbers and currency are formatted in; empty follows the document.'),\n choice('density', 'Density', 'Appearance', { comfortable: 'Comfortable', compact: 'Compact' }, 'comfortable'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap, description: 'Replaces the text the component says itself, for localization.' },\n];\n\nconst key = (name: ComponentName) => componentRegistryKey(defaultBlueprintName, name);\n\nconst formats = { [NumberFormat.Number]: 'Number', [NumberFormat.Currency]: 'Currency', [NumberFormat.Percent]: 'Percent', [NumberFormat.Compact]: 'Compact' };\n\n/** What can be edited on the foundation components (Part B 4). Each declares the shape of its data, never values (SD1). */\nexport const foundationDescriptors: ComponentDescriptor[] = [\n {\n component: key(ComponentName.EmptyState),\n displayName: 'Empty state',\n description: 'An icon, a headline, a hint and one primary action; embeddable in any region.',\n properties: [\n text('headline', 'Headline', 'Content', undefined, { default: 'Nothing here yet' }),\n text('hint', 'Hint', 'Content'),\n text('icon', 'Icon', 'Appearance'),\n text('actionLabel', 'Primary action', 'Behavior', 'The label of the one action the state offers; its behaviors say what it does.'),\n rule('actionPermission', 'Action permission', 'Whether the action works, refuses with a reason, or is not rendered.'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatCard),\n displayName: 'Stat card',\n description: 'One key figure with its label, trend and the period the trend is compared to.',\n properties: [\n text('label', 'Label', 'Content', 'What the figure measures.', { constraints: { required: true } }),\n number('value', 'Value', 'Data', 'The figure; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Number),\n text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),\n number('fractionDigits', 'Fraction digits', 'Appearance'),\n number('change', 'Change', 'Data', 'How much the figure moved, as a percentage; bind it to a query result.'),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up', 'Which movement is good: a falling response time is.'),\n text('comparison', 'Compared to', 'Content', 'The period the change is compared to, for example \"last month\".'),\n ...standardStateProperties.filter(property => property.path !== 'label'),\n ],\n },\n {\n component: key(ComponentName.TrendChip),\n displayName: 'Trend chip',\n description: 'A change drawn as a direction, a magnitude and whether the movement is good.',\n properties: [\n number('change', 'Change', 'Data', 'The movement; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Percent),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up'),\n text('comparison', 'Compared to', 'Content'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatusChip),\n displayName: 'Status chip',\n description: 'A status shown as a semantic color, an icon and its text; the text is always shown.',\n properties: [\n text('status', 'Status', 'Data', 'The status text; bind it to a query result.', { constraints: { required: true } }),\n choice('tone', 'Tone', 'Appearance', {\n [StatusTone.Success]: 'Success', [StatusTone.Warning]: 'Warning', [StatusTone.Danger]: 'Danger', [StatusTone.Info]: 'Info', [StatusTone.Neutral]: 'Neutral',\n }, StatusTone.Neutral, 'The tone picks the icon and the theme color.'),\n ],\n },\n];\n\n"],"names":["bindable","BindingSourceKind","DataContext","QueryResult","ComponentProperty","text","path","label","group","description","extra","valueType","PropertyValueType","String","acceptedBindingKinds","undefined","number","Number","editorKind","PropertyEditorKind","flag","Boolean","choice","values","defaultValue","Enum","default","choices","Object","entries","map","value","name","list","itemLabel","properties","Collection","item","rule","PermissionRule","Enabled","Disabled","Hidden","standardStateProperties","ComponentState","Ready","Loading","Empty","Error","NoPermission","Partial","Json","StringList","comfortable","compact","StringMap","key","componentRegistryKey","defaultBlueprintName","formats","NumberFormat","Currency","Percent","Compact","foundationDescriptors","component","ComponentName","EmptyState","displayName","StatCard","constraints","required","up","down","filter","property","TrendChip","StatusChip","StatusTone","Success","Warning","Danger","Info","Neutral"],"mappings":";;;;;;;;;;;AAAA;AACA;AAWA,yHACO,MAAMA,QAAAA,GAAW;AAACC,IAAAA,6BAAAA,CAAkBC,WAAW;AAAED,IAAAA,6BAAAA,CAAkBE,WAAW;AAAEF,IAAAA,6BAAAA,CAAkBG;;AAEzG,MAAMC,IAAAA,GAAO,CAACC,IAAAA,EAAcC,KAAAA,EAAeC,KAAAA,EAAeC,aAAsBC,KAAAA,GAAqC,EAAE,IAClH;AAAEJ,QAAAA,IAAAA;AAAMC,QAAAA,KAAAA;AAAOC,QAAAA,KAAAA;AAAOG,QAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;AAAE,QAAA,GAAIL,UAAU,MAAA,GAAS;YAAEM,oBAAAA,EAAsBd;AAAS,SAAA,GAAI,EAAE;QAAG,GAAIS,WAAAA,KAAgBM,SAAAA,GAAY,EAAC,GAAI;AAAEN,YAAAA;SAAa;AAAG,QAAA,GAAGC;KAAM,CAAA;AAEjM,MAAMM,MAAAA,GAAS,CAACV,IAAAA,EAAcC,KAAAA,EAAeC,KAAAA,EAAeC,aAAsBC,KAAAA,GAAqC,EAAE,IACpH;AAAEJ,QAAAA,IAAAA;AAAMC,QAAAA,KAAAA;AAAOC,QAAAA,KAAAA;AAAOG,QAAAA,SAAAA,EAAWC,8BAAkBK,MAAM;AAAEC,QAAAA,UAAAA,EAAYC,+BAAmBF,MAAM;AAAE,QAAA,GAAIT,UAAU,MAAA,GAAS;YAAEM,oBAAAA,EAAsBd;AAAS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EAAM,SAAA;gBAAWC,KAAAA,EAAO,gBAAA;gBAAkBC,KAAAA,EAAO,SAAA;AAAWG,gBAAAA,SAAAA,EAAWC,8BAAkBgB,MAAM;AAAEV,gBAAAA,UAAAA,EAAYC,+BAAmBoC;AAAU;AAC/I;AACL,KAAA;AACA,IAAA;QACIU,SAAAA,EAAWT,GAAAA,CAAIU,4BAAcW,UAAU,CAAA;QACvCT,WAAAA,EAAa,aAAA;QACb3D,WAAAA,EAAa,qFAAA;QACb0B,UAAAA,EAAY;YACR9B,IAAAA,CAAK,QAAA,EAAU,QAAA,EAAU,MAAA,EAAQ,6CAAA,EAA+C;gBAAEiE,WAAAA,EAAa;oBAAEC,QAAAA,EAAU;AAAK;AAAE,aAAA,CAAA;YAClHjD,MAAAA,CAAO,MAAA,EAAQ,QAAQ,YAAA,EAAc;gBACjC,CAACwD,qBAAAA,CAAWC,OAAO,GAAG,SAAA;gBAAW,CAACD,qBAAAA,CAAWE,OAAO,GAAG,SAAA;gBAAW,CAACF,qBAAAA,CAAWG,MAAM,GAAG,QAAA;gBAAU,CAACH,qBAAAA,CAAWI,IAAI,GAAG,MAAA;gBAAQ,CAACJ,qBAAAA,CAAWK,OAAO,GAAG;aACtJ,EAAGL,qBAAAA,CAAWK,OAAO,EAAE,8CAAA;AAC1B;AACL;;;;;;"}
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ var scene_react = require('@cratis/scene.react');
4
+ var ComponentName = require('../ComponentName.js');
5
+ var packageName = require('../packageName.js');
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ const foundationSamples = {
10
+ [ComponentName.ComponentName.EmptyState]: {
11
+ properties: {
12
+ headline: 'No invoices yet',
13
+ hint: 'Invoices you create appear here.',
14
+ icon: 'file',
15
+ actionLabel: 'New invoice'
16
+ },
17
+ data: [],
18
+ stateful: false
19
+ },
20
+ [ComponentName.ComponentName.StatCard]: {
21
+ properties: {
22
+ label: 'Open pipeline',
23
+ value: 1234567,
24
+ format: 'currency',
25
+ currency: 'USD',
26
+ change: 12.5,
27
+ comparison: 'last month',
28
+ locale: 'en-US'
29
+ },
30
+ data: [
31
+ '$1,234,567'
32
+ ],
33
+ stateful: true
34
+ },
35
+ [ComponentName.ComponentName.TrendChip]: {
36
+ properties: {
37
+ change: -3.2,
38
+ goodDirection: 'down',
39
+ comparison: 'last week',
40
+ locale: 'en-US'
41
+ },
42
+ data: [],
43
+ stateful: false
44
+ },
45
+ [ComponentName.ComponentName.StatusChip]: {
46
+ properties: {
47
+ status: 'Awaiting approval',
48
+ tone: 'warning'
49
+ },
50
+ data: [],
51
+ stateful: false
52
+ }
53
+ };
54
+ /** A scene element for a foundation component, populated with its sample unless properties are given, with the state forced when asked. */ function foundationElement(name, properties, state) {
55
+ const sample = foundationSamples[name];
56
+ return {
57
+ id: `${name}-sample`,
58
+ componentName: scene_react.componentRegistryKey(packageName.defaultBlueprintName, name),
59
+ properties: {
60
+ ...properties ?? sample?.properties ?? {},
61
+ ...state === undefined ? {} : {
62
+ state
63
+ }
64
+ },
65
+ slots: {}
66
+ };
67
+ }
68
+
69
+ exports.foundationElement = foundationElement;
70
+ exports.foundationSamples = foundationSamples;
71
+ //# sourceMappingURL=foundationSamples.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundationSamples.js","sources":["../../../foundation/foundationSamples.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';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ComponentState } from './ComponentState';\n\n/**\n * What a story or a specification feeds each foundation component to see it populated.\n *\n * These are design-time and test-time values, never part of what a component is: a component declares the shape of its data\n * and a screen binds it to a query (spec SD1). The domain blueprints supply real preview data as sample-data packs; this is\n * only enough to draw each component in each state.\n */\nexport interface FoundationSample {\n /** The properties that make the component populated. */\n properties: Record<string, unknown>;\n\n /** Text that only appears when the component shows its data, so a specification can prove the no-permission state shows none of it. */\n data: string[];\n\n /** Whether the component shows data and so owns the five standard states; chips and the empty state themselves do not. */\n stateful: boolean;\n}\n\nexport const foundationSamples: Record<string, FoundationSample> = {\n [ComponentName.EmptyState]: { properties: { headline: 'No invoices yet', hint: 'Invoices you create appear here.', icon: 'file', actionLabel: 'New invoice' }, data: [], stateful: false },\n [ComponentName.StatCard]: { properties: { label: 'Open pipeline', value: 1234567, format: 'currency', currency: 'USD', change: 12.5, comparison: 'last month', locale: 'en-US' }, data: ['$1,234,567'], stateful: true },\n [ComponentName.TrendChip]: { properties: { change: -3.2, goodDirection: 'down', comparison: 'last week', locale: 'en-US' }, data: [], stateful: false },\n [ComponentName.StatusChip]: { properties: { status: 'Awaiting approval', tone: 'warning' }, data: [], stateful: false },\n};\n\n/** A scene element for a foundation component, populated with its sample unless properties are given, with the state forced when asked. */\nexport function foundationElement(name: string, properties?: Record<string, unknown>, state?: ComponentState): ExternalComponent {\n const sample = foundationSamples[name];\n return {\n id: `${name}-sample`,\n componentName: componentRegistryKey(defaultBlueprintName, name),\n properties: { ...(properties ?? sample?.properties ?? {}), ...(state === undefined ? {} : { state }) },\n slots: {},\n } as unknown as ExternalComponent;\n}\n"],"names":["foundationSamples","ComponentName","EmptyState","properties","headline","hint","icon","actionLabel","data","stateful","StatCard","label","value","format","currency","change","comparison","locale","TrendChip","goodDirection","StatusChip","status","tone","foundationElement","name","state","sample","id","componentName","componentRegistryKey","defaultBlueprintName","undefined","slots"],"mappings":";;;;;;AAAA;AACA;MA0BaA,iBAAAA,GAAsD;IAC/D,CAACC,2BAAAA,CAAcC,UAAU,GAAG;QAAEC,UAAAA,EAAY;YAAEC,QAAAA,EAAU,iBAAA;YAAmBC,IAAAA,EAAM,kCAAA;YAAoCC,IAAAA,EAAM,MAAA;YAAQC,WAAAA,EAAa;AAAc,SAAA;AAAGC,QAA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AAAA,GAAY,EAAC,GAAI;AAAEN,gBAAAA;;AAAS,SAAA;AACrGO,QAAAA,KAAAA,EAAO;AACX,KAAA;AACJ;;;"}
@@ -0,0 +1,105 @@
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
+ * Every piece of text the foundation components say themselves, as opposed to text a screen author or a bound query
7
+ * supplies. Nothing is hard-coded in a component (spec Part B 1.5): a component reads its text from here, merged with
8
+ * the `strings` property of the element, so an application localizes by supplying a table - and a bound string
9
+ * (a `{name}` placeholder is replaced by the values the component passes) arrives the same way any other property does.
10
+ */ const foundationStrings = {
11
+ loading: 'Loading',
12
+ emptyHeadline: 'Nothing here yet',
13
+ emptyHint: 'There is nothing to show for now.',
14
+ errorHeadline: 'This could not be loaded',
15
+ errorHint: 'Something went wrong while loading. Try again in a moment.',
16
+ retry: 'Try again',
17
+ noPermissionHeadline: 'You do not have access',
18
+ noPermissionHint: 'Ask an administrator to grant you access to {subject}.',
19
+ noPermissionSubject: 'this content',
20
+ partialHeadline: 'Some parts could not be loaded',
21
+ partialHint: 'The unavailable parts are: {regions}.',
22
+ disabledNoPermission: 'You do not have permission to do this',
23
+ trendUp: 'up {value}',
24
+ trendDown: 'down {value}',
25
+ trendFlat: 'unchanged',
26
+ trendComparison: 'compared to {period}',
27
+ statusSuccess: 'Success',
28
+ statusWarning: 'Warning',
29
+ statusDanger: 'Problem',
30
+ statusInfo: 'Information',
31
+ statusNeutral: 'Status',
32
+ chartNoData: 'No data to chart',
33
+ chartDataTable: 'Chart data',
34
+ chartSeries: 'Series',
35
+ chartCategory: 'Category',
36
+ filterAdd: 'Add condition',
37
+ filterAddGroup: 'Add group',
38
+ filterRemove: 'Remove condition',
39
+ filterRemoveGroup: 'Remove group',
40
+ filterMatchAll: 'Match all (AND)',
41
+ filterMatchAny: 'Match any (OR)',
42
+ filterField: 'Field',
43
+ filterOperator: 'Operator',
44
+ filterValue: 'Value',
45
+ filterClear: 'Clear filters',
46
+ filterSummary: '{count} active filters',
47
+ columnsChoose: 'Columns',
48
+ columnsLocked: 'always shown',
49
+ columnsReset: 'Show all columns',
50
+ viewsLabel: 'Saved views',
51
+ viewsDefault: 'All items',
52
+ viewsSave: 'Save current view',
53
+ viewsManage: 'Manage views',
54
+ checklistProgress: '{done} of {total} complete',
55
+ checklistOwner: 'Owner',
56
+ checklistDue: 'Due',
57
+ activityEmpty: 'No activity yet',
58
+ avatarOverflow: '{count} more',
59
+ avatarPeople: '{count} people',
60
+ uploadDrop: 'Drop files here or',
61
+ uploadBrowse: 'Browse files',
62
+ uploadRemove: 'Remove {name}',
63
+ uploadTooLarge: '{name} is larger than {limit}',
64
+ uploadWrongType: '{name} is not an accepted file type',
65
+ uploadUploading: 'Uploading',
66
+ uploadDone: 'Uploaded',
67
+ uploadFailed: 'Upload failed',
68
+ approvalPending: 'Pending',
69
+ approvalCurrent: 'Awaiting decision',
70
+ approvalApproved: 'Approved',
71
+ approvalRejected: 'Rejected',
72
+ approvalSkipped: 'Skipped',
73
+ approvalChain: 'Approval chain',
74
+ orgExpand: 'Expand {name}',
75
+ orgCollapse: 'Collapse {name}',
76
+ orgReports: '{count} reports',
77
+ matrixAllowed: 'Allowed',
78
+ matrixDenied: 'Not allowed',
79
+ matrixGrant: 'Grant {permission} to {role}',
80
+ matrixReadOnly: 'Read-only'
81
+ };
82
+ /**
83
+ * The foundation strings with the element's own `strings` property laid over them.
84
+ *
85
+ * Only string values of known names are taken, so a typo in an application's table falls back to the default text
86
+ * rather than rendering nothing.
87
+ */ function readFoundationStrings(element) {
88
+ const supplied = element.properties.strings;
89
+ const result = {
90
+ ...foundationStrings
91
+ };
92
+ if (typeof supplied !== 'object' || supplied === null || Array.isArray(supplied)) return result;
93
+ for (const [name, value] of Object.entries(supplied)){
94
+ if (name in foundationStrings && typeof value === 'string') result[name] = value;
95
+ }
96
+ return result;
97
+ }
98
+ /** Replaces each `{name}` in a string with the value of the same name, leaving an unknown placeholder visible rather than blank. */ function formatText(text, values = {}) {
99
+ return text.replace(/\{(\w+)\}/g, (placeholder, name)=>name in values ? String(values[name]) : placeholder);
100
+ }
101
+
102
+ exports.formatText = formatText;
103
+ exports.foundationStrings = foundationStrings;
104
+ exports.readFoundationStrings = readFoundationStrings;
105
+ //# sourceMappingURL=foundationStrings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundationStrings.js","sources":["../../../foundation/foundationStrings.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 * Every piece of text the foundation components say themselves, as opposed to text a screen author or a bound query\n * supplies. Nothing is hard-coded in a component (spec Part B 1.5): a component reads its text from here, merged with\n * the `strings` property of the element, so an application localizes by supplying a table - and a bound string\n * (a `{name}` placeholder is replaced by the values the component passes) arrives the same way any other property does.\n */\nexport const foundationStrings = {\n loading: 'Loading',\n emptyHeadline: 'Nothing here yet',\n emptyHint: 'There is nothing to show for now.',\n errorHeadline: 'This could not be loaded',\n errorHint: 'Something went wrong while loading. Try again in a moment.',\n retry: 'Try again',\n noPermissionHeadline: 'You do not have access',\n noPermissionHint: 'Ask an administrator to grant you access to {subject}.',\n noPermissionSubject: 'this content',\n partialHeadline: 'Some parts could not be loaded',\n partialHint: 'The unavailable parts are: {regions}.',\n disabledNoPermission: 'You do not have permission to do this',\n trendUp: 'up {value}',\n trendDown: 'down {value}',\n trendFlat: 'unchanged',\n trendComparison: 'compared to {period}',\n statusSuccess: 'Success',\n statusWarning: 'Warning',\n statusDanger: 'Problem',\n statusInfo: 'Information',\n statusNeutral: 'Status',\n chartNoData: 'No data to chart',\n chartDataTable: 'Chart data',\n chartSeries: 'Series',\n chartCategory: 'Category',\n filterAdd: 'Add condition',\n filterAddGroup: 'Add group',\n filterRemove: 'Remove condition',\n filterRemoveGroup: 'Remove group',\n filterMatchAll: 'Match all (AND)',\n filterMatchAny: 'Match any (OR)',\n filterField: 'Field',\n filterOperator: 'Operator',\n filterValue: 'Value',\n filterClear: 'Clear filters',\n filterSummary: '{count} active filters',\n columnsChoose: 'Columns',\n columnsLocked: 'always shown',\n columnsReset: 'Show all columns',\n viewsLabel: 'Saved views',\n viewsDefault: 'All items',\n viewsSave: 'Save current view',\n viewsManage: 'Manage views',\n checklistProgress: '{done} of {total} complete',\n checklistOwner: 'Owner',\n checklistDue: 'Due',\n activityEmpty: 'No activity yet',\n avatarOverflow: '{count} more',\n avatarPeople: '{count} people',\n uploadDrop: 'Drop files here or',\n uploadBrowse: 'Browse files',\n uploadRemove: 'Remove {name}',\n uploadTooLarge: '{name} is larger than {limit}',\n uploadWrongType: '{name} is not an accepted file type',\n uploadUploading: 'Uploading',\n uploadDone: 'Uploaded',\n uploadFailed: 'Upload failed',\n approvalPending: 'Pending',\n approvalCurrent: 'Awaiting decision',\n approvalApproved: 'Approved',\n approvalRejected: 'Rejected',\n approvalSkipped: 'Skipped',\n approvalChain: 'Approval chain',\n orgExpand: 'Expand {name}',\n orgCollapse: 'Collapse {name}',\n orgReports: '{count} reports',\n matrixAllowed: 'Allowed',\n matrixDenied: 'Not allowed',\n matrixGrant: 'Grant {permission} to {role}',\n matrixReadOnly: 'Read-only',\n} as const;\n\n/** The name of one of the foundation strings. */\nexport type FoundationStringName = keyof typeof foundationStrings;\n\n/** The text table a foundation component works with. */\nexport type FoundationStrings = Record<FoundationStringName, string>;\n\n/**\n * The foundation strings with the element's own `strings` property laid over them.\n *\n * Only string values of known names are taken, so a typo in an application's table falls back to the default text\n * rather than rendering nothing.\n */\nexport function readFoundationStrings(element: ExternalComponent): FoundationStrings {\n const supplied = element.properties.strings;\n const result: FoundationStrings = { ...foundationStrings };\n if (typeof supplied !== 'object' || supplied === null || Array.isArray(supplied)) return result;\n\n for (const [name, value] of Object.entries(supplied as Record<string, unknown>)) {\n if (name in foundationStrings && typeof value === 'string') result[name as FoundationStringName] = value;\n }\n\n return result;\n}\n\n/** Replaces each `{name}` in a string with the value of the same name, leaving an unknown placeholder visible rather than blank. */\nexport function formatText(text: string, values: Record<string, string | number> = {}): string {\n return text.replace(/\\{(\\w+)\\}/g, (placeholder, name: string) => (name in values ? String(values[name]) : placeholder));\n}\n"],"names":["foundationStrings","loading","emptyHeadline","emptyHint","errorHeadline","errorHint","retry","noPermissionHeadline","noPermissionHint","noPermissionSubject","partialHeadline","partialHint","disabledNoPermission","trendUp","trendDown","trendFlat","trendComparison","statusSuccess","statusWarning","statusDanger","statusInfo","statusNeutral","chartNoData","chartDataTable","chartSeries","chartCategory","filterAdd","filterAddGroup","filterRemove","filterRemoveGroup","filterMatchAll","filterMatchAny","filterField","filterOperator","filterValue","filterClear","filterSummary","columnsChoose","columnsLocked","columnsReset","viewsLabel","viewsDefault","viewsSave","viewsManage","checklistProgress","checklistOwner","checklistDue","activityEmpty","avatarOverflow","avatarPeople","uploadDrop","uploadBrowse","uploadRemove","uploadTooLarge","uploadWrongType","uploadUploading","uploadDone","uploadFailed","approvalPending","approvalCurrent","approvalApproved","approvalRejected","approvalSkipped","approvalChain","orgExpand","orgCollapse","orgReports","matrixAllowed","matrixDenied","matrixGrant","matrixReadOnly","readFoundationStrings","element","supplied","properties","strings","result","Array","isArray","name","value","Object","entries","formatText","text","values","replace","placeholder","String"],"mappings":";;AAAA;AACA;AAIA;;;;;UAMaA,iBAAAA,GAAoB;IAC7BC,OAAAA,EAAS,SAAA;IACTC,aAAAA,EAAe,kBAAA;IACfC,SAAAA,EAAW,mCAAA;IACXC,aAAAA,EAAe,0BAAA;IACfC,SAAAA,EAAW,4DAAA;IACXC,KAAAA,EAAO,WAAA;IACPC,oBAAAA,EAAsB,wBAAA;IACtBC,gBAAAA,EAAkB,wDAAA;IAClBC,mBAAAA,EAAqB,cAAA;IACrBC,eAAAA,EAAiB,gCAAA;IACjBC,WAAAA,EAAa,uCAAA;IACbC,oBAAAA,EAAsB,uCAAA;IACtBC,OAAAA,EAAS,YAAA;I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EAAkB,UAAA;IAClBC,gBAAAA,EAAkB,UAAA;IAClBC,eAAAA,EAAiB,SAAA;IACjBC,aAAAA,EAAe,gBAAA;IACfC,SAAAA,EAAW,eAAA;IACXC,WAAAA,EAAa,iBAAA;IACbC,UAAAA,EAAY,iBAAA;IACZC,aAAAA,EAAe,SAAA;IACfC,YAAAA,EAAc,aAAA;IACdC,WAAAA,EAAa,8BAAA;IACbC,cAAAA,EAAgB;AACpB;AAQA;;;;;IAMO,SAASC,qBAAAA,CAAsBC,OAA0B,EAAA;AAC5D,IAAA,MAAMC,QAAAA,GAAWD,OAAAA,CAAQE,UAAU,CAACC,OAAO;AAC3C,IAAA,MAAMC,MAAAA,GAA4B;AAAE,QAAA,GAAG5E;AAAkB,KAAA;IACzD,IAAI,OAAOyE,aAAa,QAAA,IAAYA,QAAAA,KAAa,QAAQI,KAAAA,CAAMC,OAAO,CAACL,QAAAA,CAAAA,EAAW,OAAOG,MAAAA;IAEzF,KAAK,MAAM,CAACG,IAAAA,EAAMC,KAAAA,CAAM,IAAIC,MAAAA,CAAOC,OAAO,CAACT,QAAAA,CAAAA,CAAsC;QAC7E,IAAIM,IAAAA,IAAQ/E,qBAAqB,OAAOgF,KAAAA,KAAU,UAAUJ,MAAM,CAACG,KAA6B,GAAGC,KAAAA;AACvG,IAAA;IAEA,OAAOJ,MAAAA;AACX;AAEA,qIACO,SAASO,UAAAA,CAAWC,IAAY,EAAEC,MAAAA,GAA0C,EAAE,EAAA;AACjF,IAAA,OAAOD,IAAAA,CAAKE,OAAO,CAAC,YAAA,EAAc,CAACC,WAAAA,EAAaR,IAAAA,GAAkBA,IAAAA,IAAQM,MAAAA,GAASG,MAAAA,CAAOH,MAAM,CAACN,KAAK,CAAA,GAAIQ,WAAAA,CAAAA;AAC9G;;;;"}
package/dist/cjs/index.js CHANGED
@@ -54,6 +54,21 @@ var Logo = require('./shell/Logo.js');
54
54
  var UserMenu = require('./shell/UserMenu.js');
55
55
  var ThemeSwitcher = require('./shell/ThemeSwitcher.js');
56
56
  var LayoutModeSwitcher = require('./shell/LayoutModeSwitcher.js');
57
+ var foundationStrings = require('./foundation/foundationStrings.js');
58
+ var ComponentState = require('./foundation/ComponentState.js');
59
+ var PermissionRule = require('./foundation/PermissionRule.js');
60
+ var formatting = require('./foundation/formatting.js');
61
+ var FoundationIcon = require('./foundation/FoundationIcon.js');
62
+ var ActionButton = require('./foundation/ActionButton.js');
63
+ var StateFrame = require('./foundation/StateFrame.js');
64
+ var EmptyState = require('./foundation/EmptyState.js');
65
+ var TrendChip = require('./foundation/TrendChip.js');
66
+ var StatusChip = require('./foundation/StatusChip.js');
67
+ var StatCard = require('./foundation/StatCard.js');
68
+ var foundationDescriptors = require('./foundation/foundationDescriptors.js');
69
+ var foundationComponentMetadata = require('./foundation/foundationComponentMetadata.js');
70
+ var foundationSamples = require('./foundation/foundationSamples.js');
71
+ var FoundationStates = require('./foundation/FoundationStates.js');
57
72
  var blueprintThemeCompatibility = require('./themes/blueprintThemeCompatibility.js');
58
73
  var light = require('./themes/light.js');
59
74
  var dark = require('./themes/dark.js');
@@ -217,6 +232,43 @@ exports.Logo = Logo.Logo;
217
232
  exports.UserMenu = UserMenu.UserMenu;
218
233
  exports.ThemeSwitcher = ThemeSwitcher.ThemeSwitcher;
219
234
  exports.LayoutModeSwitcher = LayoutModeSwitcher.LayoutModeSwitcher;
235
+ exports.formatText = foundationStrings.formatText;
236
+ exports.foundationStrings = foundationStrings.foundationStrings;
237
+ exports.readFoundationStrings = foundationStrings.readFoundationStrings;
238
+ exports.ComponentState = ComponentState.ComponentState;
239
+ exports.componentStates = ComponentState.componentStates;
240
+ exports.readComponentState = ComponentState.readComponentState;
241
+ exports.PermissionRule = PermissionRule.PermissionRule;
242
+ exports.readPermissionRule = PermissionRule.readPermissionRule;
243
+ exports.NumberFormat = formatting.NumberFormat;
244
+ exports.formatDate = formatting.formatDate;
245
+ exports.formatNumber = formatting.formatNumber;
246
+ exports.isRightToLeft = formatting.isRightToLeft;
247
+ exports.readLocale = formatting.readLocale;
248
+ exports.readNumberFormat = formatting.readNumberFormat;
249
+ exports.FoundationIcon = FoundationIcon.FoundationIcon;
250
+ exports.isFoundationIcon = FoundationIcon.isFoundationIcon;
251
+ exports.ActionButton = ActionButton.ActionButton;
252
+ exports.EmptyStateView = StateFrame.EmptyStateView;
253
+ exports.FoundationFrame = StateFrame.FoundationFrame;
254
+ exports.EmptyState = EmptyState.EmptyState;
255
+ exports.TrendChip = TrendChip.TrendChip;
256
+ exports.TrendChipView = TrendChip.TrendChipView;
257
+ exports.trendDirection = TrendChip.trendDirection;
258
+ exports.trendOutcome = TrendChip.trendOutcome;
259
+ exports.StatusChip = StatusChip.StatusChip;
260
+ exports.StatusTone = StatusChip.StatusTone;
261
+ exports.readStatusTone = StatusChip.readStatusTone;
262
+ exports.statusToneIcons = StatusChip.statusToneIcons;
263
+ exports.StatCard = StatCard.StatCard;
264
+ exports.bindable = foundationDescriptors.bindable;
265
+ exports.foundationDescriptors = foundationDescriptors.foundationDescriptors;
266
+ exports.list = foundationDescriptors.list;
267
+ exports.standardStateProperties = foundationDescriptors.standardStateProperties;
268
+ exports.foundationComponentMetadata = foundationComponentMetadata.foundationComponentMetadata;
269
+ exports.foundationElement = foundationSamples.foundationElement;
270
+ exports.foundationSamples = foundationSamples.foundationSamples;
271
+ exports.FoundationStates = FoundationStates.FoundationStates;
220
272
  exports.blueprintThemeCompatibility = blueprintThemeCompatibility.blueprintThemeCompatibility;
221
273
  exports.lightTheme = light.lightTheme;
222
274
  exports.darkTheme = dark.darkTheme;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -32,7 +32,15 @@ var blueprintThemeCompatibility = require('./blueprintThemeCompatibility.js');
32
32
  'highlight.background': '#232a45',
33
33
  'highlight.color': '#c7ccff',
34
34
  'content.borderRadius': '0.5rem',
35
- 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)'
35
+ 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)',
36
+ 'status.successColor': '#86efac',
37
+ 'status.successBackground': '#14301f',
38
+ 'status.warningColor': '#fcd34d',
39
+ 'status.warningBackground': '#33290f',
40
+ 'status.dangerColor': '#fca5a5',
41
+ 'status.dangerBackground': '#3a1616',
42
+ 'status.infoColor': '#93c5fd',
43
+ 'status.infoBackground': '#162a4a'
36
44
  }
37
45
  };
38
46