@fluentui-react-native/framework 0.14.16 → 0.15.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 (51) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/babel.config.js +1 -1
  3. package/lib/compose.d.ts +27 -12
  4. package/lib/compose.js +2 -2
  5. package/lib/compose.js.map +1 -1
  6. package/lib/compressible.d.ts +5 -2
  7. package/lib/compressible.js +8 -8
  8. package/lib/compressible.js.map +1 -1
  9. package/lib/compressible.test.d.ts +1 -1
  10. package/lib/compressible.test.js +67 -59
  11. package/lib/compressible.test.js.map +1 -1
  12. package/lib/index.d.ts +76 -6
  13. package/lib/index.js +16 -2
  14. package/lib/themeHelper.d.ts +1 -1
  15. package/lib/themeHelper.js +6 -6
  16. package/lib/themeHelper.js.map +1 -1
  17. package/lib/useFluentTheme.d.ts +1 -1
  18. package/lib/useFluentTheme.js +2 -2
  19. package/lib/useFluentTheme.js.map +1 -1
  20. package/lib/useStyling.d.ts +15 -4
  21. package/lib/useStyling.js +4 -4
  22. package/lib/useStyling.js.map +1 -1
  23. package/lib/useTokens.d.ts +1 -1
  24. package/lib/useTokens.js +2 -2
  25. package/lib/useTokens.js.map +1 -1
  26. package/lib-commonjs/compose.d.ts +27 -12
  27. package/lib-commonjs/compose.js +7 -8
  28. package/lib-commonjs/compose.js.map +1 -1
  29. package/lib-commonjs/compressible.d.ts +5 -2
  30. package/lib-commonjs/compressible.js +12 -13
  31. package/lib-commonjs/compressible.js.map +1 -1
  32. package/lib-commonjs/compressible.test.d.ts +1 -1
  33. package/lib-commonjs/compressible.test.js +134 -91
  34. package/lib-commonjs/compressible.test.js.map +1 -1
  35. package/lib-commonjs/index.d.ts +76 -6
  36. package/lib-commonjs/index.js +283 -55
  37. package/lib-commonjs/index.js.map +1 -1
  38. package/lib-commonjs/themeHelper.d.ts +1 -1
  39. package/lib-commonjs/themeHelper.js +9 -9
  40. package/lib-commonjs/themeHelper.js.map +1 -1
  41. package/lib-commonjs/useFluentTheme.d.ts +1 -1
  42. package/lib-commonjs/useFluentTheme.js +7 -8
  43. package/lib-commonjs/useFluentTheme.js.map +1 -1
  44. package/lib-commonjs/useStyling.d.ts +15 -4
  45. package/lib-commonjs/useStyling.js +10 -11
  46. package/lib-commonjs/useStyling.js.map +1 -1
  47. package/lib-commonjs/useTokens.d.ts +1 -1
  48. package/lib-commonjs/useTokens.js +33 -13
  49. package/lib-commonjs/useTokens.js.map +1 -1
  50. package/package.json +68 -66
  51. package/src/compressible.test.tsx +15 -14
@@ -6,32 +6,47 @@ import type { ObjectBase } from '@fluentui-react-native/framework-base';
6
6
  * the type via the IComposableType interface, this is simply the format used to extract the type info.
7
7
  */
8
8
  export interface ComposeType<TProps, TSlotProps, TTokens, TStatics = ObjectBase> {
9
- props: TProps;
10
- slotProps: TSlotProps;
11
- tokens: TTokens;
12
- statics: TStatics;
9
+ props: TProps;
10
+ slotProps: TSlotProps;
11
+ tokens: TTokens;
12
+ statics: TStatics;
13
13
  }
14
14
  /** fragments used in type extraction */
15
15
  type PropsFragment<TProps> = {
16
- props: TProps;
16
+ props: TProps;
17
17
  };
18
18
  type SlotPropsFragment<TSlotProps> = {
19
- slotProps: TSlotProps;
19
+ slotProps: TSlotProps;
20
20
  };
21
21
  type TokensFragment<TTokens> = {
22
- tokens: TTokens;
22
+ tokens: TTokens;
23
23
  };
24
24
  type StaticsFragment<TStatics extends ObjectBase> = {
25
- statics: TStatics;
25
+ statics: TStatics;
26
26
  };
27
27
  /** Extraction types that get the various interface types from IComposableType */
28
28
  export type ExtractProps<T> = T extends PropsFragment<infer U> ? U : never;
29
29
  export type ExtractSlotProps<T> = T extends SlotPropsFragment<infer U> ? U : never;
30
30
  export type ExtractTokens<T> = T extends TokensFragment<infer U> ? U : ObjectBase;
31
31
  export type ExtractStatics<T> = T extends StaticsFragment<infer U> ? U : ObjectBase;
32
- export type ComposeOptions<TProps, TSlotProps, TTokens, TStatics extends ObjectBase> = ComposeFactoryOptions<TProps, TSlotProps, TTokens, Theme, TStatics>;
33
- export type ComposableComponent<TProps, TSlotProps, TTokens, TStatics extends ObjectBase> = ComposeFactoryComponent<TProps, TSlotProps, TTokens, Theme, TStatics>;
32
+ export type ComposeOptions<TProps, TSlotProps, TTokens, TStatics extends ObjectBase> = ComposeFactoryOptions<
33
+ TProps,
34
+ TSlotProps,
35
+ TTokens,
36
+ Theme,
37
+ TStatics
38
+ >;
39
+ export type ComposableComponent<TProps, TSlotProps, TTokens, TStatics extends ObjectBase> = ComposeFactoryComponent<
40
+ TProps,
41
+ TSlotProps,
42
+ TTokens,
43
+ Theme,
44
+ TStatics
45
+ >;
34
46
  export type UseSlots<T> = UseStyledSlots<ExtractProps<T>, ExtractSlotProps<T>>;
35
- export declare function compose<T>(options: ComposeOptions<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>, base?: ComposableComponent<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>): ComposableComponent<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>;
47
+ export declare function compose<T>(
48
+ options: ComposeOptions<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>,
49
+ base?: ComposableComponent<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>,
50
+ ): ComposableComponent<ExtractProps<T>, ExtractSlotProps<T>, ExtractTokens<T>, ExtractStatics<T>>;
36
51
  export {};
37
- //# sourceMappingURL=compose.d.ts.map
52
+ //# sourceMappingURL=compose.d.ts.map
@@ -1,10 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compose = void 0;
4
- const composition_1 = require("@fluentui-react-native/composition");
5
- const themeHelper_1 = require("./themeHelper");
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.compose = compose;
4
+ const composition_1 = require('@fluentui-react-native/composition');
5
+ const themeHelper_1 = require('./themeHelper');
6
6
  function compose(options, base) {
7
- return (0, composition_1.composeFactory)(options, themeHelper_1.themeHelper, base);
7
+ return (0, composition_1.composeFactory)(options, themeHelper_1.themeHelper, base);
8
8
  }
9
- exports.compose = compose;
10
- //# sourceMappingURL=compose.js.map
9
+ //# sourceMappingURL=compose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":";;;AACA,oEAAoE;AAIpE,+CAA4C;AA8C5C,SAAgB,OAAO,CACrB,OAAkG,EAClG,IAAqG;IAErG,OAAO,IAAA,4BAAc,EAAC,OAAO,EAAE,yBAAW,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AALD,0BAKC"}
1
+ {"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":";;;AACA,oEAAoE;AAIpE,+CAA4C;AA8C5C,iBACE,OAAkG,EAClG,IAAqG,EACL;IAChG,OAAO,IAAA,4BAAc,EAAC,OAAO,EAAE,yBAAW,EAAE,IAAI,CAAC,CAAC;AAAA,CACnD"}
@@ -9,5 +9,8 @@ import type { UseTokens } from './useTokens';
9
9
  * @param useTokens a hook function to build a set of tokens from a passed in theme as well as a cache object
10
10
  * @returns A tree compressed function component with the `.customize` method exposed to it
11
11
  */
12
- export declare function compressible<TProps, TTokens>(fn: StagedRender<TProps>, useTokens: UseTokens<TTokens>): CustomizableComponent<TProps, TTokens, Theme>;
13
- //# sourceMappingURL=compressible.d.ts.map
12
+ export declare function compressible<TProps, TTokens>(
13
+ fn: StagedRender<TProps>,
14
+ useTokens: UseTokens<TTokens>,
15
+ ): CustomizableComponent<TProps, TTokens, Theme>;
16
+ //# sourceMappingURL=compressible.d.ts.map
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compressible = void 0;
4
- const framework_base_1 = require("@fluentui-react-native/framework-base");
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.compressible = compressible;
4
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
5
5
  /**
6
6
  * Utility function which can create function components that can be tree compressed (using the stagedRender pattern),
7
7
  * and also have customize functionality.
@@ -10,13 +10,12 @@ const framework_base_1 = require("@fluentui-react-native/framework-base");
10
10
  * @returns A tree compressed function component with the `.customize` method exposed to it
11
11
  */
12
12
  function compressible(fn, useTokens) {
13
- const injectedWrapper = (props) => fn(props, useTokens);
14
- const component = (0, framework_base_1.stagedComponent)(injectedWrapper);
15
- component.customize = (...tokens) => {
16
- const useTokensNew = useTokens.customize(...tokens);
17
- return compressible(fn, useTokensNew);
18
- };
19
- return component;
13
+ const injectedWrapper = (props) => fn(props, useTokens);
14
+ const component = (0, framework_base_1.stagedComponent)(injectedWrapper);
15
+ component.customize = (...tokens) => {
16
+ const useTokensNew = useTokens.customize(...tokens);
17
+ return compressible(fn, useTokensNew);
18
+ };
19
+ return component;
20
20
  }
21
- exports.compressible = compressible;
22
- //# sourceMappingURL=compressible.js.map
21
+ //# sourceMappingURL=compressible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compressible.js","sourceRoot":"","sources":["../src/compressible.ts"],"names":[],"mappings":";;;AAEA,0EAAwE;AAMxE;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,EAAwB,EACxB,SAA6B;IAI7B,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,gCAAe,EAAC,eAAe,CAAkB,CAAC;IAEpE,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,MAAgC,EAAE,EAAE;QAC5D,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;QACpD,OAAO,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAfD,oCAeC"}
1
+ {"version":3,"file":"compressible.js","sourceRoot":"","sources":["../src/compressible.ts"],"names":[],"mappings":";;;AAEA,0EAAwE;AAMxE;;;;;;GAMG;AACH,sBACE,EAAwB,EACxB,SAA6B,EACkB;IAG/C,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,gCAAe,EAAC,eAAe,CAAkB,CAAC;IAEpE,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,MAAgC,EAAE,EAAE,CAAC;QAC7D,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;QACpD,OAAO,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAAA,CACvC,CAAC;IAEF,OAAO,SAAS,CAAC;AAAA,CAClB"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=compressible.test.d.ts.map
2
+ //# sourceMappingURL=compressible.test.d.ts.map
@@ -1,104 +1,147 @@
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 react_native_1 = require("react-native");
27
- const framework_base_1 = require("@fluentui-react-native/framework-base");
28
- const use_slot_1 = require("@fluentui-react-native/use-slot");
29
- const framework_base_2 = require("@fluentui-react-native/framework-base");
30
- const use_tokens_1 = require("@fluentui-react-native/use-tokens");
31
- const renderer = __importStar(require("react-test-renderer"));
32
- const compressible_1 = require("./compressible");
33
- const useTokens_1 = require("./useTokens");
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
+ const react_1 = require('react');
55
+ const react_native_1 = require('react-native');
56
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
57
+ const use_slot_1 = require('@fluentui-react-native/use-slot');
58
+ const use_tokens_1 = require('@fluentui-react-native/use-tokens');
59
+ const renderer = __importStar(require('react-test-renderer'));
60
+ const compressible_1 = require('./compressible');
61
+ const useTokens_1 = require('./useTokens');
34
62
  const useVariantTokens = (0, useTokens_1.buildUseTokens)({
35
- color: 'black',
36
- fontSize: 12,
37
- fontWeight: '500',
38
- defaultType: 'normal',
39
- header: {
40
- color: 'blue',
41
- fontSize: 16,
42
- fontWeight: '700',
43
- },
44
- caption: {
45
- color: 'gray',
46
- fontWeight: '300',
47
- },
63
+ color: 'black',
64
+ fontSize: 12,
65
+ fontWeight: '500',
66
+ defaultType: 'normal',
67
+ header: {
68
+ color: 'blue',
69
+ fontSize: 16,
70
+ fontWeight: '700',
71
+ },
72
+ caption: {
73
+ color: 'gray',
74
+ fontWeight: '300',
75
+ },
48
76
  });
49
77
  const VariantText = (0, compressible_1.compressible)((props, useTokens) => {
50
- // fake theme here
51
- const theme = {};
52
- // get the tokens
53
- let [tokens, cache] = useTokens(theme);
54
- // split the props, defaulting the variant type to the default type from the tokens
55
- const { variant = tokens.defaultType, style, ...rest } = props;
56
- // now apply the alternate layer tokens as appropriate
57
- [tokens, cache] = (0, use_tokens_1.applyTokenLayers)(tokens, ['normal', 'header', 'caption'], cache, (layer) => layer === variant);
58
- // merge styles together with what is passed in
59
- const mergedStyle = (0, framework_base_1.mergeStyles)({ color: tokens.color, fontSize: tokens.fontSize, fontWeight: tokens.fontWeight }, style);
60
- // now get the slot
61
- const InnerText = (0, use_slot_1.useSlot)(react_native_1.Text, { ...rest, style: mergedStyle });
62
- return (extra, children) => {
63
- return (0, framework_base_2.withSlots)(InnerText, { ...extra }, children);
64
- };
78
+ // fake theme here
79
+ const theme = {};
80
+ // get the tokens
81
+ let [tokens, cache] = useTokens(theme);
82
+ // split the props, defaulting the variant type to the default type from the tokens
83
+ const { variant = tokens.defaultType, style, ...rest } = props;
84
+ // now apply the alternate layer tokens as appropriate
85
+ [tokens, cache] = (0, use_tokens_1.applyTokenLayers)(tokens, ['normal', 'header', 'caption'], cache, (layer) => layer === variant);
86
+ // merge styles together with what is passed in
87
+ const mergedStyle = (0, framework_base_1.mergeStyles)(
88
+ { color: tokens.color, fontSize: tokens.fontSize, fontWeight: tokens.fontWeight },
89
+ style,
90
+ );
91
+ // now get the slot
92
+ const InnerText = (0, use_slot_1.useSlot)(react_native_1.Text, { ...rest, style: mergedStyle });
93
+ return (extra, children) => {
94
+ return jsx_runtime_1.jsx(InnerText, { ...extra, children: children });
95
+ };
65
96
  }, useVariantTokens);
66
97
  const SuperHeader = VariantText.customize({ header: { fontSize: 24, color: 'purple' } });
67
98
  const useLabelTokens = (0, useTokens_1.buildUseTokens)({
68
- headerVariant: 'header',
69
- captionVariant: 'caption',
99
+ headerVariant: 'header',
100
+ captionVariant: 'caption',
70
101
  });
71
102
  const Label = (0, compressible_1.compressible)((props, useTokens) => {
72
- const theme = {};
73
- const [tokens] = useTokens(theme);
74
- const { headerText, captionText, headerSlot, captionSlot } = props;
75
- const Header = (0, use_slot_1.useSlot)(headerSlot || VariantText, { variant: tokens.headerVariant });
76
- const Caption = (0, use_slot_1.useSlot)(captionSlot || VariantText, { variant: tokens.captionVariant });
77
- return () => {
78
- if (captionText) {
79
- return ((0, framework_base_2.withSlots)(react_native_1.View, null,
80
- (0, framework_base_2.withSlots)(Header, null, headerText),
81
- (0, framework_base_2.withSlots)(Caption, null, captionText)));
82
- }
83
- return (0, framework_base_2.withSlots)(Header, null, headerText);
84
- };
103
+ const theme = {};
104
+ const [tokens] = useTokens(theme);
105
+ const { headerText, captionText, headerSlot, captionSlot } = props;
106
+ const Header = (0, use_slot_1.useSlot)(headerSlot || VariantText, { variant: tokens.headerVariant });
107
+ const Caption = (0, use_slot_1.useSlot)(captionSlot || VariantText, { variant: tokens.captionVariant });
108
+ return () => {
109
+ if (captionText) {
110
+ return jsx_runtime_1.jsxs(react_native_1.View, {
111
+ children: [jsx_runtime_1.jsx(Header, { children: headerText }), jsx_runtime_1.jsx(Caption, { children: captionText })],
112
+ });
113
+ }
114
+ return jsx_runtime_1.jsx(Header, { children: headerText });
115
+ };
85
116
  }, useLabelTokens);
86
117
  describe('compressible tests', () => {
87
- it('Two labels, one with caption and one without', () => {
88
- const tree = renderer
89
- .create((0, framework_base_2.withSlots)(react_native_1.View, null,
90
- (0, framework_base_2.withSlots)(Label, { headerText: "Header1" }),
91
- (0, framework_base_2.withSlots)(Label, { headerText: "Header2", captionText: "Caption2" })))
92
- .toJSON();
93
- expect(tree).toMatchSnapshot();
118
+ it('Two labels, one with caption and one without', () => {
119
+ let component;
120
+ (0, react_1.act)(() => {
121
+ component = renderer.create(
122
+ jsx_runtime_1.jsxs(react_native_1.View, {
123
+ children: [
124
+ jsx_runtime_1.jsx(Label, { headerText: 'Header1' }),
125
+ jsx_runtime_1.jsx(Label, { headerText: 'Header2', captionText: 'Caption2' }),
126
+ ],
127
+ }),
128
+ );
94
129
  });
95
- it('Two labels, one plugging in SuperHeader instead', () => {
96
- const tree = renderer
97
- .create((0, framework_base_2.withSlots)(react_native_1.View, null,
98
- (0, framework_base_2.withSlots)(Label, { headerText: "Super Header", headerSlot: SuperHeader, captionText: "Normal caption" }),
99
- (0, framework_base_2.withSlots)(Label, { headerText: "Normal Header", captionText: "Another normal caption" })))
100
- .toJSON();
101
- expect(tree).toMatchSnapshot();
130
+ expect(component.toJSON()).toMatchSnapshot();
131
+ });
132
+ it('Two labels, one plugging in SuperHeader instead', () => {
133
+ let component;
134
+ (0, react_1.act)(() => {
135
+ component = renderer.create(
136
+ jsx_runtime_1.jsxs(react_native_1.View, {
137
+ children: [
138
+ jsx_runtime_1.jsx(Label, { headerText: 'Super Header', headerSlot: SuperHeader, captionText: 'Normal caption' }),
139
+ jsx_runtime_1.jsx(Label, { headerText: 'Normal Header', captionText: 'Another normal caption' }),
140
+ ],
141
+ }),
142
+ );
102
143
  });
144
+ expect(component.toJSON()).toMatchSnapshot();
145
+ });
103
146
  });
104
- //# sourceMappingURL=compressible.test.js.map
147
+ //# sourceMappingURL=compressible.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compressible.test.js","sourceRoot":"","sources":["../src/compressible.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,+CAA0C;AAE1C,0EAAoE;AAEpE,8DAA0D;AAC1D,0EAAkE;AAClE,kEAAqE;AACrE,8DAAgD;AAEhD,iDAA8C;AAC9C,2CAA6C;AAe7C,MAAM,gBAAgB,GAAG,IAAA,0BAAc,EAAoB;IACzD,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,IAAA,2BAAY,EAC9B,CAAC,KAAuB,EAAE,SAAuC,EAAE,EAAE;IACnE,kBAAkB;IAClB,MAAM,KAAK,GAAU,EAAW,CAAC;IACjC,iBAAiB;IACjB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,mFAAmF;IACnF,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/D,sDAAsD;IACtD,CAA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CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -2,19 +2,89 @@ export type { GetMemoValue, GetTypedMemoValue } from '@fluentui-react-native/fra
2
2
  export { getMemoCache, getTypedMemoCache, memoize } from '@fluentui-react-native/framework-base';
3
3
  export type { StyleProp } from '@fluentui-react-native/framework-base';
4
4
  export { mergeProps, mergeStyles } from '@fluentui-react-native/framework-base';
5
- export { backgroundColorTokens, borderStyles, borderTokens, colorTokens, fontStyles, foregroundColorTokens, getPaletteFromTheme, layoutStyles, layoutTokens, shadowStyles, shadowTokens, textTokens, tokenBuilder, } from '@fluentui-react-native/tokens';
6
- export type { FontStyleTokens, FontTokens, FontVariantTokens, IBackgroundColorTokens, IBorderTokens, IColorTokens, IForegroundColorTokens, IShadowTokens, LayoutTokens, TokenBuilder, } from '@fluentui-react-native/tokens';
5
+ export {
6
+ backgroundColorTokens,
7
+ borderStyles,
8
+ borderTokens,
9
+ colorTokens,
10
+ fontStyles,
11
+ foregroundColorTokens,
12
+ getPaletteFromTheme,
13
+ layoutStyles,
14
+ layoutTokens,
15
+ shadowStyles,
16
+ shadowTokens,
17
+ textTokens,
18
+ tokenBuilder,
19
+ } from '@fluentui-react-native/tokens';
20
+ export type {
21
+ FontStyleTokens,
22
+ FontTokens,
23
+ FontVariantTokens,
24
+ IBackgroundColorTokens,
25
+ IBorderTokens,
26
+ IColorTokens,
27
+ IForegroundColorTokens,
28
+ IShadowTokens,
29
+ LayoutTokens,
30
+ TokenBuilder,
31
+ } from '@fluentui-react-native/tokens';
7
32
  export { useSlot } from '@fluentui-react-native/use-slot';
8
33
  export { renderSlot, stagedComponent, withSlots } from '@fluentui-react-native/framework-base';
9
34
  export type { ComposableFunction, FinalRender, NativeReactType, SlotFn, StagedRender } from '@fluentui-react-native/framework-base';
10
35
  export { buildUseSlots } from '@fluentui-react-native/use-slots';
11
36
  export type { GetSlotProps, Slots, UseSlotOptions, UseSlotsBase } from '@fluentui-react-native/use-slots';
12
37
  export { immutableMerge, immutableMergeCore, processImmutable } from '@fluentui-react-native/framework-base';
13
- export type { BuiltinRecursionHandlers, CustomRecursionHandler, MergeOptions, ObjectBase, RecursionHandler, RecursionOption, } from '@fluentui-react-native/framework-base';
38
+ export type {
39
+ BuiltinRecursionHandlers,
40
+ CustomRecursionHandler,
41
+ MergeOptions,
42
+ ObjectBase,
43
+ RecursionHandler,
44
+ RecursionOption,
45
+ } from '@fluentui-react-native/framework-base';
14
46
  export { ThemeContext, useTheme } from '@fluentui-react-native/theme-types';
15
- export type { AliasColorTokens, AppearanceOptions, Color, FontFamilies, FontFamily, FontFamilyValue, FontSize, FontSizeValuePoints, FontSizes, FontWeight, FontWeightValue, FontWeights, OfficePalette, Palette, PaletteBackgroundColors, PaletteTextColors, PartialPalette, PartialTheme, PartialTypography, Spacing, TextStyling, Theme, ThemeColorDefinition, ThemeOptions, Typography, Variant, VariantValue, Variants, } from '@fluentui-react-native/theme-types';
47
+ export type {
48
+ AliasColorTokens,
49
+ AppearanceOptions,
50
+ Color,
51
+ FontFamilies,
52
+ FontFamily,
53
+ FontFamilyValue,
54
+ FontSize,
55
+ FontSizeValuePoints,
56
+ FontSizes,
57
+ FontWeight,
58
+ FontWeightValue,
59
+ FontWeights,
60
+ OfficePalette,
61
+ Palette,
62
+ PaletteBackgroundColors,
63
+ PaletteTextColors,
64
+ PartialPalette,
65
+ PartialTheme,
66
+ PartialTypography,
67
+ Spacing,
68
+ TextStyling,
69
+ Theme,
70
+ ThemeColorDefinition,
71
+ ThemeOptions,
72
+ Typography,
73
+ Variant,
74
+ VariantValue,
75
+ Variants,
76
+ } from '@fluentui-react-native/theme-types';
16
77
  export { compose } from './compose';
17
- export type { ComposableComponent, ComposeOptions, ComposeType, ExtractProps, ExtractSlotProps, ExtractStatics, ExtractTokens, UseSlots, } from './compose';
78
+ export type {
79
+ ComposableComponent,
80
+ ComposeOptions,
81
+ ComposeType,
82
+ ExtractProps,
83
+ ExtractSlotProps,
84
+ ExtractStatics,
85
+ ExtractTokens,
86
+ UseSlots,
87
+ } from './compose';
18
88
  export { compressible } from './compressible';
19
89
  export { useFluentTheme } from './useFluentTheme';
20
90
  export type { HasLayer, TokensThatAreAlsoProps, UseStyling } from './useStyling';
@@ -22,4 +92,4 @@ export { buildProps, buildUseStyling } from './useStyling';
22
92
  export type { BuildProps, TokenSettings, TokensFromTheme, UseStylingOptions } from './useStyling';
23
93
  export { applyPropsToTokens, applyTokenLayers, buildUseTokens, customizable, patchTokens } from './useTokens';
24
94
  export type { UseTokens, CustomizableComponent } from './useTokens';
25
- //# sourceMappingURL=index.d.ts.map
95
+ //# sourceMappingURL=index.d.ts.map