@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.
@@ -25,9 +25,9 @@ export interface LoginProps {
25
25
  onSSOMicrosoft?: () => void;
26
26
  onSSOApple?: () => void;
27
27
  onSSOLinkedIn?: () => void;
28
- onSSOGithub?: () => void;
29
- onSSOFacebook?: () => void;
30
- onSSOInstagram?: () => void;
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, onSSOGithub, onSSOFacebook, onSSOInstagram, onSSOFranceConnect, showSocialLogin, className, }: LoginProps): import("react/jsx-runtime").JSX.Element;
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}});
@@ -71,7 +71,7 @@ async function a() {
71
71
  } }), t];
72
72
  }
73
73
  async function o() {
74
- let { DndPlugin: e } = await import("@platejs/dnd/react");
74
+ let { DndPlugin: e } = await import("@platejs/dnd");
75
75
  return [e];
76
76
  }
77
77
  async function s() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wakastellar/ui",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "Zero-config UI Library for Next.js with TweakCN theming and i18n support",
5
5
  "keywords": [
6
6
  "ui",
@@ -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 { Github, Twitter, Linkedin, Mail } from "lucide-react"
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: Github,
33
- twitter: Twitter,
34
- linkedin: 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 { Github, Mail, Apple, Linkedin, Facebook, Instagram } from "lucide-react"
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
- onSSOGithub?: () => void
42
- onSSOFacebook?: () => void
43
- onSSOInstagram?: () => void
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
- onSSOGithub,
67
- onSSOFacebook,
68
- onSSOInstagram,
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 (onSSOGithub) {
117
- ssoList.push({ id: "github", label: "GitHub", icon: <Github className="h-4 w-4" />, onClick: onSSOGithub })
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: <Linkedin className="h-4 w-4" />, onClick: onSSOLinkedIn })
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: <Github className="h-4 w-4" />, onClick: onSSOGithub })
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: "Facebook", icon: <Facebook className="h-4 w-4" />, onClick: onSSOFacebook })
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: "Instagram", icon: <Instagram className="h-4 w-4" />, onClick: onSSOInstagram })
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, onSSOGithub, onSSOFacebook, onSSOInstagram, onSSOFranceConnect])
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
- Twitter,
37
- Github,
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 <Twitter className="h-4 w-4" />
330
+ return <Share2 className="h-4 w-4" />
332
331
  case "github":
333
- return <Github className="h-4 w-4" />
332
+ return <Globe className="h-4 w-4" />
334
333
  case "linkedin":
335
- return <Linkedin className="h-4 w-4" />
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
- Github,
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
- <Github className="mr-2 h-4 w-4" />
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/react"),
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/react")
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/react")
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 Approver } from "./index"
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
- orientation: { control: "select", options: ["horizontal", "vertical"], description: "Orientation" },
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 approvers: Approver[] = [
20
- { id: "1", name: "Alice Martin", role: "Manager", status: "approved", date: new Date(Date.now() - 86400000), comment: "Approuvé" },
21
- { id: "2", name: "Bob Dupont", role: "Finance", status: "approved", date: new Date(Date.now() - 43200000) },
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: { approvers, orientation: "horizontal", showComments: true },
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: { approvers, orientation: "vertical", showComments: true },
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
- approvers: approvers.map(a => ({ ...a, status: "approved" as const, date: new Date() })),
42
- orientation: "horizontal",
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
- approvers: [
50
- { ...approvers[0], status: "approved" as const },
51
- { ...approvers[1], status: "rejected" as const, comment: "Budget insuffisant" },
52
- { ...approvers[2], status: "skipped" as const },
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: { approvers, interactive: true, showComments: true },
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
- preset: { control: "select", options: ["last_week", "last_month", "last_quarter", "last_year", "custom"], description: "Préréglage" },
11
- showChart: { control: "boolean", description: "Afficher le graphique" },
12
- showPercentage: { control: "boolean", description: "Afficher les pourcentages" },
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", label: "Revenu", current: 45000, previous: 38000, format: "currency" as const },
21
- { id: "users", label: "Utilisateurs", current: 1250, previous: 1100, format: "number" as const },
22
- { id: "conversion", label: "Conversion", current: 3.5, previous: 3.2, format: "percent" as const },
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
- preset: "last_month",
29
- currentPeriod: { start: new Date("2024-01-01"), end: new Date("2024-01-31") },
30
- previousPeriod: { start: new Date("2023-12-01"), end: new Date("2023-12-31") },
31
- showChart: true,
32
- showPercentage: true,
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
- preset: "last_week",
45
- showChart: true,
46
- showPercentage: true,
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 => ({ ...m, current: m.previous * 0.9, previous: m.current })),
58
- preset: "last_month",
59
- showPercentage: true,
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: { metrics, preset: "last_quarter", showChart: false, showPercentage: true },
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: "Flèches navigation" },
13
- autoScroll: { control: "boolean", description: "Défilement auto" },
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: "À découvrir", slotIds, layout: "carousel", showArrows: true, autoScroll: false },
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 suggérés", slotIds: slotIds.slice(0, 3), layout: "list" },
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
- showRequirements: {
21
+ showChecklist: {
22
22
  control: "boolean",
23
- description: "Afficher les exigences",
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
- showRequirements: true,
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
- showRequirements: true,
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
- showRequirements: true,
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
- showRequirements: true,
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
- showRequirements: true,
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
- showRequirements: false,
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
- showRequirements: true,
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
- showRequirements: true,
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 }}>