@alveole/components 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/AnchorHeading/AnchorHeading.d.ts +7 -0
- package/dist/core/AnchorHeading/AnchorHeading.d.ts.map +1 -0
- package/dist/core/AnchorHeading/AnchorHeading.js +3 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.d.ts +13 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.d.ts.map +1 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.js +17 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.sources.d.ts +6 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.sources.d.ts.map +1 -0
- package/dist/core/AnchorHeading/AnchorHeading.stories.sources.js +6 -0
- package/dist/core/AnchorHeading/AnchorHeading.web.d.ts +3 -0
- package/dist/core/AnchorHeading/AnchorHeading.web.d.ts.map +1 -0
- package/dist/core/AnchorHeading/AnchorHeading.web.js +23 -0
- package/dist/core/AnchorHeading/index.d.ts +2 -0
- package/dist/core/AnchorHeading/index.d.ts.map +1 -0
- package/dist/core/AnchorHeading/index.js +1 -0
- package/dist/core/Version/Version.stories.d.ts +2 -1
- package/dist/core/Version/Version.stories.d.ts.map +1 -1
- package/dist/core/Version/Version.styles.d.ts +2 -1
- package/dist/core/Version/Version.styles.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/stories/index.d.ts +1 -0
- package/dist/stories/index.d.ts.map +1 -1
- package/dist/stories/index.js +1 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.d.ts +4 -2
- package/dist/ui/ActionMenu/ActionMenu.stories.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.js +48 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.d.ts +2 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.js +2 -0
- package/dist/ui/Avatar/Avatar.stories.d.ts +2 -1
- package/dist/ui/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/ui/Avatar/Avatar.styles.d.ts +2 -1
- package/dist/ui/Avatar/Avatar.styles.d.ts.map +1 -1
- package/dist/ui/Badge/Badge.stories.d.ts +4 -2
- package/dist/ui/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/ui/Badge/Badge.styles.d.ts +4 -2
- package/dist/ui/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.d.ts +7 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts +6 -2
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.js +10 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.d.ts +4 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.js +4 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.styles.d.ts +4 -2
- package/dist/ui/Breadcrumbs/Breadcrumbs.styles.d.ts.map +1 -1
- package/dist/ui/Button/Button.stories.d.ts +8 -4
- package/dist/ui/Button/Button.stories.d.ts.map +1 -1
- package/dist/ui/Button/Button.styles.d.ts +8 -4
- package/dist/ui/Button/Button.styles.d.ts.map +1 -1
- package/dist/ui/Card/Card.stories.d.ts +4 -2
- package/dist/ui/Card/Card.stories.d.ts.map +1 -1
- package/dist/ui/Card/CardHeader.styles.d.ts +4 -2
- package/dist/ui/Card/CardHeader.styles.d.ts.map +1 -1
- package/dist/ui/Card/CardSection.styles.d.ts +4 -2
- package/dist/ui/Card/CardSection.styles.d.ts.map +1 -1
- package/dist/ui/DocumentViewer/DocumentViewer.stories.d.ts +4 -2
- package/dist/ui/DocumentViewer/DocumentViewer.stories.d.ts.map +1 -1
- package/dist/ui/DocumentViewer/DocumentViewer.styles.d.ts +4 -2
- package/dist/ui/DocumentViewer/DocumentViewer.styles.d.ts.map +1 -1
- package/dist/ui/EmptyState/EmptyState.stories.d.ts +4 -2
- package/dist/ui/EmptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/ui/EmptyState/EmptyState.styles.d.ts +4 -2
- package/dist/ui/EmptyState/EmptyState.styles.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.stories.d.ts +4 -2
- package/dist/ui/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.styles.d.ts +4 -2
- package/dist/ui/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/ui/PageHeader/PageHeader.stories.d.ts +2 -1
- package/dist/ui/PageHeader/PageHeader.stories.d.ts.map +1 -1
- package/dist/ui/PageHeader/PageHeader.styles.d.ts +2 -1
- package/dist/ui/PageHeader/PageHeader.styles.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts +2 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts +2 -1
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.d.ts +2 -1
- package/dist/ui/ResourceList/ResourceList.stories.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.styles.d.ts +2 -1
- package/dist/ui/ResourceList/ResourceList.styles.d.ts.map +1 -1
- package/dist/ui/Sidebar/Sidebar.stories.d.ts +16 -8
- package/dist/ui/Sidebar/Sidebar.stories.d.ts.map +1 -1
- package/dist/ui/Sidebar/Sidebar.styles.d.ts +16 -8
- package/dist/ui/Sidebar/Sidebar.styles.d.ts.map +1 -1
- package/dist/ui/Signature/Signature.stories.d.ts +3 -2
- package/dist/ui/Signature/Signature.stories.d.ts.map +1 -1
- package/dist/ui/Signature/Signature.styles.d.ts +3 -2
- package/dist/ui/Signature/Signature.styles.d.ts.map +1 -1
- package/dist/ui/Signature/Signature.styles.js +4 -4
- package/dist/ui/Tabs/Tabs.stories.d.ts +6 -3
- package/dist/ui/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/ui/Tabs/Tabs.styles.d.ts +6 -3
- package/dist/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.stories.d.ts +4 -2
- package/dist/ui/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.styles.d.ts +4 -2
- package/dist/ui/Tag/Tag.styles.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.stories.d.ts +4 -2
- package/dist/ui/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.styles.d.ts +4 -2
- package/dist/ui/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts +2 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.styles.d.ts +2 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.styles.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +8 -4
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts +8 -4
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TypographyProps } from '../Typography';
|
|
2
|
+
export type AnchorHeadingProps = {
|
|
3
|
+
children: string;
|
|
4
|
+
style?: TypographyProps['style'];
|
|
5
|
+
};
|
|
6
|
+
export declare const AnchorHeading: ({ children, style }: AnchorHeadingProps) => import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=AnchorHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorHeading.d.ts","sourceRoot":"","sources":["../../../src/core/AnchorHeading/AnchorHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,qBAAqB,kBAAkB,gCAEpE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: "core"[];
|
|
4
|
+
experimental: true;
|
|
5
|
+
webOnly: true;
|
|
6
|
+
description: string;
|
|
7
|
+
component: ({ children, style }: import("./AnchorHeading").AnchorHeadingProps) => import("react").JSX.Element;
|
|
8
|
+
styleFn: () => {};
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
12
|
+
export * as Sources from './AnchorHeading.stories.sources';
|
|
13
|
+
//# sourceMappingURL=AnchorHeading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorHeading.stories.d.ts","sourceRoot":"","sources":["../../../src/core/AnchorHeading/AnchorHeading.stories.tsx"],"names":[],"mappings":";;;;;;;;;AAIA,wBAQkB;AAElB,eAAO,MAAM,OAAO,mCAGnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@alveole/theme';
|
|
3
|
+
import { AnchorHeading } from './AnchorHeading';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'AnchorHeading',
|
|
6
|
+
tags: ['core'],
|
|
7
|
+
experimental: true,
|
|
8
|
+
webOnly: true,
|
|
9
|
+
description: 'Titre avec ancre navigable au survol — id slug généré automatiquement.',
|
|
10
|
+
component: AnchorHeading,
|
|
11
|
+
styleFn: () => ({}),
|
|
12
|
+
};
|
|
13
|
+
export const Default = () => {
|
|
14
|
+
const { text } = useTheme();
|
|
15
|
+
return _jsx(AnchorHeading, { style: text.Titres['H5 - XS'], children: "Mon exemple de titre" });
|
|
16
|
+
};
|
|
17
|
+
export * as Sources from './AnchorHeading.stories.sources';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorHeading.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/core/AnchorHeading/AnchorHeading.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2K,CAAC;AAEhM,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file is generated. Do not edit manually.
|
|
2
|
+
// Source: src/core/AnchorHeading/AnchorHeading.stories.tsx
|
|
3
|
+
export const Default = () => "export const Default = () => {\n const { text } = useTheme();\n return <AnchorHeading style={text.Titres['H5 - XS']}>Mon exemple de titre</AnchorHeading>;\n};";
|
|
4
|
+
export const storySources = {
|
|
5
|
+
Default,
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorHeading.web.d.ts","sourceRoot":"","sources":["../../../src/core/AnchorHeading/AnchorHeading.web.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAU1D,eAAO,MAAM,aAAa,GAAI,qBAAqB,kBAAkB,gCAkCpE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@alveole/theme';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { LucideIcon } from '../../ui/LucideIcon';
|
|
5
|
+
import { Typography } from '../Typography';
|
|
6
|
+
const toSlug = (value) => value
|
|
7
|
+
.toLowerCase()
|
|
8
|
+
.normalize('NFD')
|
|
9
|
+
.replace(/[̀-ͯ]/g, '')
|
|
10
|
+
.replace(/\s+/g, '-')
|
|
11
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
12
|
+
export const AnchorHeading = ({ children, style }) => {
|
|
13
|
+
const { color } = useTheme();
|
|
14
|
+
const [hovered, setHovered] = useState(false);
|
|
15
|
+
const [iconHovered, setIconHovered] = useState(false);
|
|
16
|
+
const slug = toSlug(children);
|
|
17
|
+
return (_jsxs("div", { id: slug, style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 6 }, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [_jsx(Typography, { style: style, children: children }), _jsx("a", { href: `#${slug}`, style: {
|
|
18
|
+
opacity: hovered ? 1 : 0,
|
|
19
|
+
transition: 'opacity 0.15s',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
}, onMouseEnter: () => setIconHovered(true), onMouseLeave: () => setIconHovered(false), children: _jsx(LucideIcon, { name: "Link", size: "sm", color: iconHovered ? color.light.system.focus : color.light.text['default-grey'] }) })] }));
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/AnchorHeading/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnchorHeading';
|
|
@@ -7,10 +7,11 @@ declare const _default: {
|
|
|
7
7
|
styleFn: () => {
|
|
8
8
|
container: {
|
|
9
9
|
color: "#5F6571";
|
|
10
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
11
10
|
fontSize: 12;
|
|
12
11
|
lineHeight: 20;
|
|
13
12
|
letterSpacing: 0;
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
14
15
|
padding: import("@alveole/theme").Spacing;
|
|
15
16
|
textAlign: "center";
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Version.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Version/Version.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Version.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Version/Version.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,mCAAoB,CAAC;AAEzC,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export declare const useStyles: () => {
|
|
2
2
|
container: {
|
|
3
3
|
color: "#5F6571";
|
|
4
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
5
4
|
fontSize: 12;
|
|
6
5
|
lineHeight: 20;
|
|
7
6
|
letterSpacing: 0;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
8
9
|
padding: import("@alveole/theme").Spacing;
|
|
9
10
|
textAlign: "center";
|
|
10
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Version.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Version/Version.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Version.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Version/Version.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;CAOnB,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,KAAK,CAAC;AACpB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,KAAK,CAAC;AACpB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ALVEOLE_COMPONENTS_VERSION: "0.
|
|
1
|
+
export declare const ALVEOLE_COMPONENTS_VERSION: "0.41.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ALVEOLE_COMPONENTS_VERSION = "0.
|
|
1
|
+
export const ALVEOLE_COMPONENTS_VERSION = "0.41.0";
|
package/dist/stories/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as AStory from '../core/A/A.stories';
|
|
2
|
+
export * as AnchorHeadingStory from '../core/AnchorHeading/AnchorHeading.stories';
|
|
2
3
|
export * as BoxStory from '../core/Box/Box.stories';
|
|
3
4
|
export * as Highlight from '../core/Highlight/Highlight.stories';
|
|
4
5
|
export * as ImageStory from '../core/Image/Image.stories';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stories/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,eAAe,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,mBAAmB,MAAM,6CAA6C,CAAC;AACnF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,iBAAiB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,qBAAqB,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stories/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,kBAAkB,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,eAAe,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,mBAAmB,MAAM,6CAA6C,CAAC;AACnF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,iBAAiB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,qBAAqB,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC"}
|
package/dist/stories/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Core
|
|
2
2
|
export * as AStory from '../core/A/A.stories';
|
|
3
|
+
export * as AnchorHeadingStory from '../core/AnchorHeading/AnchorHeading.stories';
|
|
3
4
|
export * as BoxStory from '../core/Box/Box.stories';
|
|
4
5
|
export * as Highlight from '../core/Highlight/Highlight.stories';
|
|
5
6
|
export * as ImageStory from '../core/Image/Image.stories';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
4
|
tags: "ui"[];
|
|
4
5
|
experimental: false;
|
|
5
6
|
figmaURL: string;
|
|
6
7
|
description: string;
|
|
7
|
-
component: ((props: import("./ActionMenu").ActionMenuProps) =>
|
|
8
|
+
component: ((props: import("./ActionMenu").ActionMenuProps) => React.JSX.Element) & {
|
|
8
9
|
Item: typeof import("./ActionMenuItem").ActionMenuItem;
|
|
9
10
|
};
|
|
10
11
|
styleFn: () => string;
|
|
11
12
|
};
|
|
12
13
|
export default _default;
|
|
13
|
-
export declare const Default: () =>
|
|
14
|
+
export declare const Default: () => React.JSX.Element;
|
|
15
|
+
export declare const Filters: () => React.JSX.Element;
|
|
14
16
|
export * as Sources from './ActionMenu.stories.sources';
|
|
15
17
|
//# sourceMappingURL=ActionMenu.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;AAO1B,wBAQkB;AAElB,eAAO,MAAM,OAAO,yBAuCnB,CAAC;AAIF,eAAO,MAAM,OAAO,yBAqFnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Platform, ScrollView } from 'react-native';
|
|
2
4
|
import { Box } from '../../core';
|
|
3
5
|
import { Button } from '../Button';
|
|
4
6
|
import { ActionMenu } from './ActionMenu';
|
|
@@ -28,4 +30,50 @@ export const Default = () => {
|
|
|
28
30
|
];
|
|
29
31
|
return (_jsx(Box, { display: "flex", flexWrap: "wrap", gap: "1W", flexDirection: "row", "justify-content": "center", "align-items": "center", width: "100%", children: alignments.map(alignment => (_jsxs(ActionMenu, { placement: alignment, renderTrigger: () => _jsx(Button, { variant: "secondary", title: alignment }), children: [_jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Settings", selected: true }), _jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Copy" }), _jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Trash" })] }, alignment))) }));
|
|
30
32
|
};
|
|
33
|
+
export const Filters = () => {
|
|
34
|
+
const filters = [
|
|
35
|
+
{ id: 'epic', title: 'Epic', options: ['Refonte design', 'Onboarding', 'Facturation'] },
|
|
36
|
+
{ id: 'type', title: 'Type', options: ['Bug', 'Story', 'Tâche'] },
|
|
37
|
+
{
|
|
38
|
+
id: 'filtresRapides',
|
|
39
|
+
title: 'Filtres rapides',
|
|
40
|
+
options: ['Assigné à moi', 'En cours', 'En retard'],
|
|
41
|
+
multi: true,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
const [openId, setOpenId] = React.useState(null);
|
|
45
|
+
const [singleSelected, setSingleSelected] = React.useState({});
|
|
46
|
+
const [multiSelected, setMultiSelected] = React.useState({});
|
|
47
|
+
return (_jsx(ScrollView, { horizontal: true, nestedScrollEnabled: true, directionalLockEnabled: Platform.OS === 'ios', showsHorizontalScrollIndicator: false, contentContainerStyle: { flexDirection: 'row', gap: 8, paddingHorizontal: 16 }, children: filters.map(filter => {
|
|
48
|
+
const isOpen = openId === filter.id;
|
|
49
|
+
const hasSelection = filter.multi
|
|
50
|
+
? (multiSelected[filter.id]?.length ?? 0) > 0
|
|
51
|
+
: singleSelected[filter.id] != null;
|
|
52
|
+
return (_jsx(ActionMenu, { placement: "bottom-start", scrollable: false, open: isOpen, setOpen: open => setOpenId(open ? filter.id : null), renderTrigger: () => (_jsx(Button, { variant: "secondary", title: filter.title, endIcon: "ChevronDown", size: "sm", selected: hasSelection, active: isOpen })), children: filter.options.map(option => {
|
|
53
|
+
const isSelected = filter.multi
|
|
54
|
+
? (multiSelected[filter.id] ?? []).includes(option)
|
|
55
|
+
: singleSelected[filter.id] === option;
|
|
56
|
+
return (_jsx(ActionMenu.Item, { title: option, selected: isSelected, onPress: () => {
|
|
57
|
+
if (filter.multi) {
|
|
58
|
+
setMultiSelected(prev => {
|
|
59
|
+
const current = prev[filter.id] ?? [];
|
|
60
|
+
return {
|
|
61
|
+
...prev,
|
|
62
|
+
[filter.id]: current.includes(option)
|
|
63
|
+
? current.filter(o => o !== option)
|
|
64
|
+
: [...current, option],
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
setSingleSelected(prev => ({
|
|
70
|
+
...prev,
|
|
71
|
+
[filter.id]: prev[filter.id] === option ? undefined : option,
|
|
72
|
+
}));
|
|
73
|
+
setOpenId(null);
|
|
74
|
+
}
|
|
75
|
+
} }, option));
|
|
76
|
+
}) }, filter.id));
|
|
77
|
+
}) }));
|
|
78
|
+
};
|
|
31
79
|
export * as Sources from './ActionMenu.stories.sources';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const Default: () => string;
|
|
2
|
+
export declare const Filters: () => string;
|
|
2
3
|
export declare const storySources: {
|
|
3
4
|
readonly Default: () => string;
|
|
5
|
+
readonly Filters: () => string;
|
|
4
6
|
};
|
|
5
7
|
export type StorySourceName = keyof typeof storySources;
|
|
6
8
|
//# sourceMappingURL=ActionMenu.stories.sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2/B,CAAC;AAEhhC,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"ActionMenu.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2/B,CAAC;AAEhhC,eAAO,MAAM,OAAO,cAA0jG,CAAC;AAE/kG,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This file is generated. Do not edit manually.
|
|
2
2
|
// Source: src/ui/ActionMenu/ActionMenu.stories.tsx
|
|
3
3
|
export const Default = () => "export const Default = () => {\n const alignments = [\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'bottom-start',\n 'bottom-end',\n 'left-start',\n 'left-end',\n ] as const;\n\n return (\n <Box\n display=\"flex\"\n flexWrap=\"wrap\"\n gap=\"1W\"\n flexDirection=\"row\"\n justify-content=\"center\"\n align-items=\"center\"\n width=\"100%\"\n >\n {alignments.map(alignment => (\n <ActionMenu\n key={alignment}\n placement={alignment}\n renderTrigger={() => <Button variant=\"secondary\" title={alignment} />}\n >\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Settings\" selected />\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Copy\" />\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Trash\" />\n </ActionMenu>\n ))}\n </Box>\n );\n};";
|
|
4
|
+
export const Filters = () => "export const Filters = () => {\n const filters: { id: FilterId; title: string; options: string[]; multi?: boolean }[] = [\n { id: 'epic', title: 'Epic', options: ['Refonte design', 'Onboarding', 'Facturation'] },\n { id: 'type', title: 'Type', options: ['Bug', 'Story', 'Tâche'] },\n {\n id: 'filtresRapides',\n title: 'Filtres rapides',\n options: ['Assigné à moi', 'En cours', 'En retard'],\n multi: true,\n },\n ];\n\n const [openId, setOpenId] = React.useState<FilterId | null>(null);\n const [singleSelected, setSingleSelected] = React.useState<Partial<Record<FilterId, string>>>({});\n const [multiSelected, setMultiSelected] = React.useState<Partial<Record<FilterId, string[]>>>({});\n\n return (\n <ScrollView\n horizontal\n nestedScrollEnabled\n directionalLockEnabled={Platform.OS === 'ios'}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ flexDirection: 'row', gap: 8, paddingHorizontal: 16 }}\n >\n {filters.map(filter => {\n const isOpen = openId === filter.id;\n const hasSelection = filter.multi\n ? (multiSelected[filter.id]?.length ?? 0) > 0\n : singleSelected[filter.id] != null;\n\n return (\n <ActionMenu\n key={filter.id}\n placement=\"bottom-start\"\n scrollable={false}\n open={isOpen}\n setOpen={open => setOpenId(open ? filter.id : null)}\n renderTrigger={() => (\n <Button\n variant=\"secondary\"\n title={filter.title}\n endIcon=\"ChevronDown\"\n size=\"sm\"\n selected={hasSelection}\n active={isOpen}\n />\n )}\n >\n {filter.options.map(option => {\n const isSelected = filter.multi\n ? (multiSelected[filter.id] ?? []).includes(option)\n : singleSelected[filter.id] === option;\n\n return (\n <ActionMenu.Item\n key={option}\n title={option}\n selected={isSelected}\n onPress={() => {\n if (filter.multi) {\n setMultiSelected(prev => {\n const current = prev[filter.id] ?? [];\n return {\n ...prev,\n [filter.id]: current.includes(option)\n ? current.filter(o => o !== option)\n : [...current, option],\n };\n });\n } else {\n setSingleSelected(prev => ({\n ...prev,\n [filter.id]: prev[filter.id] === option ? undefined : option,\n }));\n setOpenId(null);\n }\n }}\n />\n );\n })}\n </ActionMenu>\n );\n })}\n </ScrollView>\n );\n};";
|
|
4
5
|
export const storySources = {
|
|
5
6
|
Default,
|
|
7
|
+
Filters,
|
|
6
8
|
};
|
|
@@ -17,10 +17,11 @@ declare const _default: {
|
|
|
17
17
|
display: "flex";
|
|
18
18
|
justifyContent: "center";
|
|
19
19
|
textAlign: "center";
|
|
20
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
21
20
|
fontSize: 16;
|
|
22
21
|
lineHeight: 24;
|
|
23
22
|
letterSpacing: 0;
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
24
25
|
};
|
|
25
26
|
image: {};
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAUlB,eAAO,MAAM,KAAK,mCAQjB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAK5B,CAAC;AAEF,eAAO,MAAM,KAAK,mCAQjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC"}
|
|
@@ -10,10 +10,11 @@ export declare const useStyles: () => {
|
|
|
10
10
|
display: "flex";
|
|
11
11
|
justifyContent: "center";
|
|
12
12
|
textAlign: "center";
|
|
13
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
14
13
|
fontSize: 16;
|
|
15
14
|
lineHeight: 24;
|
|
16
15
|
letterSpacing: 0;
|
|
16
|
+
fontFamily: string;
|
|
17
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
17
18
|
};
|
|
18
19
|
image: {};
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Avatar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAenB,CAAC"}
|
|
@@ -39,21 +39,23 @@ declare const _default: {
|
|
|
39
39
|
backgroundColor: "#EFF1F6";
|
|
40
40
|
};
|
|
41
41
|
badgeSm: {
|
|
42
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
43
42
|
fontSize: 12;
|
|
44
43
|
lineHeight: 20;
|
|
45
44
|
letterSpacing: 0;
|
|
46
45
|
textTransform: "uppercase";
|
|
46
|
+
fontFamily: string;
|
|
47
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
47
48
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
48
49
|
paddingRight: import("@alveole/theme").Spacing;
|
|
49
50
|
gap: import("@alveole/theme").Spacing;
|
|
50
51
|
};
|
|
51
52
|
badgeMd: {
|
|
52
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
53
53
|
fontSize: 14;
|
|
54
54
|
lineHeight: 20;
|
|
55
55
|
letterSpacing: 0;
|
|
56
56
|
textTransform: "uppercase";
|
|
57
|
+
fontFamily: string;
|
|
58
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
57
59
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
58
60
|
paddingRight: import("@alveole/theme").Spacing;
|
|
59
61
|
gap: import("@alveole/theme").Spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAElB,eAAO,MAAM,QAAQ,mCAuBpB,CAAC;AAEF,eAAO,MAAM,KAAK,mCASjB,CAAC;AAEF,eAAO,MAAM,KAAK,mCAMjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC"}
|
|
@@ -32,21 +32,23 @@ export declare const useStyles: () => {
|
|
|
32
32
|
backgroundColor: "#EFF1F6";
|
|
33
33
|
};
|
|
34
34
|
badgeSm: {
|
|
35
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
36
35
|
fontSize: 12;
|
|
37
36
|
lineHeight: 20;
|
|
38
37
|
letterSpacing: 0;
|
|
39
38
|
textTransform: "uppercase";
|
|
39
|
+
fontFamily: string;
|
|
40
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
40
41
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
41
42
|
paddingRight: import("@alveole/theme").Spacing;
|
|
42
43
|
gap: import("@alveole/theme").Spacing;
|
|
43
44
|
};
|
|
44
45
|
badgeMd: {
|
|
45
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
46
46
|
fontSize: 14;
|
|
47
47
|
lineHeight: 20;
|
|
48
48
|
letterSpacing: 0;
|
|
49
49
|
textTransform: "uppercase";
|
|
50
|
+
fontFamily: string;
|
|
51
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
50
52
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
51
53
|
paddingRight: import("@alveole/theme").Spacing;
|
|
52
54
|
gap: import("@alveole/theme").Spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type BreadcrumbItem = {
|
|
3
3
|
label: string;
|
|
4
|
-
href: string;
|
|
4
|
+
href: string | null;
|
|
5
5
|
isCurrent: boolean;
|
|
6
6
|
};
|
|
7
7
|
export type BreadcrumbsProps = React.PropsWithChildren<{
|
|
@@ -16,6 +16,12 @@ export type BreadcrumbsProps = React.PropsWithChildren<{
|
|
|
16
16
|
* Par défaut : capitalisation + remplacement des - et _ par des espaces.
|
|
17
17
|
*/
|
|
18
18
|
getLabel?: (segment: string, index: number, path: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Personnalisation du lien pour un segment.
|
|
21
|
+
* Retourner null pour afficher le segment sans lien.
|
|
22
|
+
* Par défaut : chemin reconstruit depuis l'URL courante.
|
|
23
|
+
*/
|
|
24
|
+
getHref?: (segment: string, index: number, path: string) => string | null;
|
|
19
25
|
}>;
|
|
20
26
|
/**
|
|
21
27
|
* Fil d'Ariane construit à partir de la navigation Expo Router.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpE;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC3E,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,sBA+ClD,CAAC"}
|
|
@@ -13,7 +13,7 @@ function humanizeSegment(segment) {
|
|
|
13
13
|
* Accueil > Admin > Missions > Détail
|
|
14
14
|
*/
|
|
15
15
|
export const Breadcrumbs = (props) => {
|
|
16
|
-
const { rootLabel = 'Accueil', segmentsToSkip, getLabel = segment => humanizeSegment(segment) } = props;
|
|
16
|
+
const { rootLabel = 'Accueil', segmentsToSkip, getLabel = segment => humanizeSegment(segment), getHref } = props;
|
|
17
17
|
const pathname = usePathname();
|
|
18
18
|
const styles = useStyles();
|
|
19
19
|
const segments = pathname.split('/').filter(Boolean);
|
|
@@ -32,9 +32,9 @@ export const Breadcrumbs = (props) => {
|
|
|
32
32
|
},
|
|
33
33
|
...segmentItems.map(({ segment, index, path }) => ({
|
|
34
34
|
label: getLabel(segment, index, path),
|
|
35
|
-
href: path,
|
|
35
|
+
href: getHref ? getHref(segment, index, path) : path,
|
|
36
36
|
isCurrent: index === segments.length - 1,
|
|
37
37
|
})),
|
|
38
38
|
];
|
|
39
|
-
return (_jsx(Box, { style: styles.container, children: items.map((item, index) => (_jsxs(Box, { style: { flexDirection: 'row', alignItems: 'center' }, children: [index > 0 && _jsx(Typography, { style: styles.separator, children: " > " }), item.isCurrent ? (_jsx(Typography, { style: styles.current, children: item.label })) : (_jsx(A, { href: item.href, style: styles.link, hoverStyle: styles.linkHover, children: _jsx(Typography, { style: styles.link, hoverStyle: styles.linkHover, children: item.label }) }))] }, `${item.href}-${index}`))) }));
|
|
39
|
+
return (_jsx(Box, { style: styles.container, children: items.map((item, index) => (_jsxs(Box, { style: { flexDirection: 'row', alignItems: 'center' }, children: [index > 0 && _jsx(Typography, { style: styles.separator, children: " > " }), item.isCurrent || item.href === null ? (_jsx(Typography, { style: styles.current, children: item.label })) : (_jsx(A, { href: item.href, style: styles.link, hoverStyle: styles.linkHover, children: _jsx(Typography, { style: styles.link, hoverStyle: styles.linkHover, children: item.label }) }))] }, `${item.href}-${index}`))) }));
|
|
40
40
|
};
|
|
@@ -7,10 +7,11 @@ declare const _default: {
|
|
|
7
7
|
component: (props: import("./Breadcrumbs").BreadcrumbsProps) => import("react").JSX.Element;
|
|
8
8
|
styleFn: () => {
|
|
9
9
|
container: {
|
|
10
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
11
10
|
fontSize: 12;
|
|
12
11
|
lineHeight: 20;
|
|
13
12
|
letterSpacing: 0;
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
14
15
|
flexDirection: "row";
|
|
15
16
|
flexWrap: "wrap";
|
|
16
17
|
alignItems: "center";
|
|
@@ -26,10 +27,11 @@ declare const _default: {
|
|
|
26
27
|
transitionProperty: "text-decoration";
|
|
27
28
|
transitionDuration: "0.1s";
|
|
28
29
|
transitionTimingFunction: "ease-in-out";
|
|
29
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
30
30
|
fontSize: 12;
|
|
31
31
|
lineHeight: 20;
|
|
32
32
|
letterSpacing: 0;
|
|
33
|
+
fontFamily: string;
|
|
34
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
33
35
|
color: "#5F6571";
|
|
34
36
|
textDecoration: string;
|
|
35
37
|
};
|
|
@@ -42,6 +44,8 @@ export default _default;
|
|
|
42
44
|
export declare const Default: () => import("react").JSX.Element;
|
|
43
45
|
export declare const WithCustomRootLabel: () => import("react").JSX.Element;
|
|
44
46
|
export declare const WithCustomLabels: () => import("react").JSX.Element;
|
|
47
|
+
export declare const WithCustomHref: () => import("react").JSX.Element;
|
|
48
|
+
export declare const WithNoLink: () => import("react").JSX.Element;
|
|
45
49
|
export declare const WithSegmentsToSkip: () => import("react").JSX.Element;
|
|
46
50
|
export * as Sources from './Breadcrumbs.stories.sources';
|
|
47
51
|
//# sourceMappingURL=Breadcrumbs.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAElB,eAAO,MAAM,OAAO,mCAInB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAI/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAe5B,CAAC;AAEF,eAAO,MAAM,cAAc,mCAW1B,CAAC;AAEF,eAAO,MAAM,UAAU,mCAStB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAgB9B,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC"}
|
|
@@ -23,6 +23,16 @@ export const WithCustomLabels = () => (_jsx(Box, { p: 4, children: _jsx(Breadcru
|
|
|
23
23
|
};
|
|
24
24
|
return labels[segment] ?? segment;
|
|
25
25
|
} }) }));
|
|
26
|
+
export const WithCustomHref = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { getHref: (segment, _index, path) => {
|
|
27
|
+
const hrefs = {
|
|
28
|
+
components: '/ui-kit/components',
|
|
29
|
+
};
|
|
30
|
+
return hrefs[segment] ?? path;
|
|
31
|
+
} }) }));
|
|
32
|
+
export const WithNoLink = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { getHref: (segment, _index, path) => {
|
|
33
|
+
const noLink = ['components'];
|
|
34
|
+
return noLink.includes(segment) ? null : path;
|
|
35
|
+
} }) }));
|
|
26
36
|
export const WithSegmentsToSkip = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { segmentsToSkip: ['admin', 'ui-kit', 'components'], getLabel: (segment, _index, _path) => {
|
|
27
37
|
const labels = {
|
|
28
38
|
admin: 'Administration',
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare const Default: () => string;
|
|
2
2
|
export declare const WithCustomRootLabel: () => string;
|
|
3
3
|
export declare const WithCustomLabels: () => string;
|
|
4
|
+
export declare const WithCustomHref: () => string;
|
|
5
|
+
export declare const WithNoLink: () => string;
|
|
4
6
|
export declare const WithSegmentsToSkip: () => string;
|
|
5
7
|
export declare const storySources: {
|
|
6
8
|
readonly Default: () => string;
|
|
7
9
|
readonly WithCustomRootLabel: () => string;
|
|
8
10
|
readonly WithCustomLabels: () => string;
|
|
11
|
+
readonly WithCustomHref: () => string;
|
|
12
|
+
readonly WithNoLink: () => string;
|
|
9
13
|
readonly WithSegmentsToSkip: () => string;
|
|
10
14
|
};
|
|
11
15
|
export type StorySourceName = keyof typeof storySources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2F,CAAC;AAEhH,eAAO,MAAM,mBAAmB,cAAqI,CAAC;AAEtK,eAAO,MAAM,gBAAgB,cAAsb,CAAC;AAEpd,eAAO,MAAM,kBAAkB,cAAkf,CAAC;AAElhB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2F,CAAC;AAEhH,eAAO,MAAM,mBAAmB,cAAqI,CAAC;AAEtK,eAAO,MAAM,gBAAgB,cAAsb,CAAC;AAEpd,eAAO,MAAM,cAAc,cAAgT,CAAC;AAE5U,eAAO,MAAM,UAAU,cAA0P,CAAC;AAElR,eAAO,MAAM,kBAAkB,cAAkf,CAAC;AAElhB,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
export const Default = () => "export const Default = () => (\n <Box p={4}>\n <Breadcrumbs />\n </Box>\n);";
|
|
4
4
|
export const WithCustomRootLabel = () => "export const WithCustomRootLabel = () => (\n <Box p={4}>\n <Breadcrumbs rootLabel=\"Tableau de bord\" />\n </Box>\n);";
|
|
5
5
|
export const WithCustomLabels = () => "export const WithCustomLabels = () => (\n <Box p={4}>\n <Breadcrumbs\n getLabel={(segment, _index, _path) => {\n const labels: Record<string, string> = {\n admin: 'Administration',\n missions: 'Missions',\n show: 'Détail',\n salarie: 'Espace salarié',\n client: 'Espace client',\n };\n return labels[segment] ?? segment;\n }}\n />\n </Box>\n);";
|
|
6
|
+
export const WithCustomHref = () => "export const WithCustomHref = () => (\n <Box p={4}>\n <Breadcrumbs\n getHref={(segment, _index, path) => {\n const hrefs: Record<string, string> = {\n components: '/ui-kit/components',\n };\n return hrefs[segment] ?? path;\n }}\n />\n </Box>\n);";
|
|
7
|
+
export const WithNoLink = () => "export const WithNoLink = () => (\n <Box p={4}>\n <Breadcrumbs\n getHref={(segment, _index, path) => {\n const noLink = ['components'];\n return noLink.includes(segment) ? null : path;\n }}\n />\n </Box>\n);";
|
|
6
8
|
export const WithSegmentsToSkip = () => "export const WithSegmentsToSkip = () => (\n <Box p={4}>\n <Breadcrumbs\n segmentsToSkip={['admin', 'ui-kit', 'components']}\n getLabel={(segment, _index, _path) => {\n const labels: Record<string, string> = {\n admin: 'Administration',\n missions: 'Missions',\n show: 'Détail',\n salarie: 'Espace salarié',\n client: 'Espace client',\n };\n return labels[segment] ?? segment;\n }}\n />\n </Box>\n);";
|
|
7
9
|
export const storySources = {
|
|
8
10
|
Default,
|
|
9
11
|
WithCustomRootLabel,
|
|
10
12
|
WithCustomLabels,
|
|
13
|
+
WithCustomHref,
|
|
14
|
+
WithNoLink,
|
|
11
15
|
WithSegmentsToSkip,
|
|
12
16
|
};
|