@alveole/storybook 2.0.0-alpha.16 → 2.0.0-alpha.18

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.
Files changed (37) hide show
  1. package/dist/components/ColorSwatch.js +3 -3
  2. package/dist/components/DocFooter.js +5 -5
  3. package/dist/components/EcranDeCatalogue.js +2 -2
  4. package/dist/components/EnTeteDeFiche.js +1 -1
  5. package/dist/components/ExampleBlock.js +2 -2
  6. package/dist/components/ExemplesDeLaStory.js +3 -3
  7. package/dist/components/GrilleDeFiches.js +1 -1
  8. package/dist/components/MenuCard.js +1 -1
  9. package/dist/components/PageTitle.js +2 -2
  10. package/dist/components/SearchField.js +1 -1
  11. package/dist/components/StoryCard.js +1 -1
  12. package/dist/components/StorySummary.js +1 -1
  13. package/dist/components/UIKitTopBar.js +2 -2
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -0
  17. package/dist/pages/FormulairesPage.js +2 -2
  18. package/dist/pages/InstallationPage.js +2 -2
  19. package/dist/pages/MigrationV2Page.js +2 -2
  20. package/dist/pages/PhilosophyPage.js +2 -2
  21. package/dist/pages/UIKitHomePage.js +1 -1
  22. package/dist/pages/UIKitThemePage.js +1 -1
  23. package/dist/pages/ecransDuKit.js +1 -1
  24. package/dist/pages/formulaires.stories.js +4 -4
  25. package/dist/pages/formulaires.stories.sources.d.ts.map +1 -1
  26. package/dist/pages/formulaires.stories.sources.js +4 -4
  27. package/dist/pages/installation.d.ts.map +1 -1
  28. package/dist/pages/installation.js +11 -20
  29. package/dist/screens/StoryDetailScreen.d.ts.map +1 -1
  30. package/dist/screens/StoryDetailScreen.js +1 -2
  31. package/dist/screens/ThemeCSSVariablesScreen.d.ts.map +1 -1
  32. package/dist/screens/ThemeCSSVariablesScreen.js +34 -26
  33. package/dist/screens/ThemeConstantDetailScreen.js +1 -1
  34. package/dist/screens/ThemeConstantsScreen.js +1 -1
  35. package/dist/screens/ThemePaletteScreen.js +2 -2
  36. package/dist/screens/ThemeTypographyScreen.js +4 -4
  37. package/package.json +7 -7
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Typography, useToast } from '@alveole/components';
3
- import { useTheme } from '@alveole/theme';
3
+ import { Spacings, useTheme } from '@alveole/theme';
4
4
  import { Pressable } from 'react-native';
5
5
  import { copier } from '../pressePapiers';
6
6
  /**
@@ -24,8 +24,8 @@ export const ColorSwatch = ({ entry }) => {
24
24
  borderWidth: 1,
25
25
  borderColor: color.light.border['default-grey'],
26
26
  }, children: [_jsx(Box, { style: { height: 56, backgroundColor: entry.value } }), _jsxs(Box, { style: {
27
- paddingHorizontal: 8,
28
- paddingVertical: 6,
27
+ paddingHorizontal: Spacings['1W'],
28
+ paddingVertical: Spacings['1,5V'],
29
29
  backgroundColor: color.light.background['default-grey'],
30
30
  }, children: [_jsx(Typography, { style: { fontSize: 11, fontWeight: '600', color: color.light.text['title-grey'], lineHeight: 14 }, numberOfLines: 1, children: tokenName }), _jsx(Typography, { style: {
31
31
  fontSize: 10,
@@ -1,15 +1,15 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ALVEOLE_COMPONENTS_VERSION, Box, Typography } from '@alveole/components';
3
- import { useTheme } from '@alveole/theme';
3
+ import { Spacings, useTheme } from '@alveole/theme';
4
4
  export const DocFooter = () => {
5
5
  const { color, text } = useTheme();
6
6
  return (_jsx(Box, { tag: "footer", style: {
7
7
  borderTopWidth: 1,
8
8
  borderTopColor: color.light.border['default-grey'],
9
- paddingTop: 12,
10
- paddingBottom: 12,
11
- paddingLeft: 24,
12
- paddingRight: 24,
9
+ paddingTop: Spacings['3V'],
10
+ paddingBottom: Spacings['3V'],
11
+ paddingLeft: Spacings['3W'],
12
+ paddingRight: Spacings['3W'],
13
13
  display: 'flex',
14
14
  alignItems: 'center',
15
15
  }, children: _jsxs(Typography, { style: { ...text['Corps de texte'].XS.Regular, color: color.light.text['mention-grey'] }, children: ["Alveole UI Kit \u2014 v", ALVEOLE_COMPONENTS_VERSION] }) }));
@@ -11,6 +11,6 @@ export const filDuTheme = {
11
11
  };
12
12
  /** L'echafaudage d'un ecran du catalogue : la page, sa zone sur toute la grille, puis son titre. */
13
13
  export const EcranDeCatalogue = ({ title, description, sidebar, beforeContent, footerContent, breadcrumbsProps, sommaire, children, }) => {
14
- const { grilles, spacingValue } = useTheme();
15
- return (_jsx(Page, { scrollable: true, title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: sommaire ? (_jsx(StoryLayout, { sommaire: _jsx(StorySummary, { entrees: sommaire }), children: _jsxs(Box, { display: "flex", gap: spacingValue('6W'), children: [_jsx(PageTitle, { title: title, breadcrumbsProps: breadcrumbsProps }), children] }) })) : (_jsxs(ScreenZone, { largeur: grilles['12 colonnes'], children: [_jsx(PageTitle, { title: title, breadcrumbsProps: breadcrumbsProps }), children] })) }));
14
+ const { grilles } = useTheme();
15
+ return (_jsx(Page, { scrollable: true, title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: sommaire ? (_jsx(StoryLayout, { sommaire: _jsx(StorySummary, { entrees: sommaire }), children: _jsxs(Box, { display: "flex", gap: "6W", children: [_jsx(PageTitle, { title: title, breadcrumbsProps: breadcrumbsProps }), children] }) })) : (_jsxs(ScreenZone, { largeur: grilles['12 colonnes'], children: [_jsx(PageTitle, { title: title, breadcrumbsProps: breadcrumbsProps }), children] })) }));
16
16
  };
@@ -9,5 +9,5 @@ import { PageTitle } from './PageTitle';
9
9
  */
10
10
  export const EnTeteDeFiche = ({ meta }) => {
11
11
  const { color } = useTheme();
12
- return (_jsxs(Box, { display: "flex", gap: 16, children: [_jsx(PageTitle, { title: meta.title }), _jsx(MarkdownDescription, { taille: "LG", color: color.light.text['mention-grey'], children: meta.description })] }));
12
+ return (_jsxs(Box, { display: "flex", gap: "2W", children: [_jsx(PageTitle, { title: meta.title }), _jsx(MarkdownDescription, { taille: "LG", color: color.light.text['mention-grey'], children: meta.description })] }));
13
13
  };
@@ -61,7 +61,7 @@ const CommandeDeRepli = ({ deplie, onBascule }) => {
61
61
  };
62
62
  /** Le bloc d'exemple : une démonstration et sa source, dans un seul cadre. */
63
63
  export const ExampleBlock = ({ children, source, pleinEcran = false }) => {
64
- const { color, radius } = useTheme();
64
+ const { color } = useTheme();
65
65
  const [deplie, setDeplie] = React.useState(false);
66
66
  const { visible, tronque } = decouperSource(source ?? '', LIGNES_VISIBLES);
67
67
  // La source entière, repliée ou non : copier un extrait tronqué donnerait du code qui ne
@@ -70,5 +70,5 @@ export const ExampleBlock = ({ children, source, pleinEcran = false }) => {
70
70
  if (source && typeof navigator !== 'undefined')
71
71
  navigator.clipboard?.writeText(source);
72
72
  };
73
- return (_jsxs(Box, { borderColor: color.light.border['default-grey'], borderRadius: radius('md'), borderWidth: 1, style: { overflow: 'hidden' }, children: [_jsx(Scene, { pleinEcran: pleinEcran, children: children }), source ? (_jsxs(_Fragment, { children: [_jsx(BarreDeSource, { onCopier: copier }), _jsx(Highlight, { language: "tsx", variant: "embedded", children: deplie ? source : visible }), tronque ? _jsx(CommandeDeRepli, { deplie: deplie, onBascule: () => setDeplie(!deplie) }) : null] })) : null] }));
73
+ return (_jsxs(Box, { borderColor: color.light.border['default-grey'], borderRadius: "md", borderWidth: 1, style: { overflow: 'hidden' }, children: [_jsx(Scene, { pleinEcran: pleinEcran, children: children }), source ? (_jsxs(_Fragment, { children: [_jsx(BarreDeSource, { onCopier: copier }), _jsx(Highlight, { language: "tsx", variant: "embedded", children: deplie ? source : visible }), tronque ? _jsx(CommandeDeRepli, { deplie: deplie, onBascule: () => setDeplie(!deplie) }) : null] })) : null] }));
74
74
  };
@@ -12,7 +12,7 @@ import { ExampleBlock } from './ExampleBlock';
12
12
  const UnExemple = ({ story, nom, Rendu, gabarit }) => {
13
13
  const { text } = useTheme();
14
14
  const description = descriptionDeLExemple(story, nom);
15
- return (_jsxs(Box, { display: "flex", gap: 12, children: [!gabarit ? (_jsxs(Box, { display: "flex", gap: 6, children: [_jsx(AnchorHeading, { style: text.Titres['H5 - XS'], children: nom }), description ? _jsx(MarkdownDescription, { children: description }) : null] })) : null, _jsx(ExampleBlock, { source: sourceDeLExemple(story, nom), pleinEcran: gabarit, children: _jsx(Rendu, {}) })] }));
15
+ return (_jsxs(Box, { display: "flex", gap: "3V", children: [!gabarit ? (_jsxs(Box, { display: "flex", gap: "1,5V", children: [_jsx(AnchorHeading, { style: text.Titres['H5 - XS'], children: nom }), description ? _jsx(MarkdownDescription, { children: description }) : null] })) : null, _jsx(ExampleBlock, { source: sourceDeLExemple(story, nom), pleinEcran: gabarit, children: _jsx(Rendu, {}) })] }));
16
16
  };
17
17
  /**
18
18
  * Les tags et le lien Figma : ils documentent l'onglet Examples qu'on regarde, pas la fiche en
@@ -21,7 +21,7 @@ const UnExemple = ({ story, nom, Rendu, gabarit }) => {
21
21
  */
22
22
  const StatutDeLaFiche = ({ meta }) => {
23
23
  const { color, text } = useTheme();
24
- return (_jsxs(Box, { display: "flex", flexDirection: "row", style: { alignItems: 'center', justifyContent: 'space-between' }, children: [_jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: [meta.tags.map(tag => (_jsx(Tag, { size: "md", children: tag }, tag))), getStoryFlags(meta).map(flag => (_jsx(Tag, { size: "md", children: flag.label }, flag.key)))] }), meta.figmaURL ? (_jsx(A, { href: meta.figmaURL, target: "_blank", children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Bold, color: color.light.text['action-high-primary'] }, children: "Ouvrir Figma" }) })) : null] }));
24
+ return (_jsxs(Box, { display: "flex", flexDirection: "row", style: { alignItems: 'center', justifyContent: 'space-between' }, children: [_jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: "1W", children: [meta.tags.map(tag => (_jsx(Tag, { size: "md", children: tag }, tag))), getStoryFlags(meta).map(flag => (_jsx(Tag, { size: "md", children: flag.label }, flag.key)))] }), meta.figmaURL ? (_jsx(A, { href: meta.figmaURL, target: "_blank", children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Bold, color: color.light.text['action-high-primary'] }, children: "Ouvrir Figma" }) })) : null] }));
25
25
  };
26
26
  /** Les demonstrations d'une fiche, les unes sous les autres, sous le statut de la fiche. */
27
- export const ExemplesDeLaStory = ({ story, exemples, gabarit }) => (_jsxs(Box, { display: "flex", gap: 40, mt: '5W', children: [_jsx(StatutDeLaFiche, { meta: story.default }), exemples.map(([nom, Rendu]) => (_jsx(UnExemple, { story: story, nom: nom, Rendu: Rendu, gabarit: gabarit }, nom)))] }));
27
+ export const ExemplesDeLaStory = ({ story, exemples, gabarit }) => (_jsxs(Box, { display: "flex", gap: "5W", mt: '5W', children: [_jsx(StatutDeLaFiche, { meta: story.default }), exemples.map(([nom, Rendu]) => (_jsx(UnExemple, { story: story, nom: nom, Rendu: Rendu, gabarit: gabarit }, nom)))] }));
@@ -10,5 +10,5 @@ export const GrilleDeFiches = ({ groupes, largeurDeFiche, getStoryHref, messageV
10
10
  const { text } = useTheme();
11
11
  if (groupes.length === 0)
12
12
  return _jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: messageVide });
13
- return groupes.map(([tag, fiches]) => (_jsxs(Box, { display: "flex", gap: 16, children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: tag }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 16, children: fiches.map(fiche => (_jsx(Box, { style: { alignSelf: 'stretch', width: largeurDeFiche }, children: _jsx(StoryCard, { story: fiche, href: getStoryHref(fiche) }) }, fiche.default.title))) })] }, tag)));
13
+ return groupes.map(([tag, fiches]) => (_jsxs(Box, { display: "flex", gap: "2W", children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: tag }), _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: "2W", children: fiches.map(fiche => (_jsx(Box, { style: { alignSelf: 'stretch', width: largeurDeFiche }, children: _jsx(StoryCard, { story: fiche, href: getStoryHref(fiche) }) }, fiche.default.title))) })] }, tag)));
14
14
  };
@@ -4,5 +4,5 @@ import { useTheme } from '@alveole/theme';
4
4
  /** Une entree de menu du kit : un titre, ce qu'on trouve derriere, et le moyen d'y aller. */
5
5
  export const MenuCard = ({ title, description, onPress }) => {
6
6
  const { text } = useTheme();
7
- return (_jsx(Card, { onPress: onPress, children: _jsxs(Box, { display: "flex", gap: 8, p: '150', children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: title }), _jsx(Typography, { style: text['Corps de texte'].SM.Regular, children: description })] }) }));
7
+ return (_jsx(Card, { onPress: onPress, children: _jsxs(Box, { display: "flex", gap: "1W", p: "3W", children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: title }), _jsx(Typography, { style: text['Corps de texte'].SM.Regular, children: description })] }) }));
8
8
  };
@@ -11,6 +11,6 @@ import { useTheme } from '@alveole/theme';
11
11
  * prend le cran le plus haut de notre échelle, celui que les deux premiers emploient : 40.
12
12
  */
13
13
  export const PageTitle = ({ title, breadcrumbsProps }) => {
14
- const { spacingValue, text, color } = useTheme();
15
- return (_jsxs(Box, { display: "flex", gap: spacingValue('4W'), children: [_jsx(Breadcrumbs, { ...breadcrumbsProps }), _jsx(Typography, { tag: "h1", style: { ...text.Titres['H1 - XL'], color: color.light.text['title-grey'] }, children: title })] }));
14
+ const { text, color } = useTheme();
15
+ return (_jsxs(Box, { display: "flex", gap: "4W", children: [_jsx(Breadcrumbs, { ...breadcrumbsProps }), _jsx(Typography, { tag: "h1", style: { ...text.Titres['H1 - XL'], color: color.light.text['title-grey'] }, children: title })] }));
16
16
  };
@@ -18,7 +18,7 @@ export const SearchField = ({ label, placeholder, value, onChangeText, size = 'm
18
18
  document.addEventListener('keydown', handleKeyDown);
19
19
  return () => document.removeEventListener('keydown', handleKeyDown);
20
20
  }, []);
21
- return (_jsxs(Box, { display: "flex", gap: 8, children: [label ? _jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: label }) : null, _jsx(TextInput, { ref: inputRef, placeholder: placeholder, value: value, onChangeText: onChangeText, placeholderTextColor: color.light.text['mention-grey'], autoCapitalize: "none", autoCorrect: false, style: {
21
+ return (_jsxs(Box, { display: "flex", gap: "1W", children: [label ? _jsx(Typography, { style: text['Corps de texte'].XS.CapsBold, children: label }) : null, _jsx(TextInput, { ref: inputRef, placeholder: placeholder, value: value, onChangeText: onChangeText, placeholderTextColor: color.light.text['mention-grey'], autoCapitalize: "none", autoCorrect: false, style: {
22
22
  borderWidth: 1,
23
23
  borderColor: color.light.border['default-grey'],
24
24
  borderRadius: radius('md'),
@@ -9,5 +9,5 @@ export const StoryCard = ({ story, href }) => {
9
9
  const flags = getStoryFlags(meta);
10
10
  const height = hauteurDeCarte(isVariant('mobile'));
11
11
  const description = meta.shortDescription ?? stripMarkdown(meta.description);
12
- return (_jsx(A, { href: href, style: { height }, children: _jsx(Card, { height: height, children: _jsxs(Box, { display: "flex", gap: 12, p: '100', style: { height }, children: [_jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: [meta.tags.map(tag => (_jsx(Badge, { variant: "info", size: "sm", style: { marginRight: 0 }, children: tag }, tag))), flags.map(flag => (_jsx(Badge, { variant: "default", size: "sm", style: { marginRight: 0 }, children: flag.label }, flag.key)))] }), _jsx(Typography, { style: text.Titres['H5 - XS'], children: meta.title }), _jsx(Typography, { style: text['Corps de texte'].SM.Regular, children: description })] }) }) }));
12
+ return (_jsx(A, { href: href, style: { height }, children: _jsx(Card, { height: height, children: _jsxs(Box, { display: "flex", gap: "3V", p: "2W", style: { height }, children: [_jsxs(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: "1W", children: [meta.tags.map(tag => (_jsx(Badge, { variant: "info", size: "sm", style: { marginRight: 0 }, children: tag }, tag))), flags.map(flag => (_jsx(Badge, { variant: "default", size: "sm", style: { marginRight: 0 }, children: flag.label }, flag.key)))] }), _jsx(Typography, { style: text.Titres['H5 - XS'], children: meta.title }), _jsx(Typography, { style: text['Corps de texte'].SM.Regular, children: description })] }) }) }));
13
13
  };
@@ -5,5 +5,5 @@ import { styleDuLienBrut } from './styleDuLienBrut';
5
5
  /** Le sommaire d'une page : une entrée par section, vers l'ancre que pose son titre. */
6
6
  export const StorySummary = ({ entrees }) => {
7
7
  const { color, text } = useTheme();
8
- return (_jsxs(Box, { display: "flex", gap: 8, children: [_jsx(Typography, { style: { ...text['Corps de texte'].XS.CapsBold, color: color.light.text['mention-grey'] }, children: "Sur cette page" }), entrees.map(entree => (_jsx("a", { href: `#${toSlug(entree)}`, style: styleDuLienBrut, [FOCUS_ATTRIBUTE]: 'ring', children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Regular, color: color.light.text['default-grey'] }, children: entree }) }, entree)))] }));
8
+ return (_jsxs(Box, { display: "flex", gap: "1W", children: [_jsx(Typography, { style: { ...text['Corps de texte'].XS.CapsBold, color: color.light.text['mention-grey'] }, children: "Sur cette page" }), entrees.map(entree => (_jsx("a", { href: `#${toSlug(entree)}`, style: styleDuLienBrut, [FOCUS_ATTRIBUTE]: 'ring', children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Regular, color: color.light.text['default-grey'] }, children: entree }) }, entree)))] }));
9
9
  };
@@ -74,7 +74,7 @@ const BarreMobile = ({ activeKey, items, columnGroups, logo }) => {
74
74
  borderBottomWidth: 1,
75
75
  borderBottomColor: color.light.border['default-grey'],
76
76
  flexShrink: 0,
77
- }, children: _jsx(ScrollView, { style: { ...(Platform.OS === 'web' ? { maxHeight: menuHeight } : { height: menuHeight }), flexGrow: 0 }, contentContainerStyle: { padding: spacingValue('2W'), gap: spacingValue('050') }, keyboardShouldPersistTaps: "handled", children: _jsx(MobileMenuItems, { activeKey: activeKey, items: items, columnGroups: columnGroups }) }) }))] }));
77
+ }, children: _jsx(ScrollView, { style: { ...(Platform.OS === 'web' ? { maxHeight: menuHeight } : { height: menuHeight }), flexGrow: 0 }, contentContainerStyle: { padding: spacingValue('2W'), gap: spacingValue('1W') }, keyboardShouldPersistTaps: "handled", children: _jsx(MobileMenuItems, { activeKey: activeKey, items: items, columnGroups: columnGroups }) }) }))] }));
78
78
  };
79
79
  export const UIKitTopBar = ({ activeKey, items, columnGroups = [], logo = null }) => {
80
80
  const { isVariant } = useTheme();
@@ -83,6 +83,6 @@ export const UIKitTopBar = ({ activeKey, items, columnGroups = [], logo = null }
83
83
  // Toute nouvelle fiche repart avec un menu fermé, y compris dans la même rubrique.
84
84
  return _jsx(BarreMobile, { activeKey: activeKey, items: items, columnGroups: columnGroups, logo: logo }, pathname);
85
85
  }
86
- const right = (_jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 8, children: items.map(({ key, ...item }) => (_jsx(NavItem, { ...item, current: activeKey === key }, key))) }));
86
+ const right = (_jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: "1W", children: items.map(({ key, ...item }) => (_jsx(NavItem, { ...item, current: activeKey === key }, key))) }));
87
87
  return _jsx(Header, { logo: logo, title: "Alveole UI Kit", right: right });
88
88
  };
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './pages/PhilosophyPage';
10
10
  export * from './pages/UIKitHomePage';
11
11
  export * from './pages/UIKitPage';
12
12
  export * from './pages/UIKitThemePage';
13
+ export { resumeDeLaFiche } from './screens/sourcesDExemples';
13
14
  export * from './screens/StoriesScreen';
14
15
  export * from './screens/StoryDetailScreen';
15
16
  export * from './screens/ThemeConstantDetailScreen';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './pages/PhilosophyPage';
10
10
  export * from './pages/UIKitHomePage';
11
11
  export * from './pages/UIKitPage';
12
12
  export * from './pages/UIKitThemePage';
13
+ export { resumeDeLaFiche } from './screens/sourcesDExemples';
13
14
  export * from './screens/StoriesScreen';
14
15
  export * from './screens/StoryDetailScreen';
15
16
  export * from './screens/ThemeConstantDetailScreen';
@@ -9,8 +9,8 @@ const DEMOS = { Anatomie, Clavier, Fichiers, FormulaireDeBase, Validation };
9
9
  const SectionDeFormulairesView = ({ titre, markdown, demo }) => {
10
10
  const { text } = useTheme();
11
11
  const Demo = demo ? DEMOS[demo] : null;
12
- return (_jsxs(Box, { display: "flex", gap: 8, mb: '400', children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), _jsx(MarkdownDescription, { children: markdown }), demo && Demo ? (_jsxs(Box, { display: "flex", gap: 8, children: [_jsx(Demo, {}), _jsx(JsonBlock, { language: "tsx", value: Sources.storySources[demo]() })] })) : null] }));
12
+ return (_jsxs(Box, { display: "flex", gap: "1W", mb: "8W", children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), _jsx(MarkdownDescription, { children: markdown }), demo && Demo ? (_jsxs(Box, { display: "flex", gap: "1W", children: [_jsx(Demo, {}), _jsx(JsonBlock, { language: "tsx", value: Sources.storySources[demo]() })] })) : null] }));
13
13
  };
14
14
  export const FormulairesPage = ({ beforeContent, sidebar, footerContent }) => {
15
- return (_jsx(EcranDeCatalogue, { title: "Formulaires", description: "Construire un formulaire avec les champs Alveole", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_FORMULAIRES.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: 0, children: SECTIONS_DE_FORMULAIRES.map(section => (_jsx(SectionDeFormulairesView, { ...section }, section.titre))) }) }));
15
+ return (_jsx(EcranDeCatalogue, { title: "Formulaires", description: "Construire un formulaire avec les champs Alveole", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_FORMULAIRES.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: "0V", children: SECTIONS_DE_FORMULAIRES.map(section => (_jsx(SectionDeFormulairesView, { ...section }, section.titre))) }) }));
16
16
  };
@@ -6,8 +6,8 @@ import { JsonBlock } from '../components/JsonBlock';
6
6
  import { ETAPES_D_INSTALLATION } from './installation';
7
7
  const EtapeDInstallationSection = ({ titre, paragraphes, extraits = [] }) => {
8
8
  const { text } = useTheme();
9
- return (_jsxs(Box, { display: "flex", gap: 8, mb: '400', children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), paragraphes.map(paragraphe => (_jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: paragraphe }, paragraphe))), extraits.map(({ langage, fichier, source }) => (_jsxs(Box, { display: "flex", gap: 4, children: [fichier ? _jsx(Typography, { style: text['Corps de texte'].SM.Bold, children: fichier }) : null, _jsx(JsonBlock, { language: langage, value: source })] }, source)))] }));
9
+ return (_jsxs(Box, { display: "flex", gap: "1W", mb: "8W", children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), paragraphes.map(paragraphe => (_jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: paragraphe }, paragraphe))), extraits.map(({ langage, fichier, source }) => (_jsxs(Box, { display: "flex", gap: "1V", children: [fichier ? _jsx(Typography, { style: text['Corps de texte'].SM.Bold, children: fichier }) : null, _jsx(JsonBlock, { language: langage, value: source })] }, source)))] }));
10
10
  };
11
11
  export const InstallationPage = ({ beforeContent, sidebar, footerContent }) => {
12
- return (_jsx(EcranDeCatalogue, { title: "Installation", description: "Installer et configurer Alveole dans une application Expo", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: ETAPES_D_INSTALLATION.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: 0, children: ETAPES_D_INSTALLATION.map(etape => (_jsx(EtapeDInstallationSection, { ...etape }, etape.titre))) }) }));
12
+ return (_jsx(EcranDeCatalogue, { title: "Installation", description: "Installer et configurer Alveole dans une application Expo", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: ETAPES_D_INSTALLATION.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: "0V", children: ETAPES_D_INSTALLATION.map(etape => (_jsx(EtapeDInstallationSection, { ...etape }, etape.titre))) }) }));
13
13
  };
@@ -5,8 +5,8 @@ import { EcranDeCatalogue } from '../components/EcranDeCatalogue';
5
5
  import { INTRODUCTION_DE_MIGRATION_V2, SECTIONS_DE_MIGRATION_V2 } from './migrationV2';
6
6
  const SectionDeMigrationV2 = ({ titre, markdown }) => {
7
7
  const { text } = useTheme();
8
- return (_jsxs(Box, { display: "flex", gap: 8, mb: '400', children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), _jsx(MarkdownDescription, { children: markdown })] }));
8
+ return (_jsxs(Box, { display: "flex", gap: "1W", mb: "8W", children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), _jsx(MarkdownDescription, { children: markdown })] }));
9
9
  };
10
10
  export const MigrationV2Page = ({ beforeContent, sidebar, footerContent }) => {
11
- return (_jsx(EcranDeCatalogue, { title: "Migration v2", description: "Migrer une application d'Alveole 1.x vers 2.0", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_MIGRATION_V2.map(({ titre }) => titre), children: _jsxs(Box, { display: "flex", gap: 0, children: [_jsx(Box, { mb: '400', children: _jsx(MarkdownDescription, { children: INTRODUCTION_DE_MIGRATION_V2 }) }), SECTIONS_DE_MIGRATION_V2.map(section => (_jsx(SectionDeMigrationV2, { ...section }, section.titre)))] }) }));
11
+ return (_jsx(EcranDeCatalogue, { title: "Migration v2", description: "Migrer une application d'Alveole 1.x vers 2.0", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_MIGRATION_V2.map(({ titre }) => titre), children: _jsxs(Box, { display: "flex", gap: "0V", children: [_jsx(Box, { mb: "8W", children: _jsx(MarkdownDescription, { children: INTRODUCTION_DE_MIGRATION_V2 }) }), SECTIONS_DE_MIGRATION_V2.map(section => (_jsx(SectionDeMigrationV2, { ...section }, section.titre)))] }) }));
12
12
  };
@@ -5,8 +5,8 @@ import { EcranDeCatalogue } from '../components/EcranDeCatalogue';
5
5
  import { SECTIONS_DE_PHILOSOPHIE } from './philosophie';
6
6
  const PhilosophySection = ({ titre, paragraphes }) => {
7
7
  const { text } = useTheme();
8
- return (_jsxs(Box, { display: "flex", gap: 8, mb: '400', children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), paragraphes.map(paragraphe => (_jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: paragraphe }, paragraphe)))] }));
8
+ return (_jsxs(Box, { display: "flex", gap: "1W", mb: "8W", children: [_jsx(AnchorHeading, { style: text.Titres['H4 - SM'], children: titre }), paragraphes.map(paragraphe => (_jsx(Typography, { style: text['Corps de texte'].MD.Regular, children: paragraphe }, paragraphe)))] }));
9
9
  };
10
10
  export const PhilosophyPage = ({ beforeContent, sidebar, footerContent }) => {
11
- return (_jsx(EcranDeCatalogue, { title: "Philosophie", description: "Les principes qui guident Alveole", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_PHILOSOPHIE.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: 0, children: SECTIONS_DE_PHILOSOPHIE.map(section => (_jsx(PhilosophySection, { ...section }, section.titre))) }) }));
11
+ return (_jsx(EcranDeCatalogue, { title: "Philosophie", description: "Les principes qui guident Alveole", sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, sommaire: SECTIONS_DE_PHILOSOPHIE.map(({ titre }) => titre), children: _jsx(Box, { display: "flex", gap: "0V", children: SECTIONS_DE_PHILOSOPHIE.map(section => (_jsx(PhilosophySection, { ...section }, section.titre))) }) }));
12
12
  };
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Page, Section } from '@alveole/components';
3
3
  import { MenuCard } from '../components/MenuCard';
4
4
  export const UIKitHomePage = ({ title = 'UI Kit', description = 'Documentation du design system', onOpenComponents, onOpenTheme, onOpenConstants, }) => {
5
- return (_jsx(Page, { scrollable: true, title: title, description: description, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: 16, children: [_jsx(MenuCard, { title: "Composants", description: "Liste des composants disponibles pour le d\u00E9veloppement.", onPress: onOpenComponents }), _jsx(MenuCard, { title: "Th\u00E8me", description: "Th\u00E8me de l\u2019application, liste des tokens issus du design system.", onPress: onOpenTheme }), _jsx(MenuCard, { title: "Constantes", description: "Liste des constantes de th\u00E8me expos\u00E9es par la librairie.", onPress: onOpenConstants })] }) }) }));
5
+ return (_jsx(Page, { scrollable: true, title: title, description: description, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: "2W", children: [_jsx(MenuCard, { title: "Composants", description: "Liste des composants disponibles pour le d\u00E9veloppement.", onPress: onOpenComponents }), _jsx(MenuCard, { title: "Th\u00E8me", description: "Th\u00E8me de l\u2019application, liste des tokens issus du design system.", onPress: onOpenTheme }), _jsx(MenuCard, { title: "Constantes", description: "Liste des constantes de th\u00E8me expos\u00E9es par la librairie.", onPress: onOpenConstants })] }) }) }));
6
6
  };
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Page, Section } from '@alveole/components';
3
3
  import { MenuCard } from '../components/MenuCard';
4
4
  export const UIKitThemePage = ({ title = 'UI Kit - Thème', description = 'Tokens du thème', onOpenColors, onOpenTypography, onOpenCSSVariables, sidebar, footerContent, beforeContent, }) => {
5
- return (_jsx(Page, { scrollable: true, title: title, description: description, sidebar: sidebar, footerContent: footerContent, beforeContent: beforeContent, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: 16, children: [_jsx(MenuCard, { title: "Couleurs", description: "Palette et couleurs du th\u00E8me.", onPress: onOpenColors }), _jsx(MenuCard, { title: "Typographies", description: "Styles de texte et hi\u00E9rarchie typographique.", onPress: onOpenTypography }), onOpenCSSVariables ? (_jsx(MenuCard, { title: "Variables CSS", description: "Les jetons du th\u00E8me expos\u00E9s en variables CSS.", onPress: onOpenCSSVariables })) : null] }) }) }));
5
+ return (_jsx(Page, { scrollable: true, title: title, description: description, sidebar: sidebar, footerContent: footerContent, beforeContent: beforeContent, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: "2W", children: [_jsx(MenuCard, { title: "Couleurs", description: "Palette et couleurs du th\u00E8me.", onPress: onOpenColors }), _jsx(MenuCard, { title: "Typographies", description: "Styles de texte et hi\u00E9rarchie typographique.", onPress: onOpenTypography }), onOpenCSSVariables ? (_jsx(MenuCard, { title: "Variables CSS", description: "Les jetons du th\u00E8me expos\u00E9s en variables CSS.", onPress: onOpenCSSVariables })) : null] }) }) }));
6
6
  };
@@ -7,5 +7,5 @@ export const InternalHeader = ({ canGoBack, onBack }) => {
7
7
  return (_jsx(Section, { withPaddingY: true, children: _jsx(Box, { children: _jsx(Button, { title: "Retour", variant: "tertiary", size: "sm", onPress: onBack }) }) }));
8
8
  };
9
9
  export const HomeScreen = ({ title, description, blankPage, onOpenComponents, onOpenTheme, onOpenConstants, onOpenBlank, onOpenPhilosophy, }) => {
10
- return (_jsx(Page, { scrollable: true, title: title, description: description, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: 16, children: [_jsx(MenuCard, { title: "Composants", description: "Catalogue des composants et de leurs variantes.", onPress: onOpenComponents }), _jsx(MenuCard, { title: "Th\u00E8me", description: "Couleurs et typographies du design system.", onPress: onOpenTheme }), _jsx(MenuCard, { title: "Constantes", description: "Constantes expos\u00E9es par le th\u00E8me.", onPress: onOpenConstants }), _jsx(MenuCard, { title: "Philosophie", description: "Les principes qui guident Alveole.", onPress: onOpenPhilosophy }), blankPage ? (_jsx(MenuCard, { title: blankPage.title ?? 'Page vierge', description: blankPage.description ?? 'Espace de test libre pour expérimenter.', onPress: onOpenBlank })) : null] }) }) }));
10
+ return (_jsx(Page, { scrollable: true, title: title, description: description, children: _jsx(Section, { withPaddingY: true, children: _jsxs(Box, { display: "flex", gap: "2W", children: [_jsx(MenuCard, { title: "Composants", description: "Catalogue des composants et de leurs variantes.", onPress: onOpenComponents }), _jsx(MenuCard, { title: "Th\u00E8me", description: "Couleurs et typographies du design system.", onPress: onOpenTheme }), _jsx(MenuCard, { title: "Constantes", description: "Constantes expos\u00E9es par le th\u00E8me.", onPress: onOpenConstants }), _jsx(MenuCard, { title: "Philosophie", description: "Les principes qui guident Alveole.", onPress: onOpenPhilosophy }), blankPage ? (_jsx(MenuCard, { title: blankPage.title ?? 'Page vierge', description: blankPage.description ?? 'Espace de test libre pour expérimenter.', onPress: onOpenBlank })) : null] }) }) }));
11
11
  };
@@ -21,7 +21,7 @@ export const FormulaireDeBase = () => {
21
21
  setEnvoi(true);
22
22
  setTimeout(() => setEnvoi(false), 1500);
23
23
  };
24
- return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: 16, children: [_jsx(FormControl, { label: "Nom", required: true, children: _jsx(TextInput, { value: nom, onChangeText: setNom }) }), _jsx(FormControl, { label: "Pays", children: _jsx(Select, { placeholder: "Choisir...", options: PAYS, value: pays, onChange: setPays }) }), _jsx(Checkbox, { label: "J'accepte les conditions", checked: cgu, onCheckedChange: c => setCgu(c === true) }), _jsx(Button, { type: "submit", variant: "primary", title: "Envoyer", isLoading: envoi, disabled: !cgu, onPress: soumettre })] }) }));
24
+ return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "2W", children: [_jsx(FormControl, { label: "Nom", required: true, children: _jsx(TextInput, { value: nom, onChangeText: setNom }) }), _jsx(FormControl, { label: "Pays", children: _jsx(Select, { placeholder: "Choisir...", options: PAYS, value: pays, onChange: setPays }) }), _jsx(Checkbox, { label: "J'accepte les conditions", checked: cgu, onCheckedChange: c => setCgu(c === true) }), _jsx(Button, { type: "submit", variant: "primary", title: "Envoyer", isLoading: envoi, disabled: !cgu, onPress: soumettre })] }) }));
25
25
  };
26
26
  export const Validation = () => {
27
27
  const [email, setEmail] = useState('');
@@ -29,14 +29,14 @@ export const Validation = () => {
29
29
  // L'erreur n'apparaît qu'après la première soumission : on ne reproche pas un champ pas encore rempli.
30
30
  const error = soumis && !email.includes('@') ? 'Adresse email invalide' : undefined;
31
31
  const success = soumis && !error ? 'Adresse valide' : undefined;
32
- return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: 16, children: [_jsx(FormControl, { label: "Adresse email", error: error, success: success, required: true, children: _jsx(TextInput, { type: "email", value: email, onChangeText: setEmail, error: error, success: success }) }), _jsx(Button, { type: "submit", variant: "primary", title: "Valider", onPress: () => setSoumis(true) })] }) }));
32
+ return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "2W", children: [_jsx(FormControl, { label: "Adresse email", error: error, success: success, required: true, children: _jsx(TextInput, { type: "email", value: email, onChangeText: setEmail, error: error, success: success }) }), _jsx(Button, { type: "submit", variant: "primary", title: "Valider", onPress: () => setSoumis(true) })] }) }));
33
33
  };
34
34
  export const Fichiers = () => {
35
35
  const [pieces, setPieces] = useState(null);
36
- return (_jsx(FileDropZone, { value: pieces, onChange: setPieces, multiple: true, children: _jsx(Box, { p: 16, children: _jsx(FormControl, { label: "Pi\u00E8ces jointes", hint: "Glissez des fichiers n'importe o\u00F9 sur le formulaire.", children: _jsx(FileInput, { value: pieces, onChange: setPieces, multiple: true }) }) }) }));
36
+ return (_jsx(FileDropZone, { value: pieces, onChange: setPieces, multiple: true, children: _jsx(Box, { p: "2W", children: _jsx(FormControl, { label: "Pi\u00E8ces jointes", hint: "Glissez des fichiers n'importe o\u00F9 sur le formulaire.", children: _jsx(FileInput, { value: pieces, onChange: setPieces, multiple: true }) }) }) }));
37
37
  };
38
38
  export const Clavier = () => {
39
39
  const prenom = React.useRef(null);
40
- return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: 16, children: [_jsx(FormControl, { label: "Nom", children: _jsx(TextInput, { returnKeyType: "next", submitBehavior: "submit", onSubmitEditing: () => prenom.current?.focus() }) }), _jsx(FormControl, { label: "Pr\u00E9nom", children: _jsx(TextInput, { ref: prenom, returnKeyType: "done" }) })] }) }));
40
+ return (_jsx(Form, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "2W", children: [_jsx(FormControl, { label: "Nom", children: _jsx(TextInput, { returnKeyType: "next", submitBehavior: "submit", onSubmitEditing: () => prenom.current?.focus() }) }), _jsx(FormControl, { label: "Pr\u00E9nom", children: _jsx(TextInput, { ref: prenom, returnKeyType: "done" }) })] }) }));
41
41
  };
42
42
  export * as Sources from './formulaires.stories.sources';
@@ -1 +1 @@
1
- {"version":3,"file":"formulaires.stories.sources.d.ts","sourceRoot":"","sources":["../../src/pages/formulaires.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,cAA8Y,CAAC;AAEpa,eAAO,MAAM,gBAAgB,cAAk+B,CAAC;AAEhgC,eAAO,MAAM,UAAU,cAAq1B,CAAC;AAE72B,eAAO,MAAM,QAAQ,cAAmc,CAAC;AAEzd,eAAO,MAAM,OAAO,cAAsiB,CAAC;AAE3jB,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"formulaires.stories.sources.d.ts","sourceRoot":"","sources":["../../src/pages/formulaires.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,cAA8Y,CAAC;AAEpa,eAAO,MAAM,gBAAgB,cAAo+B,CAAC;AAElgC,eAAO,MAAM,UAAU,cAAu1B,CAAC;AAE/2B,eAAO,MAAM,QAAQ,cAAqc,CAAC;AAE3d,eAAO,MAAM,OAAO,cAAwiB,CAAC;AAE7jB,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -1,10 +1,10 @@
1
1
  // This file is generated. Do not edit manually.
2
2
  // Source: src/pages/formulaires.stories.tsx
3
3
  export const Anatomie = () => "export const Anatomie = () => {\n const [email, setEmail] = useState('jean@');\n const error = email.includes('.') ? undefined : 'Adresse email invalide';\n return (\n <FormControl label=\"Adresse email\" hint=\"Votre email professionnel\" error={error} required>\n <TextInput type=\"email\" value={email} onChangeText={setEmail} error={error} />\n </FormControl>\n );\n};";
4
- export const FormulaireDeBase = () => "export const FormulaireDeBase = () => {\n const [nom, setNom] = useState('');\n const [pays, setPays] = useState<string | null>(null);\n const [cgu, setCgu] = useState(false);\n const [envoi, setEnvoi] = useState(false);\n\n const soumettre = () => {\n setEnvoi(true);\n setTimeout(() => setEnvoi(false), 1500);\n };\n\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap={16}>\n <FormControl label=\"Nom\" required>\n <TextInput value={nom} onChangeText={setNom} />\n </FormControl>\n <FormControl label=\"Pays\">\n <Select placeholder=\"Choisir...\" options={PAYS} value={pays} onChange={setPays} />\n </FormControl>\n <Checkbox label=\"J'accepte les conditions\" checked={cgu} onCheckedChange={c => setCgu(c === true)} />\n <Button type=\"submit\" variant=\"primary\" title=\"Envoyer\" isLoading={envoi} disabled={!cgu} onPress={soumettre} />\n </Box>\n </Form>\n );\n};";
5
- export const Validation = () => "export const Validation = () => {\n const [email, setEmail] = useState('');\n const [soumis, setSoumis] = useState(false);\n // L'erreur n'apparaît qu'après la première soumission : on ne reproche pas un champ pas encore rempli.\n const error = soumis && !email.includes('@') ? 'Adresse email invalide' : undefined;\n const success = soumis && !error ? 'Adresse valide' : undefined;\n\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap={16}>\n <FormControl label=\"Adresse email\" error={error} success={success} required>\n <TextInput type=\"email\" value={email} onChangeText={setEmail} error={error} success={success} />\n </FormControl>\n <Button type=\"submit\" variant=\"primary\" title=\"Valider\" onPress={() => setSoumis(true)} />\n </Box>\n </Form>\n );\n};";
6
- export const Fichiers = () => "export const Fichiers = () => {\n const [pieces, setPieces] = useState<FileInputValue>(null);\n return (\n <FileDropZone value={pieces} onChange={setPieces} multiple>\n <Box p={16}>\n <FormControl label=\"Pièces jointes\" hint=\"Glissez des fichiers n'importe où sur le formulaire.\">\n <FileInput value={pieces} onChange={setPieces} multiple />\n </FormControl>\n </Box>\n </FileDropZone>\n );\n};";
7
- export const Clavier = () => "export const Clavier = () => {\n const prenom = React.useRef<React.ComponentRef<typeof TextInput>>(null);\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap={16}>\n <FormControl label=\"Nom\">\n <TextInput returnKeyType=\"next\" submitBehavior=\"submit\" onSubmitEditing={() => prenom.current?.focus()} />\n </FormControl>\n <FormControl label=\"Prénom\">\n <TextInput ref={prenom} returnKeyType=\"done\" />\n </FormControl>\n </Box>\n </Form>\n );\n};";
4
+ export const FormulaireDeBase = () => "export const FormulaireDeBase = () => {\n const [nom, setNom] = useState('');\n const [pays, setPays] = useState<string | null>(null);\n const [cgu, setCgu] = useState(false);\n const [envoi, setEnvoi] = useState(false);\n\n const soumettre = () => {\n setEnvoi(true);\n setTimeout(() => setEnvoi(false), 1500);\n };\n\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap=\"2W\">\n <FormControl label=\"Nom\" required>\n <TextInput value={nom} onChangeText={setNom} />\n </FormControl>\n <FormControl label=\"Pays\">\n <Select placeholder=\"Choisir...\" options={PAYS} value={pays} onChange={setPays} />\n </FormControl>\n <Checkbox label=\"J'accepte les conditions\" checked={cgu} onCheckedChange={c => setCgu(c === true)} />\n <Button type=\"submit\" variant=\"primary\" title=\"Envoyer\" isLoading={envoi} disabled={!cgu} onPress={soumettre} />\n </Box>\n </Form>\n );\n};";
5
+ export const Validation = () => "export const Validation = () => {\n const [email, setEmail] = useState('');\n const [soumis, setSoumis] = useState(false);\n // L'erreur n'apparaît qu'après la première soumission : on ne reproche pas un champ pas encore rempli.\n const error = soumis && !email.includes('@') ? 'Adresse email invalide' : undefined;\n const success = soumis && !error ? 'Adresse valide' : undefined;\n\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap=\"2W\">\n <FormControl label=\"Adresse email\" error={error} success={success} required>\n <TextInput type=\"email\" value={email} onChangeText={setEmail} error={error} success={success} />\n </FormControl>\n <Button type=\"submit\" variant=\"primary\" title=\"Valider\" onPress={() => setSoumis(true)} />\n </Box>\n </Form>\n );\n};";
6
+ export const Fichiers = () => "export const Fichiers = () => {\n const [pieces, setPieces] = useState<FileInputValue>(null);\n return (\n <FileDropZone value={pieces} onChange={setPieces} multiple>\n <Box p=\"2W\">\n <FormControl label=\"Pièces jointes\" hint=\"Glissez des fichiers n'importe où sur le formulaire.\">\n <FileInput value={pieces} onChange={setPieces} multiple />\n </FormControl>\n </Box>\n </FileDropZone>\n );\n};";
7
+ export const Clavier = () => "export const Clavier = () => {\n const prenom = React.useRef<React.ComponentRef<typeof TextInput>>(null);\n return (\n <Form>\n <Box display=\"flex\" flexDirection=\"column\" gap=\"2W\">\n <FormControl label=\"Nom\">\n <TextInput returnKeyType=\"next\" submitBehavior=\"submit\" onSubmitEditing={() => prenom.current?.focus()} />\n </FormControl>\n <FormControl label=\"Prénom\">\n <TextInput ref={prenom} returnKeyType=\"done\" />\n </FormControl>\n </Box>\n </Form>\n );\n};";
8
8
  export const storySources = {
9
9
  Anatomie,
10
10
  FormulaireDeBase,
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/pages/installation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACrC,CAAC;AA4NF,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAA+C,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/pages/installation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACrC,CAAC;AAmNF,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAA+C,CAAC"}
@@ -128,37 +128,28 @@ export default config;`,
128
128
  ],
129
129
  },
130
130
  {
131
- titre: '5. Brancher le ThemeProvider',
131
+ titre: '5. Brancher l’AlveoleProvider',
132
132
  paragraphes: [
133
- 'ThemeProvider (@alveole/theme) charge les polices et fournit les couleurs et typographies à tous les composants. Il se place à la racine, dans app/_layout.tsx, au-dessus du TamaguiProvider de l’application.',
134
- 'Par défaut, ThemeProvider affiche un indicateur de chargement le temps de charger les polices. Une application qui a son propre splash screen passe loader={false} et masque son splash dans onReady.',
135
- 'Toasts (@alveole/components) est nécessaire pour afficher les notifications ; PageMetaProvider gère les balises <meta> sur le web.',
133
+ 'AlveoleProvider (@alveole/components) monte, dans l’ordre attendu par les composants, la pile obligatoire : zones sûres, thème Alveole (polices, couleurs, typographies), Tamagui, clavier et notifications. Il se place à la racine, dans app/_layout.tsx, et reçoit la config Tamagui de l’application.',
134
+ 'Par défaut, AlveoleProvider affiche un indicateur de chargement le temps de charger les polices. Une application qui a son propre splash screen passe loader={false} et masque son splash dans onReady.',
135
+ 'Les providers propres à l’application (PageMetaProvider pour les balises <meta> sur le web, AppUpdateProvider, LinkAccessContext) se placent sous AlveoleProvider. Une application qui monte déjà son propre KeyboardProvider passe keyboardProvider={false}.',
136
136
  ],
137
137
  extraits: [
138
138
  {
139
139
  langage: 'tsx',
140
140
  fichier: 'app/_layout.tsx',
141
- source: `import { PageMetaProvider, Toasts } from '@alveole/components';
142
- import { ThemeProvider } from '@alveole/theme';
141
+ source: `import { AlveoleProvider, PageMetaProvider } from '@alveole/components';
143
142
  import { Slot } from 'expo-router';
144
- import { SafeAreaProvider } from 'react-native-safe-area-context';
145
- import { TamaguiProvider } from 'tamagui';
146
143
  import tamaguiConfig from '../tamagui.config';
147
144
  import config from '../alveole.config';
148
145
 
149
146
  export default function RootLayout() {
150
147
  return (
151
- <ThemeProvider color={config.palette}>
152
- <SafeAreaProvider>
153
- <TamaguiProvider defaultTheme="light" config={tamaguiConfig}>
154
- <PageMetaProvider meta={[]}>
155
- <Toasts>
156
- <Slot />
157
- </Toasts>
158
- </PageMetaProvider>
159
- </TamaguiProvider>
160
- </SafeAreaProvider>
161
- </ThemeProvider>
148
+ <AlveoleProvider tamaguiConfig={tamaguiConfig} palette={config.palette}>
149
+ <PageMetaProvider meta={[]}>
150
+ <Slot />
151
+ </PageMetaProvider>
152
+ </AlveoleProvider>
162
153
  );
163
154
  }`,
164
155
  },
@@ -167,7 +158,7 @@ export default function RootLayout() {
167
158
  {
168
159
  titre: '6. Personnaliser les couleurs',
169
160
  paragraphes: [
170
- 'Les couleurs se surchargent dans un fichier alveole.config.ts à la racine du projet, importé par le layout et passé au ThemeProvider via la prop color.',
161
+ 'Les couleurs se surchargent dans un fichier alveole.config.ts à la racine du projet, importé par le layout et passé à AlveoleProvider via la prop palette.',
171
162
  'La palette est partielle : seules les clés fournies remplacent celles d’Alveole. Les valeurs viennent de préférence des nuanciers exportés par @alveole/theme (Colors.RougeGroseille, Colors.BleuCaptive…) ; la rubrique Thème › Couleurs liste les clés disponibles.',
172
163
  'La clé light cible les jetons sémantiques du thème clair (artwork, background, border, text) ; les clés de premier niveau (primary, background.button, stepper…) ciblent les couleurs propres aux composants.',
173
164
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"StoryDetailScreen.d.ts","sourceRoot":"","sources":["../../src/screens/StoryDetailScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C,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;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAwBF,eAAO,MAAM,iBAAiB,GAAI,sCAI/B,sBAAsB,sBAgCxB,CAAC"}
1
+ {"version":3,"file":"StoryDetailScreen.d.ts","sourceRoot":"","sources":["../../src/screens/StoryDetailScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C,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;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAwBF,eAAO,MAAM,iBAAiB,GAAI,sCAI/B,sBAAsB,sBA8BxB,CAAC"}
@@ -20,11 +20,10 @@ const ongletsDeLaFiche = (meta, exemples) => [
20
20
  ...(meta.props != null ? [{ value: 'props', label: 'Props', content: _jsx(JsonBlock, { value: meta.props }) }] : []),
21
21
  ];
22
22
  export const StoryDetailScreen = ({ story, notFoundMessage = 'Story not found.', ...cadre }) => {
23
- const { spacingValue } = useTheme();
24
23
  if (!story)
25
24
  return _jsx(FicheIntrouvable, { message: notFoundMessage, ...cadre });
26
25
  const meta = story.default;
27
26
  const exemples = getStoryExamples(story);
28
27
  const gabarit = meta.tags.includes('Template');
29
- return (_jsx(Page, { scrollable: true, title: meta.title, description: resumeDeLaFiche(meta), ...cadre, children: _jsx(StoryLayout, { sommaire: exemples.length > 0 ? _jsx(StorySummary, { entrees: exemples.map(([nom]) => nom) }) : null, children: _jsxs(Box, { display: "flex", gap: spacingValue('6W'), children: [_jsx(EnTeteDeFiche, { meta: meta }), _jsx(Tabs, { defaultValue: "examples", urlAnchorPrefix: "story", tabs: ongletsDeLaFiche(meta, _jsx(ExemplesDeLaStory, { story: story, exemples: exemples, gabarit: gabarit })) })] }) }) }));
28
+ return (_jsx(Page, { scrollable: true, title: meta.title, description: resumeDeLaFiche(meta), ...cadre, children: _jsx(StoryLayout, { sommaire: exemples.length > 0 ? _jsx(StorySummary, { entrees: exemples.map(([nom]) => nom) }) : null, children: _jsxs(Box, { display: "flex", gap: "6W", children: [_jsx(EnTeteDeFiche, { meta: meta }), _jsx(Tabs, { defaultValue: "examples", urlAnchorPrefix: "story", tabs: ongletsDeLaFiche(meta, _jsx(ExemplesDeLaStory, { story: story, exemples: exemples, gabarit: gabarit })) })] }) }) }));
30
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeCSSVariablesScreen.d.ts","sourceRoot":"","sources":["../../src/screens/ThemeCSSVariablesScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwI1B,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAIF,eAAO,MAAM,uBAAuB,GAAI,2CAA2C,4BAA4B,sBAsD9G,CAAC"}
1
+ {"version":3,"file":"ThemeCSSVariablesScreen.d.ts","sourceRoot":"","sources":["../../src/screens/ThemeCSSVariablesScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+I1B,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAIF,eAAO,MAAM,uBAAuB,GAAI,2CAA2C,4BAA4B,sBAsD9G,CAAC"}
@@ -1,51 +1,59 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Accordion, Box, Typography, useToast } from '@alveole/components';
3
- import { useTheme } from '@alveole/theme';
3
+ import { RadiusList, Spacings, useTheme } from '@alveole/theme';
4
4
  import React from 'react';
5
5
  import { Platform, Pressable } from 'react-native';
6
6
  import { EcranDeCatalogue, filDuTheme } from '../components/EcranDeCatalogue';
7
7
  import { buildGroups } from './variablesCSSDuTheme';
8
8
  // ─── Preview components ────────────────────────────────────────────────────────
9
- const ColorPreview = ({ value }) => (_jsx(Box, { style: {
10
- width: 28,
11
- height: 28,
12
- borderRadius: 6,
13
- backgroundColor: value,
14
- borderWidth: 1,
15
- borderColor: 'rgba(0,0,0,0.1)',
16
- flexShrink: 0,
17
- } }));
9
+ const ColorPreview = ({ value }) => {
10
+ const { color } = useTheme();
11
+ return (_jsx(Box, { style: {
12
+ width: 28,
13
+ height: 28,
14
+ borderRadius: RadiusList.md,
15
+ backgroundColor: value,
16
+ borderWidth: 1,
17
+ borderColor: color.light.border['default-grey'],
18
+ flexShrink: 0,
19
+ } }));
20
+ };
18
21
  const SpacingPreview = ({ value }) => {
22
+ const { color } = useTheme();
19
23
  const px = parseInt(value, 10);
20
24
  const width = Math.min(px, 96);
21
25
  return (_jsx(Box, { style: {
22
26
  width,
23
27
  height: 12,
24
- borderRadius: 2,
25
- backgroundColor: '#3B82F6',
28
+ borderRadius: RadiusList.sm,
29
+ backgroundColor: color.light.background['flat-info'],
26
30
  flexShrink: 0,
27
31
  alignSelf: 'center',
28
32
  } }));
29
33
  };
30
34
  const RadiusPreview = ({ value }) => {
35
+ const { color } = useTheme();
31
36
  const px = Math.min(parseInt(value, 10), 14);
32
37
  return (_jsx(Box, { style: {
33
38
  width: 28,
34
39
  height: 28,
35
40
  borderRadius: px,
36
41
  borderWidth: 2,
37
- borderColor: '#3B82F6',
42
+ borderColor: color.light.border['plain-info'],
38
43
  flexShrink: 0,
39
44
  } }));
40
45
  };
41
- const ElevationPreview = ({ value }) => Platform.OS === 'web' ? (_jsx(Box, { style: {
42
- width: 28,
43
- height: 28,
44
- borderRadius: 4,
45
- backgroundColor: 'white',
46
- boxShadow: value,
47
- flexShrink: 0,
48
- } })) : null;
46
+ const ElevationPreview = ({ value }) => {
47
+ const { color } = useTheme();
48
+ return Platform.OS === 'web' ? (_jsx(Box, { style: {
49
+ width: 28,
50
+ height: 28,
51
+ borderRadius: RadiusList.sm,
52
+ backgroundColor: color.light.background['default-grey'],
53
+ boxShadow: value,
54
+ flexShrink: 0,
55
+ } })) : null;
56
+ };
49
57
  // ─── Row ──────────────────────────────────────────────────────────────────────
50
58
  const VarRow = ({ entry }) => {
51
59
  const { color } = useTheme();
@@ -60,12 +68,12 @@ const VarRow = ({ entry }) => {
60
68
  return (_jsx(Pressable, { accessibilityRole: "button", onPress: copy, children: ({ pressed }) => (_jsxs(Box, { style: {
61
69
  flexDirection: 'row',
62
70
  alignItems: 'center',
63
- gap: 12,
64
- paddingVertical: 6,
65
- paddingHorizontal: 12,
66
- borderRadius: 6,
71
+ gap: Spacings['3V'],
72
+ paddingVertical: Spacings['1,5V'],
73
+ paddingHorizontal: Spacings['3V'],
74
+ borderRadius: RadiusList.md,
67
75
  backgroundColor: pressed ? color.light.background['transparent-hover'] : 'transparent',
68
- }, children: [entry.preview === 'color' && _jsx(ColorPreview, { value: entry.rawValue }), entry.preview === 'spacing' && _jsx(SpacingPreview, { value: entry.rawValue }), entry.preview === 'radius' && _jsx(RadiusPreview, { value: entry.rawValue }), entry.preview === 'elevation' && _jsx(ElevationPreview, { value: entry.rawValue }), entry.preview === 'none' && _jsx(Box, { style: { width: 28 } }), _jsxs(Box, { style: { flex: 1, gap: 1 }, children: [_jsx(Typography, { style: {
76
+ }, children: [entry.preview === 'color' && _jsx(ColorPreview, { value: entry.rawValue }), entry.preview === 'spacing' && _jsx(SpacingPreview, { value: entry.rawValue }), entry.preview === 'radius' && _jsx(RadiusPreview, { value: entry.rawValue }), entry.preview === 'elevation' && _jsx(ElevationPreview, { value: entry.rawValue }), entry.preview === 'none' && _jsx(Box, { style: { width: 28 } }), _jsxs(Box, { style: { flex: 1, gap: Spacings['0,5V'] }, children: [_jsx(Typography, { style: {
69
77
  fontSize: 12,
70
78
  fontFamily: 'monospace',
71
79
  color: color.light.text['title-grey'],
@@ -6,5 +6,5 @@ import { JsonBlock } from '../components/JsonBlock';
6
6
  export const ThemeConstantDetailScreen = ({ name, value, beforeContent, sidebar, footerContent, }) => {
7
7
  const { text } = useTheme();
8
8
  const entries = typeof value === 'object' && value != null ? Object.entries(value) : [];
9
- return (_jsx(EcranDeCatalogue, { title: name, description: name, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: _jsx(Box, { display: "flex", gap: 16, children: entries.length === 0 ? (_jsx(JsonBlock, { value: value })) : (entries.map(([entryName, entryValue]) => (_jsxs(Box, { display: "flex", gap: 8, children: [_jsx(Typography, { style: text.Titres['H6 - XXS'], children: entryName }), _jsx(JsonBlock, { value: entryValue })] }, entryName)))) }) }));
9
+ return (_jsx(EcranDeCatalogue, { title: name, description: name, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: _jsx(Box, { display: "flex", gap: "2W", children: entries.length === 0 ? (_jsx(JsonBlock, { value: value })) : (entries.map(([entryName, entryValue]) => (_jsxs(Box, { display: "flex", gap: "1W", children: [_jsx(Typography, { style: text.Titres['H6 - XXS'], children: entryName }), _jsx(JsonBlock, { value: entryValue })] }, entryName)))) }) }));
10
10
  };
@@ -10,5 +10,5 @@ export const ThemeConstantsScreen = ({ constants, title = 'UI Kit - Constants',
10
10
  const { width } = useWindowDimensions();
11
11
  const columns = width >= 1200 ? 3 : width >= 768 ? 2 : 1;
12
12
  const entries = React.useMemo(() => getConstantEntries(constants), [constants]);
13
- return (_jsx(EcranDeCatalogue, { title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: 16, children: entries.map(([name, value]) => (_jsx(Box, { width: columns === 1 ? '100%' : columns === 2 ? '48%' : '31%', children: _jsx(Pressable, { accessibilityRole: "button", onPress: onSelectConstant ? () => onSelectConstant({ name, value }) : undefined, children: _jsx(Card, { children: _jsx(Box, { p: '100', children: _jsx(Typography, { style: text.Titres['H5 - XS'], children: name }) }) }) }) }, name))) }) }));
13
+ return (_jsx(EcranDeCatalogue, { title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, children: _jsx(Box, { display: "flex", flexDirection: "row", flexWrap: "wrap", gap: "2W", children: entries.map(([name, value]) => (_jsx(Box, { width: columns === 1 ? '100%' : columns === 2 ? '48%' : '31%', children: _jsx(Pressable, { accessibilityRole: "button", onPress: onSelectConstant ? () => onSelectConstant({ name, value }) : undefined, children: _jsx(Card, { children: _jsx(Box, { p: "2W", children: _jsx(Typography, { style: text.Titres['H5 - XS'], children: name }) }) }) }) }, name))) }) }));
14
14
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Accordion, Box, Typography } from '@alveole/components';
3
- import { useTheme } from '@alveole/theme';
3
+ import { Spacings, useTheme } from '@alveole/theme';
4
4
  import React from 'react';
5
5
  import { ColorSwatch } from '../components/ColorSwatch';
6
6
  import { EcranDeCatalogue, filDuTheme } from '../components/EcranDeCatalogue';
@@ -8,7 +8,7 @@ import { buildSections, compteDeJetons, sectionsOuvertesAuDepart } from './palet
8
8
  /** Une famille de couleurs, depliable, avec le nombre de jetons qu'elle contient. */
9
9
  const SectionDeCouleurs = ({ section }) => {
10
10
  const { color } = useTheme();
11
- return (_jsx(Accordion.Item, { value: section.title, label: section.title, variant: "alt", labelChildren: _jsx(Typography, { style: { fontSize: 11, color: color.light.text['mention-grey'] }, children: compteDeJetons(section) }), noPadding: true, children: _jsx(Box, { style: { flexDirection: 'row', flexWrap: 'wrap', gap: 8, padding: 8 }, children: section.entries.map(entry => (_jsx(ColorSwatch, { entry: entry }, entry.path))) }) }));
11
+ return (_jsx(Accordion.Item, { value: section.title, label: section.title, variant: "alt", labelChildren: _jsx(Typography, { style: { fontSize: 11, color: color.light.text['mention-grey'] }, children: compteDeJetons(section) }), noPadding: true, children: _jsx(Box, { style: { flexDirection: 'row', flexWrap: 'wrap', gap: Spacings['1W'], padding: Spacings['1W'] }, children: section.entries.map(entry => (_jsx(ColorSwatch, { entry: entry }, entry.path))) }) }));
12
12
  };
13
13
  export const ThemePaletteScreen = ({ palette, title = 'UI Kit - Couleurs du thème', description = 'Palette et couleurs du thème', beforeContent, sidebar, footerContent, }) => {
14
14
  const { color } = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Card, Typography } from '@alveole/components';
3
- import { useTheme } from '@alveole/theme';
3
+ import { Spacings, useTheme } from '@alveole/theme';
4
4
  import { View } from 'react-native';
5
5
  import { EcranDeCatalogue, filDuTheme } from '../components/EcranDeCatalogue';
6
6
  const isLeafStyle = (value) => typeof value === 'object' && value !== null && 'fontSize' in value && typeof value.fontSize === 'number';
@@ -38,10 +38,10 @@ const getFontInfo = (style) => {
38
38
  const DIVIDER_COLOR = '#E5E7EB';
39
39
  const MUTED_COLOR = '#6B7280';
40
40
  const PREVIEW_WIDTH = 96;
41
- const TableHeader = ({ labelStyle }) => (_jsxs(Box, { display: "flex", gap: 0, children: [_jsxs(Box, { display: "flex", flexDirection: "row", style: { paddingVertical: 8 }, children: [_jsx(Box, { style: { width: PREVIEW_WIDTH }, children: _jsx(Typography, { style: labelStyle, children: "Aper\u00E7u" }) }), _jsx(Box, { style: { flex: 2 }, children: _jsx(Typography, { style: labelStyle, children: "Nom" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Police" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Graisse" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Taille" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Hauteur" }) })] }), _jsx(View, { style: { height: 1, backgroundColor: DIVIDER_COLOR } })] }));
41
+ const TableHeader = ({ labelStyle }) => (_jsxs(Box, { display: "flex", gap: "0V", children: [_jsxs(Box, { display: "flex", flexDirection: "row", style: { paddingVertical: Spacings['1W'] }, children: [_jsx(Box, { style: { width: PREVIEW_WIDTH }, children: _jsx(Typography, { style: labelStyle, children: "Aper\u00E7u" }) }), _jsx(Box, { style: { flex: 2 }, children: _jsx(Typography, { style: labelStyle, children: "Nom" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Police" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Graisse" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Taille" }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: labelStyle, children: "Hauteur" }) })] }), _jsx(View, { style: { height: 1, backgroundColor: DIVIDER_COLOR } })] }));
42
42
  const TableRow = ({ entry, valueStyle }) => {
43
43
  const { family, weight } = getFontInfo(entry.style);
44
- return (_jsxs(Box, { display: "flex", gap: 0, children: [_jsxs(Box, { display: "flex", flexDirection: "row", style: { paddingVertical: 12, alignItems: 'center' }, children: [_jsx(Box, { style: { width: PREVIEW_WIDTH }, children: _jsx(Typography, { style: entry.style, children: "Aa" }) }), _jsx(Box, { style: { flex: 2 }, children: _jsx(Typography, { style: valueStyle, children: entry.label }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: family }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: weight }) }), _jsx(Box, { style: { flex: 1 }, children: _jsxs(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: [entry.style.fontSize, "px"] }) }), _jsx(Box, { style: { flex: 1 }, children: _jsxs(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: [entry.style.lineHeight, "px"] }) })] }), _jsx(View, { style: { height: 1, backgroundColor: DIVIDER_COLOR } })] }));
44
+ return (_jsxs(Box, { display: "flex", gap: "0V", children: [_jsxs(Box, { display: "flex", flexDirection: "row", style: { paddingVertical: Spacings['3V'], alignItems: 'center' }, children: [_jsx(Box, { style: { width: PREVIEW_WIDTH }, children: _jsx(Typography, { style: entry.style, children: "Aa" }) }), _jsx(Box, { style: { flex: 2 }, children: _jsx(Typography, { style: valueStyle, children: entry.label }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: family }) }), _jsx(Box, { style: { flex: 1 }, children: _jsx(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: weight }) }), _jsx(Box, { style: { flex: 1 }, children: _jsxs(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: [entry.style.fontSize, "px"] }) }), _jsx(Box, { style: { flex: 1 }, children: _jsxs(Typography, { style: [valueStyle, { color: MUTED_COLOR }], children: [entry.style.lineHeight, "px"] }) })] }), _jsx(View, { style: { height: 1, backgroundColor: DIVIDER_COLOR } })] }));
45
45
  };
46
46
  export const ThemeTypographyScreen = ({ typography, title = 'UI Kit - Theme typography', description = 'Theme text styles', beforeContent, sidebar, footerContent, }) => {
47
47
  const { text } = useTheme();
@@ -51,5 +51,5 @@ export const ThemeTypographyScreen = ({ typography, title = 'UI Kit - Theme typo
51
51
  key,
52
52
  entries: flattenStyles(value),
53
53
  }));
54
- return (_jsx(EcranDeCatalogue, { title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, breadcrumbsProps: filDuTheme, children: _jsx(Box, { display: "flex", gap: 16, children: categories.map(({ key, entries }) => (_jsx(Card, { children: _jsxs(Box, { display: "flex", gap: 16, p: "150", children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: key }), _jsxs(Box, { display: "flex", gap: 0, children: [_jsx(TableHeader, { labelStyle: labelStyle }), entries.map(entry => (_jsx(TableRow, { entry: entry, valueStyle: valueStyle }, entry.label)))] })] }) }, key))) }) }));
54
+ return (_jsx(EcranDeCatalogue, { title: title, description: description, sidebar: sidebar, beforeContent: beforeContent, footerContent: footerContent, breadcrumbsProps: filDuTheme, children: _jsx(Box, { display: "flex", gap: "2W", children: categories.map(({ key, entries }) => (_jsx(Card, { children: _jsxs(Box, { display: "flex", gap: "2W", p: "3W", children: [_jsx(Typography, { style: text.Titres['H4 - SM'], children: key }), _jsxs(Box, { display: "flex", gap: "0V", children: [_jsx(TableHeader, { labelStyle: labelStyle }), entries.map(entry => (_jsx(TableRow, { entry: entry, valueStyle: valueStyle }, entry.label)))] })] }) }, key))) }) }));
55
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveole/storybook",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.18",
4
4
  "description": "Catalog screens and helpers for Alveole stories and theme tokens.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,16 +20,16 @@
20
20
  "devDependencies": {
21
21
  "@alveole/eslint-config": "file:../eslint-config",
22
22
  "@testing-library/react": "16.3.3",
23
- "babel-preset-expo": "57.0.16",
23
+ "babel-preset-expo": "58.0.20",
24
24
  "eslint": "10.13.0",
25
25
  "jest": "29.7.0",
26
26
  "jest-environment-jsdom": "30.5.2",
27
- "jest-expo": "57.0.5",
28
- "react": "19.2.3",
29
- "react-dom": "19.2.3",
30
- "react-native": "0.86.3",
27
+ "jest-expo": "58.0.12",
28
+ "react": "19.3.0",
29
+ "react-dom": "19.3.0",
30
+ "react-native": "0.88.0",
31
31
  "react-native-web": "0.21.4",
32
- "tamagui": "3.0.18"
32
+ "tamagui": "3.1.3"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@alveole/components": "*",