@alveole/storybook 2.0.0-alpha.5 → 2.0.0-alpha.7

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 +1 @@
1
- {"version":3,"file":"ExemplesDeLaStory.d.ts","sourceRoot":"","sources":["../../src/components/ExemplesDeLaStory.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAiB,eAAe,EAAE,MAAM,UAAU,CAAC;AAuEnE,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,8FAA8F;IAC9F,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,GAAI,8BAA8B,sBAAsB,gCAUrF,CAAC"}
1
+ {"version":3,"file":"ExemplesDeLaStory.d.ts","sourceRoot":"","sources":["../../src/components/ExemplesDeLaStory.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAiB,eAAe,EAAE,MAAM,UAAU,CAAC;AAwEnE,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,8FAA8F;IAC9F,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,GAAI,8BAA8B,sBAAsB,gCAUrF,CAAC"}
@@ -4,6 +4,7 @@ import { FOCUS_ATTRIBUTE, useTheme } from '@alveole/theme';
4
4
  import { descriptionDeLExemple, sourceDeLExemple } from '../screens/sourcesDExemples';
5
5
  import { getStoryFlags } from '../utils';
6
6
  import { ExampleBlock } from './ExampleBlock';
7
+ import { styleDuLienBrut } from './styleDuLienBrut';
7
8
  /**
8
9
  * Une demonstration. Le titre et la description appartiennent au document : ils restent dans le
9
10
  * flux de la page, hors de tout cadre, pour pouvoir etre ancres et repris dans un sommaire. Le
@@ -21,7 +22,7 @@ const UnExemple = ({ story, nom, Rendu, gabarit }) => {
21
22
  */
22
23
  const StatutDeLaFiche = ({ meta }) => {
23
24
  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, rel: "noreferrer", style: { textDecoration: 'none' }, target: "_blank", [FOCUS_ATTRIBUTE]: 'ring', children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Bold, color: color.light.text['action-high-primary'] }, children: "Ouvrir Figma" }) })) : null] }));
25
+ 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, rel: "noreferrer", style: styleDuLienBrut, target: "_blank", [FOCUS_ATTRIBUTE]: 'ring', children: _jsx(Typography, { style: { ...text['Corps de texte'].SM.Bold, color: color.light.text['action-high-primary'] }, children: "Ouvrir Figma" }) })) : null] }));
25
26
  };
26
27
  /** Les demonstrations d'une fiche, les unes sous les autres, sous le statut de la fiche. */
27
28
  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)))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"StorySummary.d.ts","sourceRoot":"","sources":["../../src/components/StorySummary.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,YAAY,GAAI,aAAa,iBAAiB,gCA0B1D,CAAC"}
1
+ {"version":3,"file":"StorySummary.d.ts","sourceRoot":"","sources":["../../src/components/StorySummary.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,YAAY,GAAI,aAAa,iBAAiB,gCAqB1D,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, toSlug, Typography } from '@alveole/components';
3
3
  import { FOCUS_ATTRIBUTE, useTheme } from '@alveole/theme';
4
+ import { styleDuLienBrut } from './styleDuLienBrut';
4
5
  /** Le sommaire d'une page : une entrée par section, vers l'ancre que pose son titre. */
5
6
  export const StorySummary = ({ entrees }) => {
6
7
  const { color, text } = useTheme();
7
- 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: { textDecoration: 'none' }, [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: 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
9
  };
@@ -60,7 +60,7 @@ const useNavItemStyles = makeStyles(({ color, radius, spacingValue, text }) => {
60
60
  */
61
61
  const NavItem = ({ label, href, current, block = false }) => {
62
62
  const styles = useNavItemStyles();
63
- return (_jsxs(A, { href: href, direction: "replace", ariaCurrent: current ? 'page' : undefined, style: { ...styles.container, alignItems: block ? 'flex-start' : 'center' }, hoverStyle: styles.containerHover, children: [_jsx(Typography, { style: current ? styles.labelCurrent : styles.label, children: label }), _jsx(Box, { "aria-hidden": true, children: _jsx(Typography, { style: styles.labelGhost, children: label }) })] }));
63
+ return (_jsxs(A, { href: href, direction: "replace", ariaCurrent: current ? 'page' : undefined, style: { ...styles.container, alignItems: block ? 'flex-start' : 'center' }, backgroundColor: { hover: styles.containerHover.backgroundColor }, children: [_jsx(Typography, { style: current ? styles.labelCurrent : styles.label, children: label }), _jsx(Box, { "aria-hidden": true, children: _jsx(Typography, { style: styles.labelGhost, children: label }) })] }));
64
64
  };
65
65
  /**
66
66
  * La barre en version mobile : un menu qui se deplie sous l'entete. L'etat d'ouverture vit ici,
@@ -0,0 +1,9 @@
1
+ import type { CSSProperties } from 'react';
2
+ /**
3
+ * Le style d'un `<a>` brut du catalogue qui enveloppe un libellé. En flex, le libellé devient
4
+ * un bloc à sa propre hauteur de ligne : sinon le lien garde celle de la police que Tamagui v2
5
+ * remet sur chaque vue, plus haute, et décale son libellé. En colonne, le libellé s'étire à la
6
+ * largeur du lien et passe à la ligne, là où une rangée le laissait déborder.
7
+ */
8
+ export declare const styleDuLienBrut: CSSProperties;
9
+ //# sourceMappingURL=styleDuLienBrut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleDuLienBrut.d.ts","sourceRoot":"","sources":["../../src/components/styleDuLienBrut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,aAAoF,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Le style d'un `<a>` brut du catalogue qui enveloppe un libellé. En flex, le libellé devient
3
+ * un bloc à sa propre hauteur de ligne : sinon le lien garde celle de la police que Tamagui v2
4
+ * remet sur chaque vue, plus haute, et décale son libellé. En colonne, le libellé s'étire à la
5
+ * largeur du lien et passe à la ligne, là où une rangée le laissait déborder.
6
+ */
7
+ export const styleDuLienBrut = { display: 'flex', flexDirection: 'column', textDecoration: 'none' };
@@ -1 +1 @@
1
- {"version":3,"file":"migrationV2.d.ts","sourceRoot":"","sources":["../../src/pages/migrationV2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,4BAA4B,gfAKV,CAAC;AAEhC,eAAO,MAAM,wBAAwB,EAAE,SAAS,kBAAkB,EA6lBjE,CAAC"}
1
+ {"version":3,"file":"migrationV2.d.ts","sourceRoot":"","sources":["../../src/pages/migrationV2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,4BAA4B,gfAKV,CAAC;AAEhC,eAAO,MAAM,wBAAwB,EAAE,SAAS,kBAAkB,EAopBjE,CAAC"}
@@ -471,7 +471,7 @@ de la liste : \`options={[...selectedOption ? [selectedOption] : [], ...suggesti
471
471
  },
472
472
  {
473
473
  titre: '5. Icônes → leading / trailing',
474
- markdown: `Détail et justification : [leading-trailing.md](https://github.com/Captive-Studio/alveole-js/blob/main/docs/migrations/leading-trailing.md).
474
+ markdown: `Détail et justification : [leading-trailing.md](https://github.com/captive-studio/alveole-js/blob/main/docs/migrations/leading-trailing.md).
475
475
 
476
476
  \`\`\`bash
477
477
  git grep -nE "startIcon|endIcon|\\bicon[=:]"
@@ -597,7 +597,62 @@ Les clés de spacing dépréciées existent toujours (non cassant) mais leurs us
597
597
  l'échelle V/W quand on y passe.`,
598
598
  },
599
599
  {
600
- titre: '8. Vérification finale',
600
+ titre: '8. Tamagui v2',
601
+ markdown: `Détail, changements de rendu et relevé par application : [tamagui-v2.md](https://github.com/captive-studio/alveole-js/blob/main/docs/migrations/tamagui-v2.md).
602
+
603
+ Alveole 2.0 exige Tamagui 3 (section 8 bis) : une application en Tamagui 1 fait d'abord ce saut
604
+ vers la v2, puis celui vers la v3, dans cet ordre. Monter **tous** les paquets \`tamagui\` /
605
+ \`@tamagui/*\` de l'application au même numéro exact, et aligner la clé \`allowScripts\` sur la
606
+ version des paquets \`@alveole/*\` (version unique, ADR 0029).
607
+
608
+ \`\`\`bash
609
+ git grep -nE "[^a-zA-Z]animation=|onHover(In|Out)|disablePassBorderRadius"
610
+ \`\`\`
611
+
612
+ | Avant | Après |
613
+ | ------------------------------------------------------- | --------------------------------- |
614
+ | \`animation="…"\` sur un composant Tamagui | \`transition="…"\` |
615
+ | \`onHoverIn\` / \`onHoverOut\` sur Tamagui ou \`Box\` | \`onMouseEnter\` / \`onMouseLeave\` |
616
+ | \`disablePassBorderRadius\` | retirer |
617
+ | \`dataSet\` sur un composant Tamagui | attribut direct \`data-x="…"\` |
618
+
619
+ \`onHoverIn\` reste valable sur un \`Pressable\` React Native. Ne change pas : \`tag\` de \`Box\` et
620
+ \`Typography\`, et les éléments DOM rendus (un sélecteur CSS sur \`data-table\` reste valable).
621
+
622
+ Changements de rendu, invisibles au typecheck et en jsdom :
623
+
624
+ - **chaque vue reprend la police de l'app**, hauteur de ligne comprise : un style de texte posé sur
625
+ une vue ne descend plus aux enfants, et un texte sans hauteur de ligne prend celle de la config
626
+ (23 px en \`@tamagui/config\` v3). Les \`Typography\` d'Alveole posent \`normal\` par défaut ;
627
+ - **plus de \`position: relative\` par défaut** : poser \`position: 'relative'\` sur le conteneur d'un
628
+ enfant absolu, ou \`settings.defaultPosition: 'relative'\` ;
629
+ - **\`flex: 1\` devient \`1 1 0px\`** sur le web : \`flexGrow: 1\`, ou \`settings.styleCompat: 'legacy'\` ;
630
+ - \`Image\` rend un vrai \`<img>\` (\`alt\` exigé) ; \`Switch\` ne compte plus padding ni bordure.`,
631
+ },
632
+ {
633
+ titre: '8 bis. Tamagui v3',
634
+ markdown: `Détail, changements de rendu et relevé par application : [tamagui-v3.md](https://github.com/captive-studio/alveole-js/blob/main/docs/migrations/tamagui-v3.md).
635
+
636
+ Les peer dependencies Tamagui d'Alveole sont en \`^3.0.0\` seul.
637
+
638
+ - **config** : \`@tamagui/config/v3\` et \`/v4\` n'existent plus ; passer à \`@tamagui/config/v5\` avec
639
+ les animations de \`@tamagui/config/v5-css\` ;
640
+ - **\`SafeAreaProvider\`** enveloppe \`TamaguiProvider\`, tests compris ;
641
+ - **\`@tamagui/babel-plugin\`** n'a pas de version 3 : le retirer de \`package.json\` et de
642
+ \`babel.config.js\` ;
643
+ - **pseudo-états en clauses** : \`hoverStyle\` et ses voisins disparaissent, de \`Box\` et
644
+ \`Typography\` aussi (ADR 0031). La valeur de repos et sa clause vivent sur la même prop :
645
+ \`backgroundColor={{ default: repos, hover: survol }}\`, propriété sortie de \`style\`.
646
+
647
+ \`\`\`bash
648
+ git grep -nwE "hoverStyle|pressStyle|focusStyle|focusVisibleStyle|enterStyle|exitStyle|disabledStyle"
649
+ \`\`\`
650
+
651
+ Ce qu'Alveole ne prend pas en charge suit le guide officiel :
652
+ [How to upgrade](https://tamagui.dev/docs/guides/how-to-upgrade).`,
653
+ },
654
+ {
655
+ titre: '9. Vérification finale',
601
656
  markdown: `\`\`\`bash
602
657
  git grep -nE "\\b(TextField|TextareaField|EmailField|EmailInput|PasswordField|PhoneField|PhoneInput|NumberField|OtpField|FileField|SelectMultiple|Autocomplete\\w*|NativePicker|SelectInput)\\b|startIcon|endIcon|variant=['\\"]link['\\"]|size=['\\"]xs['\\"]|noPadding|borderNone|leftAlign|\\boptional(Text)?[=:]|onActions|actionsIcon|<Tag\\b[^>]*\\bcolor=|Inter-|Barlow-"
603
658
  \`\`\`
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeTypographyScreen.d.ts","sourceRoot":"","sources":["../../src/screens/ThemeTypographyScreen.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;AAwGF,eAAO,MAAM,qBAAqB,GAAI,4EAOnC,0BAA0B,gCAqC5B,CAAC"}
1
+ {"version":3,"file":"ThemeTypographyScreen.d.ts","sourceRoot":"","sources":["../../src/screens/ThemeTypographyScreen.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;AAwGF,eAAO,MAAM,qBAAqB,GAAI,4EAOnC,0BAA0B,gCAqC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveole/storybook",
3
- "version": "2.0.0-alpha.5",
3
+ "version": "2.0.0-alpha.7",
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,8 +20,8 @@
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.14",
24
- "eslint": "10.10.0",
23
+ "babel-preset-expo": "57.0.16",
24
+ "eslint": "10.13.0",
25
25
  "jest": "29.7.0",
26
26
  "jest-environment-jsdom": "30.5.2",
27
27
  "jest-expo": "57.0.5",
@@ -29,7 +29,7 @@
29
29
  "react-dom": "19.2.3",
30
30
  "react-native": "0.86.3",
31
31
  "react-native-web": "0.21.4",
32
- "tamagui": "1.144.4"
32
+ "tamagui": "3.0.18"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@alveole/components": "*",