@artsy/palette-mobile 13.1.0 → 13.1.2

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.
@@ -1,9 +1,15 @@
1
- import { View, ViewProps } from "react-native";
1
+ import { View, ViewProps, ViewStyle } from "react-native";
2
2
  import { BorderProps, ColorProps, FlexboxProps, LayoutProps, PositionProps, SpaceProps, TextAlignProps } from "styled-system";
3
3
  import { ColorsTheme, SpacingUnitsTheme } from "../../tokens";
4
- export interface BoxProps extends ViewProps, SpaceProps<SpacingUnitsTheme>, Omit<ColorProps<ColorsTheme>, "color">, FlexboxProps, LayoutProps, PositionProps, BorderProps, TextAlignProps {
4
+ type GapProps = {
5
+ gap?: ViewStyle["gap"];
6
+ rowGap?: ViewStyle["rowGap"];
7
+ columnGap?: ViewStyle["columnGap"];
8
+ };
9
+ export interface BoxProps extends ViewProps, SpaceProps<SpacingUnitsTheme>, Omit<ColorProps<ColorsTheme>, "color">, FlexboxProps, LayoutProps, PositionProps, BorderProps, GapProps, TextAlignProps {
5
10
  }
6
11
  /**
7
12
  * Box is just a `View` with common styled-system props.
8
13
  */
9
14
  export declare const Box: import("styled-components").StyledComponent<typeof View, any, BoxProps, never>;
15
+ export {};
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { View } from "react-native";
3
- import { BoxProps } from "../Box";
4
3
  declare const _default: {
5
4
  title: string;
6
- component: import("styled-components").StyledComponent<typeof View, any, BoxProps, never>;
5
+ component: import("styled-components").StyledComponent<typeof View, any, import("./Box").BoxProps, never>;
7
6
  };
8
7
  export default _default;
9
8
  export declare const Styled: () => JSX.Element;
10
9
  export declare const RegularViewProps: () => JSX.Element;
10
+ export declare const GapProps: () => JSX.Element;
@@ -1,18 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegularViewProps = exports.Styled = void 0;
3
+ exports.GapProps = exports.RegularViewProps = exports.Styled = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const helpers_1 = require("../../storybook/helpers");
7
7
  const Box_1 = require("../Box");
8
+ const Flex_1 = require("../Flex");
9
+ const Spacer_1 = require("../Spacer");
10
+ const Text_1 = require("../Text");
8
11
  exports.default = {
9
12
  title: "Box",
10
13
  component: Box_1.Box,
11
14
  };
12
- const Styled = () => ((0, jsx_runtime_1.jsx)(helpers_1.List, { style: { marginLeft: 50 }, contentContainerStyle: { alignItems: "flex-start" }, children: (0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, backgroundColor: "blue100", flexDirection: "row", height: 30, top: 2, borderBottomWidth: 1, textAlign: "center" }) }));
15
+ const Styled = () => ((0, jsx_runtime_1.jsx)(helpers_1.List, { style: { marginLeft: 50 }, contentContainerStyle: { alignItems: "flex-start" }, children: (0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, backgroundColor: "blue100", flexDirection: "row", height: 300, width: 200, top: 2, borderBottomWidth: 1, textAlign: "center" }) }));
13
16
  exports.Styled = Styled;
14
17
  const RegularViewProps = () => {
15
18
  const r = (0, react_1.useRef)(null);
16
- return ((0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, backgroundColor: "red100", onLayout: (e) => console.log(e.nativeEvent.layout), ref: r }));
19
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, children: (0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, height: 200, width: 200, backgroundColor: "red100", onLayout: (e) => console.log(e.nativeEvent.layout), ref: r }) }));
17
20
  };
18
21
  exports.RegularViewProps = RegularViewProps;
22
+ const colors = ["red10", "green10", "yellow10", "devpurple", "red100", "black10"];
23
+ const GapProps = () => ((0, jsx_runtime_1.jsxs)(helpers_1.List, { style: { marginHorizontal: 20 }, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: "Gap \uD83D\uDC47" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { borderWidth: 1, borderColor: "black100", gap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => ((0, jsx_runtime_1.jsx)(Box_1.Box, { backgroundColor: color, width: 100, height: 100, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { children: color }) }, `${color}-1`))) }), (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "Row gap \uD83D\uDC47" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { borderWidth: 1, borderColor: "black100", rowGap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => ((0, jsx_runtime_1.jsx)(Box_1.Box, { backgroundColor: color, width: 100, height: 100, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { children: color }) }, `${color}-2`))) }), (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "Column gap \uD83D\uDC47" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { borderWidth: 1, borderColor: "black100", columnGap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => ((0, jsx_runtime_1.jsx)(Box_1.Box, { backgroundColor: color, width: 100, height: 100, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { children: color }) }, `${color}-3`))) }), (0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { y: 6 })] }));
24
+ exports.GapProps = GapProps;
@@ -9,7 +9,7 @@ const Text_1 = require("../Text");
9
9
  const TabsWithHeader = ({ children, BelowTitleHeaderComponent, headerProps = {}, showLargeHeaderText = true, title, ...rest }) => {
10
10
  const showTitle = showLargeHeaderText && !!title;
11
11
  return ((0, jsx_runtime_1.jsxs)(Screen_1.Screen, { children: [(0, jsx_runtime_1.jsx)(Screen_1.Screen.AnimatedHeader, { title: title, ...headerProps }), (0, jsx_runtime_1.jsx)(Screen_1.Screen.Body, { fullwidth: true, children: (0, jsx_runtime_1.jsx)(TabsContainer_1.TabsContainer, { ...rest, renderHeader: () => {
12
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!showTitle && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { my: 1, pl: 2, justifyContent: "center", pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display", numberOfLines: 2, children: title }) })), !!BelowTitleHeaderComponent && (0, jsx_runtime_1.jsx)(BelowTitleHeaderComponent, {})] }));
12
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!showTitle && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { my: 1, px: 2, justifyContent: "center", pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display", numberOfLines: 2, children: title }) })), !!BelowTitleHeaderComponent && (0, jsx_runtime_1.jsx)(BelowTitleHeaderComponent, {})] }));
13
13
  }, children: children }) })] }));
14
14
  };
15
15
  exports.TabsWithHeader = TabsWithHeader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "13.1.0",
3
+ "version": "13.1.2",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "RCT_METRO_PORT=8082 react-native run-android --port 8082",