@fluentui-react-native/stack 0.10.21 → 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.
- package/CHANGELOG.md +43 -1
- package/lib/Stack.d.ts +13 -7
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +45 -47
- package/lib/Stack.js.map +1 -1
- package/lib/Stack.settings.d.ts +1 -1
- package/lib/Stack.settings.js +51 -51
- package/lib/Stack.tokens.d.ts +3 -3
- package/lib/Stack.tokens.js +70 -71
- package/lib/Stack.tokens.js.map +1 -1
- package/lib/Stack.types.d.ts +79 -80
- package/lib/Stack.types.js +1 -1
- package/lib/StackItem/StackItem.d.ts +1 -1
- package/lib/StackItem/StackItem.js +5 -5
- package/lib/StackItem/StackItem.settings.d.ts +1 -1
- package/lib/StackItem/StackItem.settings.js +8 -8
- package/lib/StackItem/StackItem.tokens.d.ts +6 -2
- package/lib/StackItem/StackItem.tokens.js +13 -13
- package/lib/StackItem/StackItem.tokens.js.map +1 -1
- package/lib/StackItem/StackItem.types.d.ts +43 -43
- package/lib/StackItem/StackItem.types.js +1 -1
- package/lib/StackUtils.d.ts +7 -4
- package/lib/StackUtils.js +33 -35
- package/lib/StackUtils.js.map +1 -1
- package/lib/StackUtils.test.win32.d.ts +1 -1
- package/lib/StackUtils.test.win32.js +50 -50
- package/lib/StackUtils.test.win32.js.map +1 -1
- package/lib/__tests__/Stack.test.d.ts +1 -1
- package/lib/__tests__/Stack.test.js +15 -9
- package/lib/__tests__/Stack.test.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/Stack.d.ts +13 -7
- package/lib-commonjs/Stack.d.ts.map +1 -1
- package/lib-commonjs/Stack.js +112 -85
- package/lib-commonjs/Stack.js.map +1 -1
- package/lib-commonjs/Stack.settings.d.ts +1 -1
- package/lib-commonjs/Stack.settings.js +54 -54
- package/lib-commonjs/Stack.tokens.d.ts +3 -3
- package/lib-commonjs/Stack.tokens.js +74 -75
- package/lib-commonjs/Stack.tokens.js.map +1 -1
- package/lib-commonjs/Stack.types.d.ts +79 -80
- package/lib-commonjs/Stack.types.js +3 -3
- package/lib-commonjs/StackItem/StackItem.d.ts +1 -1
- package/lib-commonjs/StackItem/StackItem.js +13 -13
- package/lib-commonjs/StackItem/StackItem.js.map +1 -1
- package/lib-commonjs/StackItem/StackItem.settings.d.ts +1 -1
- package/lib-commonjs/StackItem/StackItem.settings.js +11 -11
- package/lib-commonjs/StackItem/StackItem.tokens.d.ts +6 -2
- package/lib-commonjs/StackItem/StackItem.tokens.js +18 -18
- package/lib-commonjs/StackItem/StackItem.tokens.js.map +1 -1
- package/lib-commonjs/StackItem/StackItem.types.d.ts +43 -43
- package/lib-commonjs/StackItem/StackItem.types.js +3 -3
- package/lib-commonjs/StackUtils.d.ts +7 -4
- package/lib-commonjs/StackUtils.js +37 -40
- package/lib-commonjs/StackUtils.js.map +1 -1
- package/lib-commonjs/StackUtils.test.win32.d.ts +1 -1
- package/lib-commonjs/StackUtils.test.win32.js +71 -53
- package/lib-commonjs/StackUtils.test.win32.js.map +1 -1
- package/lib-commonjs/__tests__/Stack.test.d.ts +1 -1
- package/lib-commonjs/__tests__/Stack.test.js +74 -37
- package/lib-commonjs/__tests__/Stack.test.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +31 -11
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +65 -64
- package/src/Stack.tsx +2 -4
- package/src/__tests__/Stack.test.tsx +7 -6
|
@@ -1,56 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const StackUtils_1 = require(
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
const StackUtils_1 = require('./StackUtils');
|
|
4
4
|
describe('StackUtils', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
it('can parse a string with px', () => {
|
|
16
|
-
expect((0, StackUtils_1.parseGap)('32px', theme)).toEqual({ rowGap: { value: 32, unit: 'px' }, columnGap: { value: 32, unit: 'px' } });
|
|
17
|
-
});
|
|
18
|
-
it('can parse a string with a float', () => {
|
|
19
|
-
expect((0, StackUtils_1.parseGap)('20.5px', theme)).toEqual({ rowGap: { value: 20.5, unit: 'px' }, columnGap: { value: 20.5, unit: 'px' } });
|
|
20
|
-
});
|
|
21
|
-
it('parses the value from the theme when given a spacing key', () => {
|
|
22
|
-
expect((0, StackUtils_1.parseGap)('m', theme)).toEqual({ rowGap: { value: 16, unit: 'em' }, columnGap: { value: 16, unit: 'em' } });
|
|
23
|
-
});
|
|
24
|
-
it('can parse a string with both horizontal and vertical gap', () => {
|
|
25
|
-
expect((0, StackUtils_1.parseGap)('30px 10px', theme)).toEqual({ rowGap: { value: 30, unit: 'px' }, columnGap: { value: 10, unit: 'px' } });
|
|
26
|
-
});
|
|
27
|
-
it('defaults to px with a string with horizontal and vertical gap with no units', () => {
|
|
28
|
-
expect((0, StackUtils_1.parseGap)('50 30', theme)).toEqual({ rowGap: { value: 50, unit: 'px' }, columnGap: { value: 30, unit: 'px' } });
|
|
29
|
-
});
|
|
30
|
-
it('can parse a string with horizontal and vertical gap with one of them getting value from the theme when given a spacing key', () => {
|
|
31
|
-
expect((0, StackUtils_1.parseGap)('50px m', theme)).toEqual({ rowGap: { value: 50, unit: 'px' }, columnGap: { value: 16, unit: 'em' } });
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
describe('parsePadding', () => {
|
|
35
|
-
const theme = {
|
|
36
|
-
spacing: {
|
|
37
|
-
s2: '5px',
|
|
38
|
-
s1: '10px',
|
|
39
|
-
m: '15px',
|
|
40
|
-
l1: '20px',
|
|
41
|
-
l2: '25px',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
it('returns its argument when given undefined, a number, or an empty string', () => {
|
|
45
|
-
expect((0, StackUtils_1.parsePadding)(undefined, theme)).toEqual(undefined);
|
|
46
|
-
expect((0, StackUtils_1.parsePadding)(0, theme)).toEqual(0);
|
|
47
|
-
});
|
|
48
|
-
it('returns its argument when given a CSS-style padding', () => {
|
|
49
|
-
expect((0, StackUtils_1.parsePadding)('10px', theme)).toEqual('10px');
|
|
50
|
-
});
|
|
51
|
-
it('converts themed spacing keys to CSS-style paddings', () => {
|
|
52
|
-
expect((0, StackUtils_1.parsePadding)('s2', theme)).toEqual('5px');
|
|
53
|
-
});
|
|
5
|
+
describe('parseGap', () => {
|
|
6
|
+
const theme = {
|
|
7
|
+
spacing: { m: '16em' },
|
|
8
|
+
};
|
|
9
|
+
it('returns a default value when given undefined', () => {
|
|
10
|
+
expect((0, StackUtils_1.parseGap)(undefined, theme)).toEqual({
|
|
11
|
+
rowGap: { value: 0, unit: 'px' },
|
|
12
|
+
columnGap: { value: 0, unit: 'px' },
|
|
13
|
+
});
|
|
54
14
|
});
|
|
15
|
+
it('returns a value with px when given a number', () => {
|
|
16
|
+
expect((0, StackUtils_1.parseGap)(10, theme)).toEqual({ rowGap: { value: 10, unit: 'px' }, columnGap: { value: 10, unit: 'px' } });
|
|
17
|
+
});
|
|
18
|
+
it('can parse a string with px', () => {
|
|
19
|
+
expect((0, StackUtils_1.parseGap)('32px', theme)).toEqual({
|
|
20
|
+
rowGap: { value: 32, unit: 'px' },
|
|
21
|
+
columnGap: { value: 32, unit: 'px' },
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
it('can parse a string with a float', () => {
|
|
25
|
+
expect((0, StackUtils_1.parseGap)('20.5px', theme)).toEqual({
|
|
26
|
+
rowGap: { value: 20.5, unit: 'px' },
|
|
27
|
+
columnGap: { value: 20.5, unit: 'px' },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
it('parses the value from the theme when given a spacing key', () => {
|
|
31
|
+
expect((0, StackUtils_1.parseGap)('m', theme)).toEqual({ rowGap: { value: 16, unit: 'em' }, columnGap: { value: 16, unit: 'em' } });
|
|
32
|
+
});
|
|
33
|
+
it('can parse a string with both horizontal and vertical gap', () => {
|
|
34
|
+
expect((0, StackUtils_1.parseGap)('30px 10px', theme)).toEqual({
|
|
35
|
+
rowGap: { value: 30, unit: 'px' },
|
|
36
|
+
columnGap: { value: 10, unit: 'px' },
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it('defaults to px with a string with horizontal and vertical gap with no units', () => {
|
|
40
|
+
expect((0, StackUtils_1.parseGap)('50 30', theme)).toEqual({
|
|
41
|
+
rowGap: { value: 50, unit: 'px' },
|
|
42
|
+
columnGap: { value: 30, unit: 'px' },
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
it('can parse a string with horizontal and vertical gap with one of them getting value from the theme when given a spacing key', () => {
|
|
46
|
+
expect((0, StackUtils_1.parseGap)('50px m', theme)).toEqual({
|
|
47
|
+
rowGap: { value: 50, unit: 'px' },
|
|
48
|
+
columnGap: { value: 16, unit: 'em' },
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('parsePadding', () => {
|
|
53
|
+
const theme = {
|
|
54
|
+
spacing: {
|
|
55
|
+
s2: '5px',
|
|
56
|
+
s1: '10px',
|
|
57
|
+
m: '15px',
|
|
58
|
+
l1: '20px',
|
|
59
|
+
l2: '25px',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
it('returns its argument when given undefined, a number, or an empty string', () => {
|
|
63
|
+
expect((0, StackUtils_1.parsePadding)(undefined, theme)).toEqual(undefined);
|
|
64
|
+
expect((0, StackUtils_1.parsePadding)(0, theme)).toEqual(0);
|
|
65
|
+
});
|
|
66
|
+
it('returns its argument when given a CSS-style padding', () => {
|
|
67
|
+
expect((0, StackUtils_1.parsePadding)('10px', theme)).toEqual('10px');
|
|
68
|
+
});
|
|
69
|
+
it('converts themed spacing keys to CSS-style paddings', () => {
|
|
70
|
+
expect((0, StackUtils_1.parsePadding)('s2', theme)).toEqual('5px');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
55
73
|
});
|
|
56
|
-
//# sourceMappingURL=StackUtils.test.win32.js.map
|
|
74
|
+
//# sourceMappingURL=StackUtils.test.win32.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackUtils.test.win32.js","sourceRoot":"","sources":["../src/StackUtils.test.win32.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"StackUtils.test.win32.js","sourceRoot":"","sources":["../src/StackUtils.test.win32.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG;YACZ,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE;SACH,CAAC;QAEtB,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE,CAAC;YACvD,MAAM,CAAC,IAAA,qBAAQ,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAAA,CACvH,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE,CAAC;YACtD,MAAM,CAAC,IAAA,qBAAQ,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,EA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,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAAA,CAC3C,CAAC,CAAC;QAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAA,yBAAY,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAAA,CACrD,CAAC,CAAC;QAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE,CAAC;YAC7D,MAAM,CAAC,IAAA,yBAAY,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAAA,CAClD,CAAC,CAAC;IAAA,CACJ,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Stack.test.d.ts.map
|
|
2
|
+
//# sourceMappingURL=Stack.test.d.ts.map
|
|
@@ -1,39 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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('react/jsx-runtime');
|
|
54
|
+
const react_1 = require('react');
|
|
55
|
+
const text_1 = require('@fluentui-react-native/text');
|
|
56
|
+
const renderer = __importStar(require('react-test-renderer'));
|
|
57
|
+
const __1 = require('..');
|
|
30
58
|
it('Stack with tokens', () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
let component;
|
|
60
|
+
(0, react_1.act)(() => {
|
|
61
|
+
component = renderer.create(
|
|
62
|
+
jsx_runtime_1.jsxs(__1.Stack, {
|
|
63
|
+
maxWidth: 400,
|
|
64
|
+
gap: 8,
|
|
65
|
+
padding: 16,
|
|
66
|
+
children: [
|
|
67
|
+
jsx_runtime_1.jsx(text_1.Text, { children: 'Hello' }),
|
|
68
|
+
jsx_runtime_1.jsx(text_1.Text, { children: 'Hello' }),
|
|
69
|
+
jsx_runtime_1.jsx(text_1.Text, { children: 'Hello' }),
|
|
70
|
+
],
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
38
75
|
});
|
|
39
|
-
//# sourceMappingURL=Stack.test.js.map
|
|
76
|
+
//# sourceMappingURL=Stack.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.test.js","sourceRoot":"","sources":["../../src/__tests__/Stack.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stack.test.js","sourceRoot":"","sources":["../../src/__tests__/Stack.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA4B;AAE5B,sDAAmD;AACnD,MAAY,QAAQ,gDAA4B;AAEhD,0BAA2B;AAE3B,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC;IAC5B,IAAI,SAAqC,CAAC;IAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CACzB,mBAAC,SAAK,IAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;gBACvC,kBAAC,WAAI,wBAAa,EAClB,kBAAC,WAAI,wBAAa,EAClB,kBAAC,WAAI,wBAAa;gBACZ,CACT,CAAC;IAAA,CACH,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export { StackItem } from './StackItem/StackItem';
|
|
|
4
4
|
export { stackName } from './Stack.types';
|
|
5
5
|
export type { Alignment, IStackProps, IStackRenderData, IStackSlotProps, IStackStatics, IStackTokens, IStackType } from './Stack.types';
|
|
6
6
|
export { Stack } from './Stack';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.Stack = exports.stackName = exports.StackItem = exports.stackItemName = void 0;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const StackItem_types_1 = require('./StackItem/StackItem.types');
|
|
5
|
+
Object.defineProperty(exports, 'stackItemName', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return StackItem_types_1.stackItemName;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const StackItem_1 = require('./StackItem/StackItem');
|
|
12
|
+
Object.defineProperty(exports, 'StackItem', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return StackItem_1.StackItem;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const Stack_types_1 = require('./Stack.types');
|
|
19
|
+
Object.defineProperty(exports, 'stackName', {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return Stack_types_1.stackName;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const Stack_1 = require('./Stack');
|
|
26
|
+
Object.defineProperty(exports, 'Stack', {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return Stack_1.Stack;
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAAnD,gHAAA,aAAa,OAAA;AAEtB,qDAAkD;AAAzC,sGAAA,SAAS,OAAA;AAClB,+CAA0C;AAAjC,wGAAA,SAAS,OAAA;AAElB,mCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,83 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "A cross-platform opinionated Fluent Text component",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
8
|
+
"directory": "packages/components/Stack"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "",
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
10
15
|
"import": "./lib/index.js",
|
|
11
|
-
"require": "./lib-commonjs/index.js"
|
|
12
|
-
"types": "./lib/index.d.ts"
|
|
16
|
+
"require": "./lib-commonjs/index.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
|
-
"
|
|
19
|
+
"main": "lib-commonjs/index.js",
|
|
20
|
+
"module": "lib/index.js",
|
|
21
|
+
"types": "lib/index.d.ts",
|
|
16
22
|
"scripts": {
|
|
17
23
|
"build": "fluentui-scripts build",
|
|
18
|
-
"
|
|
24
|
+
"build-cjs": "tsgo --outDir lib-commonjs",
|
|
25
|
+
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
|
|
19
26
|
"clean": "fluentui-scripts clean",
|
|
20
27
|
"depcheck": "fluentui-scripts depcheck",
|
|
21
28
|
"lint": "fluentui-scripts eslint",
|
|
22
|
-
"
|
|
23
|
-
"update-snapshots": "fluentui-scripts jest -u",
|
|
29
|
+
"lint-package": "fluentui-scripts lint-package",
|
|
24
30
|
"prettier": "fluentui-scripts prettier",
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
30
|
-
"directory": "packages/components/Stack"
|
|
31
|
+
"test": "fluentui-scripts jest",
|
|
32
|
+
"update-snapshots": "fluentui-scripts jest -u"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"@fluentui-react-native/adapters": "0.
|
|
34
|
-
"@fluentui-react-native/framework": "0.
|
|
35
|
-
"@fluentui-react-native/tokens": "0.
|
|
36
|
-
"@uifabricshared/foundation-composable": "0.
|
|
37
|
-
"@uifabricshared/foundation-compose": "1.
|
|
38
|
-
"@uifabricshared/foundation-settings": "0.
|
|
39
|
-
"@uifabricshared/foundation-tokens": "0.
|
|
35
|
+
"@fluentui-react-native/adapters": "0.14.0",
|
|
36
|
+
"@fluentui-react-native/framework": "0.15.0",
|
|
37
|
+
"@fluentui-react-native/tokens": "0.24.0",
|
|
38
|
+
"@uifabricshared/foundation-composable": "0.14.0",
|
|
39
|
+
"@uifabricshared/foundation-compose": "1.16.0",
|
|
40
|
+
"@uifabricshared/foundation-settings": "0.16.0",
|
|
41
|
+
"@uifabricshared/foundation-tokens": "0.16.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@babel/core": "^7.20.0",
|
|
43
45
|
"@fluentui-react-native/babel-config": "0.1.1",
|
|
44
46
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
47
|
+
"@fluentui-react-native/framework-base": "0.3.0",
|
|
45
48
|
"@fluentui-react-native/jest-config": "0.1.1",
|
|
46
|
-
"@fluentui-react-native/
|
|
47
|
-
"@fluentui-react-native/
|
|
48
|
-
"@react-native/
|
|
49
|
-
"@react-native/
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"react": "
|
|
53
|
-
"react-native": "^0.
|
|
54
|
-
"react
|
|
55
|
-
"react-
|
|
56
|
-
"react
|
|
49
|
+
"@fluentui-react-native/kit-config": "0.1.2",
|
|
50
|
+
"@fluentui-react-native/scripts": "0.1.2",
|
|
51
|
+
"@fluentui-react-native/text": "0.25.0",
|
|
52
|
+
"@react-native-community/cli": "^20.0.0",
|
|
53
|
+
"@react-native-community/cli-platform-android": "^20.0.0",
|
|
54
|
+
"@react-native-community/cli-platform-ios": "^20.0.0",
|
|
55
|
+
"@react-native/babel-preset": "^0.81.0",
|
|
56
|
+
"@react-native/metro-config": "^0.81.0",
|
|
57
|
+
"@types/react": "~19.1.0",
|
|
58
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
59
|
+
"react": "19.1.0",
|
|
60
|
+
"react-native": "^0.81.0",
|
|
61
|
+
"react-native-macos": "^0.81.0",
|
|
62
|
+
"react-native-windows": "^0.81.0",
|
|
63
|
+
"react-test-renderer": "19.1.0"
|
|
57
64
|
},
|
|
58
65
|
"peerDependencies": {
|
|
59
66
|
"@office-iss/react-native-win32": "^0.74.0",
|
|
60
|
-
"react": "18.2.0",
|
|
61
|
-
"react
|
|
62
|
-
"react-native
|
|
63
|
-
"react-native-
|
|
67
|
+
"@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
|
|
68
|
+
"react": "18.2.0 || 19.0.0 || 19.1.0",
|
|
69
|
+
"react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
70
|
+
"react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
71
|
+
"react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
|
|
72
|
+
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"@office-iss/react-native-win32": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@types/react": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"react-native-macos": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"react-native-windows": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
64
86
|
},
|
|
65
|
-
"author": "",
|
|
66
|
-
"license": "MIT",
|
|
67
87
|
"rnx-kit": {
|
|
68
88
|
"kitType": "library",
|
|
69
89
|
"alignDeps": {
|
|
70
|
-
"presets": [
|
|
71
|
-
"microsoft/react-native"
|
|
72
|
-
],
|
|
73
|
-
"requirements": {
|
|
74
|
-
"development": [
|
|
75
|
-
"react-native@0.74"
|
|
76
|
-
],
|
|
77
|
-
"production": [
|
|
78
|
-
"react-native@0.73 || 0.74"
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
90
|
"capabilities": [
|
|
82
91
|
"babel-preset-react-native",
|
|
83
92
|
"core",
|
|
@@ -86,19 +95,11 @@
|
|
|
86
95
|
"core-macos",
|
|
87
96
|
"core-windows",
|
|
88
97
|
"react",
|
|
89
|
-
"react-test-renderer"
|
|
98
|
+
"react-test-renderer",
|
|
99
|
+
"tools-core",
|
|
100
|
+
"tools-jest"
|
|
90
101
|
]
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"peerDependenciesMeta": {
|
|
94
|
-
"@office-iss/react-native-win32": {
|
|
95
|
-
"optional": true
|
|
96
102
|
},
|
|
97
|
-
"react-native-
|
|
98
|
-
"optional": true
|
|
99
|
-
},
|
|
100
|
-
"react-native-windows": {
|
|
101
|
-
"optional": true
|
|
102
|
-
}
|
|
103
|
+
"extends": "@fluentui-react-native/kit-config"
|
|
103
104
|
}
|
|
104
|
-
}
|
|
105
|
+
}
|
package/src/Stack.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** @
|
|
2
|
-
/** @jsx withSlots */
|
|
1
|
+
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { View } from 'react-native';
|
|
5
4
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
@@ -7,7 +6,6 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
7
6
|
import { filterViewProps } from '@fluentui-react-native/adapters';
|
|
8
7
|
import { backgroundColorTokens, borderTokens } from '@fluentui-react-native/tokens';
|
|
9
8
|
import type { ISlots } from '@uifabricshared/foundation-composable';
|
|
10
|
-
import { withSlots } from '@uifabricshared/foundation-composable';
|
|
11
9
|
import type { IUseComposeStyling } from '@uifabricshared/foundation-compose';
|
|
12
10
|
import { compose } from '@uifabricshared/foundation-compose';
|
|
13
11
|
import { mergeSettings } from '@uifabricshared/foundation-settings';
|
|
@@ -37,7 +35,7 @@ function _mixinStyle(style: StyleProp<ObjectBase> | undefined, mixin: ObjectBase
|
|
|
37
35
|
|
|
38
36
|
const _styleKey = 'style';
|
|
39
37
|
|
|
40
|
-
const render = (Slots: ISlots<IStackSlotProps>, renderData: IStackRenderData, ...children: React.ReactNode[]): JSX.Element => {
|
|
38
|
+
const render = (Slots: ISlots<IStackSlotProps>, renderData: IStackRenderData, ...children: React.ReactNode[]): React.JSX.Element => {
|
|
41
39
|
const { gap, horizontal, wrap } = renderData.state!;
|
|
42
40
|
|
|
43
41
|
if (gap && gap > 0 && children && globalThis.__jsiExecutorDescription !== 'ChakraRuntime') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { act } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Text } from '@fluentui-react-native/text';
|
|
4
4
|
import * as renderer from 'react-test-renderer';
|
|
@@ -6,14 +6,15 @@ import * as renderer from 'react-test-renderer';
|
|
|
6
6
|
import { Stack } from '..';
|
|
7
7
|
|
|
8
8
|
it('Stack with tokens', () => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
let component: renderer.ReactTestRenderer;
|
|
10
|
+
act(() => {
|
|
11
|
+
component = renderer.create(
|
|
11
12
|
<Stack maxWidth={400} gap={8} padding={16}>
|
|
12
13
|
<Text>Hello</Text>
|
|
13
14
|
<Text>Hello</Text>
|
|
14
15
|
<Text>Hello</Text>
|
|
15
16
|
</Stack>,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
expect(
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
expect(component!.toJSON()).toMatchSnapshot();
|
|
19
20
|
});
|