@nascentdigital/funnel-ui 4.4.21 → 4.5.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 (88) hide show
  1. package/dist/Tailwind.d.ts +5 -1
  2. package/dist/Tailwind.js +9 -0
  3. package/dist/server/blocks/Block.d.ts +42 -2
  4. package/dist/server/blocks/Block.js +88 -0
  5. package/dist/server/blocks/Clients.d.ts +20 -29
  6. package/dist/server/blocks/Clients.js +13 -57
  7. package/dist/server/blocks/MediaLayout.d.ts +10 -5
  8. package/dist/server/blocks/MediaLayout.js +41 -22
  9. package/dist/server/blocks/Message.d.ts +9 -67
  10. package/dist/server/blocks/Message.js +15 -292
  11. package/dist/server/blocks/Outcome.d.ts +22 -82
  12. package/dist/server/blocks/Outcome.js +20 -474
  13. package/dist/server/blocks/Testimonial.d.ts +81 -16
  14. package/dist/server/blocks/Testimonial.js +59 -27
  15. package/dist/server/blocks/Testimonials.d.ts +41 -0
  16. package/dist/server/blocks/Testimonials.js +90 -0
  17. package/dist/server/blocks/ValueProp.d.ts +19 -38
  18. package/dist/server/blocks/ValueProp.js +14 -100
  19. package/dist/server/blocks/index.d.ts +1 -0
  20. package/dist/server/blocks/index.js +1 -0
  21. package/dist/server/blocks/summary/Statement.d.ts +304 -0
  22. package/dist/server/blocks/summary/Statement.js +52 -0
  23. package/dist/server/blocks/summary/Summary.d.ts +18 -0
  24. package/dist/server/blocks/summary/Summary.js +34 -0
  25. package/dist/server/blocks/summary/index.d.ts +1 -0
  26. package/dist/server/blocks/summary/index.js +17 -0
  27. package/dist/server/entities/Person.d.ts +27 -2
  28. package/dist/server/entities/Person.js +55 -5
  29. package/dist/server/layouts/BrickLayout.d.ts +290 -0
  30. package/dist/server/layouts/BrickLayout.js +25 -0
  31. package/dist/server/layouts/CardLayout.d.ts +291 -0
  32. package/dist/server/layouts/CardLayout.js +25 -0
  33. package/dist/server/layouts/FlexWrapLayout.d.ts +290 -0
  34. package/dist/server/layouts/FlexWrapLayout.js +41 -0
  35. package/dist/server/layouts/StackLayout.d.ts +290 -0
  36. package/dist/server/layouts/StackLayout.js +25 -0
  37. package/dist/server/layouts/grid/GridItem.d.ts +8 -0
  38. package/dist/server/layouts/grid/GridItem.js +9 -0
  39. package/dist/server/layouts/grid/GridLayout.d.ts +293 -0
  40. package/dist/server/layouts/grid/GridLayout.js +25 -0
  41. package/dist/server/layouts/grid/index.d.ts +2 -0
  42. package/dist/server/layouts/grid/index.js +18 -0
  43. package/dist/server/layouts/index.d.ts +5 -0
  44. package/dist/server/layouts/index.js +21 -0
  45. package/dist/server/panels/BlockPanel.d.ts +80 -1
  46. package/dist/server/panels/BlockPanel.js +831 -0
  47. package/dist/server/panels/ListPanel.d.ts +62 -0
  48. package/dist/server/panels/ListPanel.js +137 -0
  49. package/dist/server/panels/MessagePanel.d.ts +69 -5
  50. package/dist/server/panels/MessagePanel.js +128 -5
  51. package/dist/server/panels/TestimonialPanel.d.ts +47 -0
  52. package/dist/server/panels/TestimonialPanel.js +71 -0
  53. package/dist/server/panels/VisualPanel.d.ts +45 -13
  54. package/dist/server/panels/VisualPanel.js +75 -16
  55. package/dist/server/panels/index.d.ts +2 -0
  56. package/dist/server/panels/index.js +2 -0
  57. package/dist/server/schema/BlockConfig.d.ts +3 -1
  58. package/dist/server/schema/BlockConfig.js +2 -1
  59. package/dist/server/schema/ItemAlignment.d.ts +2 -0
  60. package/dist/server/schema/ItemPosition.d.ts +1 -0
  61. package/dist/server/schema/ItemSize.d.ts +2 -1
  62. package/dist/server/schema/ItemSize.js +2 -1
  63. package/dist/server/schema/ListPanelLayout.d.ts +34 -0
  64. package/dist/server/schema/ListPanelLayout.js +24 -0
  65. package/dist/server/schema/PanelLayout.d.ts +14 -0
  66. package/dist/server/schema/PanelLayout.js +70 -0
  67. package/dist/server/schema/SlotVariation.d.ts +9 -0
  68. package/dist/server/schema/SlotVariation.js +48 -0
  69. package/dist/server/schema/TextAlignment.d.ts +1 -0
  70. package/dist/server/schema/index.d.ts +3 -0
  71. package/dist/server/schema/index.js +3 -0
  72. package/dist/styles/blocks/Clients.css +0 -1
  73. package/dist/styles/blocks/Message.css +0 -343
  74. package/dist/styles/blocks/Outcome.css +13 -50
  75. package/dist/styles/blocks/Summary.css +15 -0
  76. package/dist/styles/blocks/Testimonial.css +1 -318
  77. package/dist/styles/blocks/ValueProp.css +0 -126
  78. package/dist/styles/blocks/_index.css +1 -0
  79. package/dist/styles/layouts/BrickLayout.css +43 -0
  80. package/dist/styles/layouts/CardLayout.css +46 -0
  81. package/dist/styles/layouts/FlexWrapLayout.css +38 -0
  82. package/dist/styles/layouts/GridLayout.css +25 -0
  83. package/dist/styles/layouts/StackLayout.css +46 -0
  84. package/dist/styles/layouts/_index.css +6 -1
  85. package/dist/styles/panels/ListPanel.css +3 -0
  86. package/dist/styles/panels/TestimonialPanel.css +64 -0
  87. package/dist/styles/panels/_index.css +2 -0
  88. package/package.json +3 -2
@@ -18,49 +18,18 @@ exports.Message = Message;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const funnel_core_1 = require("@nascentdigital/funnel-core");
20
20
  const classnames_1 = __importDefault(require("classnames"));
21
- const fields_1 = require("../fields");
22
- const panels_1 = require("../panels");
23
- const schema_1 = require("../schema");
24
21
  const Block_1 = require("./Block");
25
- // block
22
+ // component
26
23
  function Message(_a) {
27
- var _b, _c, _d, _e;
28
- var { className, titleTag = 'span', headlineTag = 'h2', captionTag = 'div', message, visualDecorator, visualLoading = 'eager' } = _a, props = __rest(_a, ["className", "titleTag", "headlineTag", "captionTag", "message", "visualDecorator", "visualLoading"]);
29
- // don't render if missing model
30
- if (!message) {
31
- console.warn('[Message] attempted to render without message model');
32
- return null;
33
- }
34
- // destructure props
35
- const config = (_b = message.config) !== null && _b !== void 0 ? _b : {};
36
- const fields = (_c = message.fields) !== null && _c !== void 0 ? _c : {};
37
- const { visual: visualRaw, title: titleRaw, headline: headlineRaw, caption: captionRaw, ctas: ctasRaw } = fields;
38
- const visual = visualRaw === null || visualRaw === void 0 ? void 0 : visualRaw.value;
39
- const title = titleRaw === null || titleRaw === void 0 ? void 0 : titleRaw.value;
40
- const headline = headlineRaw === null || headlineRaw === void 0 ? void 0 : headlineRaw.value;
41
- const caption = captionRaw === null || captionRaw === void 0 ? void 0 : captionRaw.value;
42
- const ctas = (_d = ctasRaw === null || ctasRaw === void 0 ? void 0 : ctasRaw.value) !== null && _d !== void 0 ? _d : [];
43
- // panel layout
44
- const layout = getMessageLayout({ fields, config });
45
- const getPanel = ({ className, panel }) => {
46
- var _a;
47
- switch (panel.type) {
48
- case 'message':
49
- return ((0, jsx_runtime_1.jsx)(panels_1.MessagePanel, { className: (0, classnames_1.default)(className, 'nd-Message-message'), panel: panel, title: title, titleTag: titleTag, headline: headline, headlineTag: headlineTag, caption: caption, captionTag: captionTag, ctas: ctas }));
50
- case 'visual':
51
- return visual
52
- ?
53
- (0, jsx_runtime_1.jsx)(panels_1.VisualPanel, { className: (0, classnames_1.default)(className, 'nd-Message-visual'), panel: panel, visual: visual, anchor: (_a = funnel_core_1.Schema.EnumField.Value.fromData(config.visualAnchor)) !== null && _a !== void 0 ? _a : 'center', visualLoading: visualLoading, visualDecorator: visualDecorator })
54
- : undefined;
55
- default:
56
- return undefined;
57
- }
58
- };
59
- // render block
60
- return ((0, jsx_runtime_1.jsx)(Block_1.Block, Object.assign({ className: (0, classnames_1.default)(className, 'nd-Message', Message.Variant.getClassName((_e = config === null || config === void 0 ? void 0 : config.variant) === null || _e === void 0 ? void 0 : _e.value)), config: config, layout: layout, renderPanel: getPanel }, props)));
24
+ var { className } = _a, props = __rest(_a, ["className"]);
25
+ // extract variant
26
+ const variant = funnel_core_1.Schema.EnumField.Value.fromData(props.model.config.variant);
27
+ // render
28
+ return (0, jsx_runtime_1.jsx)(Message.Component, Object.assign({ className: (0, classnames_1.default)(className, 'nd-Message', Message.Variant.getClassName(variant)) }, props));
61
29
  }
62
30
  // extension
63
31
  (function (Message) {
32
+ var _a;
64
33
  let Variant;
65
34
  (function (Variant) {
66
35
  // enum
@@ -92,261 +61,15 @@ function Message(_a) {
92
61
  }
93
62
  Variant.getClassName = getClassName;
94
63
  })(Variant = Message.Variant || (Message.Variant = {}));
95
- let VisualWidth;
96
- (function (VisualWidth) {
97
- // schema
98
- VisualWidth.Enum = {
99
- contained: { name: 'Contained' },
100
- fullBleed: { name: 'Full Bleed' },
101
- };
102
- VisualWidth.schema = funnel_core_1.Schema.Field.enumeration({
103
- name: 'Visual Width',
104
- semantics: 'segmented',
105
- hint: 'Set width',
106
- description: 'Control the width of the visual',
107
- options: VisualWidth.Enum,
108
- defaultOption: 'contained'
109
- });
110
- // helpers
111
- function getClassName(width) {
112
- switch (width) {
113
- case 'contained':
114
- return 'nd-Block-visual-width-contained';
115
- case 'fullBleed':
116
- return 'nd-Block-visual-width-full-bleed';
117
- default:
118
- console.warn('[Message] unrecognized visual width: ', width);
119
- return 'nd-Block-visual-width-contained';
120
- }
121
- }
122
- VisualWidth.getClassName = getClassName;
123
- })(VisualWidth = Message.VisualWidth || (Message.VisualWidth = {}));
124
- // schema
125
- const configSchema = Object.assign(Object.assign({}, schema_1.BlockConfig.Presets.ThemeOnly.schema), { variant: Variant.schema, messageTextAlignment: schema_1.TextAlignment.schema.rename('Message Text Alignment').optional(), messageHorizontalPosition: schema_1.ItemAlignment.Horizontal.schema.rename('Message Horizontal Position').optional(), messageVerticalPosition: schema_1.ItemAlignment.Vertical.schema.rename('Message Vertical Position').optional(), messageWidth: schema_1.ItemSize.schema
126
- .modify({ semantics: 'segmented', name: 'Message Width' })
127
- .keepOptions('sm', 'md', 'lg', 'full')
128
- .setDefault('md')
129
- .optional(), visualPosition: schema_1.ItemPosition.schema
130
- .rename('Visual Position')
131
- .updateOptions({ stacked: { name: 'Background', hint: 'Aligns the item as an overlay/background.' } })
132
- .removeOptions('center')
133
- .setDefault('left')
134
- .optional(), visualAspect: schema_1.AspectRatio.schema
135
- .rename('Visual Aspect')
136
- .optional(), visualAnchor: schema_1.Anchor.schema
137
- .rename('Visual Anchor')
138
- .optional(), visualWidth: VisualWidth.schema.optional(), contentAlignment: schema_1.ItemAlignment.Vertical.schema.rename('Content Alignment').optional() });
139
- const fieldsSchema = {
140
- visual: fields_1.Visual.schema.modify({ tags: 'hero' }).optional(),
141
- title: fields_1.Title.schema.modify({ description: 'A short intro or heading for the message' }).optional(),
142
- headline: fields_1.Headline.schema,
143
- caption: fields_1.Caption.schema.optional(),
144
- ctas: funnel_core_1.Schema.Field.list({
145
- name: 'CTAs',
146
- description: 'Add your call-to-actions in the order you\'d like them to appear *(these are optional)*.',
147
- itemTypes: {
148
- cta: funnel_core_1.Schema.Field.link({ name: 'Call to Action' })
149
- },
150
- min: 1,
151
- max: 2
152
- }).optional()
153
- };
154
- Message.schema = funnel_core_1.Schema.Block.create({
64
+ // factory
65
+ _a = Block_1.Block.create({
155
66
  id: '_nd-message',
156
67
  name: 'Message',
157
68
  version: 1,
158
- config: configSchema,
159
- fields: fieldsSchema,
160
- getConfig: getMessageConfig,
161
- getLayout: getMessageLayout
162
- });
163
- })(Message || (exports.Message = Message = {}));
164
- //helpers
165
- function getMessageConfig(args) {
166
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
167
- // parse args
168
- const { configSchema, config, fields } = args;
169
- // current config helpers
170
- const visual = fields === null || fields === void 0 ? void 0 : fields.visual;
171
- const hasVisual = ((_a = fields === null || fields === void 0 ? void 0 : fields.visual) === null || _a === void 0 ? void 0 : _a.value) !== undefined;
172
- const visualConfig = panels_1.VisualPanel.getConfig({ visual, config, aspectKey: 'visualAspect', anchorKey: 'visualAnchor' });
173
- // default config
174
- const defaultConfig = Object.assign(Object.assign(Object.assign(Object.assign({}, config), { theme: funnel_core_1.Schema.EnumField.Value.toData('default'), messageTextAlignment: funnel_core_1.Schema.EnumField.Value.toData('left'), messageHorizontalPosition: funnel_core_1.Schema.EnumField.Value.toData('start'), messageVerticalPosition: funnel_core_1.Schema.EnumField.Value.toData('start'), messageWidth: funnel_core_1.Schema.EnumField.Value.toData('md'), visualPosition: funnel_core_1.Schema.EnumField.Value.toData('left') }), visualConfig.defaultConfig), { visualWidth: funnel_core_1.Schema.EnumField.Value.toData('contained'), contentAlignment: funnel_core_1.Schema.EnumField.Value.toData('start') });
175
- // current values or fallback to a valid value
176
- const messageTextAlignment = (_b = funnel_core_1.Schema.EnumField.Value.fromData(config.messageTextAlignment)) !== null && _b !== void 0 ? _b : (_c = defaultConfig.messageTextAlignment) === null || _c === void 0 ? void 0 : _c.value;
177
- const messageHorizontalPosition = (_d = funnel_core_1.Schema.EnumField.Value.fromData(config.messageHorizontalPosition)) !== null && _d !== void 0 ? _d : (_e = defaultConfig.messageHorizontalPosition) === null || _e === void 0 ? void 0 : _e.value;
178
- const messageVerticalPosition = (_f = funnel_core_1.Schema.EnumField.Value.fromData(config.messageVerticalPosition)) !== null && _f !== void 0 ? _f : (_g = defaultConfig.messageVerticalPosition) === null || _g === void 0 ? void 0 : _g.value;
179
- const messageWidth = (_h = funnel_core_1.Schema.EnumField.Value.fromData(config.messageWidth)) !== null && _h !== void 0 ? _h : (_j = defaultConfig.messageWidth) === null || _j === void 0 ? void 0 : _j.value;
180
- const visualPosition = (_k = funnel_core_1.Schema.EnumField.Value.fromData(config.visualPosition)) !== null && _k !== void 0 ? _k : (_l = defaultConfig.visualPosition) === null || _l === void 0 ? void 0 : _l.value;
181
- const visualWidth = (_m = funnel_core_1.Schema.EnumField.Value.fromData(config.visualWidth)) !== null && _m !== void 0 ? _m : (_o = defaultConfig.visualWidth) === null || _o === void 0 ? void 0 : _o.value;
182
- const contentAlignment = (_p = funnel_core_1.Schema.EnumField.Value.fromData(config.contentAlignment)) !== null && _p !== void 0 ? _p : (_q = defaultConfig.contentAlignment) === null || _q === void 0 ? void 0 : _q.value;
183
- const updatedConfig = Object.assign(Object.assign(Object.assign(Object.assign({}, config), { messageTextAlignment: funnel_core_1.Schema.EnumField.Value.toData(messageTextAlignment), messageHorizontalPosition: funnel_core_1.Schema.EnumField.Value.toData(messageHorizontalPosition), messageVerticalPosition: funnel_core_1.Schema.EnumField.Value.toData(messageVerticalPosition), messageWidth: funnel_core_1.Schema.EnumField.Value.toData(messageWidth), visualPosition: funnel_core_1.Schema.EnumField.Value.toData(visualPosition) }), visualConfig.config), { visualWidth: funnel_core_1.Schema.EnumField.Value.toData(visualWidth), contentAlignment: funnel_core_1.Schema.EnumField.Value.toData(contentAlignment) });
184
- // has visual and message
185
- if (hasVisual) {
186
- const updatedConfigSchema = Object.assign(Object.assign({}, configSchema), visualConfig.configSchema);
187
- // if visual is stacked
188
- if (visualPosition === 'stacked') {
189
- // update message width options to small and medium
190
- updatedConfigSchema.messageWidth = configSchema.messageWidth.keepOptions('sm', 'md');
191
- // set message width value to small if it was initially undefined or not valid
192
- if (!config.messageWidth || !updatedConfigSchema.messageWidth.isValidOption((_r = updatedConfig.messageWidth) === null || _r === void 0 ? void 0 : _r.value)) {
193
- updatedConfig.messageWidth = funnel_core_1.Schema.EnumField.Value.toData('sm');
194
- }
195
- // drop content alignment
196
- delete updatedConfigSchema.contentAlignment;
197
- return {
198
- updatedConfigSchema,
199
- updatedConfig,
200
- defaultConfig
201
- };
202
- }
203
- // otherwise, visual not in background
204
- // update message width options
205
- updatedConfigSchema.messageWidth = configSchema.messageWidth.keepOptions('md', 'lg', 'full');
206
- // update config if not valid
207
- if (!updatedConfigSchema.messageWidth.isValidOption((_s = updatedConfig.messageWidth) === null || _s === void 0 ? void 0 : _s.value)) {
208
- updatedConfig.messageWidth = funnel_core_1.Schema.EnumField.Value.toData('md');
209
- }
210
- if (messageWidth === 'full') {
211
- delete updatedConfigSchema.messageHorizontalPosition;
212
- }
213
- // visual above or below
214
- if (visualPosition === 'top' || visualPosition === 'bottom') {
215
- delete updatedConfigSchema.messageVerticalPosition;
216
- delete updatedConfigSchema.contentAlignment;
217
- }
218
- // visual not above or below
219
- else {
220
- delete updatedConfigSchema.messageHorizontalPosition;
221
- delete updatedConfigSchema.messageVerticalPosition;
222
- delete updatedConfigSchema.messageTextAlignment;
223
- delete updatedConfigSchema.messageWidth;
69
+ message: true,
70
+ visual: true,
71
+ extendConfigSchema: {
72
+ variant: Message.Variant.schema
224
73
  }
225
- return {
226
- updatedConfigSchema,
227
- updatedConfig,
228
- defaultConfig
229
- };
230
- }
231
- // has message only
232
- const messageWidthSchema = configSchema.messageWidth.keepOptions('md', 'lg', 'full');
233
- return {
234
- updatedConfigSchema: {
235
- theme: configSchema.theme,
236
- variant: configSchema.variant,
237
- messageHorizontalPosition: messageWidth === 'full'
238
- ? undefined
239
- : configSchema.messageHorizontalPosition,
240
- messageTextAlignment: configSchema.messageTextAlignment,
241
- messageWidth: messageWidthSchema
242
- },
243
- updatedConfig: Object.assign(Object.assign({}, updatedConfig), { messageWidth: messageWidthSchema.isValidOption((_t = updatedConfig.messageWidth) === null || _t === void 0 ? void 0 : _t.value) ?
244
- updatedConfig.messageWidth : funnel_core_1.Schema.EnumField.Value.toData('md') }),
245
- defaultConfig
246
- };
247
- }
248
- function getMessageLayout(args) {
249
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
250
- // parse args
251
- const { config, fields } = args;
252
- const hasVisual = ((_a = fields === null || fields === void 0 ? void 0 : fields.visual) === null || _a === void 0 ? void 0 : _a.value) !== undefined;
253
- const messageTextAlignment = (_b = funnel_core_1.Schema.EnumField.Value.fromData(config.messageTextAlignment)) !== null && _b !== void 0 ? _b : 'left';
254
- const messageHorizontalPosition = (_c = funnel_core_1.Schema.EnumField.Value.fromData(config.messageHorizontalPosition)) !== null && _c !== void 0 ? _c : 'start';
255
- const messageVerticalPosition = (_d = funnel_core_1.Schema.EnumField.Value.fromData(config.messageVerticalPosition)) !== null && _d !== void 0 ? _d : 'start';
256
- const messageWidth = (_e = funnel_core_1.Schema.EnumField.Value.fromData(config.messageWidth)) !== null && _e !== void 0 ? _e : 'md';
257
- const visualPosition = (_f = funnel_core_1.Schema.EnumField.Value.fromData(config.visualPosition)) !== null && _f !== void 0 ? _f : 'left';
258
- const visualAspect = (_g = funnel_core_1.Schema.EnumField.Value.fromData(config.visualAspect)) !== null && _g !== void 0 ? _g : 'auto';
259
- const visualWidth = (_h = funnel_core_1.Schema.EnumField.Value.fromData(config.visualWidth)) !== null && _h !== void 0 ? _h : 'contained';
260
- const contentAlign = (_j = funnel_core_1.Schema.EnumField.Value.fromData(config.contentAlignment)) !== null && _j !== void 0 ? _j : 'start';
261
- const fullBleedVisual = visualWidth === 'fullBleed' ? 'true' : 'false';
262
- let layout;
263
- if (hasVisual) {
264
- layout = visualPosition === 'left'
265
- // language=XML (visual left)
266
- ? `
267
- <block
268
- xmlns="nd:block"
269
- name="Visual-Left"
270
- tightDesktop="${fullBleedVisual === 'true' ? 'both' : 'none'}"
271
- tightMobile="${fullBleedVisual === 'true' ? 'above' : 'none'}"
272
- >
273
- <row alignY="${contentAlign}">
274
- <visual aspect="${visualAspect}" alignY="center" fullBleed="${fullBleedVisual}" />
275
- <message textAlign="${messageTextAlignment}" />
276
- </row>
277
- </block>
278
- `
279
- : visualPosition === 'right'
280
- // language=XML (visual right)
281
- ? `
282
- <block
283
- xmlns="nd:block"
284
- name="Visual-Right"
285
- tightDesktop="${fullBleedVisual === 'true' ? 'both' : 'none'}"
286
- tightMobile="${fullBleedVisual === 'true' ? 'above' : 'none'}"
287
- >
288
- <row alignY="${contentAlign}" >
289
- <message textAlign="${messageTextAlignment}"/>
290
- <visual aspect="${visualAspect}" alignY="center" fullBleed="${fullBleedVisual}" />
291
- </row>
292
- </block>
293
- `
294
- : visualPosition === 'top'
295
- // language=XML (visual top)
296
- ? `
297
- <block xmlns="nd:block" name="Visual-Top" tight="${fullBleedVisual === 'true' ? 'above' : 'none'}">
298
- <col>
299
- <visual aspect="${visualAspect}" alignY="center" fullBleed="${fullBleedVisual}"/>
300
- <message
301
- textAlign="${messageTextAlignment}"
302
- alignX="${messageHorizontalPosition}"
303
- size="${messageWidth}"
304
- />
305
- </col>
306
- </block>
307
- ` : visualPosition === 'bottom'
308
- // language=XML (visual bottom)
309
- ? `
310
- <block xmlns="nd:block" name="Visual-Bottom" tight="${fullBleedVisual === 'true' ? 'below' : 'none'}">
311
- <col>
312
- <message
313
- textAlign="${messageTextAlignment}"
314
- alignX="${messageHorizontalPosition}"
315
- size="${messageWidth}"
316
- />
317
- <visual aspect="${visualAspect}" alignY="center" fullBleed="${fullBleedVisual}"/>
318
- </col>
319
- </block>
320
- `
321
- // language=XML (visual stacked)
322
- : `
323
- <block xmlns="nd:block" name="Visual-Stacked" tight="${fullBleedVisual === 'true' ? 'both' : 'none'}">
324
- <stack>
325
- <message
326
- textAlign="${messageTextAlignment}"
327
- alignX="${messageHorizontalPosition}"
328
- alignY="${messageVerticalPosition}"
329
- size="${messageWidth}"
330
- />
331
- <visual aspect="${visualAspect}" alignY="center" fullBleed="${fullBleedVisual}"/>
332
- </stack>
333
- </block>
334
- `;
335
- }
336
- else {
337
- // language=XML
338
- layout = `
339
- <block xmlns="nd:block" name="No-Visual">
340
- <col>
341
- <message
342
- textAlign="${messageTextAlignment}"
343
- alignX="${messageHorizontalPosition}"
344
- size="${messageWidth}"
345
- />
346
- </col>
347
- </block>
348
- `;
349
- }
350
- // return skeleton
351
- return funnel_core_1.BlockLayout.parse(layout);
352
- }
74
+ }), Message.Component = _a.Component, Message.schema = _a.schema;
75
+ })(Message || (exports.Message = Message = {}));
@@ -1,84 +1,24 @@
1
- import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
- import { HTMLBlockElement, HTMLElements } from '../../types';
3
- import { Caption, Headline, Title, Visual } from '../fields';
4
- import { Anchor, ItemAlignment, ItemPosition, ItemSize, TextAlignment } from '../schema';
5
- import { OutcomeDetail } from './OutcomeDetail';
6
- export declare function Outcome({ className, titleTag, headlineTag, captionTag, detailsTag, detailTag, outcome, visualLoading, ...props }: Outcome.Props): import("react/jsx-runtime").JSX.Element | null;
1
+ import { Schema } from '@nascentdigital/funnel-core';
2
+ import { ComponentProps } from 'react';
3
+ import { Block } from './Block';
4
+ export declare function Outcome(props: ComponentProps<typeof Outcome.Component>): import("react/jsx-runtime").JSX.Element;
7
5
  export declare namespace Outcome {
8
- export type IntroPosition = 'inline' | 'left' | 'center' | 'right';
9
- export namespace IntroPosition {
10
- const Enum: Schema.EnumField.Options<IntroPosition>;
11
- const schema: Schema.EnumField<Schema.EnumField.Options<IntroPosition>>;
12
- function getClassName(position?: IntroPosition): string;
13
- }
14
- export const configSchema: {
15
- introPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<IntroPosition>>>;
16
- introTextAlignment: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<TextAlignment>>>;
17
- introWidth: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemSize>>>;
18
- detailsWidth: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemSize>>>;
19
- detailsPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemAlignment>>>;
20
- visualPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemPosition>>>;
21
- visualAspect: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<BlockLayout.AspectRatio>>>;
22
- visualAnchor: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<Anchor>>>;
23
- contentAlignment: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemAlignment>>>;
24
- theme: Schema.EnumField<Readonly<import("@nascentdigital/funnel-core").BlockThemes.Options>>;
25
- };
26
- const fieldsSchema: {
27
- visual: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
28
- title: Schema.Optional<Schema.TextField>;
29
- headline: Schema.RichTextField;
30
- caption: Schema.Optional<Schema.RichTextField>;
31
- link: Schema.Optional<Schema.LinkField>;
32
- details: Schema.Optional<Schema.ListField<{
33
- detail: Schema.ObjectField<{
34
- title: Schema.Optional<Schema.TextField>;
35
- headline: Schema.RichTextField;
36
- caption: Schema.RichTextField;
37
- icon: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
38
- link: Schema.Optional<Schema.LinkField>;
39
- }>;
40
- }>>;
41
- };
42
- export const schema: Schema.Block<"_nd-outcome", {
43
- visual: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
44
- title: Schema.Optional<Schema.TextField>;
45
- headline: Schema.RichTextField;
46
- caption: Schema.Optional<Schema.RichTextField>;
47
- link: Schema.Optional<Schema.LinkField>;
48
- details: Schema.Optional<Schema.ListField<{
49
- detail: Schema.ObjectField<{
50
- title: Schema.Optional<Schema.TextField>;
51
- headline: Schema.RichTextField;
52
- caption: Schema.RichTextField;
53
- icon: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
54
- link: Schema.Optional<Schema.LinkField>;
55
- }>;
56
- }>>;
57
- }, {
58
- introPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<IntroPosition>>>;
59
- introTextAlignment: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<TextAlignment>>>;
60
- introWidth: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemSize>>>;
61
- detailsWidth: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemSize>>>;
62
- detailsPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemAlignment>>>;
63
- visualPosition: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemPosition>>>;
64
- visualAspect: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<BlockLayout.AspectRatio>>>;
65
- visualAnchor: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<Anchor>>>;
66
- contentAlignment: Schema.Optional<Schema.EnumField<Schema.EnumField.Options<ItemAlignment>>>;
67
- theme: Schema.EnumField<Readonly<import("@nascentdigital/funnel-core").BlockThemes.Options>>;
68
- }>;
69
- export type Props = HTMLBlockElement<'div'> & {
70
- titleTag?: Title.Tag;
71
- headlineTag?: Headline.Tag;
72
- captionTag?: Caption.Tag;
73
- detailsTag?: HTMLElements.Standard.Container;
74
- detailTag?: OutcomeDetail.Tag;
75
- outcome: Model;
76
- visualLoading?: Visual.Loading;
77
- };
78
- export type GetConfigArgs = Schema.Block.GetConfig.Args<typeof configSchema, typeof fieldsSchema>;
79
- export type GetConfigResult = Schema.Block.GetConfig.Result<typeof configSchema>;
80
- export type GetLayoutArgs = Schema.Block.GetLayout.Args<typeof configSchema, typeof fieldsSchema>;
81
- export type Model = Schema.Block.LinkedData<typeof schema>;
82
- export type DetailModel = Schema.ListField.LinkedValue<Schema.Optional.InnerType<typeof schema['fields']['details']>>[number];
83
- export {};
6
+ const Component: import("react").FunctionComponent<Block.Create.Result.Component<true, true, Schema.ListField<{
7
+ detail: Schema.ObjectField<{
8
+ title: Schema.Optional<Schema.TextField>;
9
+ headline: Schema.RichTextField;
10
+ caption: Schema.RichTextField;
11
+ icon: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
12
+ link: Schema.Optional<Schema.LinkField>;
13
+ }>;
14
+ }>, Schema.Block.Config>>, schema: Block.Create.Result.Schema<true, true, Schema.ListField<{
15
+ detail: Schema.ObjectField<{
16
+ title: Schema.Optional<Schema.TextField>;
17
+ headline: Schema.RichTextField;
18
+ caption: Schema.RichTextField;
19
+ icon: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
20
+ link: Schema.Optional<Schema.LinkField>;
21
+ }>;
22
+ }>, Schema.Block.Config>;
23
+ type Model = Schema.Block.LinkedData<typeof schema>;
84
24
  }