@fluentui-react-native/experimental-shadow 0.2.31 → 0.2.33

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.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@fluentui-react-native/experimental-shadow",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 18 Oct 2022 04:04:58 GMT",
5
+ "date": "Thu, 20 Oct 2022 23:15:22 GMT",
6
+ "tag": "@fluentui-react-native/experimental-shadow_v0.2.33",
7
+ "version": "0.2.33",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "78454019+lyzhan7@users.noreply.github.com",
12
+ "package": "@fluentui-react-native/experimental-shadow",
13
+ "commit": "919157eea517674033ee0226391eda0eb1626642",
14
+ "comment": "Update spec: why shadow component is different"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 20 Oct 2022 18:30:02 GMT",
21
+ "tag": "@fluentui-react-native/experimental-shadow_v0.2.32",
22
+ "version": "0.2.32",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui-react-native/experimental-shadow",
28
+ "comment": "Bump @fluentui-react-native/pressable to v0.9.23",
29
+ "commit": "9e827dde137238cae829145564cbc880bbdc5a90"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Tue, 18 Oct 2022 04:06:27 GMT",
6
36
  "tag": "@fluentui-react-native/experimental-shadow_v0.2.31",
7
37
  "version": "0.2.31",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @fluentui-react-native/experimental-shadow
2
2
 
3
- This log was last generated on Tue, 18 Oct 2022 04:04:58 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 20 Oct 2022 23:15:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.2.33
8
+
9
+ Thu, 20 Oct 2022 23:15:22 GMT
10
+
11
+ ### Patches
12
+
13
+ - Update spec: why shadow component is different (78454019+lyzhan7@users.noreply.github.com)
14
+
15
+ ## 0.2.32
16
+
17
+ Thu, 20 Oct 2022 18:30:02 GMT
18
+
19
+ ### Patches
20
+
21
+ - Bump @fluentui-react-native/pressable to v0.9.23
22
+
7
23
  ## 0.2.31
8
24
 
9
- Tue, 18 Oct 2022 04:04:58 GMT
25
+ Tue, 18 Oct 2022 04:06:27 GMT
10
26
 
11
27
  ### Patches
12
28
 
package/SPEC.md CHANGED
@@ -6,6 +6,8 @@ A `Shadow` is a component that can be used to add Fluent shadows to other compon
6
6
 
7
7
  Shadows defined in the Fluent design system are actually comprised of two shadows. The **key shadow** is used to create a feeling of distance, and the **ambient shadow** is used to define the edges of the shape.
8
8
 
9
+ The `Shadow` component is different from other components in that it was created to address limitations with React Native - Views in React Native can only have one Shadow set at a time. This component provides an easy way to add a Fluent shadow to another component.
10
+
9
11
  ## Shadow Depth Ramp
10
12
 
11
13
  These are the current `Shadow` variants:
@@ -17,17 +19,17 @@ These are the current `Shadow` variants:
17
19
 
18
20
  ## Sample Code
19
21
 
20
- Examples adding some Shadows to some text:
22
+ Examples adding some Shadows to a Button:
21
23
 
22
24
  ```tsx
23
25
  <Shadow shadowToken={theme.shadows.shadow8}>
24
- <Text>Text box with shadow8</Text>
26
+ <Button>Text box with shadow8</Button>
25
27
  </Shadow>
26
28
  ```
27
29
 
28
30
  ```tsx
29
31
  <Shadow shadowToken={theme.shadows.shadow8brand}>
30
- <Text>Text box with shadow8brand</Text>
32
+ <Button>Text box with shadow8brand</Button>
31
33
  </Shadow>
32
34
  ```
33
35
 
@@ -44,6 +46,11 @@ If `undefined` is passed into the `shadowToken` prop, no shadow will be rendered
44
46
 
45
47
  `Shadow` must take exactly one child, which must be of type View.
46
48
 
49
+ ## Implementation details
50
+
51
+ In order to get around the React Native restriction of one Shadow per View, the Shadow component adds an extra View around the original View. One of the shadows is placed on the original View and the other is placed on the extra View. The Shadow component smartly extracts the original View's style props so that the extra View isn't noticable (ex. will always be the same size as the original View, padding/margins are set correctly, etc.)
52
+
47
53
  ## Notes
48
54
 
49
55
  - Known issue: there may be some slight rounding discrepancies due to hex to decimal rounding errors, ex. opacity 0.24 may end up at 0.25.
56
+ - One additional adjustment that was needed on Apple platforms was to divide the blur radius token value by 2. This was needed because shadow blur/radius looks different across platforms - more information here: https://github.com/microsoft/apple-ux-guide/blob/gh-pages/Shadows.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/experimental-shadow",
3
- "version": "0.2.31",
3
+ "version": "0.2.33",
4
4
  "description": "A cross-platform Shadow component using the Fluent Design System",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@fluentui-react-native/framework": "0.8.12",
26
- "@fluentui-react-native/pressable": "0.9.22",
26
+ "@fluentui-react-native/pressable": "0.9.23",
27
27
  "@fluentui-react-native/theme-types": "0.22.0"
28
28
  },
29
29
  "devDependencies": {