@artsy/palette-mobile 19.15.1 → 20.0.0--canary.399.4691.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/dist/elements/Avatar/Avatar.stories.d.ts +9 -7
- package/dist/elements/Avatar/Avatar.stories.js +45 -4
- package/dist/elements/BorderBox/BorderBox.d.ts +3 -1
- package/dist/elements/Box/Box.d.ts +1 -1
- package/dist/elements/Box/Box.stories.d.ts +1 -1
- package/dist/elements/Checkbox/Checkbox.d.ts +1 -1
- package/dist/elements/Input/helpers.d.ts +1 -1
- package/dist/elements/Pill/Pill.d.ts +2 -2
- package/dist/elements/Radio/RadioButton.d.ts +1 -1
- package/dist/elements/Separator/Separator.d.ts +1 -1
- package/dist/elements/Separator/Separator.stories.d.ts +1 -1
- package/dist/elements/Separator/ShadowSeparator.d.ts +3 -1
- package/dist/storybook/decorators.js +3 -2
- package/package.json +6 -6
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare
|
|
1
|
+
import { Avatar } from "./Avatar";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: Meta<typeof Avatar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type AvatarStory = StoryObj<typeof Avatar>;
|
|
6
|
+
export declare const Default: AvatarStory;
|
|
7
|
+
export declare const WithImage: AvatarStory;
|
|
8
|
+
export declare const WithInitials: AvatarStory;
|
|
9
|
+
export declare const Variants: AvatarStory;
|
|
@@ -1,11 +1,52 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar } from "./Avatar";
|
|
3
3
|
import { List, Row } from "../../storybook/helpers";
|
|
4
|
-
|
|
4
|
+
const meta = {
|
|
5
5
|
title: "Avatar",
|
|
6
6
|
component: Avatar,
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["xxs", "xs", "sm", "md"],
|
|
11
|
+
description: "The size of the Avatar",
|
|
12
|
+
},
|
|
13
|
+
initials: {
|
|
14
|
+
control: { type: "text" },
|
|
15
|
+
description: "If an image is missing, show initials instead",
|
|
16
|
+
},
|
|
17
|
+
src: {
|
|
18
|
+
control: { type: "text" },
|
|
19
|
+
description: "URL of the avatar image",
|
|
20
|
+
},
|
|
21
|
+
blurhash: {
|
|
22
|
+
control: { type: "text" },
|
|
23
|
+
description: "Blurhash string for the image placeholder",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
7
26
|
};
|
|
27
|
+
export default meta;
|
|
8
28
|
const sizes = ["md", "sm", "xs", "xxs"];
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
export const Default = {
|
|
30
|
+
args: {
|
|
31
|
+
initials: "AB",
|
|
32
|
+
size: "md",
|
|
33
|
+
},
|
|
34
|
+
render: (args) => _jsx(Avatar, { ...args }),
|
|
35
|
+
};
|
|
36
|
+
export const WithImage = {
|
|
37
|
+
args: {
|
|
38
|
+
src: "https://placekitten.com/300/300",
|
|
39
|
+
size: "md",
|
|
40
|
+
},
|
|
41
|
+
render: (args) => _jsx(Avatar, { ...args }),
|
|
42
|
+
};
|
|
43
|
+
export const WithInitials = {
|
|
44
|
+
args: {
|
|
45
|
+
initials: "JD",
|
|
46
|
+
size: "md",
|
|
47
|
+
},
|
|
48
|
+
render: (args) => _jsx(Avatar, { ...args }),
|
|
49
|
+
};
|
|
50
|
+
export const Variants = {
|
|
51
|
+
render: () => (_jsxs(List, { children: [_jsx(Row, { children: sizes.map((s) => (_jsx(Avatar, { initials: "A", size: s }, s))) }), _jsx(Row, { children: sizes.map((s) => (_jsx(Avatar, { initials: "AA", size: s }, s))) }), _jsx(Row, { children: sizes.map((s) => (_jsx(Avatar, { src: "https://placekitten.com/300/300", size: s }, s))) })] })),
|
|
52
|
+
};
|
|
@@ -8,4 +8,6 @@ export interface BorderBoxProps extends FlexProps, BorderProps, SpaceProps<Spaci
|
|
|
8
8
|
* A `View` or `div` (depending on the platform) that has a common border
|
|
9
9
|
* and padding set by default
|
|
10
10
|
*/
|
|
11
|
-
export declare const BorderBox: import("styled-components").
|
|
11
|
+
export declare const BorderBox: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<Omit<import("..").BoxProps & import("react").RefAttributes<import("react-native").View>, "ref"> & {
|
|
12
|
+
ref?: import("react").Ref<import("react-native").View>;
|
|
13
|
+
}, BorderBoxProps>>;
|
|
@@ -12,5 +12,5 @@ export interface BoxProps extends ViewProps, SpaceProps<SpacingUnitsTheme>, Omit
|
|
|
12
12
|
/**
|
|
13
13
|
* Box is just a `View` with common styled-system props.
|
|
14
14
|
*/
|
|
15
|
-
export declare const Box: import("styled-components").
|
|
15
|
+
export declare const Box: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<ViewProps & import("react").RefAttributes<View>, BoxProps>>;
|
|
16
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { View } from "react-native";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("styled-components").
|
|
4
|
+
component: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps & import("react").RefAttributes<View>, import("./Box").BoxProps>>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Styled: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,5 +16,5 @@ interface CheckMarkProps {
|
|
|
16
16
|
size: number;
|
|
17
17
|
}
|
|
18
18
|
export declare const CheckMark: ({ size }: CheckMarkProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const DisabledMark: import("styled-components").
|
|
19
|
+
export declare const DisabledMark: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<CheckMarkProps, never>>;
|
|
20
20
|
export {};
|
|
@@ -39,5 +39,5 @@ export declare const getInputState: ({ isFocused, value, }: {
|
|
|
39
39
|
export declare const getInputVariant: ({ disabled, hasError, }: {
|
|
40
40
|
disabled: boolean;
|
|
41
41
|
hasError: boolean;
|
|
42
|
-
}) => "disabled" | "
|
|
42
|
+
}) => "disabled" | "default" | "error";
|
|
43
43
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconProps } from "@artsy/icons/native";
|
|
2
2
|
import { MotiPressableProps } from "moti/interactions";
|
|
3
|
-
import {
|
|
3
|
+
import { RuleSet } from "styled-components";
|
|
4
4
|
import { FlexProps } from "../Flex";
|
|
5
5
|
export declare const PILL_VARIANT_NAMES: readonly ["badge", "default", "dotted", "filter", "profile", "search", "onboarding", "link"];
|
|
6
6
|
export type PillState = "default" | "selected" | "disabled";
|
|
@@ -18,5 +18,5 @@ export type PillProps = (FlexProps & {
|
|
|
18
18
|
src?: string;
|
|
19
19
|
});
|
|
20
20
|
export declare const Pill: React.FC<PillProps>;
|
|
21
|
-
declare const PILL_VARIANTS: Record<PillVariant, Record<PillState,
|
|
21
|
+
declare const PILL_VARIANTS: Record<PillVariant, Record<PillState, RuleSet>>;
|
|
22
22
|
export {};
|
|
@@ -22,5 +22,5 @@ interface RadioDotProps {
|
|
|
22
22
|
size: number;
|
|
23
23
|
}
|
|
24
24
|
export declare const RadioDot: ({ size }: RadioDotProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const DisabledDot: import("styled-components").
|
|
25
|
+
export declare const DisabledDot: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<RadioDotProps, never>>;
|
|
26
26
|
export {};
|
|
@@ -4,4 +4,4 @@ export interface SeparatorProps extends SpaceProps, WidthProps, BorderProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* A horizontal divider whose width and spacing can be adjusted
|
|
6
6
|
*/
|
|
7
|
-
export declare const Separator: import("styled-components").
|
|
7
|
+
export declare const Separator: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<import("styled-components/native/dist/types").Substitute<import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps, import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, SeparatorProps>, SeparatorProps>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: import("styled-components").
|
|
3
|
+
component: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<import("styled-components/native/dist/types").Substitute<import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps, import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, import("./Separator").SeparatorProps>, import("./Separator").SeparatorProps>>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Styled: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare const ShadowSeparator: import("styled-components").
|
|
1
|
+
export declare const ShadowSeparator: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<Omit<import("styled-components/native/dist/types").FastOmit<import("styled-components/native/dist/types").Substitute<import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps, import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, import("./Separator").SeparatorProps>, keyof import("./Separator").SeparatorProps> & import("./Separator").SeparatorProps, "ref"> & {
|
|
2
|
+
ref?: import("react").Ref<import("react-native").View>;
|
|
3
|
+
}, never>>;
|
|
@@ -5,7 +5,8 @@ import { Appearance } from "react-native";
|
|
|
5
5
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
6
6
|
import { Theme } from "../Theme";
|
|
7
7
|
import { Flex } from "../elements/Flex";
|
|
8
|
-
import {
|
|
8
|
+
import { Pill } from "../elements/Pill";
|
|
9
|
+
import { Text } from "../elements/Text";
|
|
9
10
|
import { ScreenDimensionsProvider } from "../utils/hooks";
|
|
10
11
|
export const withTheme = (story) => (_jsxs(Theme, { theme: "v3light", children: [_jsx(Text, { color: "red", children: "aaww" }), story()] }));
|
|
11
12
|
const DARK_MODE_STORAGE_KEY = "dark-mode-mode";
|
|
@@ -38,5 +39,5 @@ export const useDarkModeSwitcher = (story) => {
|
|
|
38
39
|
};
|
|
39
40
|
const isDarkMode = mode === "dark" || (mode === "system" && systemMode === "dark");
|
|
40
41
|
const theme = isDarkMode ? "v3dark" : "v3light";
|
|
41
|
-
return (_jsx(ScreenDimensionsProvider, { children: _jsx(SafeAreaProvider, { children: _jsx(Theme, { theme: theme, children: _jsxs(Flex, { flex: 1, backgroundColor: "background", children: [_jsxs(Flex, { flexDirection: "row", justifyContent: "space-around", children: [
|
|
42
|
+
return (_jsx(ScreenDimensionsProvider, { children: _jsx(SafeAreaProvider, { children: _jsx(Theme, { theme: theme, children: _jsxs(Flex, { flex: 1, backgroundColor: "background", children: [_jsxs(Flex, { flexDirection: "row", justifyContent: "space-around", py: 1, backgroundColor: "mono5", children: [_jsx(Text, { color: "mono100", children: "Dark mode" }), _jsxs(Flex, { flexDirection: "row", gap: 1, children: [_jsx(Pill, { variant: "default", selected: mode === "light", onPress: () => setMode("light"), children: "Light" }), _jsx(Pill, { variant: "default", selected: mode === "dark", onPress: () => setMode("dark"), children: "Dark" }), _jsx(Pill, { variant: "default", selected: mode === "system", onPress: () => setMode("system"), children: "System" })] })] }), _jsx(Flex, { p: 2, children: story() })] }) }) }) }));
|
|
42
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette-mobile",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0--canary.399.4691.0",
|
|
4
4
|
"description": "Artsy's design system for React Native",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "expo run:android --port 8082",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"@artsy/palette-tokens": "7.0.0",
|
|
39
39
|
"@d11/react-native-fast-image": "8.12.0",
|
|
40
40
|
"@shopify/flash-list": "^1.8.3",
|
|
41
|
-
"@styled-system/core": "^5.1.2",
|
|
42
41
|
"@styled-system/theme-get": "^5.1.2",
|
|
43
42
|
"events": "^3.3.0",
|
|
44
43
|
"lodash": "^4.17.21",
|
|
@@ -79,7 +78,11 @@
|
|
|
79
78
|
"@babel/runtime": "^7.25.0",
|
|
80
79
|
"@gorhom/bottom-sheet": "^4.6.4",
|
|
81
80
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
81
|
+
"@react-native-community/datetimepicker": "8.0.1",
|
|
82
|
+
"@react-native-community/slider": "4.5.2",
|
|
82
83
|
"@react-native/eslint-config": "0.76.9",
|
|
84
|
+
"@storybook/addon-ondevice-actions": "^8.3.5",
|
|
85
|
+
"@storybook/addon-ondevice-controls": "^8.3.5",
|
|
83
86
|
"@storybook/react-native": "^8.6.2",
|
|
84
87
|
"@testing-library/react-native": "13.2.0",
|
|
85
88
|
"@types/events": "^3.0.0",
|
|
@@ -87,10 +90,7 @@
|
|
|
87
90
|
"@types/lodash": "4.14.191",
|
|
88
91
|
"@types/react": "~19.0.10",
|
|
89
92
|
"@types/react-test-renderer": "19.0.0",
|
|
90
|
-
"@types/styled-components": "^5.1.26",
|
|
91
|
-
"@types/styled-components-react-native": "^5.2.1",
|
|
92
93
|
"@types/styled-system": "^5.1.16",
|
|
93
|
-
"@types/styled-system__core": "^5.1.3",
|
|
94
94
|
"@types/styled-system__theme-get": "^5.0.2",
|
|
95
95
|
"@typescript-eslint/eslint-plugin": "5.51.0",
|
|
96
96
|
"@typescript-eslint/parser": "^5.51.0",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"react-native-svg": "15.12.0",
|
|
134
134
|
"react-test-renderer": "19.0.0",
|
|
135
135
|
"rimraf": "4.1.2",
|
|
136
|
-
"styled-components": "
|
|
136
|
+
"styled-components": "6.1.19",
|
|
137
137
|
"typescript": "5.8.3"
|
|
138
138
|
},
|
|
139
139
|
"resolutions": {
|