@fluentui-react-native/use-slots 0.10.11 → 0.11.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.
@@ -1,243 +1,325 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const framework_base_1 = require("@fluentui-react-native/framework-base");
27
- const framework_base_2 = require("@fluentui-react-native/framework-base");
28
- const renderer = __importStar(require("react-test-renderer"));
29
- const buildUseSlots_1 = require("./buildUseSlots");
1
+ 'use strict';
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k];
13
+ },
14
+ };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ });
22
+ var __setModuleDefault =
23
+ (this && this.__setModuleDefault) ||
24
+ (Object.create
25
+ ? function (o, v) {
26
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
27
+ }
28
+ : function (o, v) {
29
+ o['default'] = v;
30
+ });
31
+ var __importStar =
32
+ (this && this.__importStar) ||
33
+ (function () {
34
+ var ownKeys = function (o) {
35
+ ownKeys =
36
+ Object.getOwnPropertyNames ||
37
+ function (o) {
38
+ var ar = [];
39
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
+ return ar;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ return function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
48
+ __setModuleDefault(result, mod);
49
+ return result;
50
+ };
51
+ })();
52
+ Object.defineProperty(exports, '__esModule', { value: true });
53
+ const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
54
+ /** @jsxImportSource @fluentui-react-native/framework-base */
55
+ const react_1 = require('react');
56
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
57
+ const framework_base_2 = require('@fluentui-react-native/framework-base');
58
+ const renderer = __importStar(require('react-test-renderer'));
59
+ const react_native_1 = require('react-native');
60
+ const buildUseSlots_1 = require('./buildUseSlots');
30
61
  /**
31
62
  * This file contains samples and description to help explain what the useSlots hook does and why it is useful
32
63
  * for building components.
33
64
  */
34
65
  describe('useSlots sample code test suite', () => {
66
+ /**
67
+ * The first mechanism to understand is the stagedComponent mechanic. This allows a component to be written, separating
68
+ * hook calls and component rendering. This allows it to be safely called as a function by a higher order component, even conditionally.
69
+ */
70
+ /**
71
+ * Example #1: Single level simple component ----------------------------------------
72
+ *
73
+ * First we are going to create a wrapped text component that bolds all text. One component will be authored as a staged
74
+ * component and one as a regular component.
75
+ */
76
+ const boldBaseProps = { style: { fontWeight: 900 } };
77
+ /**
78
+ * First create the bold text in the standard way. This is just a function component.
79
+ */
80
+ const BoldTextStandard = (props) => {
35
81
  /**
36
- * The first mechanism to understand is the stagedComponent mechanic. This allows a component to be written, separating
37
- * hook calls and component rendering. This allows it to be safely called as a function by a higher order component, even conditionally.
82
+ * Pick out the children to pass them on to the child Text element
38
83
  */
84
+ const { children, ...rest } = props;
39
85
  /**
40
- * Example #1: Single level simple component ----------------------------------------
41
- *
42
- * First we are going to create a wrapped text component that bolds all text. One component will be authored as a staged
43
- * component and one as a regular component.
86
+ * Now render the text, merging the baseProps with the style updates with the rest param. Note that this leverages the fact
87
+ * that mergeProps will reliably produce style objects with the same reference, given the same inputs.
44
88
  */
45
- const boldBaseProps = { style: { fontWeight: 900 } };
89
+ return jsx_runtime_1.jsx(react_native_1.Text, { ...(0, framework_base_1.mergeProps)(boldBaseProps, rest), children: children });
90
+ };
91
+ BoldTextStandard.displayName = 'BoldTextStandard';
92
+ /**
93
+ * To write the same component using the staged pattern is only slightly more complex. The pattern involves splitting the component rendering into
94
+ * two parts and executing any hooks in the first part.
95
+ *
96
+ * The phasedComponent function takes an input function of this form and wraps it in a function component that react knows how to render
97
+ */
98
+ const BoldTextStaged = (0, framework_base_2.phasedComponent)((props) => {
46
99
  /**
47
- * First create the bold text in the standard way. This is just a function component.
100
+ * This section would be where hook/styling code would go, props here would include everything coming in from the base react tree with the
101
+ * exception of children, which will be passed in stage 2.
48
102
  */
49
- const BoldTextStandard = (props) => {
50
- /**
51
- * Pick out the children to pass them on to the child Text element
52
- */
53
- const { children, ...rest } = props;
54
- /**
55
- * Now render the text, merging the baseProps with the style updates with the rest param. Note that this leverages the fact
56
- * that mergeProps will reliably produce style objects with the same reference, given the same inputs.
57
- */
58
- return (0, framework_base_2.withSlots)("span", { ...(0, framework_base_1.mergeProps)(boldBaseProps, rest) }, children);
103
+ return (extra) => {
104
+ /**
105
+ * extra are additional props that may be filled in by a higher order component. They should not include styling and are only props the
106
+ * enclosing component are passing to the JSX elements
107
+ */
108
+ const { children, ...rest } = extra;
109
+ return jsx_runtime_1.jsx(react_native_1.Text, {
110
+ ...(0, framework_base_1.mergeProps)(boldBaseProps, props, rest),
111
+ children: children,
112
+ });
59
113
  };
60
- BoldTextStandard.displayName = 'BoldTextStandard';
114
+ });
115
+ BoldTextStaged.displayName = 'BoldTextStaged';
116
+ it('renders sample 1 - the two types of basic bold text components', () => {
117
+ const styleToMerge = { color: 'black' };
61
118
  /**
62
- * To write the same component using the staged pattern is only slightly more complex. The pattern involves splitting the component rendering into
63
- * two parts and executing any hooks in the first part.
64
- *
65
- * The stagedComponent function takes an input function of this form and wraps it in a function component that react knows how to render
119
+ * First render the staged component. This invokes the wrapper that was built by the stagedComponent function
66
120
  */
67
- const BoldTextStaged = (0, framework_base_2.stagedComponent)((props) => {
68
- /**
69
- * This section would be where hook/styling code would go, props here would include everything coming in from the base react tree with the
70
- * exception of children, which will be passed in stage 2.
71
- */
72
- return (extra, children) => {
73
- /**
74
- * extra are additional props that may be filled in by a higher order component. They should not include styling and are only props the
75
- * enclosing component are passing to the JSX elements
76
- */
77
- return (0, framework_base_2.withSlots)("span", { ...(0, framework_base_1.mergeProps)(boldBaseProps, props, extra) }, children);
78
- };
79
- });
80
- BoldTextStaged.displayName = 'BoldTextStaged';
81
- it('renders sample 1 - the two types of basic bold text components', () => {
82
- const styleToMerge = { color: 'black' };
83
- /**
84
- * First render the staged component. This invokes the wrapper that was built by the stagedComponent function
85
- */
86
- const wrapper = renderer
87
- .create((0, framework_base_2.withSlots)("div", null,
88
- (0, framework_base_2.withSlots)(BoldTextStaged, { style: styleToMerge }, "Staged component at one level"),
89
- (0, framework_base_2.withSlots)(BoldTextStandard, { style: styleToMerge }, "Standard component of a single level")))
90
- .toJSON();
91
- expect(wrapper).toMatchSnapshot();
121
+ let component;
122
+ (0, react_1.act)(() => {
123
+ component = renderer.create(
124
+ jsx_runtime_1.jsxs(react_native_1.View, {
125
+ children: [
126
+ jsx_runtime_1.jsx(BoldTextStaged, { style: styleToMerge, children: 'Staged component at one level' }),
127
+ jsx_runtime_1.jsx(BoldTextStandard, { style: styleToMerge, children: 'Standard component of a single level' }),
128
+ ],
129
+ }),
130
+ );
92
131
  });
132
+ expect(component.toJSON()).toMatchSnapshot();
133
+ });
134
+ /**
135
+ * Example #2 - Simple component containing another simple component -------------------------------------
136
+ *
137
+ * Next we will build a layer on top of the previously authored components to turn the bold text components into header components. This is
138
+ * to illustrate the way in which components can be commonly built on top of other simpler components.
139
+ */
140
+ const headerBaseProps = { style: { fontSize: 20 } };
141
+ /**
142
+ * The standard way of doing things is a repeat of what happens above. Grab the children, pass them on, merge the rest of the props with
143
+ * base props.
144
+ *
145
+ * This again leverages style merging via mergeProps to avoid changing the references of the style objects on every render
146
+ */
147
+ const HeaderStandard = (props) => {
148
+ const { children, ...rest } = props;
149
+ return jsx_runtime_1.jsx(BoldTextStandard, { ...(0, framework_base_1.mergeProps)(headerBaseProps, rest), children: children });
150
+ };
151
+ HeaderStandard.displayName = 'HeaderStandard';
152
+ /**
153
+ * To consume the staged component we'll use the use slots hook builder. This allows easy consumption of staged components (or standard components)
154
+ * This will be described in more detail further on but in this case the component has a single child component, so it only has one slot that we
155
+ * will call 'text'
156
+ *
157
+ * This should be built once, and consumed by the component, not built on the fly inside
158
+ */
159
+ const useHeaderSlots = (0, buildUseSlots_1.buildUseSlots)({ slots: { text: BoldTextStaged } });
160
+ /**
161
+ * Now author the staged component using the slot hook
162
+ */
163
+ const HeaderStaged = (0, framework_base_2.phasedComponent)((props) => {
93
164
  /**
94
- * Example #2 - Simple component containing another simple component -------------------------------------
95
- *
96
- * Next we will build a layer on top of the previously authored components to turn the bold text components into header components. This is
97
- * to illustrate the way in which components can be commonly built on top of other simpler components.
98
- */
99
- const headerBaseProps = { style: { fontSize: 20 } };
100
- /**
101
- * The standard way of doing things is a repeat of what happens above. Grab the children, pass them on, merge the rest of the props with
102
- * base props.
165
+ * Call the slots hook (or any hook) outside of the inner closure. The useSlots hook will return an object with each slot as a renderable
166
+ * function. The hooks for sub-components will be called as part of this call. Props passed in at this point will be the props that appear
167
+ * in outer part of the staged component. (For this example `props`)
103
168
  *
104
- * This again leverages style merging via mergeProps to avoid changing the references of the style objects on every render
105
- */
106
- const HeaderStandard = (props) => {
107
- const { children, ...rest } = props;
108
- return (0, framework_base_2.withSlots)(BoldTextStandard, { ...(0, framework_base_1.mergeProps)(headerBaseProps, rest) }, children);
169
+ * Note that while we are passing in props, in the simple usage case it isn't used and could be omitted if desired
170
+ * */
171
+ const BoldText = useHeaderSlots(props).text;
172
+ /** Now the inner closure, pretty much the same as before */
173
+ return (extra) => {
174
+ const { children, ...rest } = extra;
175
+ /**
176
+ * Instead of rendering the <BoldTextStageed> component directly we render using the slot. If this is a staged component it will call the
177
+ * inner closure directly, without going through createElement. Entries passed into the JSX, including children, are what appear in the
178
+ * props of the inner closure. (In this example `extra`)
179
+ *
180
+ * NOTE: this requires using the withSlots helper via the jsx directive. This knows how to pick apart the entries and just call the second
181
+ * part of the function
182
+ */
183
+ return jsx_runtime_1.jsx(BoldText, { ...(0, framework_base_1.mergeProps)(headerBaseProps, props, rest), children: children });
109
184
  };
110
- HeaderStandard.displayName = 'HeaderStandard';
111
- /**
112
- * To consume the staged component we'll use the use slots hook builder. This allows easy consumption of staged components (or standard components)
113
- * This will be described in more detail further on but in this case the component has a single child component, so it only has one slot that we
114
- * will call 'text'
115
- *
116
- * This should be built once, and consumed by the component, not built on the fly inside
117
- */
118
- const useHeaderSlots = (0, buildUseSlots_1.buildUseSlots)({ slots: { text: BoldTextStaged } });
185
+ });
186
+ HeaderStaged.displayName = 'HeaderStaged';
187
+ /**
188
+ * Look at the snapshots to compare the rendered output. The staged component will skip the intermediate levels of the react hieararchy while
189
+ * still rendering to the correct primitives.
190
+ */
191
+ it('renders sample 2 = the two types of two level header components', () => {
192
+ const styleToMerge = { color: 'black' };
119
193
  /**
120
- * Now author the staged component using the slot hook
194
+ * First render the staged component. This invokes the wrapper that was built by the stagedComponent function
121
195
  */
122
- const HeaderStaged = (0, framework_base_2.stagedComponent)((props) => {
123
- /**
124
- * Call the slots hook (or any hook) outside of the inner closure. The useSlots hook will return an object with each slot as a renderable
125
- * function. The hooks for sub-components will be called as part of this call. Props passed in at this point will be the props that appear
126
- * in outer part of the staged component. (For this example `props`)
127
- *
128
- * Note that while we are passing in props, in the simple usage case it isn't used and could be omitted if desired
129
- * */
130
- const BoldText = useHeaderSlots(props).text;
131
- /** Now the inner closure, pretty much the same as before */
132
- return (extra, children) => {
133
- /**
134
- * Instead of rendering the <BoldTextStageed> component directly we render using the slot. If this is a staged component it will call the
135
- * inner closure directly, without going through createElement. Entries passed into the JSX, including children, are what appear in the
136
- * props of the inner closure. (In this example `extra`)
137
- *
138
- * NOTE: this requires using the withSlots helper via the jsx directive. This knows how to pick apart the entries and just call the second
139
- * part of the function
140
- */
141
- return (0, framework_base_2.withSlots)(BoldText, { ...(0, framework_base_1.mergeProps)(headerBaseProps, props, extra) }, children);
142
- };
196
+ let component;
197
+ (0, react_1.act)(() => {
198
+ component = renderer.create(
199
+ jsx_runtime_1.jsxs('div', {
200
+ children: [
201
+ jsx_runtime_1.jsx(HeaderStaged, { style: styleToMerge, children: 'Staged component with two levels' }),
202
+ jsx_runtime_1.jsx(HeaderStandard, { style: styleToMerge, children: 'Standard component with two levels' }),
203
+ ],
204
+ }),
205
+ );
143
206
  });
144
- HeaderStaged.displayName = 'HeaderStaged';
145
- /**
146
- * Look at the snapshots to compare the rendered output. The staged component will skip the intermediate levels of the react hieararchy while
147
- * still rendering to the correct primitives.
148
- */
149
- it('renders sample 2 = the two types of two level header components', () => {
150
- const styleToMerge = { color: 'black' };
151
- /**
152
- * First render the staged component. This invokes the wrapper that was built by the stagedComponent function
153
- */
154
- const wrapper = renderer
155
- .create((0, framework_base_2.withSlots)("div", null,
156
- (0, framework_base_2.withSlots)(HeaderStaged, { style: styleToMerge }, "Staged component with two levels"),
157
- (0, framework_base_2.withSlots)(HeaderStandard, { style: styleToMerge }, "Standard component with two levels")))
158
- .toJSON();
159
- expect(wrapper).toMatchSnapshot();
207
+ expect(component.toJSON()).toMatchSnapshot();
208
+ });
209
+ /** standard props for the container */
210
+ const containerProps = { style: { display: 'flex', flexDirection: 'column' } };
211
+ /**
212
+ * add a quick cache to ensure that we don't thrash the styles. This is a danger any time a value from a style is added as
213
+ * a prop on a component
214
+ */
215
+ const colorProps = {};
216
+ const getColorProps = (value) => {
217
+ if (value !== undefined) {
218
+ colorProps[value] = colorProps[value] || { style: { color: value } };
219
+ return colorProps[value];
220
+ }
221
+ return {};
222
+ };
223
+ /**
224
+ * now just create the component like a standard react functional component
225
+ */
226
+ const CaptionedHeaderStandard = (props) => {
227
+ const { headerColor, captionColor, captionText, children, ...rest } = props;
228
+ const headerColorProps = getColorProps(headerColor);
229
+ const captionColorProps = getColorProps(captionColor);
230
+ return jsx_runtime_1.jsxs(react_native_1.View, {
231
+ ...(0, framework_base_1.mergeProps)(containerProps, rest),
232
+ children: [
233
+ jsx_runtime_1.jsx(HeaderStandard, { ...headerColorProps, children: children }),
234
+ captionText && jsx_runtime_1.jsx(BoldTextStandard, { ...captionColorProps, children: captionText }),
235
+ ],
160
236
  });
161
- /** standard props for the container */
162
- const containerProps = { style: { display: 'flex', flexDirection: 'column' } };
163
- /**
164
- * add a quick cache to ensure that we don't thrash the styles. This is a danger any time a value from a style is added as
165
- * a prop on a component
166
- */
167
- const colorProps = {};
168
- const getColorProps = (value) => {
169
- if (value !== undefined) {
170
- colorProps[value] = colorProps[value] || { style: { color: value } };
171
- return colorProps[value];
172
- }
173
- return {};
237
+ };
238
+ CaptionedHeaderStandard.displayName = `CaptionedHeaderStandard';`;
239
+ /**
240
+ * now build the same component using slots hook. This will also add use of the style injection pattern
241
+ */
242
+ const useCaptionedHeaderSlots = (0, buildUseSlots_1.buildUseSlots)({
243
+ /** Slots are just like above, this component will have three sub-components */
244
+ slots: {
245
+ container: react_native_1.View,
246
+ header: HeaderStaged,
247
+ caption: BoldTextStaged,
248
+ },
249
+ /** useStyling is an optional function that turns props into props for the sub-components */
250
+ useStyling: (props) => ({
251
+ container: containerProps,
252
+ header: getColorProps(props.headerColor),
253
+ caption: getColorProps(props.captionColor),
254
+ }),
255
+ });
256
+ /** a mask to clear props that we don't want to pass to the inner view */
257
+ const clearCustomProps = { headerColor: undefined, captionColor: undefined };
258
+ /**
259
+ * now use the hook to implement it as a staged component
260
+ */
261
+ const CaptionedHeaderStaged = (0, framework_base_2.phasedComponent)((props) => {
262
+ // At the point where this is called the slots are initialized with the initial prop values from useStyling above
263
+ const Slots = useCaptionedHeaderSlots(props);
264
+ return (extra) => {
265
+ // merge the props together, picking out the caption text and clearing any custom values we don't want forwarded to the view
266
+ const { children, captionText, ...rest } = (0, framework_base_1.mergeProps)(props, extra, clearCustomProps);
267
+ // now render using the slots. Any values passed in via JSX will be merged with values from the slot hook above
268
+ return jsx_runtime_1.jsxs(Slots.container, {
269
+ ...rest,
270
+ children: [
271
+ jsx_runtime_1.jsx(Slots.header, { children: children }),
272
+ captionText && jsx_runtime_1.jsx(Slots.caption, { children: captionText }),
273
+ ],
274
+ });
174
275
  };
276
+ });
277
+ CaptionedHeaderStaged.displayName = 'CaptionedHeaderStaged';
278
+ it('renders sample 3 - the two types of higher order header components', () => {
279
+ const styleToMerge = { backgroundColor: 'gray', borderColor: 'purple', borderWidth: 1 };
175
280
  /**
176
- * now just create the component like a standard react functional component
281
+ * Render the two sets of components. Note in the snapshots how the render tree layers for the standard approach are starting
282
+ * to add up.
177
283
  */
178
- const CaptionedHeaderStandard = (props) => {
179
- const { headerColor, captionColor, captionText, children, ...rest } = props;
180
- const headerColorProps = getColorProps(headerColor);
181
- const captionColorProps = getColorProps(captionColor);
182
- return ((0, framework_base_2.withSlots)("div", { ...(0, framework_base_1.mergeProps)(containerProps, rest) },
183
- (0, framework_base_2.withSlots)(HeaderStandard, { ...headerColorProps }, children),
184
- captionText && (0, framework_base_2.withSlots)(BoldTextStandard, { ...captionColorProps }, captionText)));
185
- };
186
- CaptionedHeaderStandard.displayName = `CaptionedHeaderStandard';`;
187
- /**
188
- * now build the same component using slots hook. This will also add use of the style injection pattern
189
- */
190
- const useCaptionedHeaderSlots = (0, buildUseSlots_1.buildUseSlots)({
191
- /** Slots are just like above, this component will have three sub-components */
192
- slots: {
193
- container: 'div',
194
- header: HeaderStaged,
195
- caption: BoldTextStaged,
196
- },
197
- /** useStyling is an optional function that turns props into props for the sub-components */
198
- useStyling: (props) => ({
199
- container: containerProps,
200
- header: getColorProps(props.headerColor),
201
- caption: getColorProps(props.captionColor),
284
+ let component;
285
+ (0, react_1.act)(() => {
286
+ component = renderer.create(
287
+ jsx_runtime_1.jsxs('div', {
288
+ children: [
289
+ jsx_runtime_1.jsx('span', { children: '--- SIMPLE USAGE COMPARISON ---' }),
290
+ jsx_runtime_1.jsx(CaptionedHeaderStandard, { style: styleToMerge, children: 'Standard HOC' }),
291
+ jsx_runtime_1.jsx(CaptionedHeaderStaged, { style: styleToMerge, children: 'Staged HOC' }),
292
+ jsx_runtime_1.jsx('span', { children: '--- COMPARISON WITH CAPTIONS ---' }),
293
+ jsx_runtime_1.jsx(CaptionedHeaderStandard, {
294
+ style: styleToMerge,
295
+ captionText: 'Caption text',
296
+ children: 'Standard HOC with Caption',
297
+ }),
298
+ jsx_runtime_1.jsx(CaptionedHeaderStaged, {
299
+ style: styleToMerge,
300
+ captionText: 'Caption text',
301
+ children: 'Staged HOC with Caption',
302
+ }),
303
+ jsx_runtime_1.jsx('span', { children: '--- COMPARISON WITH CAPTIONS AND CUSTOMIZATIONS ---' }),
304
+ jsx_runtime_1.jsx(CaptionedHeaderStandard, {
305
+ style: styleToMerge,
306
+ captionText: 'Caption text',
307
+ captionColor: 'yellow',
308
+ headerColor: 'red',
309
+ children: 'Standard HOC with caption and customizations',
310
+ }),
311
+ jsx_runtime_1.jsx(CaptionedHeaderStaged, {
312
+ style: styleToMerge,
313
+ captionText: 'Caption text',
314
+ captionColor: 'yellow',
315
+ headerColor: 'red',
316
+ children: 'Staged HOC with caption and customizations',
317
+ }),
318
+ ],
202
319
  }),
320
+ );
203
321
  });
204
- /** a mask to clear props that we don't want to pass to the inner view */
205
- const clearCustomProps = { headerColor: undefined, captionColor: undefined };
206
- /**
207
- * now use the hook to implement it as a staged component
208
- */
209
- const CaptionedHeaderStaged = (0, framework_base_2.stagedComponent)((props) => {
210
- // At the point where this is called the slots are initialized with the initial prop values from useStyling above
211
- const Slots = useCaptionedHeaderSlots(props);
212
- return (extra, children) => {
213
- // merge the props together, picking out the caption text and clearing any custom values we don't want forwarded to the view
214
- const { captionText, ...rest } = (0, framework_base_1.mergeProps)(props, extra, clearCustomProps);
215
- // now render using the slots. Any values passed in via JSX will be merged with values from the slot hook above
216
- return ((0, framework_base_2.withSlots)(Slots.container, { ...rest },
217
- (0, framework_base_2.withSlots)(Slots.header, null, children),
218
- captionText && (0, framework_base_2.withSlots)(Slots.caption, null, captionText)));
219
- };
220
- });
221
- CaptionedHeaderStaged.displayName = 'CaptionedHeaderStaged';
222
- it('renders sample 3 - the two types of higher order header components', () => {
223
- const styleToMerge = { backgroundColor: 'gray', borderColor: 'purple', borderWidth: 1 };
224
- /**
225
- * Render the two sets of components. Note in the snapshots how the render tree layers for the standard approach are starting
226
- * to add up.
227
- */
228
- const wrapper = renderer
229
- .create((0, framework_base_2.withSlots)("div", null,
230
- (0, framework_base_2.withSlots)("span", null, "--- SIMPLE USAGE COMPARISON ---"),
231
- (0, framework_base_2.withSlots)(CaptionedHeaderStandard, { style: styleToMerge }, "Standard HOC"),
232
- (0, framework_base_2.withSlots)(CaptionedHeaderStaged, { style: styleToMerge }, "Staged HOC"),
233
- (0, framework_base_2.withSlots)("span", null, "--- COMPARISON WITH CAPTIONS ---"),
234
- (0, framework_base_2.withSlots)(CaptionedHeaderStandard, { style: styleToMerge, captionText: "Caption text" }, "Standard HOC with Caption"),
235
- (0, framework_base_2.withSlots)(CaptionedHeaderStaged, { style: styleToMerge, captionText: "Caption text" }, "Staged HOC with Caption"),
236
- (0, framework_base_2.withSlots)("span", null, "--- COMPARISON WITH CAPTIONS AND CUSTOMIZATIONS ---"),
237
- (0, framework_base_2.withSlots)(CaptionedHeaderStandard, { style: styleToMerge, captionText: "Caption text", captionColor: "yellow", headerColor: "red" }, "Standard HOC with caption and customizations"),
238
- (0, framework_base_2.withSlots)(CaptionedHeaderStaged, { style: styleToMerge, captionText: "Caption text", captionColor: "yellow", headerColor: "red" }, "Staged HOC with caption and customizations")))
239
- .toJSON();
240
- expect(wrapper).toMatchSnapshot();
241
- });
322
+ expect(component.toJSON()).toMatchSnapshot();
323
+ });
242
324
  });
243
- //# sourceMappingURL=useSlots.samples.test.js.map
325
+ //# sourceMappingURL=useSlots.samples.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSlots.samples.test.js","sourceRoot":"","sources":["../src/useSlots.samples.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0EAAmE;AACnE,0EAAmF;AACnF,8DAAgD;AAEhD,mDAAgD;AAQhD;;;GAGG;AAEH,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C;;;OAGG;IAEH;;;;;OAKG;IAEH,MAAM,aAAa,GAAc,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC;IAEhE;;OAEG;IACH,MAAM,gBAAgB,GAAgE,CAAC,KAAyC,EAAE,EAAE;QAClI;;WAEG;QACH,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAEpC;;;WAGG;QACH,OAAO,6CAAU,IAAA,2BAAU,EAAC,aAAa,EAAE,IAAI,CAAC,IAAG,QAAQ,CAAQ,CAAC;IACtE,CAAC,CAAC;IACF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD;;;;;OAKG;IACH,MAAM,cAAc,GAAG,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