-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandre Pinot
authored and
Alexandre Pinot
committed
Nov 15, 2024
1 parent
8964d96
commit 91c60db
Showing
42 changed files
with
980 additions
and
205 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// src/components/MonBouton/MonBouton.tsx | ||
import React from "react"; | ||
import { cn } from "@sparkle/lib/utils"; | ||
|
||
// Types de variantes | ||
type ButtonVariant = "purple" | "blue" | "green"; | ||
|
||
interface MonBoutonProps { | ||
label: string; | ||
onClick?: () => void; | ||
className?: string; | ||
disabled?: boolean; | ||
variant?: ButtonVariant; | ||
withRipple?: boolean; | ||
} | ||
|
||
export function MonBouton({ | ||
label, | ||
onClick, | ||
className, | ||
disabled = false, | ||
variant = "purple", | ||
withRipple = true, | ||
}: MonBoutonProps) { | ||
const variantStyles: Record<ButtonVariant, string> = { | ||
purple: [ | ||
"s-bg-purple-500/10", | ||
"s-border-purple-500/20", | ||
"s-text-purple-700", | ||
"hover:s-bg-purple-500/20", | ||
"hover:s-border-purple-500/30", | ||
"hover:s-shadow-purple-500/30", | ||
"focus:s-ring-purple-500/40" | ||
].join(" "), | ||
|
||
blue: [ | ||
"s-bg-blue-500/10", | ||
"s-border-blue-500/20", | ||
"s-text-blue-700", | ||
"hover:s-bg-blue-500/20", | ||
"hover:s-border-blue-500/30", | ||
"hover:s-shadow-blue-500/30", | ||
"focus:s-ring-blue-500/40" | ||
].join(" "), | ||
|
||
green: [ | ||
"s-bg-emerald-400/10", | ||
"s-border-emerald-500/20", | ||
"s-text-emerald-700", | ||
"hover:s-bg-emerald-500/20", | ||
"hover:s-border-emerald-500/30", | ||
"hover:s-shadow-emerald-500/30", | ||
"focus:s-ring-emerald-500/40" | ||
].join(" "), | ||
}; | ||
|
||
return ( | ||
<button | ||
className={cn( | ||
// Style de base | ||
"s-relative", | ||
"s-overflow-hidden", | ||
"s-border", | ||
"s-backdrop-blur-sm", | ||
"s-h-12", | ||
"s-px-6", | ||
"s-rounded-lg", | ||
"hover:s-shadow-lg", | ||
"s-transition-all", | ||
"s-duration-300", | ||
"focus:s-outline-none", | ||
"focus:s-ring-2", | ||
"focus:s-ring-offset-2", | ||
|
||
// Applique les styles de la variante | ||
variantStyles[variant], | ||
|
||
// Styles désactivés | ||
disabled && [ | ||
"s-opacity-50", | ||
"s-cursor-not-allowed", | ||
"s-pointer-events-none", | ||
"s-grayscale" | ||
], | ||
|
||
className | ||
)} | ||
onClick={onClick} | ||
disabled={disabled} | ||
> | ||
{/* Effet de ripple */} | ||
{withRipple && ( | ||
<span className={cn( | ||
"s-absolute s-inset-0", | ||
"s-transform s-translate-y-full", | ||
"hover:s-translate-y-0", | ||
"s-transition-transform", | ||
"s-duration-300", | ||
"s-bg-gradient-to-t s-from-white/5 s-to-transparent" | ||
)} /> | ||
)} | ||
|
||
<span className="s-relative s-z-10 s-font-medium"> | ||
{label} | ||
</span> | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from "react"; | ||
import * as React from "react"; | ||
const SvgCamera = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
fill="#000" | ||
d="M9.001 3h6l2 2h4.5c.553 0 .5-.052.5.5v15c0 .552.053.5-.5.5h-19c-.552 0-.5.052-.5-.5v-15c0-.552-.052-.5.5-.5h4.5l2-2Zm3 16a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm0-2a4 4 0 1 1 0-8 4 4 0 0 1 0 8Z" | ||
/> | ||
</svg> | ||
); | ||
export default SvgCamera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from "react"; | ||
import * as React from "react"; | ||
const SvgListDeselect = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M7.293 8.707 6 7.414 4.707 8.707 3.293 7.293 4.586 6 3.293 4.707l1.414-1.414L6 4.586l1.293-1.293 1.414 1.414L7.414 6l1.293 1.293-1.414 1.414ZM11 4.5h10v3H11v-3ZM21 11H11v3h10v-3ZM21 17.5H11v3h10v-3ZM6 20.414l1.293 1.293 1.414-1.414L7.414 19l1.293-1.293-1.414-1.414L6 17.586l-1.293-1.293-1.414 1.414L4.586 19l-1.293 1.293 1.414 1.414L6 20.414ZM7.293 15.207 6 13.914l-1.293 1.293-1.414-1.414L4.586 12.5l-1.293-1.293 1.414-1.414L6 11.086l1.293-1.293 1.414 1.414L7.414 12.5l1.293 1.293-1.414 1.414Z" | ||
/> | ||
</svg> | ||
); | ||
export default SvgListDeselect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from "react"; | ||
import * as React from "react"; | ||
const SvgListSelect = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M21 11H11v3h10v-3ZM21 17.5H11v3h10v-3ZM6 21.331l3.707-3.707-1.414-1.414L6 18.503 4.71 17.21l-1.42 1.41L6 21.331ZM6 14.831l3.707-3.707L8.293 9.71 6 12.003 4.71 10.71l-1.42 1.41L6 14.831ZM21 4.5H11v3h10v-3ZM6 8.331l3.707-3.707L8.293 3.21 6 5.503 4.71 4.21 3.29 5.62 6 8.331Z" | ||
/> | ||
</svg> | ||
); | ||
export default SvgListSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { SVGProps } from "react"; | ||
import * as React from "react"; | ||
const SvgServerLocked = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M17 17h-2v2h2v-2ZM12 7a1 1 0 0 0-1 1v1h2V8a1 1 0 0 0-1-1Z" | ||
/> | ||
<path | ||
fill="currentColor" | ||
fillRule="evenodd" | ||
d="M21 5a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V5ZM5 17a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-2Zm5-9v1H9v4h6V9h-1V8a2 2 0 1 0-4 0Z" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
); | ||
export default SvgServerLocked; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { SVGProps } from "react"; | ||
import * as React from "react"; | ||
const SvgTSquare = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="1em" | ||
height="1em" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
> | ||
<path | ||
fill="#000" | ||
d="M2 3.5c0-.552-.052-.5.5-.5h19c.552 0 .5-.052.5.5v17c0 .552.052.5-.5.5h-19c-.552 0-.5.052-.5-.5v-17ZM4 5v14h16V5H4Zm3 3h10v3h-2v-1h-2v4h1.5v2h-5v-2H11v-4H9v1H7V8Z" | ||
/> | ||
</svg> | ||
); | ||
export default SvgTSquare; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.