alouette 7.0.0-beta.2 → 7.0.0-beta.21
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/README.md +7 -1
- package/dist/createAlouetteTamagui-browser.es.js +105 -95
- package/dist/createAlouetteTamagui-browser.es.js.map +1 -1
- package/dist/createAlouetteTamagui-node18.mjs +105 -95
- package/dist/createAlouetteTamagui-node18.mjs.map +1 -1
- package/dist/createAlouetteTamagui-react-native.cjs.js +107 -94
- package/dist/createAlouetteTamagui-react-native.cjs.js.map +1 -1
- package/dist/definitions/components/actions/Button.d.ts +20 -0
- package/dist/definitions/components/actions/Button.d.ts.map +1 -0
- package/dist/definitions/components/actions/Button.stories.d.ts +10 -0
- package/dist/definitions/components/actions/Button.stories.d.ts.map +1 -0
- package/dist/definitions/components/actions/IconButton.d.ts +18 -0
- package/dist/definitions/components/actions/IconButton.d.ts.map +1 -0
- package/dist/definitions/components/actions/IconButton.stories.d.ts +10 -0
- package/dist/definitions/components/actions/IconButton.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/Box.d.ts +13 -0
- package/dist/definitions/components/containers/Box.d.ts.map +1 -0
- package/dist/definitions/components/containers/Box.stories.d.ts +18 -0
- package/dist/definitions/components/containers/Box.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/PressableBox.d.ts +12 -0
- package/dist/definitions/components/containers/PressableBox.d.ts.map +1 -0
- package/dist/definitions/components/containers/PressableBox.stories.d.ts +18 -0
- package/dist/definitions/components/containers/PressableBox.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/variants.d.ts +61 -0
- package/dist/definitions/components/containers/variants.d.ts.map +1 -0
- package/dist/definitions/components/feedback/FeedbackIcon.d.ts +8 -0
- package/dist/definitions/components/feedback/FeedbackIcon.d.ts.map +1 -0
- package/dist/definitions/components/feedback/Message.d.ts +25 -0
- package/dist/definitions/components/feedback/Message.d.ts.map +1 -0
- package/dist/definitions/components/feedback/Message.stories.d.ts +10 -0
- package/dist/definitions/components/feedback/Message.stories.d.ts.map +1 -0
- package/dist/definitions/components/forms/InputText.d.ts +23 -0
- package/dist/definitions/components/forms/InputText.d.ts.map +1 -0
- package/dist/definitions/components/forms/InputText.stories.d.ts +16 -0
- package/dist/definitions/components/forms/InputText.stories.d.ts.map +1 -0
- package/dist/definitions/components/layout/Separator.d.ts +6 -0
- package/dist/definitions/components/layout/Separator.d.ts.map +1 -0
- package/dist/definitions/components/layout/Separator.stories.d.ts +10 -0
- package/dist/definitions/components/layout/Separator.stories.d.ts.map +1 -0
- package/dist/definitions/components/layout/list.d.ts +7 -0
- package/dist/definitions/components/layout/list.d.ts.map +1 -0
- package/dist/definitions/components/layout/list.stories.d.ts +7 -0
- package/dist/definitions/components/layout/list.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/Icon.d.ts +14 -0
- package/dist/definitions/components/primitives/Icon.d.ts.map +1 -0
- package/dist/definitions/components/primitives/Icon.stories.d.ts +9 -0
- package/dist/definitions/components/primitives/Icon.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/ScrollView.d.ts +14 -0
- package/dist/definitions/components/primitives/ScrollView.d.ts.map +1 -0
- package/dist/definitions/components/primitives/View.d.ts +5 -0
- package/dist/definitions/components/primitives/View.d.ts.map +1 -0
- package/dist/definitions/components/primitives/View.stories.d.ts +10 -0
- package/dist/definitions/components/primitives/View.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/createVariants.d.ts +54 -0
- package/dist/definitions/components/primitives/createVariants.d.ts.map +1 -0
- package/dist/definitions/components/primitives/stacks.d.ts +17 -0
- package/dist/definitions/components/primitives/stacks.d.ts.map +1 -0
- package/dist/definitions/components/primitives/stacks.stories.d.ts +10 -0
- package/dist/definitions/components/primitives/stacks.stories.d.ts.map +1 -0
- package/dist/definitions/components/story-components/Story.d.ts +21 -0
- package/dist/definitions/components/story-components/Story.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryContainer.d.ts +7 -0
- package/dist/definitions/components/story-components/StoryContainer.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryDecorator.d.ts +3 -0
- package/dist/definitions/components/story-components/StoryDecorator.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryGrid.d.ts +19 -0
- package/dist/definitions/components/story-components/StoryGrid.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryTitle.d.ts +10 -0
- package/dist/definitions/components/story-components/StoryTitle.d.ts.map +1 -0
- package/dist/definitions/components/story-components/WithTamaguiConfig.d.ts +7 -0
- package/dist/definitions/components/story-components/WithTamaguiConfig.d.ts.map +1 -0
- package/dist/definitions/components/typography/Typography.d.ts +38 -0
- package/dist/definitions/components/typography/Typography.d.ts.map +1 -0
- package/dist/definitions/components/typography/Typography.stories.d.ts +15 -0
- package/dist/definitions/components/typography/Typography.stories.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.d.ts +20 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts +10 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/useCurrentBreakpointName.d.ts +5 -0
- package/dist/definitions/components/windowSize/useCurrentBreakpointName.d.ts.map +1 -0
- package/dist/definitions/config/Breakpoints.d.ts +32 -0
- package/dist/definitions/config/Breakpoints.d.ts.map +1 -0
- package/dist/definitions/config/animations.d.ts +15 -0
- package/dist/definitions/config/animations.d.ts.map +1 -0
- package/dist/definitions/config/animations.web.d.ts +5 -0
- package/dist/definitions/config/animations.web.d.ts.map +1 -0
- package/dist/definitions/config/colorScales.d.ts +13 -0
- package/dist/definitions/config/colorScales.d.ts.map +1 -0
- package/dist/definitions/config/createAlouetteFonts.d.ts +90 -0
- package/dist/definitions/config/createAlouetteFonts.d.ts.map +1 -0
- package/dist/definitions/config/createAlouetteTokens.d.ts +557 -0
- package/dist/definitions/config/createAlouetteTokens.d.ts.map +1 -0
- package/dist/definitions/config/media.d.ts +15 -0
- package/dist/definitions/config/media.d.ts.map +1 -0
- package/dist/definitions/config/themes.d.ts +247 -0
- package/dist/definitions/config/themes.d.ts.map +1 -0
- package/dist/definitions/config/themes.stories.d.ts +8 -0
- package/dist/definitions/config/themes.stories.d.ts.map +1 -0
- package/dist/definitions/config/tokens.stories.d.ts +8 -0
- package/dist/definitions/config/tokens.stories.d.ts.map +1 -0
- package/dist/definitions/config/utils/groupTokens.d.ts +7 -0
- package/dist/definitions/config/utils/groupTokens.d.ts.map +1 -0
- package/dist/definitions/core/AlouetteDecorator.d.ts +3 -0
- package/dist/definitions/core/AlouetteDecorator.d.ts.map +1 -0
- package/dist/definitions/core/AlouetteProvider.d.ts +8 -0
- package/dist/definitions/core/AlouetteProvider.d.ts.map +1 -0
- package/dist/definitions/createAlouetteTamagui.d.ts +136 -0
- package/dist/definitions/createAlouetteTamagui.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +42 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/index-browser.es.js +389 -60
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-node18.mjs +389 -60
- package/dist/index-node18.mjs.map +1 -1
- package/dist/index-react-native.cjs.js +403 -56
- package/dist/index-react-native.cjs.js.map +1 -1
- package/package.json +31 -24
- package/src/components/actions/Button.stories.tsx +4 -5
- package/src/components/actions/Button.tsx +3 -4
- package/src/components/actions/IconButton.stories.tsx +2 -3
- package/src/components/actions/IconButton.tsx +4 -4
- package/src/components/containers/{Frame.stories.tsx → Box.stories.tsx} +21 -21
- package/src/components/containers/{Frame.tsx → Box.tsx} +3 -3
- package/src/components/containers/{Pressable.stories.tsx → PressableBox.stories.tsx} +8 -8
- package/src/components/containers/PressableBox.tsx +9 -0
- package/src/components/containers/variants.ts +15 -12
- package/src/components/feedback/FeedbackIcon.tsx +2 -2
- package/src/components/feedback/Message.stories.tsx +2 -2
- package/src/components/feedback/Message.tsx +4 -4
- package/src/components/forms/InputText.stories.tsx +2 -2
- package/src/components/forms/InputText.tsx +5 -0
- package/src/components/layout/Separator.stories.tsx +39 -0
- package/src/components/layout/Separator.tsx +31 -0
- package/src/components/layout/list.stories.tsx +24 -0
- package/src/components/layout/list.tsx +30 -0
- package/src/components/primitives/Icon.stories.tsx +1 -1
- package/src/components/primitives/Icon.tsx +6 -12
- package/src/components/primitives/ScrollView.ts +2 -1
- package/src/components/primitives/createVariants.ts +7 -5
- package/src/components/primitives/stacks.stories.tsx +14 -14
- package/src/components/primitives/stacks.ts +2 -6
- package/src/components/story-components/Story.tsx +1 -1
- package/src/components/story-components/StoryGrid.tsx +0 -1
- package/src/components/story-components/StoryTitle.tsx +3 -0
- package/src/components/typography/Typography.tsx +2 -0
- package/src/components/windowSize/SwitchBreakpoints.stories.tsx +1 -1
- package/src/config/animations.ts +4 -0
- package/src/config/animations.web.ts +1 -0
- package/src/config/colorScales.ts +4 -4
- package/src/config/createAlouetteFonts.ts +6 -6
- package/src/config/createAlouetteTokens.ts +23 -18
- package/src/config/themes.stories.tsx +5 -9
- package/src/config/themes.ts +139 -68
- package/src/config/tokens.stories.tsx +7 -7
- package/src/core/AlouetteDecorator.tsx +1 -0
- package/src/createAlouetteTamagui.ts +32 -19
- package/src/index.ts +50 -3
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -5
- package/.yo-rc.json +0 -11
- package/dist/phosphor-icons-browser.es.js +0 -2497
- package/dist/phosphor-icons-browser.es.js.map +0 -1
- package/dist/phosphor-icons-node18.mjs +0 -2497
- package/dist/phosphor-icons-node18.mjs.map +0 -1
- package/dist/phosphor-icons-react-native.cjs.js +0 -4998
- package/dist/phosphor-icons-react-native.cjs.js.map +0 -1
- package/phosphor-icons.js +0 -1
- package/rollup.config.mjs +0 -8
- package/scripts/generate-phosphor-icons-legacy-withcopy.mjs +0 -64
- package/scripts/generate-phosphor-icons.mjs +0 -51
- package/src/.eslintrc.json +0 -32
- package/src/components/containers/Pressable.tsx +0 -9
- package/src/components/windowSize/__snapshots__/SwitchBreakpoints.stories.tsx.snap +0 -1032
- package/src/components/windowSize/__snapshots_web__/SwitchBreakpoints.stories.tsx.snap +0 -402
- package/src/phosphor-icons.cjs +0 -1254
- package/src/phosphor-icons.d.ts +0 -2501
- package/src/phosphor-icons.ts +0 -2499
- package/src/typings/bundler.d.ts +0 -10
- package/tsconfig.json +0 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { VStack } from "../primitives/stacks";
|
|
2
3
|
import { Story } from "../story-components/Story";
|
|
3
4
|
import type { MessageProps } from "./Message";
|
|
4
5
|
import { Message } from "./Message";
|
|
5
|
-
import { VStack } from "../primitives/stacks";
|
|
6
6
|
|
|
7
7
|
type ThisStory = StoryObj<typeof Message>;
|
|
8
8
|
|
|
@@ -45,7 +45,7 @@ export const MessageStory: ThisStory = {
|
|
|
45
45
|
</Story.Section>
|
|
46
46
|
<Story.Section title="Edge Cases">
|
|
47
47
|
<VStack gap="$1">
|
|
48
|
-
<Message theme="info"
|
|
48
|
+
<Message textCentered theme="info">
|
|
49
49
|
"textCentered" Example Message with very very very very very very
|
|
50
50
|
very very very very very very very very very very very very very
|
|
51
51
|
very very very long text
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { View, styled } from "@tamagui/core";
|
|
2
|
+
import { XRegularIcon } from "alouette-icons/phosphor-icons";
|
|
2
3
|
import type { ComponentProps, ReactNode } from "react";
|
|
4
|
+
import { IconButton } from "../actions/IconButton";
|
|
5
|
+
import { Box } from "../containers/Box";
|
|
3
6
|
import { Icon } from "../primitives/Icon";
|
|
4
|
-
import { Frame } from "../containers/Frame";
|
|
5
7
|
import { Typography } from "../typography/Typography";
|
|
6
8
|
import { FeedbackIcon } from "./FeedbackIcon";
|
|
7
|
-
import { IconButton } from "../actions/IconButton";
|
|
8
|
-
import { XRegularIcon } from "../../phosphor-icons";
|
|
9
9
|
|
|
10
|
-
export const MessageFrame = styled(
|
|
10
|
+
export const MessageFrame = styled(Box, {
|
|
11
11
|
name: "MessageFrame",
|
|
12
12
|
alignItems: "center",
|
|
13
13
|
withBackground: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Story } from "../story-components/Story";
|
|
3
|
-
import { InputText } from "./InputText";
|
|
4
3
|
import { StoryGrid } from "../story-components/StoryGrid";
|
|
4
|
+
import { InputText } from "./InputText";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "alouette/forms/InputText",
|
|
@@ -23,9 +23,9 @@ export const InputTextStory: StoryObj = {
|
|
|
23
23
|
).map((theme) => (
|
|
24
24
|
<Story.SubSection
|
|
25
25
|
key={theme}
|
|
26
|
+
withBackground
|
|
26
27
|
title={theme}
|
|
27
28
|
theme={theme}
|
|
28
|
-
withBackground
|
|
29
29
|
>
|
|
30
30
|
<StoryGrid.Row flexWrap>
|
|
31
31
|
{(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GetProps } from "@tamagui/core";
|
|
1
2
|
import { styled } from "@tamagui/core";
|
|
2
3
|
import { TextInput } from "react-native";
|
|
3
4
|
import * as variants from "../containers/variants";
|
|
@@ -28,6 +29,10 @@ export const InputText = styled(StyledInputText, {
|
|
|
28
29
|
// animation: "formElement", // remove all style ?
|
|
29
30
|
});
|
|
30
31
|
|
|
32
|
+
export type InputTextProps = GetProps<typeof InputText>;
|
|
33
|
+
|
|
31
34
|
export const TextArea = styled(InputText, {
|
|
32
35
|
multiline: true,
|
|
33
36
|
});
|
|
37
|
+
|
|
38
|
+
export type TextAreaProps = GetProps<typeof TextArea>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { View } from "../primitives/View";
|
|
3
|
+
import { HStack } from "../primitives/stacks";
|
|
4
|
+
import { Story } from "../story-components/Story";
|
|
5
|
+
import { Typography } from "../typography/Typography";
|
|
6
|
+
import { Separator } from "./Separator";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "alouette/layout/Separator",
|
|
10
|
+
component: Separator,
|
|
11
|
+
} satisfies Meta<unknown>;
|
|
12
|
+
|
|
13
|
+
export const SeparatorStory: StoryObj = {
|
|
14
|
+
name: "Separator",
|
|
15
|
+
render: () => (
|
|
16
|
+
<Story preview={<Separator />}>
|
|
17
|
+
<Story.Section title="Themes">
|
|
18
|
+
<Story.SubSection title="primary">
|
|
19
|
+
<Separator theme="primary" />
|
|
20
|
+
</Story.SubSection>
|
|
21
|
+
|
|
22
|
+
<Story.SubSection title="success">
|
|
23
|
+
<Separator theme="success" />
|
|
24
|
+
</Story.SubSection>
|
|
25
|
+
</Story.Section>
|
|
26
|
+
<Story.Section title="Vertical">
|
|
27
|
+
<HStack height={100}>
|
|
28
|
+
<View flexGrow={1}>
|
|
29
|
+
<Typography />
|
|
30
|
+
</View>
|
|
31
|
+
<Separator vertical />
|
|
32
|
+
<View flexGrow={1}>
|
|
33
|
+
<Typography />
|
|
34
|
+
</View>
|
|
35
|
+
</HStack>
|
|
36
|
+
</Story.Section>
|
|
37
|
+
</Story>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { GetProps } from "@tamagui/core";
|
|
2
|
+
import { Stack, styled } from "@tamagui/core";
|
|
3
|
+
|
|
4
|
+
export const Separator = styled(Stack, {
|
|
5
|
+
name: "Separator",
|
|
6
|
+
flexGrow: 1,
|
|
7
|
+
flexShrink: 0,
|
|
8
|
+
height: 0,
|
|
9
|
+
maxHeight: 0,
|
|
10
|
+
borderColor: "$borderColor",
|
|
11
|
+
borderWidth: 0,
|
|
12
|
+
borderBottomWidth: 1,
|
|
13
|
+
y: -0.5,
|
|
14
|
+
|
|
15
|
+
variants: {
|
|
16
|
+
vertical: {
|
|
17
|
+
true: {
|
|
18
|
+
height: "auto",
|
|
19
|
+
maxHeight: "auto",
|
|
20
|
+
width: 0,
|
|
21
|
+
maxWidth: 0,
|
|
22
|
+
borderBottomWidth: 0,
|
|
23
|
+
borderRightWidth: 1,
|
|
24
|
+
y: 0,
|
|
25
|
+
x: -0.5,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
} as const,
|
|
29
|
+
} as const);
|
|
30
|
+
|
|
31
|
+
export type SeparatorProps = GetProps<typeof Separator>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { VStack } from "../primitives/stacks";
|
|
3
|
+
import { Story } from "../story-components/Story";
|
|
4
|
+
import { Typography } from "../typography/Typography";
|
|
5
|
+
import { PressableListItem } from "./list";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "alouette/layout/List",
|
|
9
|
+
} satisfies Meta<unknown>;
|
|
10
|
+
|
|
11
|
+
export const PressableListItemStory: StoryObj = {
|
|
12
|
+
name: "List",
|
|
13
|
+
render: () => (
|
|
14
|
+
<Story
|
|
15
|
+
preview={
|
|
16
|
+
<VStack>
|
|
17
|
+
<PressableListItem onPress={() => {}}>
|
|
18
|
+
<Typography>List Item</Typography>
|
|
19
|
+
</PressableListItem>
|
|
20
|
+
</VStack>
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
),
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CaretRightRegularIcon } from "alouette-icons/phosphor-icons";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import { Icon } from "../primitives/Icon";
|
|
5
|
+
import { View } from "../primitives/View";
|
|
6
|
+
import { HStack, Stack } from "../primitives/stacks";
|
|
7
|
+
|
|
8
|
+
export interface PressableListItemProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
}
|
|
12
|
+
export function PressableListItem({
|
|
13
|
+
children,
|
|
14
|
+
onPress,
|
|
15
|
+
}: PressableListItemProps): ReactNode {
|
|
16
|
+
return (
|
|
17
|
+
<Pressable onPress={onPress}>
|
|
18
|
+
<HStack
|
|
19
|
+
justifyContent="space-between"
|
|
20
|
+
paddingHorizontal="$4"
|
|
21
|
+
paddingVertical="$3"
|
|
22
|
+
>
|
|
23
|
+
<View>{children}</View>
|
|
24
|
+
<Stack justifyContent="center">
|
|
25
|
+
<Icon icon={<CaretRightRegularIcon />} size={20} />
|
|
26
|
+
</Stack>
|
|
27
|
+
</HStack>
|
|
28
|
+
</Pressable>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import * as AllPhosphorIcons from "
|
|
2
|
+
import * as AllPhosphorIcons from "alouette-icons/phosphor-icons";
|
|
3
3
|
import { Story } from "../story-components/Story";
|
|
4
4
|
import { Icon } from "./Icon";
|
|
5
5
|
|
|
@@ -2,14 +2,14 @@ import type { ColorTokens, GetProps, Variable } from "@tamagui/core";
|
|
|
2
2
|
import { useStyle } from "@tamagui/core";
|
|
3
3
|
import type { ReactElement, ReactNode } from "react";
|
|
4
4
|
import type { OpaqueColorValue } from "react-native";
|
|
5
|
-
import type {
|
|
6
|
-
import {
|
|
5
|
+
import type { BoxProps } from "../containers/Box";
|
|
6
|
+
import { Box } from "../containers/Box";
|
|
7
7
|
|
|
8
8
|
export interface IconProps
|
|
9
|
-
extends Exclude<GetProps<typeof
|
|
9
|
+
extends Exclude<GetProps<typeof Box>, "alignSelf" | "style"> {
|
|
10
10
|
icon: ReactElement;
|
|
11
11
|
color?: ColorTokens | OpaqueColorValue | Variable<any> | undefined;
|
|
12
|
-
align?:
|
|
12
|
+
align?: BoxProps["alignSelf"];
|
|
13
13
|
contrast?: boolean;
|
|
14
14
|
size?: number;
|
|
15
15
|
}
|
|
@@ -33,14 +33,8 @@ export function Icon({
|
|
|
33
33
|
// const clonedIcon = cloneElement(icon, { color: style.color });
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
37
|
-
{...props}
|
|
38
|
-
centered
|
|
39
|
-
alignSelf={align}
|
|
40
|
-
size={size}
|
|
41
|
-
style={style as any}
|
|
42
|
-
>
|
|
36
|
+
<Box {...props} centered alignSelf={align} size={size} style={style as any}>
|
|
43
37
|
{icon}
|
|
44
|
-
</
|
|
38
|
+
</Box>
|
|
45
39
|
);
|
|
46
40
|
}
|
|
@@ -29,11 +29,11 @@ export const getBorderAdditionalInteraction = ({
|
|
|
29
29
|
return {
|
|
30
30
|
borderColor: `$${prefix}.borderColor:hover`,
|
|
31
31
|
};
|
|
32
|
-
case
|
|
32
|
+
case "press":
|
|
33
33
|
return {
|
|
34
34
|
borderColor: `$${prefix}.borderColor:press`,
|
|
35
35
|
};
|
|
36
|
-
case
|
|
36
|
+
case "focus":
|
|
37
37
|
return {
|
|
38
38
|
borderColor: `$${prefix}.borderColor:focus`,
|
|
39
39
|
};
|
|
@@ -57,6 +57,7 @@ export const getBorderAdditionalInteraction = ({
|
|
|
57
57
|
} as const;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
// eslint-disable-next-line complexity
|
|
60
61
|
export const getBackgroundAdditionalInteraction = ({
|
|
61
62
|
internalForcedPseudoState,
|
|
62
63
|
disabled,
|
|
@@ -66,7 +67,8 @@ export const getBackgroundAdditionalInteraction = ({
|
|
|
66
67
|
const prefix =
|
|
67
68
|
interactive === "text"
|
|
68
69
|
? "interactive.forms"
|
|
69
|
-
:
|
|
70
|
+
: // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
71
|
+
`interactive.${variant || "contained"}`;
|
|
70
72
|
|
|
71
73
|
if (disabled) {
|
|
72
74
|
return {
|
|
@@ -80,11 +82,11 @@ export const getBackgroundAdditionalInteraction = ({
|
|
|
80
82
|
return {
|
|
81
83
|
backgroundColor: `$${prefix}.backgroundColor:hover`,
|
|
82
84
|
};
|
|
83
|
-
case
|
|
85
|
+
case "press":
|
|
84
86
|
return {
|
|
85
87
|
backgroundColor: `$${prefix}.backgroundColor:press`,
|
|
86
88
|
};
|
|
87
|
-
case
|
|
89
|
+
case "focus":
|
|
88
90
|
return {
|
|
89
91
|
backgroundColor: `$${prefix}.backgroundColor:focus`,
|
|
90
92
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Box } from "../containers/Box";
|
|
2
3
|
import { Story } from "../story-components/Story";
|
|
4
|
+
import { Typography } from "../typography/Typography";
|
|
3
5
|
import { View } from "./View";
|
|
4
6
|
import { HStack, VStack, Stack } from "./stacks";
|
|
5
|
-
import { Typography } from "../typography/Typography";
|
|
6
|
-
import { Frame } from "../containers/Frame";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: "alouette/Primitives/Stacks",
|
|
@@ -36,22 +36,22 @@ export const StacksStory: StoryObj = {
|
|
|
36
36
|
</Story.Section>
|
|
37
37
|
<Story.Section title="HStack with gap">
|
|
38
38
|
<HStack theme="primary" gap="$20">
|
|
39
|
-
<
|
|
39
|
+
<Box centered withBackground flexGrow={1}>
|
|
40
40
|
<Typography contrast>1</Typography>
|
|
41
|
-
</
|
|
42
|
-
<
|
|
41
|
+
</Box>
|
|
42
|
+
<Box centered withBackground flexGrow={1}>
|
|
43
43
|
<Typography contrast>2</Typography>
|
|
44
|
-
</
|
|
44
|
+
</Box>
|
|
45
45
|
</HStack>
|
|
46
46
|
</Story.Section>
|
|
47
47
|
<Story.Section title="VStack with gap">
|
|
48
48
|
<VStack theme="primary" gap="$20" alignItems="flex-start">
|
|
49
|
-
<
|
|
49
|
+
<Box centered withBackground flexGrow={1}>
|
|
50
50
|
<Typography>1</Typography>
|
|
51
|
-
</
|
|
52
|
-
<
|
|
51
|
+
</Box>
|
|
52
|
+
<Box centered backgroundColor="$color.primary.9" flexGrow={1}>
|
|
53
53
|
<Typography>2</Typography>
|
|
54
|
-
</
|
|
54
|
+
</Box>
|
|
55
55
|
</VStack>
|
|
56
56
|
</Story.Section>
|
|
57
57
|
<Story.Section title="VStack in base, HStack in large">
|
|
@@ -62,12 +62,12 @@ export const StacksStory: StoryObj = {
|
|
|
62
62
|
gap="$20"
|
|
63
63
|
alignItems="flex-start"
|
|
64
64
|
>
|
|
65
|
-
<
|
|
65
|
+
<Box centered withBackground flexGrow={1}>
|
|
66
66
|
<Typography>1</Typography>
|
|
67
|
-
</
|
|
68
|
-
<
|
|
67
|
+
</Box>
|
|
68
|
+
<Box centered backgroundColor="$color.primary.9" flexGrow={1}>
|
|
69
69
|
<Typography>2</Typography>
|
|
70
|
-
</
|
|
70
|
+
</Box>
|
|
71
71
|
</Stack>
|
|
72
72
|
</Story.Section>
|
|
73
73
|
</Story>
|
|
@@ -13,12 +13,8 @@ export const Stack = styled(View, {
|
|
|
13
13
|
variants: {
|
|
14
14
|
...variants,
|
|
15
15
|
type: {
|
|
16
|
-
h: {
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
v: {
|
|
20
|
-
flexDirection: "column",
|
|
21
|
-
},
|
|
16
|
+
h: { flexDirection: "row" },
|
|
17
|
+
v: { flexDirection: "column" },
|
|
22
18
|
},
|
|
23
19
|
} as const,
|
|
24
20
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
1
|
import { styled } from "@tamagui/core";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
3
|
import type { Except } from "type-fest";
|
|
4
4
|
import type { VStackProps } from "../primitives/stacks";
|
|
5
5
|
import { VStack } from "../primitives/stacks";
|
|
@@ -3,7 +3,6 @@ import { Children } from "react";
|
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
4
|
import { View } from "../primitives/View";
|
|
5
5
|
import { VStack } from "../primitives/stacks";
|
|
6
|
-
import type { TypographyProps } from "../typography/Typography";
|
|
7
6
|
import { StoryTitle } from "./StoryTitle";
|
|
8
7
|
|
|
9
8
|
export interface StoryGridRowProps {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GetProps } from "@tamagui/core";
|
|
1
2
|
import { styled } from "@tamagui/core";
|
|
2
3
|
import { Typography } from "../typography/Typography";
|
|
3
4
|
|
|
@@ -17,3 +18,5 @@ export const StoryTitle = styled(Typography, {
|
|
|
17
18
|
level: 1,
|
|
18
19
|
},
|
|
19
20
|
} as const);
|
|
21
|
+
|
|
22
|
+
export type StoryTitleProps = GetProps<typeof StoryTitle>;
|
|
@@ -48,6 +48,8 @@ export const TypographyParagraph = styled(Typography, {
|
|
|
48
48
|
family: "body",
|
|
49
49
|
} as const);
|
|
50
50
|
|
|
51
|
+
export type TypographyParagraphProps = GetProps<typeof TypographyParagraph>;
|
|
52
|
+
|
|
51
53
|
const TypographySizeContext = createContext<TypographyProps["size"]>(undefined);
|
|
52
54
|
|
|
53
55
|
export const TypographyWithContext = Typography.styleable(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { BreakpointNameEnum } from "../../config/Breakpoints";
|
|
3
|
-
import { StoryGrid } from "../story-components/StoryGrid";
|
|
4
3
|
import { Story } from "../story-components/Story";
|
|
4
|
+
import { StoryGrid } from "../story-components/StoryGrid";
|
|
5
5
|
import { Typography } from "../typography/Typography";
|
|
6
6
|
import {
|
|
7
7
|
SwitchBreakpointsUsingDisplayNone,
|
package/src/config/animations.ts
CHANGED
|
@@ -21,12 +21,12 @@ export const createColorScale = <const T extends AlouetteColorScale>(
|
|
|
21
21
|
): T => colorScale;
|
|
22
22
|
|
|
23
23
|
export type AlouetteColorScaleNames =
|
|
24
|
+
| "danger"
|
|
24
25
|
| "grayscale"
|
|
25
|
-
| "success"
|
|
26
26
|
| "info"
|
|
27
|
-
| "
|
|
28
|
-
| "
|
|
29
|
-
| "
|
|
27
|
+
| "primary"
|
|
28
|
+
| "success"
|
|
29
|
+
| "warning";
|
|
30
30
|
|
|
31
31
|
export type ColorScaleTokens = {
|
|
32
32
|
[K in AlouetteColorScaleNames as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];
|
|
@@ -33,9 +33,9 @@ export const createAlouetteFonts = ({
|
|
|
33
33
|
black: "900",
|
|
34
34
|
},
|
|
35
35
|
face: {
|
|
36
|
-
400: { normal: headingFontFamily
|
|
37
|
-
700: { normal: headingFontFamily
|
|
38
|
-
900: { normal: headingFontFamily
|
|
36
|
+
400: { normal: `${headingFontFamily}Regular` },
|
|
37
|
+
700: { normal: `${headingFontFamily}Bold` },
|
|
38
|
+
900: { normal: `${headingFontFamily}Black` },
|
|
39
39
|
},
|
|
40
40
|
size: headingFontSizes,
|
|
41
41
|
lineHeight: {
|
|
@@ -54,9 +54,9 @@ export const createAlouetteFonts = ({
|
|
|
54
54
|
black: "900",
|
|
55
55
|
},
|
|
56
56
|
face: {
|
|
57
|
-
400: { normal: bodyFontFamily
|
|
58
|
-
700: { normal: bodyFontFamily
|
|
59
|
-
900: { normal: bodyFontFamily
|
|
57
|
+
400: { normal: `${bodyFontFamily}Regular` },
|
|
58
|
+
700: { normal: `${bodyFontFamily}Bold` },
|
|
59
|
+
900: { normal: `${bodyFontFamily}Black` },
|
|
60
60
|
},
|
|
61
61
|
size: bodyFontSizes,
|
|
62
62
|
lineHeight: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createTokens } from "@tamagui/core";
|
|
2
2
|
import type { IntRange } from "type-fest";
|
|
3
3
|
import type {
|
|
4
|
-
AlouetteColorScaleNames,
|
|
5
4
|
AlouetteColorScaleNumber,
|
|
6
5
|
AlouetteColorScales,
|
|
7
6
|
} from "./colorScales";
|
|
@@ -11,48 +10,54 @@ type NegativeAlouetteSize = `-${AlouetteSize}`;
|
|
|
11
10
|
type AlouetteSizeRecord = Record<AlouetteSize, number>;
|
|
12
11
|
type NegativeAlouetteSizeRecord = Record<NegativeAlouetteSize, number>;
|
|
13
12
|
|
|
14
|
-
const createAlouetteSizes = <N extends boolean>(
|
|
13
|
+
const createAlouetteSizes = <const N extends boolean>(
|
|
15
14
|
spacing: number,
|
|
16
15
|
negative: N,
|
|
17
|
-
): N extends true ?
|
|
16
|
+
): N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord => {
|
|
18
17
|
const MAX_SIZE = 64;
|
|
19
|
-
const sizes
|
|
20
|
-
N extends true ?
|
|
21
|
-
|
|
18
|
+
const sizes: Partial<
|
|
19
|
+
N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord
|
|
20
|
+
> = {};
|
|
22
21
|
for (let size = 0; size <= MAX_SIZE; size++) {
|
|
23
22
|
(sizes as any)[negative ? `-${size}` : `${size}`] = size * spacing;
|
|
24
23
|
}
|
|
25
24
|
return sizes as N extends true
|
|
26
|
-
?
|
|
27
|
-
:
|
|
25
|
+
? NegativeAlouetteSizeRecord
|
|
26
|
+
: AlouetteSizeRecord;
|
|
28
27
|
};
|
|
29
28
|
|
|
30
|
-
type ColorScaleTokens = {
|
|
31
|
-
[K in
|
|
29
|
+
type ColorScaleTokens<ColorScales extends AlouetteColorScales> = {
|
|
30
|
+
[K in string &
|
|
31
|
+
keyof ColorScales as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const transformColorScalesToTokens = (
|
|
35
|
-
colorScales:
|
|
36
|
-
): ColorScaleTokens => {
|
|
34
|
+
const transformColorScalesToTokens = <ColorScales extends AlouetteColorScales>(
|
|
35
|
+
colorScales: ColorScales,
|
|
36
|
+
): ColorScaleTokens<ColorScales> => {
|
|
37
37
|
return Object.fromEntries(
|
|
38
38
|
Object.entries(colorScales).flatMap(([colorName, colorScale]) => {
|
|
39
39
|
return Object.entries(colorScale).map(([scaleNumber, colorValue]) => {
|
|
40
40
|
return [`${colorName}.${scaleNumber}`, colorValue];
|
|
41
41
|
});
|
|
42
42
|
}),
|
|
43
|
-
) as ColorScaleTokens
|
|
43
|
+
) as ColorScaleTokens<ColorScales>;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export interface AlouetteTokensOptions {
|
|
47
47
|
spacing?: number;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export const createAlouetteTokens =
|
|
51
|
-
|
|
50
|
+
export const createAlouetteTokens = <
|
|
51
|
+
const ColorScales extends AlouetteColorScales,
|
|
52
|
+
>(
|
|
53
|
+
colorScales: ColorScales,
|
|
52
54
|
{ spacing = 4 }: AlouetteTokensOptions = {},
|
|
53
55
|
) => {
|
|
54
|
-
const sizes = createAlouetteSizes(spacing, false);
|
|
55
|
-
const negativeSizes = createAlouetteSizes(
|
|
56
|
+
const sizes: AlouetteSizeRecord = createAlouetteSizes(spacing, false);
|
|
57
|
+
const negativeSizes: NegativeAlouetteSizeRecord = createAlouetteSizes(
|
|
58
|
+
-spacing,
|
|
59
|
+
true,
|
|
60
|
+
);
|
|
56
61
|
|
|
57
62
|
return createTokens({
|
|
58
63
|
color: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import type { Entries } from "type-fest";
|
|
3
|
+
import { Box } from "../components/containers/Box";
|
|
3
4
|
import { View } from "../components/primitives/View";
|
|
4
5
|
import { VStack } from "../components/primitives/stacks";
|
|
5
|
-
import { StoryGrid } from "../components/story-components/StoryGrid";
|
|
6
6
|
import { Story } from "../components/story-components/Story";
|
|
7
|
-
import {
|
|
7
|
+
import { StoryGrid } from "../components/story-components/StoryGrid";
|
|
8
|
+
import { WithTamaguiConfig } from "../components/story-components/WithTamaguiConfig";
|
|
8
9
|
import { Typography } from "../components/typography/Typography";
|
|
9
10
|
import { groupTokens } from "./utils/groupTokens";
|
|
10
|
-
import { WithTamaguiConfig } from "../components/story-components/WithTamaguiConfig";
|
|
11
11
|
|
|
12
12
|
type ThisStory = StoryObj<unknown>;
|
|
13
13
|
|
|
@@ -25,13 +25,9 @@ export const TokensStory: ThisStory = {
|
|
|
25
25
|
{(Object.entries(themes) as Entries<typeof themes>).map(
|
|
26
26
|
([themeName, theme]) => (
|
|
27
27
|
<Story.Section key={themeName} title={themeName}>
|
|
28
|
-
<
|
|
29
|
-
withBackground
|
|
30
|
-
padding="$md"
|
|
31
|
-
theme={themeName as string}
|
|
32
|
-
>
|
|
28
|
+
<Box withBackground padding="$md" theme={themeName as string}>
|
|
33
29
|
<Typography contrast>Demo</Typography>
|
|
34
|
-
</
|
|
30
|
+
</Box>
|
|
35
31
|
|
|
36
32
|
{groupTokens(theme).map(([groupName, tokens]) => (
|
|
37
33
|
<StoryGrid.Row key={groupName} flexWrap>
|