@wakastellar/ui 3.5.0 → 3.5.2
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/editor.cjs.js +2 -2
- package/dist/editor.es.js +4 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6826 -6826
- package/dist/src/blocks/login/index.d.ts +4 -4
- package/dist/src/stories/editor/EditorStoryWrapper.d.ts +11 -0
- package/dist/waka-editor-plugins-CGojOMS5.js +1 -0
- package/dist/{waka-editor-plugins-DR6tpsUC.mjs → waka-editor-plugins-Dwh4Vreq.mjs} +1 -1
- package/package.json +1 -1
- package/src/blocks/footer/index.tsx +4 -4
- package/src/blocks/login/index.tsx +14 -14
- package/src/blocks/profile/index.tsx +5 -6
- package/src/blocks/sidebar/index.tsx +0 -2
- package/src/components/dropdown-menu/DropdownMenu.stories.tsx +2 -2
- package/src/components/editor/waka-dnd-editor.tsx +1 -1
- package/src/components/editor/waka-document-editor.tsx +1 -1
- package/src/components/editor/waka-editor-plugins.ts +1 -1
- package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +15 -17
- package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +35 -19
- package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +18 -5
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +11 -34
- package/src/components/waka-streak-counter/WakaStreakCounter.stories.tsx +30 -30
- package/dist/waka-editor-plugins-sGSh9hn2.js +0 -1
|
@@ -25,9 +25,9 @@ export interface LoginProps {
|
|
|
25
25
|
onSSOMicrosoft?: () => void;
|
|
26
26
|
onSSOApple?: () => void;
|
|
27
27
|
onSSOLinkedIn?: () => void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
onSSOGlobe?: () => void;
|
|
29
|
+
onSSOUsers?: () => void;
|
|
30
|
+
onSSOCamera?: () => void;
|
|
31
31
|
onSSOFranceConnect?: () => void;
|
|
32
32
|
/** Afficher la connexion sociale (déprécié, utilise config.signup_options) */
|
|
33
33
|
showSocialLogin?: boolean;
|
|
@@ -39,4 +39,4 @@ export interface LoginFormData {
|
|
|
39
39
|
password: string;
|
|
40
40
|
rememberMe?: boolean;
|
|
41
41
|
}
|
|
42
|
-
export declare function Login({ config, onSubmit, onForgotPassword, onSignUp, onSSOGoogle, onSSOMicrosoft, onSSOApple, onSSOLinkedIn,
|
|
42
|
+
export declare function Login({ config, onSubmit, onForgotPassword, onSignUp, onSSOGoogle, onSSOMicrosoft, onSSOApple, onSSOLinkedIn, onSSOGlobe, onSSOUsers, onSSOCamera, onSSOFranceConnect, showSocialLogin, className, }: LoginProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function EditorStoryWrapper({ children }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a lazy-loaded wrapper component for editor components.
|
|
7
|
+
* This defers the import to render time so ErrorBoundary can catch failures.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createLazyEditor<P extends Record<string, unknown>>(importFn: () => Promise<{
|
|
10
|
+
default: React.ComponentType<P>;
|
|
11
|
+
}>): React.LazyExoticComponent<React.ComponentType<P>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=require(`./chunk-14q5BKub.js`).r({getPresetLoaders:()=>h,loadAIPlugins:()=>u,loadComboboxPlugins:()=>m,loadCorePlugins:()=>t,loadDiffPlugin:()=>p,loadDndPlugin:()=>a,loadEmojiPlugin:()=>d,loadFloatingPlugin:()=>f,loadIndentPlugin:()=>s,loadLinkPlugin:()=>n,loadMarkdownPlugin:()=>c,loadMediaPlugins:()=>r,loadMentionPlugins:()=>i,loadSelectionPlugin:()=>l,loadTocPlugin:()=>o});async function t(){let[e,t,n,r]=await Promise.all([import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`)]);return[e.BoldPlugin,e.ItalicPlugin,e.UnderlinePlugin,e.StrikethroughPlugin,e.CodePlugin,e.HighlightPlugin,e.SuperscriptPlugin,e.SubscriptPlugin,e.H1Plugin,e.H2Plugin,e.H3Plugin,e.H4Plugin,e.H5Plugin,e.H6Plugin,e.BlockquotePlugin,t.TablePlugin,t.TableRowPlugin,t.TableCellPlugin,t.TableCellHeaderPlugin,n.ColumnPlugin,n.ColumnItemPlugin,r.CalloutPlugin]}async function n(){let{LinkPlugin:e}=await import(`@platejs/link/react`);return[e.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})]}async function r(){let{ImagePlugin:e,MediaEmbedPlugin:t}=await import(`@platejs/media/react`);return[e,t]}async function i(){let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);return[e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t]}async function a(){let{DndPlugin:e}=await import(`@platejs/dnd`);return[e]}async function o(){let{TocPlugin:e}=await import(`@platejs/toc/react`);return[e]}async function s(){let{IndentPlugin:e}=await import(`@platejs/indent/react`);return[e]}async function c(){let{MarkdownPlugin:e}=await import(`@platejs/markdown`);return[e]}async function l(){let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);return[e]}async function u(e){let{AIPlugin:t,AIChatPlugin:n}=await import(`@platejs/ai/react`),r=[t];return e?.endpoint?r.push(n.configure({options:{chat:{api:e.endpoint,body:{system:e.systemPrompt??`You are a helpful writing assistant.`},headers:e.headers}}})):r.push(n),r}async function d(){let{EmojiPlugin:e}=await import(`@platejs/emoji/react`);return[e]}async function f(){return[]}async function p(){return[]}async function m(){let{SlashPlugin:e,SlashInputPlugin:t}=await import(`@platejs/combobox/react`);return[e.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/}}),t]}function h(e){switch(e){case`minimal`:return[];case`standard`:return[n,s];case`full`:return[n,r,i,a,o,s,c,l]}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return n}});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from "react"
|
|
|
4
4
|
import { cn } from "../../utils"
|
|
5
5
|
import { Button } from "../../components/button"
|
|
6
6
|
import { Separator } from "../../components/separator"
|
|
7
|
-
import {
|
|
7
|
+
import { Globe, Share2, ExternalLink, Mail } from "lucide-react"
|
|
8
8
|
|
|
9
9
|
export interface FooterLink {
|
|
10
10
|
label: string
|
|
@@ -29,9 +29,9 @@ export interface FooterProps {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const socialIcons = {
|
|
32
|
-
github:
|
|
33
|
-
twitter:
|
|
34
|
-
linkedin:
|
|
32
|
+
github: Globe,
|
|
33
|
+
twitter: Share2,
|
|
34
|
+
linkedin: ExternalLink,
|
|
35
35
|
email: Mail,
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -7,7 +7,7 @@ import { Input } from "../../components/input"
|
|
|
7
7
|
import { Label } from "../../components/label"
|
|
8
8
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/card"
|
|
9
9
|
import { Separator } from "../../components/separator"
|
|
10
|
-
import {
|
|
10
|
+
import { Globe, Mail, Apple, ExternalLink, Users, Camera } from "lucide-react"
|
|
11
11
|
import { useTheme } from "../../context/theme-provider"
|
|
12
12
|
import type { LoginConfig } from "./types"
|
|
13
13
|
|
|
@@ -38,9 +38,9 @@ export interface LoginProps {
|
|
|
38
38
|
onSSOMicrosoft?: () => void
|
|
39
39
|
onSSOApple?: () => void
|
|
40
40
|
onSSOLinkedIn?: () => void
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
onSSOGlobe?: () => void
|
|
42
|
+
onSSOUsers?: () => void
|
|
43
|
+
onSSOCamera?: () => void
|
|
44
44
|
onSSOFranceConnect?: () => void
|
|
45
45
|
/** Afficher la connexion sociale (déprécié, utilise config.signup_options) */
|
|
46
46
|
showSocialLogin?: boolean
|
|
@@ -63,9 +63,9 @@ export function Login({
|
|
|
63
63
|
onSSOMicrosoft,
|
|
64
64
|
onSSOApple,
|
|
65
65
|
onSSOLinkedIn,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
onSSOGlobe,
|
|
67
|
+
onSSOUsers,
|
|
68
|
+
onSSOCamera,
|
|
69
69
|
onSSOFranceConnect,
|
|
70
70
|
showSocialLogin = false,
|
|
71
71
|
className,
|
|
@@ -113,8 +113,8 @@ export function Login({
|
|
|
113
113
|
// Mode legacy (sans config)
|
|
114
114
|
if (!config?.signup_options) {
|
|
115
115
|
if (showSocialLogin) {
|
|
116
|
-
if (
|
|
117
|
-
ssoList.push({ id: "github", label: "GitHub", icon: <
|
|
116
|
+
if (onSSOGlobe) {
|
|
117
|
+
ssoList.push({ id: "github", label: "GitHub", icon: <Globe className="h-4 w-4" />, onClick: onSSOGlobe })
|
|
118
118
|
}
|
|
119
119
|
if (onSSOGoogle) {
|
|
120
120
|
ssoList.push({ id: "google", label: "Google", icon: <Mail className="h-4 w-4" />, onClick: onSSOGoogle })
|
|
@@ -137,23 +137,23 @@ export function Login({
|
|
|
137
137
|
ssoList.push({ id: "apple", label: "Apple", icon: <Apple className="h-4 w-4" />, onClick: onSSOApple })
|
|
138
138
|
}
|
|
139
139
|
if (options.allow_sso_linkedIn) {
|
|
140
|
-
ssoList.push({ id: "linkedin", label: "LinkedIn", icon: <
|
|
140
|
+
ssoList.push({ id: "linkedin", label: "LinkedIn", icon: <ExternalLink className="h-4 w-4" />, onClick: onSSOLinkedIn })
|
|
141
141
|
}
|
|
142
142
|
if (options.allow_sso_github) {
|
|
143
|
-
ssoList.push({ id: "github", label: "GitHub", icon: <
|
|
143
|
+
ssoList.push({ id: "github", label: "GitHub", icon: <Globe className="h-4 w-4" />, onClick: onSSOGlobe })
|
|
144
144
|
}
|
|
145
145
|
if (options.allow_sso_facebook) {
|
|
146
|
-
ssoList.push({ id: "facebook", label: "
|
|
146
|
+
ssoList.push({ id: "facebook", label: "Users", icon: <Users className="h-4 w-4" />, onClick: onSSOUsers })
|
|
147
147
|
}
|
|
148
148
|
if (options.allow_sso_instagram) {
|
|
149
|
-
ssoList.push({ id: "instagram", label: "
|
|
149
|
+
ssoList.push({ id: "instagram", label: "Camera", icon: <Camera className="h-4 w-4" />, onClick: onSSOCamera })
|
|
150
150
|
}
|
|
151
151
|
if (options.allow_sso_france_connect) {
|
|
152
152
|
ssoList.push({ id: "france-connect", label: "France Connect", icon: <Mail className="h-4 w-4" />, onClick: onSSOFranceConnect })
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
return ssoList
|
|
156
|
-
}, [config?.signup_options, showSocialLogin, onSSOGoogle, onSSOMicrosoft, onSSOApple, onSSOLinkedIn,
|
|
156
|
+
}, [config?.signup_options, showSocialLogin, onSSOGoogle, onSSOMicrosoft, onSSOApple, onSSOLinkedIn, onSSOGlobe, onSSOUsers, onSSOCamera, onSSOFranceConnect])
|
|
157
157
|
|
|
158
158
|
// Vérifie si la connexion classique est autorisée
|
|
159
159
|
// Si config n'est pas fourni, on autorise le login par défaut
|
|
@@ -33,9 +33,8 @@ import {
|
|
|
33
33
|
X,
|
|
34
34
|
Loader2,
|
|
35
35
|
Link as LinkIcon,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Linkedin,
|
|
36
|
+
Share2,
|
|
37
|
+
ExternalLink,
|
|
39
38
|
} from "lucide-react"
|
|
40
39
|
|
|
41
40
|
// ============================================
|
|
@@ -328,11 +327,11 @@ function SocialLinks({ links, isEditing }: SocialLinksProps) {
|
|
|
328
327
|
const getIcon = (type: ProfileSocialLink["type"]) => {
|
|
329
328
|
switch (type) {
|
|
330
329
|
case "twitter":
|
|
331
|
-
return <
|
|
330
|
+
return <Share2 className="h-4 w-4" />
|
|
332
331
|
case "github":
|
|
333
|
-
return <
|
|
332
|
+
return <Globe className="h-4 w-4" />
|
|
334
333
|
case "linkedin":
|
|
335
|
-
return <
|
|
334
|
+
return <ExternalLink className="h-4 w-4" />
|
|
336
335
|
case "website":
|
|
337
336
|
return <Globe className="h-4 w-4" />
|
|
338
337
|
default:
|
|
@@ -596,8 +596,6 @@ export function WakaSidebar({
|
|
|
596
596
|
"bg-[var(--sidebar-bg)] text-[var(--sidebar-text)]",
|
|
597
597
|
"[&_.bg-sidebar-active]:bg-[var(--sidebar-active)]",
|
|
598
598
|
"[&_.text-sidebar-active-foreground]:text-[var(--sidebar-active-foreground)]",
|
|
599
|
-
"[&_.text-sidebar-foreground\\/70]:text-[var(--sidebar-text)]",
|
|
600
|
-
"[&_.text-sidebar-foreground\\/70]:opacity-70",
|
|
601
599
|
"[&_.border-sidebar-active]:border-[var(--sidebar-active)]",
|
|
602
600
|
contentClassName
|
|
603
601
|
)
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
MessageSquare,
|
|
28
28
|
PlusCircle,
|
|
29
29
|
Plus,
|
|
30
|
-
|
|
30
|
+
Globe,
|
|
31
31
|
LifeBuoy,
|
|
32
32
|
Cloud,
|
|
33
33
|
LogOut,
|
|
@@ -190,7 +190,7 @@ export const WithSubmenu: Story = {
|
|
|
190
190
|
</DropdownMenuGroup>
|
|
191
191
|
<DropdownMenuSeparator />
|
|
192
192
|
<DropdownMenuItem>
|
|
193
|
-
<
|
|
193
|
+
<Globe className="mr-2 h-4 w-4" />
|
|
194
194
|
<span>GitHub</span>
|
|
195
195
|
</DropdownMenuItem>
|
|
196
196
|
<DropdownMenuItem>
|
|
@@ -111,7 +111,7 @@ export const WakaDnDEditor = React.forwardRef<HTMLDivElement, WakaDnDEditorProps
|
|
|
111
111
|
import("@platejs/layout/react"),
|
|
112
112
|
import("@platejs/callout/react"),
|
|
113
113
|
import("@platejs/link/react"),
|
|
114
|
-
import("@platejs/dnd
|
|
114
|
+
import("@platejs/dnd"),
|
|
115
115
|
import("@platejs/selection/react"),
|
|
116
116
|
])
|
|
117
117
|
|
|
@@ -220,7 +220,7 @@ export const WakaDocumentEditor = React.forwardRef<HTMLDivElement, WakaDocumentE
|
|
|
220
220
|
// Optional: DnD
|
|
221
221
|
if (cfg.enableDnD) {
|
|
222
222
|
try {
|
|
223
|
-
const { DndPlugin } = await import("@platejs/dnd
|
|
223
|
+
const { DndPlugin } = await import("@platejs/dnd")
|
|
224
224
|
plugins.push(DndPlugin)
|
|
225
225
|
} catch { /* not installed */ }
|
|
226
226
|
}
|
|
@@ -89,7 +89,7 @@ export async function loadMentionPlugins(): Promise<PlatePlugin[]> {
|
|
|
89
89
|
|
|
90
90
|
/** Loads DnD (drag and drop) plugin */
|
|
91
91
|
export async function loadDndPlugin(): Promise<PlatePlugin[]> {
|
|
92
|
-
const { DndPlugin } = await import("@platejs/dnd
|
|
92
|
+
const { DndPlugin } = await import("@platejs/dnd")
|
|
93
93
|
return [DndPlugin]
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import { WakaApprovalChain, type
|
|
2
|
+
import { WakaApprovalChain, type ApprovalStep } from "./index"
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof WakaApprovalChain> = {
|
|
5
5
|
title: "Admin/WakaApprovalChain",
|
|
@@ -7,28 +7,27 @@ const meta: Meta<typeof WakaApprovalChain> = {
|
|
|
7
7
|
parameters: { layout: "padded" },
|
|
8
8
|
tags: ["autodocs"],
|
|
9
9
|
argTypes: {
|
|
10
|
-
|
|
10
|
+
variant: { control: "select", options: ["horizontal", "vertical"], description: "Orientation" },
|
|
11
11
|
showComments: { control: "boolean", description: "Afficher les commentaires" },
|
|
12
|
-
interactive: { control: "boolean", description: "Mode interactif" },
|
|
13
12
|
},
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export default meta
|
|
17
16
|
type Story = StoryObj<typeof WakaApprovalChain>
|
|
18
17
|
|
|
19
|
-
const
|
|
20
|
-
{ id: "1", name: "Alice Martin", role: "Manager", status: "approved",
|
|
21
|
-
{ id: "2", name: "Bob Dupont", role: "Finance", status: "approved",
|
|
22
|
-
{ id: "3", name: "Charlie Bernard", role: "Directeur", status: "pending" },
|
|
18
|
+
const steps: ApprovalStep[] = [
|
|
19
|
+
{ id: "1", approver: { id: "a1", name: "Alice Martin", role: "Manager" }, status: "approved", timestamp: new Date(Date.now() - 86400000), comment: "Approuve" },
|
|
20
|
+
{ id: "2", approver: { id: "a2", name: "Bob Dupont", role: "Finance" }, status: "approved", timestamp: new Date(Date.now() - 43200000) },
|
|
21
|
+
{ id: "3", approver: { id: "a3", name: "Charlie Bernard", role: "Directeur" }, status: "pending" },
|
|
23
22
|
]
|
|
24
23
|
|
|
25
24
|
export const Default: Story = {
|
|
26
|
-
args: {
|
|
25
|
+
args: { steps, variant: "horizontal", showComments: true },
|
|
27
26
|
render: (args) => <WakaApprovalChain {...args} />,
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export const Vertical: Story = {
|
|
31
|
-
args: {
|
|
30
|
+
args: { steps, variant: "vertical", showComments: true },
|
|
32
31
|
render: (args) => (
|
|
33
32
|
<div style={{ maxWidth: 400 }}>
|
|
34
33
|
<WakaApprovalChain {...args} />
|
|
@@ -38,18 +37,18 @@ export const Vertical: Story = {
|
|
|
38
37
|
|
|
39
38
|
export const AllApproved: Story = {
|
|
40
39
|
args: {
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
steps: steps.map(s => ({ ...s, status: "approved" as const, timestamp: new Date() })),
|
|
41
|
+
variant: "horizontal",
|
|
43
42
|
},
|
|
44
43
|
render: (args) => <WakaApprovalChain {...args} />,
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
export const Rejected: Story = {
|
|
48
47
|
args: {
|
|
49
|
-
|
|
50
|
-
{ ...
|
|
51
|
-
{ ...
|
|
52
|
-
{ ...
|
|
48
|
+
steps: [
|
|
49
|
+
{ ...steps[0], status: "approved" as const },
|
|
50
|
+
{ ...steps[1], status: "rejected" as const, comment: "Budget insuffisant" },
|
|
51
|
+
{ ...steps[2], status: "pending" as const },
|
|
53
52
|
],
|
|
54
53
|
showComments: true,
|
|
55
54
|
},
|
|
@@ -57,7 +56,6 @@ export const Rejected: Story = {
|
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
export const Interactive: Story = {
|
|
60
|
-
args: {
|
|
59
|
+
args: { steps, showComments: true, currentUserId: "a3" },
|
|
61
60
|
render: (args) => <WakaApprovalChain {...args} />,
|
|
62
61
|
}
|
|
63
|
-
|
|
@@ -7,29 +7,32 @@ const meta: Meta<typeof WakaComparePeriod> = {
|
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
9
9
|
argTypes: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
periodPreset: { control: "select", options: ["last_week", "last_month", "last_quarter", "last_year", "custom"], description: "Prereglage" },
|
|
11
|
+
showComparisonBars: { control: "boolean", description: "Afficher les barres de comparaison" },
|
|
12
|
+
showSummary: { control: "boolean", description: "Afficher le resume" },
|
|
13
13
|
},
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export default meta
|
|
17
17
|
type Story = StoryObj<typeof WakaComparePeriod>
|
|
18
18
|
|
|
19
|
+
const currentPeriod = { start: new Date("2024-01-01"), end: new Date("2024-01-31") }
|
|
20
|
+
const previousPeriod = { start: new Date("2023-12-01"), end: new Date("2023-12-31") }
|
|
21
|
+
|
|
19
22
|
const metrics = [
|
|
20
|
-
{ id: "revenue",
|
|
21
|
-
{ id: "users",
|
|
22
|
-
{ id: "conversion",
|
|
23
|
+
{ id: "revenue", name: "Revenu", value: { current: 45000, previous: 38000 }, unit: "EUR" },
|
|
24
|
+
{ id: "users", name: "Utilisateurs", value: { current: 1250, previous: 1100 } },
|
|
25
|
+
{ id: "conversion", name: "Conversion", value: { current: 3.5, previous: 3.2 }, unit: "%" },
|
|
23
26
|
]
|
|
24
27
|
|
|
25
28
|
export const Default: Story = {
|
|
26
29
|
args: {
|
|
27
30
|
metrics,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
currentPeriod,
|
|
32
|
+
previousPeriod,
|
|
33
|
+
periodPreset: "last_month",
|
|
34
|
+
showComparisonBars: true,
|
|
35
|
+
showSummary: true,
|
|
33
36
|
},
|
|
34
37
|
render: (args) => (
|
|
35
38
|
<div style={{ width: 500 }}>
|
|
@@ -41,9 +44,11 @@ export const Default: Story = {
|
|
|
41
44
|
export const WeekComparison: Story = {
|
|
42
45
|
args: {
|
|
43
46
|
metrics,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
currentPeriod: { start: new Date("2024-01-22"), end: new Date("2024-01-28") },
|
|
48
|
+
previousPeriod: { start: new Date("2024-01-15"), end: new Date("2024-01-21") },
|
|
49
|
+
periodPreset: "last_week",
|
|
50
|
+
showComparisonBars: true,
|
|
51
|
+
showSummary: true,
|
|
47
52
|
},
|
|
48
53
|
render: (args) => (
|
|
49
54
|
<div style={{ width: 500 }}>
|
|
@@ -54,9 +59,14 @@ export const WeekComparison: Story = {
|
|
|
54
59
|
|
|
55
60
|
export const NegativeTrend: Story = {
|
|
56
61
|
args: {
|
|
57
|
-
metrics: metrics.map(m => ({
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
metrics: metrics.map(m => ({
|
|
63
|
+
...m,
|
|
64
|
+
value: { current: m.value.previous * 0.9, previous: m.value.current },
|
|
65
|
+
})),
|
|
66
|
+
currentPeriod,
|
|
67
|
+
previousPeriod,
|
|
68
|
+
periodPreset: "last_month",
|
|
69
|
+
showSummary: true,
|
|
60
70
|
},
|
|
61
71
|
render: (args) => (
|
|
62
72
|
<div style={{ width: 500 }}>
|
|
@@ -66,11 +76,17 @@ export const NegativeTrend: Story = {
|
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
export const NoChart: Story = {
|
|
69
|
-
args: {
|
|
79
|
+
args: {
|
|
80
|
+
metrics,
|
|
81
|
+
currentPeriod,
|
|
82
|
+
previousPeriod,
|
|
83
|
+
periodPreset: "last_quarter",
|
|
84
|
+
showComparisonBars: false,
|
|
85
|
+
showSummary: true,
|
|
86
|
+
},
|
|
70
87
|
render: (args) => (
|
|
71
88
|
<div style={{ width: 400 }}>
|
|
72
89
|
<WakaComparePeriod {...args} />
|
|
73
90
|
</div>
|
|
74
91
|
),
|
|
75
92
|
}
|
|
76
|
-
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
2
|
import { WakaContentRecommendation } from "./index"
|
|
3
|
+
import { WakaAdProvider } from "../waka-ad-provider/index"
|
|
4
|
+
|
|
5
|
+
const adConfig = {
|
|
6
|
+
network: "custom" as const,
|
|
7
|
+
customAdServer: "https://ads.example.com",
|
|
8
|
+
testMode: true,
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
const meta: Meta<typeof WakaContentRecommendation> = {
|
|
5
12
|
title: "Sponsoring/WakaContentRecommendation",
|
|
6
13
|
component: WakaContentRecommendation,
|
|
7
14
|
parameters: { layout: "padded" },
|
|
8
15
|
tags: ["autodocs"],
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<WakaAdProvider config={adConfig}>
|
|
19
|
+
<Story />
|
|
20
|
+
</WakaAdProvider>
|
|
21
|
+
),
|
|
22
|
+
],
|
|
9
23
|
argTypes: {
|
|
10
24
|
layout: { control: "select", options: ["grid", "carousel", "list"], description: "Disposition" },
|
|
11
25
|
columns: { control: "select", options: [2, 3, 4], description: "Colonnes (grid)" },
|
|
12
|
-
showArrows: { control: "boolean", description: "
|
|
13
|
-
autoScroll: { control: "boolean", description: "
|
|
26
|
+
showArrows: { control: "boolean", description: "Fleches navigation" },
|
|
27
|
+
autoScroll: { control: "boolean", description: "Defilement auto" },
|
|
14
28
|
},
|
|
15
29
|
}
|
|
16
30
|
|
|
@@ -25,12 +39,12 @@ export const Default: Story = {
|
|
|
25
39
|
}
|
|
26
40
|
|
|
27
41
|
export const Carousel: Story = {
|
|
28
|
-
args: { title: "
|
|
42
|
+
args: { title: "A decouvrir", slotIds, layout: "carousel", showArrows: true, autoScroll: false },
|
|
29
43
|
render: (args) => <WakaContentRecommendation {...args} />,
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
export const List: Story = {
|
|
33
|
-
args: { title: "Articles
|
|
47
|
+
args: { title: "Articles suggeres", slotIds: slotIds.slice(0, 3), layout: "list" },
|
|
34
48
|
render: (args) => <WakaContentRecommendation {...args} />,
|
|
35
49
|
}
|
|
36
50
|
|
|
@@ -38,4 +52,3 @@ export const TwoColumns: Story = {
|
|
|
38
52
|
args: { title: "Pour vous", slotIds: slotIds.slice(0, 4), layout: "grid", columns: 2 },
|
|
39
53
|
render: (args) => <WakaContentRecommendation {...args} />,
|
|
40
54
|
}
|
|
41
|
-
|
|
@@ -18,9 +18,9 @@ const meta: Meta<typeof WakaPasswordStrength> = {
|
|
|
18
18
|
control: "boolean",
|
|
19
19
|
description: "Afficher le champ de saisie",
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
showChecklist: {
|
|
22
22
|
control: "boolean",
|
|
23
|
-
description: "Afficher
|
|
23
|
+
description: "Afficher la checklist des exigences",
|
|
24
24
|
},
|
|
25
25
|
showStrengthBar: {
|
|
26
26
|
control: "boolean",
|
|
@@ -34,22 +34,6 @@ const meta: Meta<typeof WakaPasswordStrength> = {
|
|
|
34
34
|
control: "number",
|
|
35
35
|
description: "Longueur minimale requise",
|
|
36
36
|
},
|
|
37
|
-
requireUppercase: {
|
|
38
|
-
control: "boolean",
|
|
39
|
-
description: "Exiger une majuscule",
|
|
40
|
-
},
|
|
41
|
-
requireLowercase: {
|
|
42
|
-
control: "boolean",
|
|
43
|
-
description: "Exiger une minuscule",
|
|
44
|
-
},
|
|
45
|
-
requireNumber: {
|
|
46
|
-
control: "boolean",
|
|
47
|
-
description: "Exiger un chiffre",
|
|
48
|
-
},
|
|
49
|
-
requireSpecial: {
|
|
50
|
-
control: "boolean",
|
|
51
|
-
description: "Exiger un caractère spécial",
|
|
52
|
-
},
|
|
53
37
|
},
|
|
54
38
|
}
|
|
55
39
|
|
|
@@ -58,15 +42,12 @@ type Story = StoryObj<typeof WakaPasswordStrength>
|
|
|
58
42
|
|
|
59
43
|
export const Default: Story = {
|
|
60
44
|
args: {
|
|
45
|
+
password: "",
|
|
61
46
|
showInput: true,
|
|
62
|
-
|
|
47
|
+
showChecklist: true,
|
|
63
48
|
showStrengthBar: true,
|
|
64
49
|
showStrengthLabel: true,
|
|
65
50
|
minLength: 8,
|
|
66
|
-
requireUppercase: true,
|
|
67
|
-
requireLowercase: true,
|
|
68
|
-
requireNumber: true,
|
|
69
|
-
requireSpecial: true,
|
|
70
51
|
},
|
|
71
52
|
render: (args) => (
|
|
72
53
|
<div style={{ width: 350 }}>
|
|
@@ -79,7 +60,7 @@ export const WeakPassword: Story = {
|
|
|
79
60
|
args: {
|
|
80
61
|
password: "abc",
|
|
81
62
|
showInput: false,
|
|
82
|
-
|
|
63
|
+
showChecklist: true,
|
|
83
64
|
showStrengthBar: true,
|
|
84
65
|
showStrengthLabel: true,
|
|
85
66
|
},
|
|
@@ -94,7 +75,7 @@ export const FairPassword: Story = {
|
|
|
94
75
|
args: {
|
|
95
76
|
password: "Password1",
|
|
96
77
|
showInput: false,
|
|
97
|
-
|
|
78
|
+
showChecklist: true,
|
|
98
79
|
showStrengthBar: true,
|
|
99
80
|
showStrengthLabel: true,
|
|
100
81
|
},
|
|
@@ -109,7 +90,7 @@ export const GoodPassword: Story = {
|
|
|
109
90
|
args: {
|
|
110
91
|
password: "Password123!",
|
|
111
92
|
showInput: false,
|
|
112
|
-
|
|
93
|
+
showChecklist: true,
|
|
113
94
|
showStrengthBar: true,
|
|
114
95
|
showStrengthLabel: true,
|
|
115
96
|
},
|
|
@@ -124,7 +105,7 @@ export const StrongPassword: Story = {
|
|
|
124
105
|
args: {
|
|
125
106
|
password: "MyStr0ng!P@ssword2024",
|
|
126
107
|
showInput: false,
|
|
127
|
-
|
|
108
|
+
showChecklist: true,
|
|
128
109
|
showStrengthBar: true,
|
|
129
110
|
showStrengthLabel: true,
|
|
130
111
|
},
|
|
@@ -138,7 +119,7 @@ export const StrongPassword: Story = {
|
|
|
138
119
|
export const BarOnly: Story = {
|
|
139
120
|
args: {
|
|
140
121
|
showInput: true,
|
|
141
|
-
|
|
122
|
+
showChecklist: false,
|
|
142
123
|
showStrengthBar: true,
|
|
143
124
|
showStrengthLabel: true,
|
|
144
125
|
},
|
|
@@ -152,7 +133,7 @@ export const BarOnly: Story = {
|
|
|
152
133
|
export const RequirementsOnly: Story = {
|
|
153
134
|
args: {
|
|
154
135
|
showInput: true,
|
|
155
|
-
|
|
136
|
+
showChecklist: true,
|
|
156
137
|
showStrengthBar: false,
|
|
157
138
|
showStrengthLabel: false,
|
|
158
139
|
},
|
|
@@ -166,13 +147,9 @@ export const RequirementsOnly: Story = {
|
|
|
166
147
|
export const SimpleRequirements: Story = {
|
|
167
148
|
args: {
|
|
168
149
|
showInput: true,
|
|
169
|
-
|
|
150
|
+
showChecklist: true,
|
|
170
151
|
showStrengthBar: true,
|
|
171
152
|
minLength: 6,
|
|
172
|
-
requireUppercase: false,
|
|
173
|
-
requireLowercase: true,
|
|
174
|
-
requireNumber: true,
|
|
175
|
-
requireSpecial: false,
|
|
176
153
|
},
|
|
177
154
|
render: (args) => (
|
|
178
155
|
<div style={{ width: 350 }}>
|