@rpcbase/ui 0.34.0 → 0.36.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/ui",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "exports": {
@@ -1,4 +1,5 @@
1
- import clsx from "clsx";
1
+ import clsx from "clsx"
2
+
2
3
 
3
4
  export const ApplePayButton = ({ onClick, className = "" }) => {
4
5
  return (
@@ -12,5 +13,5 @@ export const ApplePayButton = ({ onClick, className = "" }) => {
12
13
  <path d="M9.536 2.579c-.571.675-1.485 1.208-2.4 1.132-.113-.914.334-1.884.858-2.484C8.565.533 9.564.038 10.374 0c.095.951-.276 1.884-.838 2.579zm.829 1.313c-1.324-.077-2.457.751-3.085.751-.638 0-1.6-.713-2.647-.694-1.362.019-2.628.79-3.323 2.017-1.429 2.455-.372 6.09 1.009 8.087.676.99 1.485 2.075 2.552 2.036 1.009-.038 1.409-.656 2.628-.656 1.228 0 1.58.656 2.647.637 1.104-.019 1.8-.99 2.475-1.979.771-1.122 1.086-2.217 1.105-2.274-.02-.019-2.133-.828-2.152-3.263-.02-2.036 1.666-3.007 1.742-3.064-.952-1.408-2.437-1.56-2.951-1.598zm7.645-2.76v14.834h2.305v-5.072h3.19c2.913 0 4.96-1.998 4.96-4.89 0-2.893-2.01-4.872-4.885-4.872h-5.57zm2.305 1.941h2.656c2 0 3.142 1.066 3.142 2.94 0 1.875-1.142 2.95-3.151 2.95h-2.647v-5.89zM32.673 16.08c1.448 0 2.79-.733 3.4-1.893h.047v1.779h2.133V8.582c0-2.14-1.714-3.52-4.351-3.52-2.447 0-4.256 1.399-4.323 3.32h2.076c.171-.913 1.018-1.512 2.18-1.512 1.41 0 2.2.656 2.2 1.865v.818l-2.876.171c-2.675.162-4.123 1.256-4.123 3.159 0 1.922 1.495 3.197 3.637 3.197zm.62-1.76c-1.229 0-2.01-.59-2.01-1.494 0-.933.752-1.475 2.19-1.56l2.562-.162v.837c0 1.39-1.181 2.379-2.743 2.379zM41.1 20c2.247 0 3.304-.856 4.227-3.454l4.047-11.341h-2.342l-2.714 8.763h-.047l-2.714-8.763h-2.409l3.904 10.799-.21.656c-.352 1.114-.923 1.542-1.942 1.542-.18 0-.533-.02-.676-.038v1.779c.133.038.705.057.876.057z" />
13
14
  </svg>
14
15
  </button>
15
- );
16
- };
16
+ )
17
+ }
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from "react"
2
2
 
3
3
 
4
4
  const colorVariants = {
@@ -26,7 +26,7 @@ export const Checkbox = ({
26
26
  ...props
27
27
  }: CheckboxProps) => {
28
28
 
29
- const colorClasses = colorVariants[color];
29
+ const colorClasses = colorVariants[color]
30
30
 
31
31
  return (
32
32
  <div className="flex h-6 shrink-0 items-center">
@@ -64,5 +64,5 @@ export const Checkbox = ({
64
64
  </svg>
65
65
  </div>
66
66
  </div>
67
- );
68
- };
67
+ )
68
+ }
@@ -1,6 +1,6 @@
1
- import clsx from "clsx";
2
- import { ReactNode, useState, useRef, useEffect } from "react";
3
- import { Link } from "react-router";
1
+ import clsx from "clsx"
2
+ import { ReactNode, useState, useRef, useEffect } from "react"
3
+ import { Link } from "react-router"
4
4
 
5
5
 
6
6
  export const MenuPopover = ({
@@ -18,30 +18,30 @@ export const MenuPopover = ({
18
18
  isActive: boolean;
19
19
  children: (props: { setIsOpen: (isOpen: boolean) => void }) => ReactNode
20
20
  }) => {
21
- const [isOpen, setIsOpen] = useState(false);
22
- const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
23
- const popoverRef = useRef(null);
21
+ const [isOpen, setIsOpen] = useState(false)
22
+ const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
23
+ const popoverRef = useRef(null)
24
24
 
25
25
  const handleMouseEnter = () => {
26
26
  if (timeoutRef.current) {
27
- clearTimeout(timeoutRef.current);
27
+ clearTimeout(timeoutRef.current)
28
28
  }
29
- setIsOpen(true);
30
- };
29
+ setIsOpen(true)
30
+ }
31
31
 
32
32
  const handleMouseLeave = () => {
33
33
  timeoutRef.current = setTimeout(() => {
34
- setIsOpen(false);
35
- }, 120);
36
- };
34
+ setIsOpen(false)
35
+ }, 120)
36
+ }
37
37
 
38
38
  useEffect(() => {
39
39
  return () => {
40
40
  if (timeoutRef.current) {
41
- clearTimeout(timeoutRef.current);
41
+ clearTimeout(timeoutRef.current)
42
42
  }
43
- };
44
- }, []);
43
+ }
44
+ }, [])
45
45
 
46
46
  return (
47
47
  <div
@@ -54,7 +54,7 @@ export const MenuPopover = ({
54
54
  <Link
55
55
  to={href}
56
56
  onClick={() => {
57
- setIsOpen(false);
57
+ setIsOpen(false)
58
58
  }}
59
59
  className={clsx(
60
60
  "relative z-10 -mb-px flex items-center border-b-2 pt-px text-sm font-medium text-gray-700 cursor-pointer transition-colors duration-200 ease-out hover:text-gray-800",
@@ -82,5 +82,5 @@ export const MenuPopover = ({
82
82
  </div>
83
83
  )}
84
84
  </div>
85
- );
86
- };
85
+ )
86
+ }
@@ -1,5 +1,6 @@
1
1
  import { MenuPopover } from "./MenuPopover"
2
2
 
3
+
3
4
  export const Header = {
4
5
  MenuPopover
5
6
  }
package/src/index.ts CHANGED
@@ -3,4 +3,3 @@ export * from "./helpers"
3
3
  export * from "./Checkbox"
4
4
  export * from "./Image"
5
5
  export * from "./ApplePayButton"
6
- export * from "./AppleSignInButton"
@@ -1,33 +0,0 @@
1
- import clsx from "clsx"
2
-
3
- export const AppleSignInButton = ({
4
- onClick,
5
- className = ""
6
- }) => {
7
-
8
- return (
9
- <button
10
- onClick={onClick}
11
- className={clsx(`
12
- w-full
13
- bg-black text-white hover:bg-gray-800
14
- flex items-center justify-center
15
- px-6 py-2
16
- rounded-lg
17
- font-medium
18
- transition duration-150 ease-in-out
19
- focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black
20
- `, className)}
21
- >
22
- <svg
23
- className="w-5 h-5 mr-3"
24
- xmlns="http://www.w3.org/2000/svg"
25
- viewBox="0 0 24 24"
26
- fill="white"
27
- >
28
- <path d="M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.539 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701" />
29
- </svg>
30
- Continuer avec Apple
31
- </button>
32
- )
33
- }