@fluentui-react-native/experimental-shadow 0.6.19 → 0.7.1
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 +52 -0
- package/SPEC.md +1 -1
- package/lib/Shadow.d.ts +1 -1
- package/lib/Shadow.d.ts.map +1 -1
- package/lib/Shadow.js +11 -17
- package/lib/Shadow.js.map +1 -1
- package/lib/Shadow.types.d.ts +3 -0
- package/lib/Shadow.types.d.ts.map +1 -1
- package/lib/Shadow.types.js.map +1 -1
- package/lib/__tests__/Shadow.test.js +87 -44
- package/lib/__tests__/Shadow.test.js.map +1 -1
- package/lib/shadowStyle.js.map +1 -1
- package/lib-commonjs/Shadow.d.ts +1 -1
- package/lib-commonjs/Shadow.d.ts.map +1 -1
- package/lib-commonjs/Shadow.js +30 -26
- package/lib-commonjs/Shadow.js.map +1 -1
- package/lib-commonjs/Shadow.types.d.ts +3 -0
- package/lib-commonjs/Shadow.types.d.ts.map +1 -1
- package/lib-commonjs/Shadow.types.js.map +1 -1
- package/lib-commonjs/__tests__/Shadow.test.js +104 -51
- package/lib-commonjs/__tests__/Shadow.test.js.map +1 -1
- package/lib-commonjs/index.js +2 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/shadowStyle.js.map +1 -1
- package/package.json +61 -59
- package/src/Shadow.tsx +8 -17
- package/src/Shadow.types.ts +4 -0
- package/src/__tests__/Shadow.test.tsx +83 -34
- package/src/__tests__/__snapshots__/Shadow.test.tsx.snap +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/experimental-shadow
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0d6e9c1: chore: migrate to `oxfmt`
|
|
8
|
+
- ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
|
|
9
|
+
- Updated dependencies [0d6e9c1]
|
|
10
|
+
- Updated dependencies [ac6e7af]
|
|
11
|
+
- @fluentui-react-native/pressable@0.13.1
|
|
12
|
+
- @fluentui-react-native/framework@0.15.1
|
|
13
|
+
- @fluentui-react-native/theme-types@0.44.1
|
|
14
|
+
- @fluentui-react-native/framework-base@0.3.1
|
|
15
|
+
|
|
16
|
+
## 0.7.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- d7adbdd: # Migration from Beachball to Changesets
|
|
21
|
+
|
|
22
|
+
This changeset represents the migration from Beachball to Changesets for version management and consolidates all changes from 440+ beachball change files that were in the `change/` directory.
|
|
23
|
+
|
|
24
|
+
All 75 affected packages receive a minor version bump to acknowledge the accumulated changes from the beachball era.
|
|
25
|
+
|
|
26
|
+
## What Changed
|
|
27
|
+
|
|
28
|
+
Going forward, all version management uses Changesets via `yarn changeset`. The following beachball infrastructure has been removed:
|
|
29
|
+
|
|
30
|
+
- ❌ 440+ beachball change files from `change/` directory
|
|
31
|
+
- ❌ `beachball` package dependency
|
|
32
|
+
- ❌ Beachball scripts from `package.json`
|
|
33
|
+
- ❌ `beachball.config.js` configuration file
|
|
34
|
+
- ❌ Beachball publish steps from Azure Pipelines
|
|
35
|
+
|
|
36
|
+
## New Workflow
|
|
37
|
+
|
|
38
|
+
✅ **Create changes**: Run `yarn changeset` to document changes
|
|
39
|
+
✅ **Version bump PRs**: Automatically created by GitHub Actions
|
|
40
|
+
✅ **Publishing**: Handled by Azure Pipelines using `changeset publish`
|
|
41
|
+
✅ **Validation**: CI validates changesets and blocks major version bumps
|
|
42
|
+
|
|
43
|
+
For details, see `CHANGESETS_SETUP.md` and `CONTRIBUTING.md`.
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- d1d8c26: We were pinning @types/react and react-native-macos via resolutions. This fixes that which uncovered a bunch of type inconsistencies that needed to be addressed.
|
|
48
|
+
- Updated dependencies [d7adbdd]
|
|
49
|
+
- Updated dependencies [d1d8c26]
|
|
50
|
+
- @fluentui-react-native/framework@0.15.0
|
|
51
|
+
- @fluentui-react-native/framework-base@0.3.0
|
|
52
|
+
- @fluentui-react-native/pressable@0.13.0
|
|
53
|
+
- @fluentui-react-native/theme-types@0.44.0
|
|
54
|
+
|
|
3
55
|
<!-- This log was last generated on Tue, 05 Aug 2025 18:50:43 GMT and should not be manually modified. -->
|
|
4
56
|
|
|
5
57
|
<!-- Start content -->
|
package/SPEC.md
CHANGED
|
@@ -33,7 +33,7 @@ Examples adding some Shadows to a Button:
|
|
|
33
33
|
</Shadow>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
For more examples of using Shadow, please see the [ShadowTest test page](https://github.com/microsoft/fluentui-react-native/tree/main/apps/
|
|
36
|
+
For more examples of using Shadow, please see the [ShadowTest test page](https://github.com/microsoft/fluentui-react-native/tree/main/apps/tester-core/src/TestComponents/Shadow) in the [Fluent Tester app](https://github.com/microsoft/fluentui-react-native/blob/main/apps/fluent-tester/README.md).
|
|
37
37
|
|
|
38
38
|
For an example of adding a Shadow as a slot to a Fluent component, please see the [FAB component](https://github.com/microsoft/fluentui-react-native/tree/main/packages/components/Button/src/FAB) - this component exists on both iOS and Android, but currently only the iOS version uses the Shadow component. The [Notification component](https://github.com/microsoft/fluentui-react-native/tree/main/packages/components/Notification) is another example that uses the Shadow component.
|
|
39
39
|
|
package/lib/Shadow.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ShadowProps } from './Shadow.types';
|
|
2
|
-
export declare const Shadow: import("@fluentui-react-native/framework").
|
|
2
|
+
export declare const Shadow: import("@fluentui-react-native/framework-base").FunctionComponent<ShadowProps>;
|
|
3
3
|
export default Shadow;
|
|
4
4
|
//# sourceMappingURL=Shadow.d.ts.map
|
package/lib/Shadow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,eAAO,MAAM,MAAM,gFAiBjB,CAAC;AA6HH,eAAe,MAAM,CAAC"}
|
package/lib/Shadow.js
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
|
-
import { mergeProps,
|
|
4
|
-
import { memoize } from '@fluentui-react-native/framework';
|
|
4
|
+
import { memoize, mergeProps, phasedComponent, directComponent } from '@fluentui-react-native/framework-base';
|
|
5
5
|
import { shadowName } from './Shadow.types';
|
|
6
6
|
import { getShadowTokenStyleSet } from './shadowStyle';
|
|
7
|
-
export const Shadow =
|
|
8
|
-
return (final
|
|
7
|
+
export const Shadow = phasedComponent((props) => {
|
|
8
|
+
return directComponent((final) => {
|
|
9
|
+
const { children, ...rest } = final;
|
|
9
10
|
if (!props.shadowToken) {
|
|
10
|
-
return
|
|
11
|
+
return _jsx(_Fragment, { children: children });
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
const child = childrenArray[0];
|
|
14
|
-
if (__DEV__) {
|
|
15
|
-
if (childrenArray.length !== 1) {
|
|
16
|
-
console.warn('Shadow must only have one child');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const { style: childStyle, ...restOfChildProps } = child.props;
|
|
13
|
+
const { style: childStyle, ...restOfChildProps } = children.props;
|
|
20
14
|
const shadowViewStyleProps = getStylePropsForShadowViews(childStyle, props.shadowToken);
|
|
21
15
|
const innerShadowViewProps = mergeProps(restOfChildProps, shadowViewStyleProps.inner);
|
|
22
|
-
const outerShadowViewProps = mergeProps(
|
|
23
|
-
const childWithInnerShadow = React.cloneElement(
|
|
24
|
-
return
|
|
25
|
-
};
|
|
16
|
+
const outerShadowViewProps = mergeProps(rest, shadowViewStyleProps.outer);
|
|
17
|
+
const childWithInnerShadow = React.cloneElement(children, innerShadowViewProps);
|
|
18
|
+
return _jsx(View, { ...outerShadowViewProps, children: childWithInnerShadow });
|
|
19
|
+
});
|
|
26
20
|
});
|
|
27
21
|
const getStylePropsForShadowViews = memoize(getStylePropsForShadowViewsWorker);
|
|
28
22
|
function getStylePropsForShadowViewsWorker(childStyleProps = {}, shadowToken) {
|
package/lib/Shadow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAI9G,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC;IAC5D,OAAO,eAAe,CAAc,CAAC,KAAkB,EAAE,EAAE,CAAC;QAC1D,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,OAAO,4BAAG,QAAQ,GAAI,CAAC;QACzB,CAAC;QAED,MAAM,EAA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AC,MAAM,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAAA,CAC5D,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC;AAEhC,eAAe,MAAM,CAAC"}
|
package/lib/Shadow.types.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { ViewProps } from 'react-native';
|
|
2
3
|
import type { ShadowToken } from '@fluentui-react-native/theme-types';
|
|
3
4
|
export declare const shadowName = "Shadow";
|
|
4
5
|
export interface ShadowProps extends ViewProps {
|
|
5
6
|
shadowToken?: ShadowToken;
|
|
7
|
+
/** Exactly one child */
|
|
8
|
+
children: React.ReactElement;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=Shadow.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.types.d.ts","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Shadow.types.d.ts","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B"}
|
package/lib/Shadow.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.types.js","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Shadow.types.js","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { act } from 'react';
|
|
2
3
|
import { Text, View } from 'react-native';
|
|
3
4
|
import { mergeStyles, useFluentTheme } from '@fluentui-react-native/framework';
|
|
4
5
|
import { Pressable } from '@fluentui-react-native/pressable';
|
|
@@ -7,23 +8,17 @@ import { Shadow } from '../Shadow';
|
|
|
7
8
|
const backgroundColor = { backgroundColor: 'red' };
|
|
8
9
|
const TestShadow = (props) => {
|
|
9
10
|
const theme = useFluentTheme();
|
|
10
|
-
return (
|
|
11
|
-
React.createElement(View, { style: backgroundColor },
|
|
12
|
-
React.createElement(Text, null, props.displayText))));
|
|
11
|
+
return (_jsx(Shadow, { shadowToken: theme.shadows[props.depth], children: _jsx(View, { style: backgroundColor, children: _jsx(Text, { children: props.displayText }) }) }));
|
|
13
12
|
};
|
|
14
13
|
const TestPressableWithAndWithoutShadow = () => {
|
|
15
14
|
const theme = useFluentTheme();
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
React.createElement(View, null,
|
|
20
|
-
React.createElement(Pressable, { style: backgroundColor }))));
|
|
15
|
+
return (_jsxs(View, { children: [
|
|
16
|
+
_jsx(Shadow, { shadowToken: theme.shadows['shadow16'], children: _jsx(Pressable, { style: backgroundColor }) }), _jsx(View, { children: _jsx(Pressable, { style: backgroundColor }) })
|
|
17
|
+
] }));
|
|
21
18
|
};
|
|
22
19
|
const TestShadowOnChildViewWithProps = (props) => {
|
|
23
20
|
const theme = useFluentTheme();
|
|
24
|
-
return (
|
|
25
|
-
React.createElement(View, { style: mergeStyles(props.childViewStyleProps, backgroundColor) },
|
|
26
|
-
React.createElement(Text, null, JSON.stringify(props.childViewStyleProps)))));
|
|
21
|
+
return (_jsx(Shadow, { shadowToken: theme.shadows['shadow16'], children: _jsx(View, { style: mergeStyles(props.childViewStyleProps, backgroundColor), children: _jsx(Text, { children: JSON.stringify(props.childViewStyleProps) }) }) }));
|
|
27
22
|
};
|
|
28
23
|
describe('Shadow component tests', () => {
|
|
29
24
|
beforeAll(() => {
|
|
@@ -33,68 +28,116 @@ describe('Shadow component tests', () => {
|
|
|
33
28
|
}));
|
|
34
29
|
});
|
|
35
30
|
it('Shadow (depth=2)', () => {
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
let component;
|
|
32
|
+
act(() => {
|
|
33
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=2)", depth: "shadow2" }));
|
|
34
|
+
});
|
|
35
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
38
36
|
});
|
|
39
37
|
it('Shadow (depth=4)', () => {
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
let component;
|
|
39
|
+
act(() => {
|
|
40
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=4)", depth: "shadow4" }));
|
|
41
|
+
});
|
|
42
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
42
43
|
});
|
|
43
44
|
it('Shadow (depth=8)', () => {
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
let component;
|
|
46
|
+
act(() => {
|
|
47
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=8)", depth: "shadow8" }));
|
|
48
|
+
});
|
|
49
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
46
50
|
});
|
|
47
51
|
it('Shadow (depth=16)', () => {
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
let component;
|
|
53
|
+
act(() => {
|
|
54
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=16)", depth: "shadow16" }));
|
|
55
|
+
});
|
|
56
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
50
57
|
});
|
|
51
58
|
it('Shadow (depth=28)', () => {
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
let component;
|
|
60
|
+
act(() => {
|
|
61
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=28)", depth: "shadow28" }));
|
|
62
|
+
});
|
|
63
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
54
64
|
});
|
|
55
65
|
it('Shadow (depth=64)', () => {
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
let component;
|
|
67
|
+
act(() => {
|
|
68
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Shadow (depth=64)", depth: "shadow64" }));
|
|
69
|
+
});
|
|
70
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
58
71
|
});
|
|
59
72
|
it('Brand shadow (depth=2)', () => {
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
let component;
|
|
74
|
+
act(() => {
|
|
75
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=2)", depth: "shadow2brand" }));
|
|
76
|
+
});
|
|
77
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
62
78
|
});
|
|
63
79
|
it('Brand shadow (depth=4)', () => {
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
let component;
|
|
81
|
+
act(() => {
|
|
82
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=4)", depth: "shadow4brand" }));
|
|
83
|
+
});
|
|
84
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
66
85
|
});
|
|
67
86
|
it('Brand shadow (depth=8)', () => {
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
let component;
|
|
88
|
+
act(() => {
|
|
89
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=8)", depth: "shadow8brand" }));
|
|
90
|
+
});
|
|
91
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
70
92
|
});
|
|
71
93
|
it('Brand shadow (depth=16)', () => {
|
|
72
|
-
|
|
73
|
-
|
|
94
|
+
let component;
|
|
95
|
+
act(() => {
|
|
96
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=16)", depth: "shadow16brand" }));
|
|
97
|
+
});
|
|
98
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
74
99
|
});
|
|
75
100
|
it('Brand shadow (depth=28)', () => {
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
let component;
|
|
102
|
+
act(() => {
|
|
103
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=28)", depth: "shadow28brand" }));
|
|
104
|
+
});
|
|
105
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
78
106
|
});
|
|
79
107
|
it('Brand shadow (depth=64)', () => {
|
|
80
|
-
|
|
81
|
-
|
|
108
|
+
let component;
|
|
109
|
+
act(() => {
|
|
110
|
+
component = renderer.create(_jsx(TestShadow, { displayText: "Brand shadow (depth=64)", depth: "shadow64brand" }));
|
|
111
|
+
});
|
|
112
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
82
113
|
});
|
|
83
114
|
it('Pressable that has a shadow vs. pressable without shadow', () => {
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
let component;
|
|
116
|
+
act(() => {
|
|
117
|
+
component = renderer.create(_jsx(TestPressableWithAndWithoutShadow, {}));
|
|
118
|
+
});
|
|
119
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
86
120
|
});
|
|
87
121
|
it('Shadow on a child with margin and padding', () => {
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
let component;
|
|
123
|
+
act(() => {
|
|
124
|
+
component = renderer.create(_jsx(TestShadowOnChildViewWithProps, { childViewStyleProps: { margin: 2, padding: 2 } }));
|
|
125
|
+
});
|
|
126
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
90
127
|
});
|
|
91
128
|
it('Shadow on a child with border radius', () => {
|
|
92
|
-
|
|
93
|
-
|
|
129
|
+
let component;
|
|
130
|
+
act(() => {
|
|
131
|
+
component = renderer.create(_jsx(TestShadowOnChildViewWithProps, { childViewStyleProps: { borderRadius: 2 } }));
|
|
132
|
+
});
|
|
133
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
94
134
|
});
|
|
95
135
|
it('Shadow on a child with border width', () => {
|
|
96
|
-
|
|
97
|
-
|
|
136
|
+
let component;
|
|
137
|
+
act(() => {
|
|
138
|
+
component = renderer.create(_jsx(TestShadowOnChildViewWithProps, { childViewStyleProps: { borderWidth: 2 } }));
|
|
139
|
+
});
|
|
140
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
98
141
|
});
|
|
99
142
|
afterAll(() => {
|
|
100
143
|
jest.unmock('react-native/Libraries/Utilities/Platform');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.test.js","sourceRoot":"","sources":["../../src/__tests__/Shadow.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Shadow.test.js","sourceRoot":"","sources":["../../src/__tests__/Shadow.test.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,eAAe,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AAMnD,MAAM,UAAU,GAA6C,CAAC,KAAsB,EAAE,EAAE,CAAC;IACv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,EAAE,aAAa,CAAC,IAAI,GAAG,oBAAoB;YACvD,YAAY,EAAE;gBACZ,KAAK,EAAE,aAAa,CAAC,CAAC;gBACtB,MAAM,EAAE,aAAa,CAAC,CAAC;aACxB;SACF;KACF,CAAC;AAAA,CACH;AAED,MAAM,wBAAwB,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC;IAC1D,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAAA,CAC7C,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC;IAC5D,MAAM,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;IAEtD,8BAA8B;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAAA,CACjD,CAAC"}
|
package/lib-commonjs/Shadow.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ShadowProps } from './Shadow.types';
|
|
2
|
-
export declare const Shadow: import("@fluentui-react-native/framework").
|
|
2
|
+
export declare const Shadow: import("@fluentui-react-native/framework-base").FunctionComponent<ShadowProps>;
|
|
3
3
|
export default Shadow;
|
|
4
4
|
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,eAAO,MAAM,MAAM,gFAiBjB,CAAC;AA6HH,eAAe,MAAM,CAAC"}
|
package/lib-commonjs/Shadow.js
CHANGED
|
@@ -15,42 +15,46 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Shadow = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
38
|
const React = __importStar(require("react"));
|
|
28
39
|
const react_native_1 = require("react-native");
|
|
29
|
-
const
|
|
30
|
-
const framework_2 = require("@fluentui-react-native/framework");
|
|
40
|
+
const framework_base_1 = require("@fluentui-react-native/framework-base");
|
|
31
41
|
const Shadow_types_1 = require("./Shadow.types");
|
|
32
42
|
const shadowStyle_1 = require("./shadowStyle");
|
|
33
|
-
exports.Shadow = (0,
|
|
34
|
-
return (
|
|
43
|
+
exports.Shadow = (0, framework_base_1.phasedComponent)((props) => {
|
|
44
|
+
return (0, framework_base_1.directComponent)((final) => {
|
|
45
|
+
const { children, ...rest } = final;
|
|
35
46
|
if (!props.shadowToken) {
|
|
36
|
-
return
|
|
47
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: children });
|
|
37
48
|
}
|
|
38
|
-
const
|
|
39
|
-
const child = childrenArray[0];
|
|
40
|
-
if (__DEV__) {
|
|
41
|
-
if (childrenArray.length !== 1) {
|
|
42
|
-
console.warn('Shadow must only have one child');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const { style: childStyle, ...restOfChildProps } = child.props;
|
|
49
|
+
const { style: childStyle, ...restOfChildProps } = children.props;
|
|
46
50
|
const shadowViewStyleProps = getStylePropsForShadowViews(childStyle, props.shadowToken);
|
|
47
|
-
const innerShadowViewProps = (0,
|
|
48
|
-
const outerShadowViewProps = (0,
|
|
49
|
-
const childWithInnerShadow = React.cloneElement(
|
|
50
|
-
return
|
|
51
|
-
};
|
|
51
|
+
const innerShadowViewProps = (0, framework_base_1.mergeProps)(restOfChildProps, shadowViewStyleProps.inner);
|
|
52
|
+
const outerShadowViewProps = (0, framework_base_1.mergeProps)(rest, shadowViewStyleProps.outer);
|
|
53
|
+
const childWithInnerShadow = React.cloneElement(children, innerShadowViewProps);
|
|
54
|
+
return jsx_runtime_1.jsx(react_native_1.View, { ...outerShadowViewProps, children: childWithInnerShadow });
|
|
55
|
+
});
|
|
52
56
|
});
|
|
53
|
-
const getStylePropsForShadowViews = (0,
|
|
57
|
+
const getStylePropsForShadowViews = (0, framework_base_1.memoize)(getStylePropsForShadowViewsWorker);
|
|
54
58
|
function getStylePropsForShadowViewsWorker(childStyleProps = {}, shadowToken) {
|
|
55
59
|
const shadowTokenStyleSet = (0, shadowStyle_1.getShadowTokenStyleSet)(shadowToken);
|
|
56
60
|
if (__DEV__) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../src/Shadow.tsx"],"names":[],"mappings":"
|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QAEN,GAAG,mBAAmB,CAAC,OAAO;QAC9B,GAAG,qBAAqB;KACzB,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;AAAA,CACvE;AAED,SAAS,gBAAgB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;IAC9C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,MAAM,CAAC;AAAA,CACf;AAED,MAAM,yBAAyB,GAAG,CAAC,MAAiB,EAAE,EAAE,CAAC;IACvD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAAA,CAC5D,CAAC;AAEF,QAAA,MAAM,CAAC,WAAW,GAAG,yBAAU,CAAC;kBAEjB,QAAA,MAAM"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { ViewProps } from 'react-native';
|
|
2
3
|
import type { ShadowToken } from '@fluentui-react-native/theme-types';
|
|
3
4
|
export declare const shadowName = "Shadow";
|
|
4
5
|
export interface ShadowProps extends ViewProps {
|
|
5
6
|
shadowToken?: ShadowToken;
|
|
7
|
+
/** Exactly one child */
|
|
8
|
+
children: React.ReactElement;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=Shadow.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.types.d.ts","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Shadow.types.d.ts","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shadow.types.js","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Shadow.types.js","sourceRoot":"","sources":["../src/Shadow.types.ts"],"names":[],"mappings":";;;AAKa,QAAA,UAAU,GAAG,QAAQ,CAAC"}
|