@alveole/storybook 2.0.0-alpha.12 → 2.0.0-alpha.13

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":"ExampleBlock.d.ts","sourceRoot":"","sources":["../../src/components/ExampleBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AA8F1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0FAA0F;IAC1F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,YAAY,GAAI,kCAA0C,iBAAiB,sBAkCvF,CAAC"}
1
+ {"version":3,"file":"ExampleBlock.d.ts","sourceRoot":"","sources":["../../src/components/ExampleBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuH1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0FAA0F;IAC1F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,YAAY,GAAI,kCAA0C,iBAAiB,sBAkCvF,CAAC"}
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Box, Button, Highlight, Typography } from '@alveole/components';
3
3
  import { useTheme } from '@alveole/theme';
4
4
  import React from 'react';
5
- import { Platform } from 'react-native';
5
+ import { Platform, StyleSheet } from 'react-native';
6
+ import Svg, { Circle, Defs, Pattern, Rect } from 'react-native-svg';
6
7
  import { decouperSource } from '../storySource';
7
8
  /** Au delà, la source prend plus de place que ce qu'elle documente. */
8
9
  const LIGNES_VISIBLES = 12;
@@ -17,14 +18,17 @@ const PAS_DE_LA_TRAME = 16;
17
18
  */
18
19
  const Scene = ({ children, pleinEcran }) => {
19
20
  const { color } = useTheme();
20
- return (_jsx(Box, { p: Platform.OS === 'web' ? '3W' : '1W', style: {
21
+ const trameId = `trame-${React.useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;
22
+ return (_jsxs(Box, { p: Platform.OS === 'web' ? '3W' : '1W', style: {
21
23
  backgroundColor: color.light.background['default-grey'],
22
- backgroundImage: `radial-gradient(circle, ${color.light.border['default-grey']} 1px, transparent 1px)`,
23
- backgroundSize: `${PAS_DE_LA_TRAME}px ${PAS_DE_LA_TRAME}px`,
24
+ ...(Platform.OS === 'web' && {
25
+ backgroundImage: `radial-gradient(circle, ${color.light.border['default-grey']} 1px, transparent 1px)`,
26
+ backgroundSize: `${PAS_DE_LA_TRAME}px ${PAS_DE_LA_TRAME}px`,
27
+ }),
24
28
  alignItems: pleinEcran ? undefined : 'center',
25
29
  justifyContent: 'center',
26
30
  minHeight: pleinEcran ? 420 : 160,
27
- }, children: children }));
31
+ }, children: [Platform.OS !== 'web' && (_jsxs(Svg, { style: StyleSheet.absoluteFill, pointerEvents: "none", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: [_jsx(Defs, { children: _jsx(Pattern, { id: trameId, width: PAS_DE_LA_TRAME, height: PAS_DE_LA_TRAME, patternUnits: "userSpaceOnUse", children: _jsx(Circle, { cx: PAS_DE_LA_TRAME / 2, cy: PAS_DE_LA_TRAME / 2, r: 1, fill: color.light.border['default-grey'] }) }) }), _jsx(Rect, { width: "100%", height: "100%", fill: `url(#${trameId})` })] })), children] }));
28
32
  };
29
33
  /**
30
34
  * La barre qui sépare la démonstration de sa source : elle dit où finit ce qu'on montre et
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveole/storybook",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.13",
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",
@@ -36,7 +36,8 @@
36
36
  "@alveole/core": "*",
37
37
  "@alveole/theme": "*",
38
38
  "react": "*",
39
- "react-native": "*"
39
+ "react-native": "*",
40
+ "react-native-svg": "^15.0.0"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "pnpm run generate:sources && tsc -p tsconfig.build.json",