@cratis/scene.blueprint.default 4.31.0 → 4.33.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 (226) hide show
  1. package/ComponentName.ts +24 -0
  2. package/defaultBlueprint.ts +2 -1
  3. package/defaultBlueprintComponentMetadata.ts +2 -0
  4. package/defaultBlueprintComponents.ts +9 -0
  5. package/dist/cjs/ComponentName.js +8 -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 +21 -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/ChartWrapper.js +520 -0
  16. package/dist/cjs/foundation/ChartWrapper.js.map +1 -0
  17. package/dist/cjs/foundation/ColumnChooser.js +156 -0
  18. package/dist/cjs/foundation/ColumnChooser.js.map +1 -0
  19. package/dist/cjs/foundation/ComponentState.js +42 -0
  20. package/dist/cjs/foundation/ComponentState.js.map +1 -0
  21. package/dist/cjs/foundation/EmptyState.js +31 -0
  22. package/dist/cjs/foundation/EmptyState.js.map +1 -0
  23. package/dist/cjs/foundation/FilterBuilder.js +307 -0
  24. package/dist/cjs/foundation/FilterBuilder.js.map +1 -0
  25. package/dist/cjs/foundation/FoundationIcon.js +58 -0
  26. package/dist/cjs/foundation/FoundationIcon.js.map +1 -0
  27. package/dist/cjs/foundation/FoundationStates.js +62 -0
  28. package/dist/cjs/foundation/FoundationStates.js.map +1 -0
  29. package/dist/cjs/foundation/PermissionRule.js +22 -0
  30. package/dist/cjs/foundation/PermissionRule.js.map +1 -0
  31. package/dist/cjs/foundation/SavedViewsMenu.js +199 -0
  32. package/dist/cjs/foundation/SavedViewsMenu.js.map +1 -0
  33. package/dist/cjs/foundation/StatCard.js +61 -0
  34. package/dist/cjs/foundation/StatCard.js.map +1 -0
  35. package/dist/cjs/foundation/StateFrame.js +200 -0
  36. package/dist/cjs/foundation/StateFrame.js.map +1 -0
  37. package/dist/cjs/foundation/StatusChip.js +64 -0
  38. package/dist/cjs/foundation/StatusChip.js.map +1 -0
  39. package/dist/cjs/foundation/TrendChip.js +93 -0
  40. package/dist/cjs/foundation/TrendChip.js.map +1 -0
  41. package/dist/cjs/foundation/chartGeometry.js +101 -0
  42. package/dist/cjs/foundation/chartGeometry.js.map +1 -0
  43. package/dist/cjs/foundation/columnModel.js +43 -0
  44. package/dist/cjs/foundation/columnModel.js.map +1 -0
  45. package/dist/cjs/foundation/filterModel.js +123 -0
  46. package/dist/cjs/foundation/filterModel.js.map +1 -0
  47. package/dist/cjs/foundation/formatting.js +85 -0
  48. package/dist/cjs/foundation/formatting.js.map +1 -0
  49. package/dist/cjs/foundation/foundationComponentMetadata.js +69 -0
  50. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -0
  51. package/dist/cjs/foundation/foundationDescriptors.js +385 -0
  52. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -0
  53. package/dist/cjs/foundation/foundationSamples.js +201 -0
  54. package/dist/cjs/foundation/foundationSamples.js.map +1 -0
  55. package/dist/cjs/foundation/foundationStrings.js +130 -0
  56. package/dist/cjs/foundation/foundationStrings.js.map +1 -0
  57. package/dist/cjs/foundation/useElementWidth.js +31 -0
  58. package/dist/cjs/foundation/useElementWidth.js.map +1 -0
  59. package/dist/cjs/foundation/viewModel.js +24 -0
  60. package/dist/cjs/foundation/viewModel.js.map +1 -0
  61. package/dist/cjs/index.js +90 -0
  62. package/dist/cjs/index.js.map +1 -1
  63. package/dist/cjs/themes/dark.js +9 -1
  64. package/dist/cjs/themes/dark.js.map +1 -1
  65. package/dist/cjs/themes/light.js +10 -2
  66. package/dist/cjs/themes/light.js.map +1 -1
  67. package/dist/esm/ComponentName.d.ts +9 -1
  68. package/dist/esm/ComponentName.d.ts.map +1 -1
  69. package/dist/esm/ComponentName.js +8 -0
  70. package/dist/esm/ComponentName.js.map +1 -1
  71. package/dist/esm/defaultBlueprint.d.ts.map +1 -1
  72. package/dist/esm/defaultBlueprint.js +9 -5
  73. package/dist/esm/defaultBlueprint.js.map +1 -1
  74. package/dist/esm/defaultBlueprintComponentMetadata.d.ts.map +1 -1
  75. package/dist/esm/defaultBlueprintComponentMetadata.js +8 -0
  76. package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
  77. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  78. package/dist/esm/defaultBlueprintComponents.js +21 -1
  79. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  80. package/dist/esm/foundation/ActionButton.d.ts +13 -0
  81. package/dist/esm/foundation/ActionButton.d.ts.map +1 -0
  82. package/dist/esm/foundation/ActionButton.js +31 -0
  83. package/dist/esm/foundation/ActionButton.js.map +1 -0
  84. package/dist/esm/foundation/ChartWrapper.d.ts +5 -0
  85. package/dist/esm/foundation/ChartWrapper.d.ts.map +1 -0
  86. package/dist/esm/foundation/ChartWrapper.js +517 -0
  87. package/dist/esm/foundation/ChartWrapper.js.map +1 -0
  88. package/dist/esm/foundation/ColumnChooser.d.ts +3 -0
  89. package/dist/esm/foundation/ColumnChooser.d.ts.map +1 -0
  90. package/dist/esm/foundation/ColumnChooser.js +154 -0
  91. package/dist/esm/foundation/ColumnChooser.js.map +1 -0
  92. package/dist/esm/foundation/ComponentState.d.ts +12 -0
  93. package/dist/esm/foundation/ComponentState.d.ts.map +1 -0
  94. package/dist/esm/foundation/ComponentState.js +38 -0
  95. package/dist/esm/foundation/ComponentState.js.map +1 -0
  96. package/dist/esm/foundation/EmptyState.d.ts +3 -0
  97. package/dist/esm/foundation/EmptyState.d.ts.map +1 -0
  98. package/dist/esm/foundation/EmptyState.js +29 -0
  99. package/dist/esm/foundation/EmptyState.js.map +1 -0
  100. package/dist/esm/foundation/FilterBuilder.d.ts +3 -0
  101. package/dist/esm/foundation/FilterBuilder.d.ts.map +1 -0
  102. package/dist/esm/foundation/FilterBuilder.js +305 -0
  103. package/dist/esm/foundation/FilterBuilder.js.map +1 -0
  104. package/dist/esm/foundation/Foundation.stories.d.ts +37 -0
  105. package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -0
  106. package/dist/esm/foundation/Foundation.stories.js +34 -0
  107. package/dist/esm/foundation/Foundation.stories.js.map +1 -0
  108. package/dist/esm/foundation/FoundationIcon.d.ts +7 -0
  109. package/dist/esm/foundation/FoundationIcon.d.ts.map +1 -0
  110. package/dist/esm/foundation/FoundationIcon.js +55 -0
  111. package/dist/esm/foundation/FoundationIcon.js.map +1 -0
  112. package/dist/esm/foundation/FoundationStates.d.ts +8 -0
  113. package/dist/esm/foundation/FoundationStates.d.ts.map +1 -0
  114. package/dist/esm/foundation/FoundationStates.js +60 -0
  115. package/dist/esm/foundation/FoundationStates.js.map +1 -0
  116. package/dist/esm/foundation/PermissionRule.d.ts +8 -0
  117. package/dist/esm/foundation/PermissionRule.d.ts.map +1 -0
  118. package/dist/esm/foundation/PermissionRule.js +19 -0
  119. package/dist/esm/foundation/PermissionRule.js.map +1 -0
  120. package/dist/esm/foundation/SavedViewsMenu.d.ts +4 -0
  121. package/dist/esm/foundation/SavedViewsMenu.d.ts.map +1 -0
  122. package/dist/esm/foundation/SavedViewsMenu.js +196 -0
  123. package/dist/esm/foundation/SavedViewsMenu.js.map +1 -0
  124. package/dist/esm/foundation/StatCard.d.ts +3 -0
  125. package/dist/esm/foundation/StatCard.d.ts.map +1 -0
  126. package/dist/esm/foundation/StatCard.js +59 -0
  127. package/dist/esm/foundation/StatCard.js.map +1 -0
  128. package/dist/esm/foundation/StateFrame.d.ts +15 -0
  129. package/dist/esm/foundation/StateFrame.d.ts.map +1 -0
  130. package/dist/esm/foundation/StateFrame.js +197 -0
  131. package/dist/esm/foundation/StateFrame.js.map +1 -0
  132. package/dist/esm/foundation/StatusChip.d.ts +13 -0
  133. package/dist/esm/foundation/StatusChip.d.ts.map +1 -0
  134. package/dist/esm/foundation/StatusChip.js +59 -0
  135. package/dist/esm/foundation/StatusChip.js.map +1 -0
  136. package/dist/esm/foundation/TrendChip.d.ts +18 -0
  137. package/dist/esm/foundation/TrendChip.d.ts.map +1 -0
  138. package/dist/esm/foundation/TrendChip.js +88 -0
  139. package/dist/esm/foundation/TrendChip.js.map +1 -0
  140. package/dist/esm/foundation/chartGeometry.d.ts +34 -0
  141. package/dist/esm/foundation/chartGeometry.d.ts.map +1 -0
  142. package/dist/esm/foundation/chartGeometry.js +93 -0
  143. package/dist/esm/foundation/chartGeometry.js.map +1 -0
  144. package/dist/esm/foundation/columnModel.d.ts +11 -0
  145. package/dist/esm/foundation/columnModel.d.ts.map +1 -0
  146. package/dist/esm/foundation/columnModel.js +38 -0
  147. package/dist/esm/foundation/columnModel.js.map +1 -0
  148. package/dist/esm/foundation/filterModel.d.ts +33 -0
  149. package/dist/esm/foundation/filterModel.d.ts.map +1 -0
  150. package/dist/esm/foundation/filterModel.js +112 -0
  151. package/dist/esm/foundation/filterModel.js.map +1 -0
  152. package/dist/esm/foundation/formatting.d.ts +13 -0
  153. package/dist/esm/foundation/formatting.d.ts.map +1 -0
  154. package/dist/esm/foundation/formatting.js +78 -0
  155. package/dist/esm/foundation/formatting.js.map +1 -0
  156. package/dist/esm/foundation/foundationComponentMetadata.d.ts +3 -0
  157. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -0
  158. package/dist/esm/foundation/foundationComponentMetadata.js +67 -0
  159. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -0
  160. package/dist/esm/foundation/foundationDescriptors.d.ts +6 -0
  161. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -0
  162. package/dist/esm/foundation/foundationDescriptors.js +380 -0
  163. package/dist/esm/foundation/foundationDescriptors.js.map +1 -0
  164. package/dist/esm/foundation/foundationSamples.d.ts +10 -0
  165. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -0
  166. package/dist/esm/foundation/foundationSamples.js +198 -0
  167. package/dist/esm/foundation/foundationSamples.js.map +1 -0
  168. package/dist/esm/foundation/foundationStrings.d.ts +103 -0
  169. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -0
  170. package/dist/esm/foundation/foundationStrings.js +126 -0
  171. package/dist/esm/foundation/foundationStrings.js.map +1 -0
  172. package/dist/esm/foundation/index.d.ts +25 -0
  173. package/dist/esm/foundation/index.d.ts.map +1 -0
  174. package/dist/esm/foundation/index.js +25 -0
  175. package/dist/esm/foundation/index.js.map +1 -0
  176. package/dist/esm/foundation/useElementWidth.d.ts +3 -0
  177. package/dist/esm/foundation/useElementWidth.d.ts.map +1 -0
  178. package/dist/esm/foundation/useElementWidth.js +29 -0
  179. package/dist/esm/foundation/useElementWidth.js.map +1 -0
  180. package/dist/esm/foundation/viewModel.d.ts +7 -0
  181. package/dist/esm/foundation/viewModel.d.ts.map +1 -0
  182. package/dist/esm/foundation/viewModel.js +22 -0
  183. package/dist/esm/foundation/viewModel.js.map +1 -0
  184. package/dist/esm/gallery/widgets.js +1 -1
  185. package/dist/esm/index.d.ts +1 -0
  186. package/dist/esm/index.d.ts.map +1 -1
  187. package/dist/esm/index.js +24 -0
  188. package/dist/esm/index.js.map +1 -1
  189. package/dist/esm/themes/dark.d.ts.map +1 -1
  190. package/dist/esm/themes/dark.js +9 -1
  191. package/dist/esm/themes/dark.js.map +1 -1
  192. package/dist/esm/themes/light.d.ts.map +1 -1
  193. package/dist/esm/themes/light.js +10 -2
  194. package/dist/esm/themes/light.js.map +1 -1
  195. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  196. package/foundation/ActionButton.tsx +39 -0
  197. package/foundation/ChartWrapper.tsx +252 -0
  198. package/foundation/ColumnChooser.tsx +73 -0
  199. package/foundation/ComponentState.ts +53 -0
  200. package/foundation/EmptyState.tsx +22 -0
  201. package/foundation/FilterBuilder.tsx +144 -0
  202. package/foundation/Foundation.stories.tsx +46 -0
  203. package/foundation/FoundationIcon.tsx +49 -0
  204. package/foundation/FoundationStates.tsx +46 -0
  205. package/foundation/PermissionRule.ts +26 -0
  206. package/foundation/SavedViewsMenu.tsx +94 -0
  207. package/foundation/StatCard.tsx +44 -0
  208. package/foundation/StateFrame.tsx +126 -0
  209. package/foundation/StatusChip.tsx +51 -0
  210. package/foundation/TrendChip.tsx +78 -0
  211. package/foundation/chartGeometry.ts +108 -0
  212. package/foundation/columnModel.ts +39 -0
  213. package/foundation/filterModel.ts +111 -0
  214. package/foundation/formatting.ts +69 -0
  215. package/foundation/foundationComponentMetadata.ts +21 -0
  216. package/foundation/foundationDescriptors.ts +204 -0
  217. package/foundation/foundationSamples.ts +63 -0
  218. package/foundation/foundationStrings.ts +137 -0
  219. package/foundation/index.ts +27 -0
  220. package/foundation/useElementWidth.ts +31 -0
  221. package/foundation/viewModel.ts +21 -0
  222. package/index.ts +1 -0
  223. package/package.json +9 -8
  224. package/shell/layout.css +526 -0
  225. package/themes/dark.ts +8 -0
  226. package/themes/light.ts +9 -1
@@ -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 [ComponentName.ChartWrapper]: {\n properties: { title: 'Revenue by quarter', kind: 'line', categories: ['Q1', 'Q2', 'Q3', 'Q4'], series: [{ name: 'Revenue', values: [120, 180, 150, 240] }, { name: 'Target', values: [100, 150, 200, 220] }], locale: 'en-US' },\n data: ['Revenue by quarter'], stateful: true,\n },\n [ComponentName.FilterBuilder]: {\n properties: {\n fields: [{ name: 'owner', label: 'Owner', type: 'text' }, { name: 'status', label: 'Status', type: 'select', options: ['Open', 'Won', 'Lost'] }, { name: 'value', label: 'Value', type: 'number' }],\n filter: { operator: 'and', conditions: [{ field: 'status', operator: 'is', value: 'Open' }, { field: 'owner', operator: 'contains', value: 'Ada' }], groups: [] },\n },\n data: ['2 active filters'], stateful: true,\n },\n [ComponentName.ColumnChooser]: {\n properties: { columns: [{ id: 'name', label: 'Name', locked: true }, { id: 'owner', label: 'Owner' }, { id: 'status', label: 'Status', visible: false }] },\n data: ['3 shown'], stateful: true,\n },\n [ComponentName.SavedViewsMenu]: {\n properties: { views: [{ id: 'all', label: 'All leads' }, { id: 'mine', label: 'Mine' }, { id: 'overdue', label: 'Overdue' }], activeView: 'mine' },\n data: ['Mine'], stateful: true,\n },\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","ChartWrapper","title","kind","categories","series","name","values","FilterBuilder","fields","type","options","filter","operator","conditions","field","groups","ColumnChooser","columns","id","locked","visible","SavedViewsMenu","views","activeView","foundationElement","state","sample","componentName","componentRegistryKey","defaultBlueprintName","undefined","slots"],"mappings":";;;;AAAA;AACA;MA0BaA,iBAAAA,GAAsD;IAC/D,CAACC,aAAAA,CAAcC,UAAU,GAAG;QAAEC,UAAAA,EAAY;YAAEC,QAAAA,EAAU,iBAAA;YAAmBC,IAAAA,EAAM,kCAAA;YAAoCC,IAAAA,EAAM,MAAA;YAAQC,WAAAA,EAAa;AAAc,SAAA;AAAGC,QAAAA,IAAAA,EAAM,EAAE;QAAEC,QAAAA,EAAU;AAAM,KAAA;IACzL,CAACR,aAAAA,CAAcS,QAAQ,GAAG;QAAEP,UAAAA,EAAY;YAAEQ,KAAAA,EAAO,eAAA;YAAiBC,KAAAA,EAAO,OAAA;YAASC,MAAAA,EAAQ,UAAA;YAAYC,QAAAA,EAAU,KAAA;YAAOC,MAAAA,EAAQ,IAAA;YAAMC,UAAAA,EAAY,YAAA;YAAcC,MAAAA,EAAQ;AAAQ,SAAA;QAAGT,IAAAA,EAAM;AAAC,YAAA;AAAa,SAAA;QAAEC,QAAAA,EAAU;AAAK,KAAA;IACvN,CAACR,aAAAA,CAAciB,SAAS,GAAG;QAAEf,UAAAA,EAAY;AAAEY,YAAAA,MAAAA,EAAQ,IAAC;YAAKI,aA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C,gBAAA;oBAAEJ,EAAAA,EAAI,KAAA;oBAAO9B,KAAAA,EAAO;AAAY,iBAAA;AAAG,gBAAA;oBAAE8B,EAAAA,EAAI,MAAA;oBAAQ9B,KAAAA,EAAO;AAAO,iBAAA;AAAG,gBAAA;oBAAE8B,EAAAA,EAAI,SAAA;oBAAW9B,KAAAA,EAAO;AAAU;AAAE,aAAA;YAAEmC,UAAAA,EAAY;AAAO,SAAA;QACjJtC,IAAAA,EAAM;AAAC,YAAA;AAAO,SAAA;QAAEC,QAAAA,EAAU;AAC9B;AACJ;AAEA,4IACO,SAASsC,iBAAAA,CAAkBnB,IAAY,EAAEzB,UAAoC,EAAE6C,KAAsB,EAAA;IACxG,MAAMC,MAAAA,GAASjD,iBAAiB,CAAC4B,IAAAA,CAAK;IACtC,OAAO;QACHa,EAAAA,EAAI,CAAA,EAAGb,IAAAA,CAAK,OAAO,CAAC;AACpBsB,QAAAA,aAAAA,EAAeC,qBAAqBC,oBAAAA,EAAsBxB,IAAAA,CAAAA;QAC1DzB,UAAAA,EAAY;AAAE,YAAA,GAAIA,UAAAA,IAAc8C,MAAAA,EAAQ9C,UAAAA,IAAc,EAAE;YAAG,GAAI6C,KAAAA,KAAUK,SAAAA,GAAY,EAAC,GAAI;AAAEL,gBAAAA;;AAAS,SAAA;AACrGM,QAAAA,KAAAA,EAAO;AACX,KAAA;AACJ;;"}
@@ -0,0 +1,103 @@
1
+ import { ExternalComponent } from '@cratis/scene.model';
2
+ export declare const foundationStrings: {
3
+ readonly loading: 'Loading';
4
+ readonly emptyHeadline: 'Nothing here yet';
5
+ readonly emptyHint: 'There is nothing to show for now.';
6
+ readonly errorHeadline: 'This could not be loaded';
7
+ readonly errorHint: 'Something went wrong while loading. Try again in a moment.';
8
+ readonly retry: 'Try again';
9
+ readonly noPermissionHeadline: 'You do not have access';
10
+ readonly noPermissionHint: 'Ask an administrator to grant you access to {subject}.';
11
+ readonly noPermissionSubject: 'this content';
12
+ readonly partialHeadline: 'Some parts could not be loaded';
13
+ readonly partialHint: 'The unavailable parts are: {regions}.';
14
+ readonly disabledNoPermission: 'You do not have permission to do this';
15
+ readonly trendUp: 'up {value}';
16
+ readonly trendDown: 'down {value}';
17
+ readonly trendFlat: 'unchanged';
18
+ readonly trendComparison: 'compared to {period}';
19
+ readonly statusSuccess: 'Success';
20
+ readonly statusWarning: 'Warning';
21
+ readonly statusDanger: 'Problem';
22
+ readonly statusInfo: 'Information';
23
+ readonly statusNeutral: 'Status';
24
+ readonly chartNoData: 'No data to chart';
25
+ readonly chartDataTable: 'Chart data';
26
+ readonly chartSeries: 'Series';
27
+ readonly chartCategory: 'Category';
28
+ readonly filterAdd: 'Add condition';
29
+ readonly filterAddGroup: 'Add group';
30
+ readonly filterRemove: 'Remove condition';
31
+ readonly filterRemoveGroup: 'Remove group';
32
+ readonly filterMatchAll: 'Match all (AND)';
33
+ readonly filterMatchAny: 'Match any (OR)';
34
+ readonly filterField: 'Field';
35
+ readonly filterOperator: 'Operator';
36
+ readonly filterValue: 'Value';
37
+ readonly filterClear: 'Clear filters';
38
+ readonly filterCondition: 'Condition {n}';
39
+ readonly filterGroup: 'Group {n}';
40
+ readonly filterNoFields: 'There are no fields to filter on';
41
+ readonly opContains: 'contains';
42
+ readonly opEquals: 'equals';
43
+ readonly opNotEquals: 'does not equal';
44
+ readonly opStartsWith: 'starts with';
45
+ readonly opIsEmpty: 'is empty';
46
+ readonly opGreater: 'is greater than';
47
+ readonly opGreaterOrEqual: 'is at least';
48
+ readonly opLess: 'is less than';
49
+ readonly opLessOrEqual: 'is at most';
50
+ readonly opBefore: 'is before';
51
+ readonly opAfter: 'is after';
52
+ readonly opOn: 'is on';
53
+ readonly opIs: 'is';
54
+ readonly opIsNot: 'is not';
55
+ readonly opTrue: 'is yes';
56
+ readonly opFalse: 'is no';
57
+ readonly filterSummary: '{count} active filters';
58
+ readonly filterSummaryOne: '1 active filter';
59
+ readonly columnsChoose: 'Columns';
60
+ readonly columnsLocked: 'always shown';
61
+ readonly columnsReset: 'Show all columns';
62
+ readonly columnsMoveUp: 'Move {name} up';
63
+ readonly columnsMoveDown: 'Move {name} down';
64
+ readonly columnsShown: '{shown} of {total} shown';
65
+ readonly columnsNone: 'There are no columns to choose from';
66
+ readonly viewsLabel: 'Saved views';
67
+ readonly viewsDefault: 'All items';
68
+ readonly viewsSave: 'Save current view';
69
+ readonly viewsManage: 'Manage views';
70
+ readonly viewsNone: 'There are no saved views';
71
+ readonly checklistProgress: '{done} of {total} complete';
72
+ readonly checklistOwner: 'Owner';
73
+ readonly checklistDue: 'Due';
74
+ readonly activityEmpty: 'No activity yet';
75
+ readonly avatarOverflow: '{count} more';
76
+ readonly avatarPeople: '{count} people';
77
+ readonly uploadDrop: 'Drop files here or';
78
+ readonly uploadBrowse: 'Browse files';
79
+ readonly uploadRemove: 'Remove {name}';
80
+ readonly uploadTooLarge: '{name} is larger than {limit}';
81
+ readonly uploadWrongType: '{name} is not an accepted file type';
82
+ readonly uploadUploading: 'Uploading';
83
+ readonly uploadDone: 'Uploaded';
84
+ readonly uploadFailed: 'Upload failed';
85
+ readonly approvalPending: 'Pending';
86
+ readonly approvalCurrent: 'Awaiting decision';
87
+ readonly approvalApproved: 'Approved';
88
+ readonly approvalRejected: 'Rejected';
89
+ readonly approvalSkipped: 'Skipped';
90
+ readonly approvalChain: 'Approval chain';
91
+ readonly orgExpand: 'Expand {name}';
92
+ readonly orgCollapse: 'Collapse {name}';
93
+ readonly orgReports: '{count} reports';
94
+ readonly matrixAllowed: 'Allowed';
95
+ readonly matrixDenied: 'Not allowed';
96
+ readonly matrixGrant: 'Grant {permission} to {role}';
97
+ readonly matrixReadOnly: 'Read-only';
98
+ };
99
+ export type FoundationStringName = keyof typeof foundationStrings;
100
+ export type FoundationStrings = Record<FoundationStringName, string>;
101
+ export declare function readFoundationStrings(element: ExternalComponent): FoundationStrings;
102
+ export declare function formatText(text: string, values?: Record<string, string | number>): string;
103
+ //# sourceMappingURL=foundationStrings.d.ts.map
@@ -0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e;aAC1B,WAAW,EAAE,iBAAiB;aAC9B,UAAU,EAAE,iBAAiB;aAC7B,aAAa,EAAE,SAAS;aACxB,YAAY,EAAE,aAAa;aAC3B,WAAW,EAAE,8BAA8B;aAC3C,cAAc,EAAE,WAAW;CACrB,CAAC;AAGX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAGlE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAQrE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CAUnF;AAGD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,GAAG,MAAM,CAE7F"}
@@ -0,0 +1,126 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * Every piece of text the foundation components say themselves, as opposed to text a screen author or a bound query
5
+ * supplies. Nothing is hard-coded in a component (spec Part B 1.5): a component reads its text from here, merged with
6
+ * the `strings` property of the element, so an application localizes by supplying a table - and a bound string
7
+ * (a `{name}` placeholder is replaced by the values the component passes) arrives the same way any other property does.
8
+ */ const foundationStrings = {
9
+ loading: 'Loading',
10
+ emptyHeadline: 'Nothing here yet',
11
+ emptyHint: 'There is nothing to show for now.',
12
+ errorHeadline: 'This could not be loaded',
13
+ errorHint: 'Something went wrong while loading. Try again in a moment.',
14
+ retry: 'Try again',
15
+ noPermissionHeadline: 'You do not have access',
16
+ noPermissionHint: 'Ask an administrator to grant you access to {subject}.',
17
+ noPermissionSubject: 'this content',
18
+ partialHeadline: 'Some parts could not be loaded',
19
+ partialHint: 'The unavailable parts are: {regions}.',
20
+ disabledNoPermission: 'You do not have permission to do this',
21
+ trendUp: 'up {value}',
22
+ trendDown: 'down {value}',
23
+ trendFlat: 'unchanged',
24
+ trendComparison: 'compared to {period}',
25
+ statusSuccess: 'Success',
26
+ statusWarning: 'Warning',
27
+ statusDanger: 'Problem',
28
+ statusInfo: 'Information',
29
+ statusNeutral: 'Status',
30
+ chartNoData: 'No data to chart',
31
+ chartDataTable: 'Chart data',
32
+ chartSeries: 'Series',
33
+ chartCategory: 'Category',
34
+ filterAdd: 'Add condition',
35
+ filterAddGroup: 'Add group',
36
+ filterRemove: 'Remove condition',
37
+ filterRemoveGroup: 'Remove group',
38
+ filterMatchAll: 'Match all (AND)',
39
+ filterMatchAny: 'Match any (OR)',
40
+ filterField: 'Field',
41
+ filterOperator: 'Operator',
42
+ filterValue: 'Value',
43
+ filterClear: 'Clear filters',
44
+ filterCondition: 'Condition {n}',
45
+ filterGroup: 'Group {n}',
46
+ filterNoFields: 'There are no fields to filter on',
47
+ opContains: 'contains',
48
+ opEquals: 'equals',
49
+ opNotEquals: 'does not equal',
50
+ opStartsWith: 'starts with',
51
+ opIsEmpty: 'is empty',
52
+ opGreater: 'is greater than',
53
+ opGreaterOrEqual: 'is at least',
54
+ opLess: 'is less than',
55
+ opLessOrEqual: 'is at most',
56
+ opBefore: 'is before',
57
+ opAfter: 'is after',
58
+ opOn: 'is on',
59
+ opIs: 'is',
60
+ opIsNot: 'is not',
61
+ opTrue: 'is yes',
62
+ opFalse: 'is no',
63
+ filterSummary: '{count} active filters',
64
+ filterSummaryOne: '1 active filter',
65
+ columnsChoose: 'Columns',
66
+ columnsLocked: 'always shown',
67
+ columnsReset: 'Show all columns',
68
+ columnsMoveUp: 'Move {name} up',
69
+ columnsMoveDown: 'Move {name} down',
70
+ columnsShown: '{shown} of {total} shown',
71
+ columnsNone: 'There are no columns to choose from',
72
+ viewsLabel: 'Saved views',
73
+ viewsDefault: 'All items',
74
+ viewsSave: 'Save current view',
75
+ viewsManage: 'Manage views',
76
+ viewsNone: 'There are no saved views',
77
+ checklistProgress: '{done} of {total} complete',
78
+ checklistOwner: 'Owner',
79
+ checklistDue: 'Due',
80
+ activityEmpty: 'No activity yet',
81
+ avatarOverflow: '{count} more',
82
+ avatarPeople: '{count} people',
83
+ uploadDrop: 'Drop files here or',
84
+ uploadBrowse: 'Browse files',
85
+ uploadRemove: 'Remove {name}',
86
+ uploadTooLarge: '{name} is larger than {limit}',
87
+ uploadWrongType: '{name} is not an accepted file type',
88
+ uploadUploading: 'Uploading',
89
+ uploadDone: 'Uploaded',
90
+ uploadFailed: 'Upload failed',
91
+ approvalPending: 'Pending',
92
+ approvalCurrent: 'Awaiting decision',
93
+ approvalApproved: 'Approved',
94
+ approvalRejected: 'Rejected',
95
+ approvalSkipped: 'Skipped',
96
+ approvalChain: 'Approval chain',
97
+ orgExpand: 'Expand {name}',
98
+ orgCollapse: 'Collapse {name}',
99
+ orgReports: '{count} reports',
100
+ matrixAllowed: 'Allowed',
101
+ matrixDenied: 'Not allowed',
102
+ matrixGrant: 'Grant {permission} to {role}',
103
+ matrixReadOnly: 'Read-only'
104
+ };
105
+ /**
106
+ * The foundation strings with the element's own `strings` property laid over them.
107
+ *
108
+ * Only string values of known names are taken, so a typo in an application's table falls back to the default text
109
+ * rather than rendering nothing.
110
+ */ function readFoundationStrings(element) {
111
+ const supplied = element.properties.strings;
112
+ const result = {
113
+ ...foundationStrings
114
+ };
115
+ if (typeof supplied !== 'object' || supplied === null || Array.isArray(supplied)) return result;
116
+ for (const [name, value] of Object.entries(supplied)){
117
+ if (name in foundationStrings && typeof value === 'string') result[name] = value;
118
+ }
119
+ return result;
120
+ }
121
+ /** 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 = {}) {
122
+ return text.replace(/\{(\w+)\}/g, (placeholder, name)=>name in values ? String(values[name]) : placeholder);
123
+ }
124
+
125
+ export { formatText, foundationStrings, readFoundationStrings };
126
+ //# 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 filterCondition: 'Condition {n}',\n filterGroup: 'Group {n}',\n filterNoFields: 'There are no fields to filter on',\n opContains: 'contains',\n opEquals: 'equals',\n opNotEquals: 'does not equal',\n opStartsWith: 'starts with',\n opIsEmpty: 'is empty',\n opGreater: 'is greater than',\n opGreaterOrEqual: 'is at least',\n opLess: 'is less than',\n opLessOrEqual: 'is at most',\n opBefore: 'is before',\n opAfter: 'is after',\n opOn: 'is on',\n opIs: 'is',\n opIsNot: 'is not',\n opTrue: 'is yes',\n opFalse: 'is no',\n filterSummary: '{count} active filters',\n filterSummaryOne: '1 active filter',\n columnsChoose: 'Columns',\n columnsLocked: 'always shown',\n columnsReset: 'Show all columns',\n columnsMoveUp: 'Move {name} up',\n columnsMoveDown: 'Move {name} down',\n columnsShown: '{shown} of {total} shown',\n columnsNone: 'There are no columns to choose from',\n viewsLabel: 'Saved views',\n viewsDefault: 'All items',\n viewsSave: 'Save current view',\n viewsManage: 'Manage views',\n viewsNone: 'There are no saved 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","filterCondition","filterGroup","filterNoFields","opContains","opEquals","opNotEquals","opStartsWith","opIsEmpty","opGreater","opGreaterOrEqual","opLess","opLessOrEqual","opBefore","opAfter","opOn","opIs","opIsNot","opTrue","opFalse","filterSummary","filterSummaryOne","columnsChoose","columnsLocked","columnsReset","columnsMoveUp","columnsMoveDown","columnsShown","columnsNone","viewsLabel","viewsDefault","viewsSave","viewsManage","viewsNone","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,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ACbC,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,GAAGrG;AAAkB,KAAA;IACzD,IAAI,OAAOkG,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,IAAQxG,qBAAqB,OAAOyG,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;;"}
@@ -0,0 +1,25 @@
1
+ export * from './foundationStrings';
2
+ export * from './ComponentState';
3
+ export * from './PermissionRule';
4
+ export * from './formatting';
5
+ export * from './FoundationIcon';
6
+ export * from './ActionButton';
7
+ export * from './StateFrame';
8
+ export * from './EmptyState';
9
+ export * from './TrendChip';
10
+ export * from './StatusChip';
11
+ export * from './StatCard';
12
+ export * from './chartGeometry';
13
+ export * from './useElementWidth';
14
+ export * from './ChartWrapper';
15
+ export * from './filterModel';
16
+ export * from './FilterBuilder';
17
+ export * from './columnModel';
18
+ export * from './ColumnChooser';
19
+ export * from './viewModel';
20
+ export * from './SavedViewsMenu';
21
+ export * from './foundationDescriptors';
22
+ export * from './foundationComponentMetadata';
23
+ export * from './foundationSamples';
24
+ export * from './FoundationStates';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../foundation/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,25 @@
1
+ export * from './foundationStrings';
2
+ export * from './ComponentState';
3
+ export * from './PermissionRule';
4
+ export * from './formatting';
5
+ export * from './FoundationIcon';
6
+ export * from './ActionButton';
7
+ export * from './StateFrame';
8
+ export * from './EmptyState';
9
+ export * from './TrendChip';
10
+ export * from './StatusChip';
11
+ export * from './StatCard';
12
+ export * from './chartGeometry';
13
+ export * from './useElementWidth';
14
+ export * from './ChartWrapper';
15
+ export * from './filterModel';
16
+ export * from './FilterBuilder';
17
+ export * from './columnModel';
18
+ export * from './ColumnChooser';
19
+ export * from './viewModel';
20
+ export * from './SavedViewsMenu';
21
+ export * from './foundationDescriptors';
22
+ export * from './foundationComponentMetadata';
23
+ export * from './foundationSamples';
24
+ export * from './FoundationStates';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../foundation/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ export declare function useElementWidth(reference: RefObject<HTMLElement | null>, fallback: number): number;
3
+ //# sourceMappingURL=useElementWidth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElementWidth.d.ts","sourceRoot":"","sources":["../../../foundation/useElementWidth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAM7D,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAqBlG"}
@@ -0,0 +1,29 @@
1
+ import { useState, useLayoutEffect } from 'react';
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 width of an element, kept up to date, so a chart can draw at the size it is shown at instead of scaling a fixed drawing -
7
+ * which would shrink its labels with it on a phone. Where there is no `ResizeObserver` (a test environment) the fallback is used.
8
+ */ function useElementWidth(reference, fallback) {
9
+ const [width, setWidth] = useState(fallback);
10
+ useLayoutEffect(()=>{
11
+ const element = reference.current;
12
+ if (!element) return;
13
+ const measure = ()=>{
14
+ const measured = Math.round(element.getBoundingClientRect().width);
15
+ if (measured > 0) setWidth(measured);
16
+ };
17
+ measure();
18
+ if (typeof ResizeObserver === 'undefined') return;
19
+ const observer = new ResizeObserver(measure);
20
+ observer.observe(element);
21
+ return ()=>observer.disconnect();
22
+ }, [
23
+ reference
24
+ ]);
25
+ return width;
26
+ }
27
+
28
+ export { useElementWidth };
29
+ //# sourceMappingURL=useElementWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElementWidth.js","sources":["../../../foundation/useElementWidth.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 { RefObject, useLayoutEffect, useState } from 'react';\n\n/**\n * The width of an element, kept up to date, so a chart can draw at the size it is shown at instead of scaling a fixed drawing -\n * which would shrink its labels with it on a phone. Where there is no `ResizeObserver` (a test environment) the fallback is used.\n */\nexport function useElementWidth(reference: RefObject<HTMLElement | null>, fallback: number): number {\n const [width, setWidth] = useState(fallback);\n\n useLayoutEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n const measure = () => {\n const measured = Math.round(element.getBoundingClientRect().width);\n if (measured > 0) setWidth(measured);\n };\n\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [reference]);\n\n return width;\n}\n"],"names":["useElementWidth","reference","fallback","width","setWidth","useState","useLayoutEffect","element","current","measure","measured","Math","round","getBoundingClientRect","ResizeObserver","observer","observe","disconnect"],"mappings":";;AAAA;AACA;AAIA;;;AAGC,IACM,SAASA,eAAAA,CAAgBC,SAAwC,EAAEC,QAAgB,EAAA;AACtF,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASH,QAAAA,CAAAA;IAEnCI,eAAAA,CAAgB,IAAA;QACZ,MAAMC,OAAAA,GAAUN,UAAUO,OAAO;AACjC,QAAA,IAAI,CAACD,OAAAA,EAAS;AAEd,QAAA,MAAME,OAAAA,GAAU,IAAA;AACZ,YAAA,MAAMC,WAAWC,IAAAA,CAAKC,KAAK,CAACL,OAAAA,CAAQM,qBAAqB,GAAGV,KAAK,CAAA;YACjE,IAAIO,QAAAA,GAAW,GAAGN,QAAAA,CAASM,QAAAA,CAAAA;AAC/B,QAAA,CAAA;AAEAD,QAAAA,OAAAA,EAAAA;QACA,IAAI,OAAOK,mBAAmB,WAAA,EAAa;QAE3C,MAAMC,QAAAA,GAAW,IAAID,cAAAA,CAAeL,OAAAA,CAAAA;AACpCM,QAAAA,QAAAA,CAASC,OAAO,CAACT,OAAAA,CAAAA;QACjB,OAAO,IAAMQ,SAASE,UAAU,EAAA;IACpC,CAAA,EAAG;AAAChB,QAAAA;AAAU,KAAA,CAAA;IAEd,OAAOE,KAAAA;AACX;;"}
@@ -0,0 +1,7 @@
1
+ export interface SavedView {
2
+ id: string;
3
+ label: string;
4
+ description?: string;
5
+ }
6
+ export declare function readViews(value: unknown): SavedView[];
7
+ //# sourceMappingURL=viewModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewModel.d.ts","sourceRoot":"","sources":["../../../foundation/viewModel.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAE,CASrD"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** One saved view of a list: a named combination of filters, sort and columns. The definition lives with the application. */ /** Reads saved views out of a property value, dropping entries without an id. */ function readViews(value) {
4
+ if (!Array.isArray(value)) return [];
5
+ return value.flatMap((entry)=>{
6
+ if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];
7
+ const { id, label, description } = entry;
8
+ if (typeof id !== 'string' || id.length === 0) return [];
9
+ return [
10
+ {
11
+ id,
12
+ label: typeof label === 'string' && label.length > 0 ? label : id,
13
+ ...typeof description === 'string' ? {
14
+ description
15
+ } : {}
16
+ }
17
+ ];
18
+ });
19
+ }
20
+
21
+ export { readViews };
22
+ //# sourceMappingURL=viewModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewModel.js","sources":["../../../foundation/viewModel.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/** One saved view of a list: a named combination of filters, sort and columns. The definition lives with the application. */\nexport interface SavedView {\n id: string;\n label: string;\n description?: string;\n}\n\n/** Reads saved views out of a property value, dropping entries without an id. */\nexport function readViews(value: unknown): SavedView[] {\n if (!Array.isArray(value)) return [];\n\n return value.flatMap((entry): SavedView[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];\n const { id, label, description } = entry as Record<string, unknown>;\n if (typeof id !== 'string' || id.length === 0) return [];\n return [{ id, label: typeof label === 'string' && label.length > 0 ? label : id, ...(typeof description === 'string' ? { description } : {}) }];\n });\n}\n"],"names":["readViews","value","Array","isArray","flatMap","entry","id","label","description","length"],"mappings":"AAAA;AACA;AAEA,gNAQO,SAASA,UAAUC,KAAc,EAAA;AACpC,IAAA,IAAI,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA,EAAQ,OAAO,EAAE;IAEpC,OAAOA,KAAAA,CAAMG,OAAO,CAAC,CAACC,KAAAA,GAAAA;QAClB,IAAI,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,KAAU,IAAA,IAAQH,MAAMC,OAAO,CAACE,KAAAA,CAAAA,EAAQ,OAAO,EAAE;AAClF,QAAA,MAAM,EAAEC,EAAE,EAAEC,KAAK,EAAEC,WAAW,EAAE,GAAGH,KAAAA;QACnC,IAAI,OAAOC,OAAO,QAAA,IAAYA,EAAAA,CAAGG,MAAM,KAAK,CAAA,EAAG,OAAO,EAAE;QACxD,OAAO;AAAC,YAAA;AAAEH,gBAAAA,EAAAA;AAAIC,gBAAAA,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,IAAYA,MAAME,MAAM,GAAG,IAAIF,KAAAA,GAAQD,EAAAA;gBAAI,GAAI,OAAOE,gBAAgB,QAAA,GAAW;AAAEA,oBAAAA;AAAY,iBAAA,GAAI;AAAI;AAAE,SAAA;AACnJ,IAAA,CAAA,CAAA;AACJ;;"}
@@ -1,5 +1,5 @@
1
1
  import { ComponentName } from '../ComponentName.js';
2
- import { card, text, externalComponent, panel, button } from './elements.js';
2
+ import { externalComponent, card, text, panel, button } from './elements.js';
3
3
 
4
4
  // Copyright (c) Cratis. All rights reserved.
5
5
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -4,6 +4,7 @@ export * from './configuration';
4
4
  export * from './layouts';
5
5
  export * from './gallery';
6
6
  export * from './shell';
7
+ export * from './foundation';
7
8
  export * from './themes';
8
9
  export * from './defaultBlueprintComponents';
9
10
  export * from './defaultBlueprint';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -52,6 +52,30 @@ export { Logo } from './shell/Logo.js';
52
52
  export { UserMenu } from './shell/UserMenu.js';
53
53
  export { ThemeSwitcher } from './shell/ThemeSwitcher.js';
54
54
  export { LayoutModeSwitcher } from './shell/LayoutModeSwitcher.js';
55
+ export { formatText, foundationStrings, readFoundationStrings } from './foundation/foundationStrings.js';
56
+ export { ComponentState, componentStates, readComponentState } from './foundation/ComponentState.js';
57
+ export { PermissionRule, readPermissionRule } from './foundation/PermissionRule.js';
58
+ export { NumberFormat, formatDate, formatNumber, isRightToLeft, readLocale, readNumberFormat } from './foundation/formatting.js';
59
+ export { FoundationIcon, isFoundationIcon } from './foundation/FoundationIcon.js';
60
+ export { ActionButton } from './foundation/ActionButton.js';
61
+ export { EmptyStateView, FoundationFrame } from './foundation/StateFrame.js';
62
+ export { EmptyState } from './foundation/EmptyState.js';
63
+ export { TrendChip, TrendChipView, trendDirection, trendOutcome } from './foundation/TrendChip.js';
64
+ export { StatusChip, StatusTone, readStatusTone, statusToneIcons } from './foundation/StatusChip.js';
65
+ export { StatCard } from './foundation/StatCard.js';
66
+ export { ChartKind, dataMaximum, donutSlices, funnelStages, niceScale, readSeries, ringPath } from './foundation/chartGeometry.js';
67
+ export { useElementWidth } from './foundation/useElementWidth.js';
68
+ export { ChartWrapper, readChartKind } from './foundation/ChartWrapper.js';
69
+ export { FilterFieldType, countActiveConditions, emptyFilter, filterOperators, maximumFilterDepth, newCondition, normalizeFilter, readFilterFields, updateGroupAt, valuelessOperators } from './foundation/filterModel.js';
70
+ export { FilterBuilder } from './foundation/FilterBuilder.js';
71
+ export { moveColumn, readColumns, toggleColumn, visibleColumnIds } from './foundation/columnModel.js';
72
+ export { ColumnChooser } from './foundation/ColumnChooser.js';
73
+ export { readViews } from './foundation/viewModel.js';
74
+ export { SavedViewsMenu, savedViewActionOutput } from './foundation/SavedViewsMenu.js';
75
+ export { bindable, foundationDescriptors, list, standardStateProperties } from './foundation/foundationDescriptors.js';
76
+ export { foundationComponentMetadata } from './foundation/foundationComponentMetadata.js';
77
+ export { foundationElement, foundationSamples } from './foundation/foundationSamples.js';
78
+ export { FoundationStates } from './foundation/FoundationStates.js';
55
79
  export { blueprintThemeCompatibility } from './themes/blueprintThemeCompatibility.js';
56
80
  export { lightTheme } from './themes/light.js';
57
81
  export { darkTheme } from './themes/dark.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../themes/dark.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAW5C,eAAO,MAAM,SAAS,EAAE,KAuBvB,CAAC"}
1
+ {"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../themes/dark.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAW5C,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAC"}
@@ -30,7 +30,15 @@ import { blueprintThemeCompatibility } from './blueprintThemeCompatibility.js';
30
30
  'highlight.background': '#232a45',
31
31
  'highlight.color': '#c7ccff',
32
32
  'content.borderRadius': '0.5rem',
33
- 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)'
33
+ 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)',
34
+ 'status.successColor': '#86efac',
35
+ 'status.successBackground': '#14301f',
36
+ 'status.warningColor': '#fcd34d',
37
+ 'status.warningBackground': '#33290f',
38
+ 'status.dangerColor': '#fca5a5',
39
+ 'status.dangerBackground': '#3a1616',
40
+ 'status.infoColor': '#93c5fd',
41
+ 'status.infoBackground': '#162a4a'
34
42
  }
35
43
  };
36
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"dark.js","sources":["../../../themes/dark.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 { Theme } from '@cratis/scene.model';\nimport { blueprintThemeCompatibility } from './blueprintThemeCompatibility';\n\n/**\n * The dark theme the shell ships with.\n *\n * Deliberately the same ten token names as the light theme and nothing more. A dark theme that introduced\n * extra tokens would work only for the parts of the shell written after it existed - the token set is the\n * contract, and both themes filling it identically is what makes switching between them a swap rather than\n * a re-render with holes in it.\n */\nexport const darkTheme: Theme = {\n name: 'Scene Default Dark',\n compatibleWith: blueprintThemeCompatibility,\n isDark: true,\n author: 'Cratis',\n authorUrl: 'https://cratis.io',\n license: 'MIT',\n description: 'The default dark palette: a deep slate ramp with a lifted indigo accent.',\n tokens: {\n 'primary.color': '#818cf8',\n 'primary.contrastColor': '#10131f',\n 'surface.background': '#0f1117',\n 'surface.card': '#171a23',\n 'surface.border': '#262a36',\n 'surface.hover': '#1f2431',\n 'surface.overlay': '#1c2030',\n 'text.color': '#e6e8ef',\n 'text.mutedColor': '#9aa1b1',\n 'highlight.background': '#232a45',\n 'highlight.color': '#c7ccff',\n 'content.borderRadius': '0.5rem',\n 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)',\n },\n};\n"],"names":["darkTheme","name","compatibleWith","blueprintThemeCompatibility","isDark","author","authorUrl","license","description","tokens"],"mappings":";;AAAA;AACA;AAKA;;;;;;;UAQaA,SAAAA,GAAmB;IAC5BC,IAAAA,EAAM,oBAAA;IACNC,cAAAA,EAAgBC,2BAAAA;IAChBC,MAAAA,EAAQ,IAAA;IACRC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,mBAAA;IACXC,OAAAA,EAAS,KAAA;IACTC,WAAAA,EAAa,0EAAA;IACbC,MAAAA,EAAQ;QACJ,eAAA,EAAiB,SAAA;QACjB,uBAAA,EAAyB,SAAA;QACzB,oBAAA,EAAsB,SAAA;QACtB,cAAA,EAAgB,SAAA;QAChB,gBAAA,EAAkB,SAAA;QAClB,eAAA,EAAiB,SAAA;QACjB,iBAAA,EAAmB,SAAA;QACnB,YAAA,EAAc,SAAA;QACd,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,SAAA;QACxB,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,QAAA;QACxB,YAAA,EAAc;AAClB;AACJ;;"}
1
+ {"version":3,"file":"dark.js","sources":["../../../themes/dark.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 { Theme } from '@cratis/scene.model';\nimport { blueprintThemeCompatibility } from './blueprintThemeCompatibility';\n\n/**\n * The dark theme the shell ships with.\n *\n * Deliberately the same ten token names as the light theme and nothing more. A dark theme that introduced\n * extra tokens would work only for the parts of the shell written after it existed - the token set is the\n * contract, and both themes filling it identically is what makes switching between them a swap rather than\n * a re-render with holes in it.\n */\nexport const darkTheme: Theme = {\n name: 'Scene Default Dark',\n compatibleWith: blueprintThemeCompatibility,\n isDark: true,\n author: 'Cratis',\n authorUrl: 'https://cratis.io',\n license: 'MIT',\n description: 'The default dark palette: a deep slate ramp with a lifted indigo accent.',\n tokens: {\n 'primary.color': '#818cf8',\n 'primary.contrastColor': '#10131f',\n 'surface.background': '#0f1117',\n 'surface.card': '#171a23',\n 'surface.border': '#262a36',\n 'surface.hover': '#1f2431',\n 'surface.overlay': '#1c2030',\n 'text.color': '#e6e8ef',\n 'text.mutedColor': '#9aa1b1',\n 'highlight.background': '#232a45',\n 'highlight.color': '#c7ccff',\n 'content.borderRadius': '0.5rem',\n 'focus.ring': '0 0 0 2px rgb(129 140 248 / 0.45)',\n 'status.successColor': '#86efac',\n 'status.successBackground': '#14301f',\n 'status.warningColor': '#fcd34d',\n 'status.warningBackground': '#33290f',\n 'status.dangerColor': '#fca5a5',\n 'status.dangerBackground': '#3a1616',\n 'status.infoColor': '#93c5fd',\n 'status.infoBackground': '#162a4a',\n },\n};\n"],"names":["darkTheme","name","compatibleWith","blueprintThemeCompatibility","isDark","author","authorUrl","license","description","tokens"],"mappings":";;AAAA;AACA;AAKA;;;;;;;UAQaA,SAAAA,GAAmB;IAC5BC,IAAAA,EAAM,oBAAA;IACNC,cAAAA,EAAgBC,2BAAAA;IAChBC,MAAAA,EAAQ,IAAA;IACRC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,mBAAA;IACXC,OAAAA,EAAS,KAAA;IACTC,WAAAA,EAAa,0EAAA;IACbC,MAAAA,EAAQ;QACJ,eAAA,EAAiB,SAAA;QACjB,uBAAA,EAAyB,SAAA;QACzB,oBAAA,EAAsB,SAAA;QACtB,cAAA,EAAgB,SAAA;QAChB,gBAAA,EAAkB,SAAA;QAClB,eAAA,EAAiB,SAAA;QACjB,iBAAA,EAAmB,SAAA;QACnB,YAAA,EAAc,SAAA;QACd,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,SAAA;QACxB,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,QAAA;QACxB,YAAA,EAAc,mCAAA;QACd,qBAAA,EAAuB,SAAA;QACvB,0BAAA,EAA4B,SAAA;QAC5B,qBAAA,EAAuB,SAAA;QACvB,0BAAA,EAA4B,SAAA;QAC5B,oBAAA,EAAsB,SAAA;QACtB,yBAAA,EAA2B,SAAA;QAC3B,kBAAA,EAAoB,SAAA;QACpB,uBAAA,EAAyB;AAC7B;AACJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../themes/light.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAc5C,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC"}
1
+ {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../themes/light.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAc5C,eAAO,MAAM,UAAU,EAAE,KA+BxB,CAAC"}
@@ -29,11 +29,19 @@ import { blueprintThemeCompatibility } from './blueprintThemeCompatibility.js';
29
29
  'surface.hover': '#eceef1',
30
30
  'surface.overlay': '#ffffff',
31
31
  'text.color': '#1f2430',
32
- 'text.mutedColor': '#6b7280',
32
+ 'text.mutedColor': '#5b6472',
33
33
  'highlight.background': '#eef2ff',
34
34
  'highlight.color': '#3730a3',
35
35
  'content.borderRadius': '0.5rem',
36
- 'focus.ring': '0 0 0 2px rgb(79 70 229 / 0.4)'
36
+ 'focus.ring': '0 0 0 2px rgb(79 70 229 / 0.4)',
37
+ 'status.successColor': '#166534',
38
+ 'status.successBackground': '#dcfce7',
39
+ 'status.warningColor': '#854d0e',
40
+ 'status.warningBackground': '#fef3c7',
41
+ 'status.dangerColor': '#991b1b',
42
+ 'status.dangerBackground': '#fee2e2',
43
+ 'status.infoColor': '#1e40af',
44
+ 'status.infoBackground': '#dbeafe'
37
45
  }
38
46
  };
39
47
 
@@ -1 +1 @@
1
- {"version":3,"file":"light.js","sources":["../../../themes/light.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 { Theme } from '@cratis/scene.model';\nimport { blueprintThemeCompatibility } from './blueprintThemeCompatibility';\n\n/**\n * The light theme the shell ships with.\n *\n * The palette is original to Cratis - a neutral grey ramp with an indigo accent - rather than adopted from\n * any existing preset, which is why `author` says so rather than being left blank. A theme with empty\n * attribution reads as \"nobody has checked\", and once a palette is lifted from somewhere else without its\n * credit, nobody can tell afterwards which of the two it was.\n *\n * The token set is the shell's whole styling contract: every rule in `layout.css` resolves back to one of\n * these ten names. A theme that defines them defines the entire shell.\n */\nexport const lightTheme: Theme = {\n name: 'Scene Default Light',\n compatibleWith: blueprintThemeCompatibility,\n isDark: false,\n author: 'Cratis',\n authorUrl: 'https://cratis.io',\n license: 'MIT',\n description: 'The default light palette: a neutral grey ramp with an indigo accent.',\n tokens: {\n 'primary.color': '#4f46e5',\n 'primary.contrastColor': '#ffffff',\n 'surface.background': '#f4f5f7',\n 'surface.card': '#ffffff',\n 'surface.border': '#e2e5e9',\n 'surface.hover': '#eceef1',\n 'surface.overlay': '#ffffff',\n 'text.color': '#1f2430',\n 'text.mutedColor': '#6b7280',\n 'highlight.background': '#eef2ff',\n 'highlight.color': '#3730a3',\n 'content.borderRadius': '0.5rem',\n 'focus.ring': '0 0 0 2px rgb(79 70 229 / 0.4)',\n },\n};\n"],"names":["lightTheme","name","compatibleWith","blueprintThemeCompatibility","isDark","author","authorUrl","license","description","tokens"],"mappings":";;AAAA;AACA;AAKA;;;;;;;;;;UAWaA,UAAAA,GAAoB;IAC7BC,IAAAA,EAAM,qBAAA;IACNC,cAAAA,EAAgBC,2BAAAA;IAChBC,MAAAA,EAAQ,KAAA;IACRC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,mBAAA;IACXC,OAAAA,EAAS,KAAA;IACTC,WAAAA,EAAa,uEAAA;IACbC,MAAAA,EAAQ;QACJ,eAAA,EAAiB,SAAA;QACjB,uBAAA,EAAyB,SAAA;QACzB,oBAAA,EAAsB,SAAA;QACtB,cAAA,EAAgB,SAAA;QAChB,gBAAA,EAAkB,SAAA;QAClB,eAAA,EAAiB,SAAA;QACjB,iBAAA,EAAmB,SAAA;QACnB,YAAA,EAAc,SAAA;QACd,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,SAAA;QACxB,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,QAAA;QACxB,YAAA,EAAc;AAClB;AACJ;;"}
1
+ {"version":3,"file":"light.js","sources":["../../../themes/light.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 { Theme } from '@cratis/scene.model';\nimport { blueprintThemeCompatibility } from './blueprintThemeCompatibility';\n\n/**\n * The light theme the shell ships with.\n *\n * The palette is original to Cratis - a neutral grey ramp with an indigo accent - rather than adopted from\n * any existing preset, which is why `author` says so rather than being left blank. A theme with empty\n * attribution reads as \"nobody has checked\", and once a palette is lifted from somewhere else without its\n * credit, nobody can tell afterwards which of the two it was.\n *\n * The token set is the shell's whole styling contract: every rule in `layout.css` resolves back to one of\n * these ten names. A theme that defines them defines the entire shell.\n */\nexport const lightTheme: Theme = {\n name: 'Scene Default Light',\n compatibleWith: blueprintThemeCompatibility,\n isDark: false,\n author: 'Cratis',\n authorUrl: 'https://cratis.io',\n license: 'MIT',\n description: 'The default light palette: a neutral grey ramp with an indigo accent.',\n tokens: {\n 'primary.color': '#4f46e5',\n 'primary.contrastColor': '#ffffff',\n 'surface.background': '#f4f5f7',\n 'surface.card': '#ffffff',\n 'surface.border': '#e2e5e9',\n 'surface.hover': '#eceef1',\n 'surface.overlay': '#ffffff',\n 'text.color': '#1f2430',\n 'text.mutedColor': '#5b6472',\n 'highlight.background': '#eef2ff',\n 'highlight.color': '#3730a3',\n 'content.borderRadius': '0.5rem',\n 'focus.ring': '0 0 0 2px rgb(79 70 229 / 0.4)',\n 'status.successColor': '#166534',\n 'status.successBackground': '#dcfce7',\n 'status.warningColor': '#854d0e',\n 'status.warningBackground': '#fef3c7',\n 'status.dangerColor': '#991b1b',\n 'status.dangerBackground': '#fee2e2',\n 'status.infoColor': '#1e40af',\n 'status.infoBackground': '#dbeafe',\n },\n};\n"],"names":["lightTheme","name","compatibleWith","blueprintThemeCompatibility","isDark","author","authorUrl","license","description","tokens"],"mappings":";;AAAA;AACA;AAKA;;;;;;;;;;UAWaA,UAAAA,GAAoB;IAC7BC,IAAAA,EAAM,qBAAA;IACNC,cAAAA,EAAgBC,2BAAAA;IAChBC,MAAAA,EAAQ,KAAA;IACRC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,mBAAA;IACXC,OAAAA,EAAS,KAAA;IACTC,WAAAA,EAAa,uEAAA;IACbC,MAAAA,EAAQ;QACJ,eAAA,EAAiB,SAAA;QACjB,uBAAA,EAAyB,SAAA;QACzB,oBAAA,EAAsB,SAAA;QACtB,cAAA,EAAgB,SAAA;QAChB,gBAAA,EAAkB,SAAA;QAClB,eAAA,EAAiB,SAAA;QACjB,iBAAA,EAAmB,SAAA;QACnB,YAAA,EAAc,SAAA;QACd,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,SAAA;QACxB,iBAAA,EAAmB,SAAA;QACnB,sBAAA,EAAwB,QAAA;QACxB,YAAA,EAAc,gCAAA;QACd,qBAAA,EAAuB,SAAA;QACvB,0BAAA,EAA4B,SAAA;QAC5B,qBAAA,EAAuB,SAAA;QACvB,0BAAA,EAA4B,SAAA;QAC5B,oBAAA,EAAsB,SAAA;QACtB,yBAAA,EAA2B,SAAA;QAC3B,kBAAA,EAAoB,SAAA;QACpB,uBAAA,EAAyB;AAC7B;AACJ;;"}