@alveole/storybook 0.35.2 → 0.36.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Typography } from '@alveole/components';
|
|
2
|
+
import { ALVEOLE_COMPONENTS_VERSION, Box, Typography } from '@alveole/components';
|
|
3
3
|
import { useTheme } from '@alveole/theme';
|
|
4
4
|
import { Pressable, useWindowDimensions } from 'react-native';
|
|
5
5
|
export const UIKitTopBar = ({ activeKey, items }) => {
|
|
@@ -13,10 +13,10 @@ export const UIKitTopBar = ({ activeKey, items }) => {
|
|
|
13
13
|
alignItems: width >= 960 ? 'center' : 'flex-start',
|
|
14
14
|
flexDirection: width >= 960 ? 'row' : 'column',
|
|
15
15
|
justifyContent: 'space-between',
|
|
16
|
-
}, children: [_jsxs(Box, { display: "flex", gap: 2, children: [_jsx(Typography, { style: text['Corps de texte'].
|
|
16
|
+
}, children: [_jsxs(Box, { display: "flex", gap: 2, children: [_jsx(Typography, { style: text['Corps de texte'].SM.Bold, children: "Alveole \u2022 UI Kit" }), _jsxs(Typography, { style: {
|
|
17
17
|
...text['Corps de texte'].XS.Regular,
|
|
18
18
|
color: color.light.text['mention-grey'],
|
|
19
|
-
}, children: "
|
|
19
|
+
}, children: ["Version ", ALVEOLE_COMPONENTS_VERSION] })] }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: items.map(item => {
|
|
20
20
|
const isActive = item.key === activeKey;
|
|
21
21
|
return (_jsx(Pressable, { accessibilityRole: "link", onPress: item.onPress, children: ({ pressed }) => (_jsx(Box, { borderColor: isActive ? color.light.border['action-low-primary'] : color.light.border['default-grey'], borderRadius: radius('full'), borderWidth: 1, pl: '100', pr: '100', pt: '075', pb: '075', style: {
|
|
22
22
|
backgroundColor: isActive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryDetailScreen.d.ts","sourceRoot":"","sources":["../../src/screens/StoryDetailScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StoryDetailScreen.d.ts","sourceRoot":"","sources":["../../src/screens/StoryDetailScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AA8GF,eAAO,MAAM,iBAAiB,GAAI,4CAI/B,sBAAsB,4CAgJxB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Button, Page, Section,
|
|
2
|
+
import { Box, Button, Page, Section, Typography } from '@alveole/components';
|
|
3
3
|
import { useTheme } from '@alveole/theme';
|
|
4
|
-
import
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Linking, ScrollView } from 'react-native';
|
|
5
6
|
import { JsonBlock } from '../components/JsonBlock';
|
|
6
7
|
import { getStoryExamples, getStoryFlags } from '../utils';
|
|
7
8
|
const DetailPill = ({ label, tone = 'info' }) => {
|
|
@@ -23,6 +24,12 @@ const MetaCard = ({ label, value }) => {
|
|
|
23
24
|
const { color, radius, text } = useTheme();
|
|
24
25
|
return (_jsxs(Box, { borderColor: color.light.border['default-grey'], borderRadius: radius('md'), borderWidth: 1, display: "flex", gap: 4, p: '100', style: { backgroundColor: color.light.background['alt-grey'], minWidth: 160 }, children: [_jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: label }), _jsx(Typography, { style: text['Corps de texte'].SM.SemiBold, children: value })] }));
|
|
25
26
|
};
|
|
27
|
+
const DetailTabs = ({ tabs, defaultValue }) => {
|
|
28
|
+
const initialValue = defaultValue || tabs[0]?.value || '';
|
|
29
|
+
const [activeValue, setActiveValue] = React.useState(initialValue);
|
|
30
|
+
const activeTab = tabs.find(tab => tab.value === activeValue) ?? tabs[0];
|
|
31
|
+
return (_jsxs(Box, { display: "flex", gap: 16, children: [_jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: tabs.map(tab => (_jsx(Button, { title: tab.label, size: "sm", variant: "tertiary", selected: tab.value === activeTab?.value, onPress: () => setActiveValue(tab.value) }, tab.value))) }), activeTab?.scrollable ? (_jsx(ScrollView, { style: { flex: 1 }, contentContainerStyle: { paddingBottom: 16 }, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: true, children: activeTab.content })) : (activeTab?.content)] }));
|
|
32
|
+
};
|
|
26
33
|
export const StoryDetailScreen = ({ story, notFoundMessage = 'Story not found.', beforeContent, }) => {
|
|
27
34
|
const { text, color, radius } = useTheme();
|
|
28
35
|
if (!story) {
|
|
@@ -40,7 +47,7 @@ export const StoryDetailScreen = ({ story, notFoundMessage = 'Story not found.',
|
|
|
40
47
|
alignItems: 'flex-start',
|
|
41
48
|
flexDirection: 'row',
|
|
42
49
|
justifyContent: 'space-between',
|
|
43
|
-
}, children: [_jsxs(Box, { display: "flex", gap: 6, style: { flex: 1 }, children: [_jsx(Typography, { style: text.Titres['H3 - MD'], children: meta.title }), _jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: meta.description })] }), meta.figmaURL ? (_jsx(Button, { title: "Ouvrir Figma", variant: "primary", onPress: () => Linking.openURL(meta.figmaURL) })) : null] }), _jsxs(Box, { display: "flex", gap: 10, children: [_jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: "Tags" }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: meta.tags.map(tag => (_jsx(DetailPill, { label: tag, tone: "tag" }, tag))) })] }), flags.length > 0 ? (_jsxs(Box, { display: "flex", gap: 10, children: [_jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: "Informations" }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: flags.map(flag => (_jsx(DetailPill, { label: flag.label }, flag.key))) })] })) : null, _jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 12, children: [_jsx(MetaCard, { label: "Exemples", value: String(examples.length) }), _jsx(MetaCard, { label: "Styles", value: "Disponibles" }), meta.props != null ? _jsx(MetaCard, { label: "Props", value: "Document\u00E9es" }) : null] })] }), _jsx(
|
|
50
|
+
}, children: [_jsxs(Box, { display: "flex", gap: 6, style: { flex: 1 }, children: [_jsx(Typography, { style: text.Titres['H3 - MD'], children: meta.title }), _jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: meta.description })] }), meta.figmaURL ? (_jsx(Button, { title: "Ouvrir Figma", variant: "primary", onPress: () => Linking.openURL(meta.figmaURL) })) : null] }), _jsxs(Box, { display: "flex", gap: 10, children: [_jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: "Tags" }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: meta.tags.map(tag => (_jsx(DetailPill, { label: tag, tone: "tag" }, tag))) })] }), flags.length > 0 ? (_jsxs(Box, { display: "flex", gap: 10, children: [_jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: "Informations" }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: flags.map(flag => (_jsx(DetailPill, { label: flag.label }, flag.key))) })] })) : null, _jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 12, children: [_jsx(MetaCard, { label: "Exemples", value: String(examples.length) }), _jsx(MetaCard, { label: "Styles", value: "Disponibles" }), meta.props != null ? _jsx(MetaCard, { label: "Props", value: "Document\u00E9es" }) : null] })] }), _jsx(DetailTabs, { defaultValue: "examples", tabs: [
|
|
44
51
|
{
|
|
45
52
|
value: 'examples',
|
|
46
53
|
label: 'Examples',
|