@rxdrag/website-lib-core 0.0.98 → 0.0.99

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": "@rxdrag/website-lib-core",
3
- "version": "0.0.98",
3
+ "version": "0.0.99",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
@@ -25,8 +25,8 @@
25
25
  "eslint": "^7.32.0",
26
26
  "typescript": "^5",
27
27
  "@rxdrag/eslint-config-custom": "0.2.12",
28
- "@rxdrag/tsconfig": "0.2.0",
29
- "@rxdrag/slate-preview": "1.2.63"
28
+ "@rxdrag/slate-preview": "1.2.63",
29
+ "@rxdrag/tsconfig": "0.2.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@iconify/utils": "^3.0.2",
@@ -36,8 +36,8 @@
36
36
  "lodash-es": "^4.17.21",
37
37
  "react": "^19.1.0",
38
38
  "react-dom": "^19.1.0",
39
- "@rxdrag/entify-lib": "0.0.23",
40
- "@rxdrag/rxcms-models": "0.3.95"
39
+ "@rxdrag/rxcms-models": "0.3.95",
40
+ "@rxdrag/entify-lib": "0.0.23"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "astro": "^4.0.0 || ^5.0.0"
@@ -1,33 +1,46 @@
1
- import clsx from "clsx"
2
- import { forwardRef } from "react"
1
+ import clsx from "clsx";
2
+ import { forwardRef } from "react";
3
3
 
4
4
  export type ToTopProps = {
5
- className?: string,
6
- children?: React.ReactNode
7
- }
5
+ className?: string;
6
+ svg?: string;
7
+ };
8
8
 
9
- export const ToTop = forwardRef<HTMLDivElement, ToTopProps>((
10
- props, ref) => {
11
- const { className, children, ...rest } = props
9
+ export const ToTop = forwardRef<HTMLDivElement, ToTopProps>((props, ref) => {
10
+ const { className, svg, ...rest } = props;
12
11
  const handleClick = () => {
13
- window.scrollTo({ top: 0, behavior: "smooth" })
14
- }
12
+ window.scrollTo({ top: 0, behavior: "smooth" });
13
+ };
15
14
 
16
- return <div
17
- ref={ref}
18
- className={
19
- clsx(
15
+ return (
16
+ <div
17
+ ref={ref}
18
+ className={clsx(
20
19
  "fixed bottom-4 right-4 hidden user-select-none scrolled:flex cursor-pointer transition duration-300 ease-in-out z-50",
21
- className,
22
- )
23
- }
24
- {...rest}
25
- onClick={handleClick}
26
- >
27
- {
28
- children || <svg className="h-6 w-6" width="1.5rem" height="1.5rem" fill="none" viewBox="0 0 24 24" stroke="currentColor">
29
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 15l7-7 7 7" />
30
- </svg>
31
- }
32
- </div>
33
- })
20
+ className
21
+ )}
22
+ {...rest}
23
+ onClick={handleClick}
24
+ >
25
+ {svg ? (
26
+ <div className="contents" dangerouslySetInnerHTML={{ __html: svg }} />
27
+ ) : (
28
+ <svg
29
+ className="h-6 w-6"
30
+ width="1.5rem"
31
+ height="1.5rem"
32
+ fill="none"
33
+ viewBox="0 0 24 24"
34
+ stroke="currentColor"
35
+ >
36
+ <path
37
+ strokeLinecap="round"
38
+ strokeLinejoin="round"
39
+ strokeWidth={2}
40
+ d="M5 15l7-7 7 7"
41
+ />
42
+ </svg>
43
+ )}
44
+ </div>
45
+ );
46
+ });