@momo-kits/foundation 0.169.18-beta.1 → 0.169.18-beta.3

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.
@@ -81,16 +81,14 @@ describe('getFooterGeometry', () => {
81
81
  const input = { ...duoOuter, insetLeft: 84, insetRight: 0, ...ANCHORED };
82
82
  expect(getFooterGeometry(input)).toMatchObject({
83
83
  barMargin: { left: 84, right: 0 },
84
- contentPadding: { left: 0, right: 0 },
85
84
  });
86
85
  });
87
86
 
88
- it('spans the anchored bar over the window, its content inside the insets', () => {
87
+ it('spans the anchored bar and centers its content on the window', () => {
89
88
  expect(getFooterGeometry({ ...DUO_INNER, ...ANCHORED })).toEqual({
90
89
  kind: 'anchored',
91
90
  width: 758,
92
91
  barMargin: { left: 0, right: 0 },
93
- contentPadding: { left: 84, right: 34 },
94
92
  });
95
93
  });
96
94
 
@@ -99,7 +97,6 @@ describe('getFooterGeometry', () => {
99
97
  kind: 'sheet',
100
98
  width: 758,
101
99
  barMargin: { left: 0, right: 0 },
102
- contentPadding: { left: 0, right: 0 },
103
100
  });
104
101
  });
105
102
  });
@@ -29,10 +29,6 @@ type FooterGeometry = {
29
29
  * iPhone Duo side column, the foldable bar and sheet are laid on the window.
30
30
  */
31
31
  barMargin: HorizontalInsets;
32
- /**
33
- * Padding inside the anchored bar that keeps its content clear of the side column.
34
- */
35
- contentPadding: HorizontalInsets;
36
32
  };
37
33
 
38
34
  type DesignSystemContext = {
@@ -124,7 +120,6 @@ const getFooterGeometry = ({
124
120
  kind: 'phone',
125
121
  width: contentWidth,
126
122
  barMargin: contentInsets,
127
- contentPadding: NO_INSETS,
128
123
  };
129
124
  }
130
125
 
@@ -140,15 +135,10 @@ const getFooterGeometry = ({
140
135
  kind: 'sheet',
141
136
  width: footerWidth,
142
137
  barMargin: NO_INSETS,
143
- contentPadding: NO_INSETS,
144
138
  };
145
139
  }
146
- return {
147
- kind: 'anchored',
148
- width: footerWidth,
149
- barMargin: NO_INSETS,
150
- contentPadding: contentInsets,
151
- };
140
+ // Figma centers the anchored content on the window too, side column included
141
+ return { kind: 'anchored', width: footerWidth, barMargin: NO_INSETS };
152
142
  };
153
143
 
154
144
  /**
@@ -252,7 +242,7 @@ const ScreenFooter = ({
252
242
  bottomSpace = duoTabInset;
253
243
  }
254
244
 
255
- const { kind, barMargin, contentPadding } = layout;
245
+ const { kind, barMargin } = layout;
256
246
  const hasBarMargin = barMargin.left > 0 || barMargin.right > 0;
257
247
 
258
248
  // one view tree for every kind, so folding keeps the footer content's state
@@ -260,10 +250,10 @@ const ScreenFooter = ({
260
250
  hasBarMargin && styles.footerClip,
261
251
  { marginLeft: barMargin.left, marginRight: barMargin.right },
262
252
  ];
253
+ const configured = context?.designSystemConfig?.config?.footerSeparator;
254
+ const resolved = getFooterSeparator(separator, configured);
263
255
  let surfaceStyle: StyleProp<ViewStyle> = styles.shadow;
264
256
  if (kind === 'anchored') {
265
- const configured = context?.designSystemConfig?.config?.footerSeparator;
266
- const resolved = getFooterSeparator(separator, configured);
267
257
  const separatorStyle = getSeparatorStyle(
268
258
  resolved,
269
259
  theme.colors.border.default,
@@ -272,7 +262,13 @@ const ScreenFooter = ({
272
262
  }
273
263
  if (kind === 'sheet') {
274
264
  containerStyle = [containerStyle, { marginTop: -layout.overlap }];
275
- surfaceStyle = [styles.footerSheet, { width: layout.width }];
265
+ // the sheet has no top line; `shadow` gives it the phone footer shadow
266
+ const hasShadow = resolved === 'shadow';
267
+ surfaceStyle = [
268
+ styles.footerSheet,
269
+ hasShadow && styles.shadow,
270
+ { width: layout.width },
271
+ ];
276
272
  }
277
273
  let surfaceColor: string | undefined;
278
274
  if (layout.hasSurface) {
@@ -289,8 +285,6 @@ const ScreenFooter = ({
289
285
  style={[
290
286
  surfaceStyle,
291
287
  {
292
- paddingLeft: contentPadding.left,
293
- paddingRight: contentPadding.right,
294
288
  paddingBottom: bottomSpace + Spacing.S,
295
289
  backgroundColor: surfaceColor,
296
290
  },
@@ -74,10 +74,10 @@ export interface ScreenProps extends ViewProps {
74
74
  footerStyle?: ScreenFooterStyle;
75
75
 
76
76
  /**
77
- * Optional. Top edge of the `anchored` footer on foldables: `border`, a 1pt line, or
78
- * `shadow`, the phone footer's shadow. Defaults to the host's design system config
79
- * (`footerSeparator`), else `border`. Phones keep their shadow; an image background
80
- * draws neither.
77
+ * Optional. Top edge of the footer on foldables: `border`, a 1pt line on the
78
+ * `anchored` bar (none on a `sheet`), or `shadow`, the phone footer's shadow on
79
+ * either. Defaults to the host's design system config (`footerSeparator`), else
80
+ * `border`. Phones keep their shadow; an image background draws neither.
81
81
  */
82
82
  footerSeparator?: ScreenFooterSeparator;
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.169.18-beta.1",
3
+ "version": "0.169.18-beta.3",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},