@stackshift-ui/swiper-button 1.0.0 → 6.0.3
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/chunk-KX77LR4U.mjs +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/swiper-button.js +1 -1
- package/dist/swiper-button.mjs +1 -1
- package/package.json +8 -7
- package/src/index.ts +4 -0
- package/src/swiper-button.test.tsx +13 -0
- package/src/swiper-button.tsx +136 -0
- package/dist/chunk-FD6CH4H2.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as d}from"@stackshift-ui/button";import{useStackShiftUIComponents as u}from"@stackshift-ui/system";import g from"classnames";import{jsx as t}from"react/jsx-runtime";var n="SwiperButton",h=({variant:e="variant_a",type:s="left",onClick:i,ariaLabel:l,children:o,className:p,as:f,...m})=>{let{[n]:c=d}=u(),w={variant_a:a,variant_b:C}[e]||a,r="inline-block p-2 text-primary rounded-full shadow focus:outline-none",v={variant_a:r,variant_b:r}[e];return t(c,{as:"button",variant:"unstyled",onClick:i,className:g(v,p),"data-testid":n.toLowerCase(),ariaLabel:l,...m,children:o||t(w,{type:s})})};h.displayName=n;var a=({type:e})=>e==="right"?t("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}):t("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),C=({type:e})=>e==="left"?t("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:t("path",{d:"M9 16.0185C9.268 16.2905 9.268 16.7275 9 16.9975C8.732 17.2675 8.299 17.2685 8.031 16.9975L0.201 9.0895C-0.067 8.8195 -0.067 8.3825 0.201 8.1105L8.031 0.2025C8.299 -0.0675 8.732 -0.0675 9 0.2025C9.268 0.4735 9.268 0.9115 9 1.1815L1.859 8.6005L9 16.0185Z",fill:"#0045d8"})}):t("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:t("path",{d:"M0.19922 1.1817C-0.0687795 0.909696 -0.0687794 0.472695 0.19922 0.202695C0.46722 -0.0673054 0.90022 -0.0683048 1.16822 0.202695L8.99822 8.11069C9.26622 8.3807 9.26622 8.81769 8.99822 9.08969L1.16822 16.9977C0.900219 17.2677 0.467218 17.2677 0.199219 16.9977C-0.0687809 16.7267 -0.0687808 16.2887 0.199219 16.0187L7.34022 8.5997L0.19922 1.1817Z",fill:"#0045d8"})});export{h as a};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var L=Object.create;var s=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!B.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(a=k(e,r))||a.enumerable});return t};var b=(t,e,o)=>(o=t!=null?L(x(t)):{},p(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),M=t=>p(s({},"__esModule",{value:!0}),t);var S={};N(S,{SwiperButton:()=>d});module.exports=M(S);var
|
|
2
|
+
"use strict";var L=Object.create;var s=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!B.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(a=k(e,r))||a.enumerable});return t};var b=(t,e,o)=>(o=t!=null?L(x(t)):{},p(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),M=t=>p(s({},"__esModule",{value:!0}),t);var S={};N(S,{SwiperButton:()=>d});module.exports=M(S);var c=require("@stackshift-ui/button"),w=require("@stackshift-ui/system"),v=b(require("classnames")),n=require("react/jsx-runtime"),i="SwiperButton",d=({variant:t="variant_a",type:e="left",onClick:o,ariaLabel:a,children:r,className:u,as:V,...g})=>{let{[i]:h=c.Button}=(0,w.useStackShiftUIComponents)(),C={variant_a:m,variant_b:P}[t]||m,l="inline-block p-2 text-primary rounded-full shadow focus:outline-none",f={variant_a:l,variant_b:l}[t];return(0,n.jsx)(h,{as:"button",variant:"unstyled",onClick:o,className:(0,v.default)(f,u),"data-testid":i.toLowerCase(),ariaLabel:a,...g,children:r||(0,n.jsx)(C,{type:e})})};d.displayName=i;var m=({type:t})=>t==="right"?(0,n.jsx)("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}):(0,n.jsx)("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),P=({type:t})=>t==="left"?(0,n.jsx)("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:(0,n.jsx)("path",{d:"M9 16.0185C9.268 16.2905 9.268 16.7275 9 16.9975C8.732 17.2675 8.299 17.2685 8.031 16.9975L0.201 9.0895C-0.067 8.8195 -0.067 8.3825 0.201 8.1105L8.031 0.2025C8.299 -0.0675 8.732 -0.0675 9 0.2025C9.268 0.4735 9.268 0.9115 9 1.1815L1.859 8.6005L9 16.0185Z",fill:"#0045d8"})}):(0,n.jsx)("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:(0,n.jsx)("path",{d:"M0.19922 1.1817C-0.0687795 0.909696 -0.0687794 0.472695 0.19922 0.202695C0.46722 -0.0673054 0.90022 -0.0683048 1.16822 0.202695L8.99822 8.11069C9.26622 8.3807 9.26622 8.81769 8.99822 9.08969L1.16822 16.9977C0.900219 17.2677 0.467218 17.2677 0.199219 16.9977C-0.0687809 16.7267 -0.0687808 16.2887 0.199219 16.0187L7.34022 8.5997L0.19922 1.1817Z",fill:"#0045d8"})});0&&(module.exports={SwiperButton});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e}from"./chunk-
|
|
2
|
+
"use strict";import{a as e}from"./chunk-KX77LR4U.mjs";export{e as SwiperButton};
|
package/dist/swiper-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var L=Object.create;var s=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!B.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(a=k(e,r))||a.enumerable});return t};var b=(t,e,o)=>(o=t!=null?L(x(t)):{},p(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),M=t=>p(s({},"__esModule",{value:!0}),t);var S={};N(S,{SwiperButton:()=>d});module.exports=M(S);var
|
|
1
|
+
"use strict";var L=Object.create;var s=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!B.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(a=k(e,r))||a.enumerable});return t};var b=(t,e,o)=>(o=t!=null?L(x(t)):{},p(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),M=t=>p(s({},"__esModule",{value:!0}),t);var S={};N(S,{SwiperButton:()=>d});module.exports=M(S);var c=require("@stackshift-ui/button"),w=require("@stackshift-ui/system"),v=b(require("classnames")),n=require("react/jsx-runtime"),i="SwiperButton",d=({variant:t="variant_a",type:e="left",onClick:o,ariaLabel:a,children:r,className:u,as:V,...g})=>{let{[i]:h=c.Button}=(0,w.useStackShiftUIComponents)(),C={variant_a:m,variant_b:P}[t]||m,l="inline-block p-2 text-primary rounded-full shadow focus:outline-none",f={variant_a:l,variant_b:l}[t];return(0,n.jsx)(h,{as:"button",variant:"unstyled",onClick:o,className:(0,v.default)(f,u),"data-testid":i.toLowerCase(),ariaLabel:a,...g,children:r||(0,n.jsx)(C,{type:e})})};d.displayName=i;var m=({type:t})=>t==="right"?(0,n.jsx)("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}):(0,n.jsx)("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),P=({type:t})=>t==="left"?(0,n.jsx)("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:(0,n.jsx)("path",{d:"M9 16.0185C9.268 16.2905 9.268 16.7275 9 16.9975C8.732 17.2675 8.299 17.2685 8.031 16.9975L0.201 9.0895C-0.067 8.8195 -0.067 8.3825 0.201 8.1105L8.031 0.2025C8.299 -0.0675 8.732 -0.0675 9 0.2025C9.268 0.4735 9.268 0.9115 9 1.1815L1.859 8.6005L9 16.0185Z",fill:"#0045d8"})}):(0,n.jsx)("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:(0,n.jsx)("path",{d:"M0.19922 1.1817C-0.0687795 0.909696 -0.0687794 0.472695 0.19922 0.202695C0.46722 -0.0673054 0.90022 -0.0683048 1.16822 0.202695L8.99822 8.11069C9.26622 8.3807 9.26622 8.81769 8.99822 9.08969L1.16822 16.9977C0.900219 17.2677 0.467218 17.2677 0.199219 16.9977C-0.0687809 16.7267 -0.0687808 16.2887 0.199219 16.0187L7.34022 8.5997L0.19922 1.1817Z",fill:"#0045d8"})});0&&(module.exports={SwiperButton});
|
package/dist/swiper-button.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-KX77LR4U.mjs";export{a as SwiperButton};
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/swiper-button",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"module": "./dist/index.mjs",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist/**"
|
|
11
|
+
"dist/**",
|
|
12
|
+
"src"
|
|
12
13
|
],
|
|
13
14
|
"author": "WebriQ <info@webriq.com>",
|
|
14
15
|
"devDependencies": {
|
|
@@ -28,14 +29,14 @@
|
|
|
28
29
|
"typescript": "^5.6.2",
|
|
29
30
|
"vite-tsconfig-paths": "^5.0.1",
|
|
30
31
|
"vitest": "^2.1.1",
|
|
31
|
-
"@stackshift-ui/eslint-config": "
|
|
32
|
-
"@stackshift-ui/typescript-config": "
|
|
32
|
+
"@stackshift-ui/eslint-config": "6.0.2",
|
|
33
|
+
"@stackshift-ui/typescript-config": "6.0.2"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"classnames": "^2.5.1",
|
|
36
|
-
"@stackshift-ui/scripts": "
|
|
37
|
-
"@stackshift-ui/
|
|
38
|
-
"@stackshift-ui/
|
|
37
|
+
"@stackshift-ui/scripts": "6.0.2",
|
|
38
|
+
"@stackshift-ui/system": "6.0.3",
|
|
39
|
+
"@stackshift-ui/button": "6.0.3"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"@types/react": "16.8 - 19",
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cleanup, render, screen } from "@testing-library/react";
|
|
2
|
+
import { afterEach, describe, test } from "vitest";
|
|
3
|
+
import { SwiperButton } from "./swiper-button";
|
|
4
|
+
|
|
5
|
+
describe.concurrent("swiper-button", () => {
|
|
6
|
+
afterEach(cleanup);
|
|
7
|
+
|
|
8
|
+
test("Common: Swiper Button - test if renders without errors", ({ expect }) => {
|
|
9
|
+
const clx = "swiperbtn-class";
|
|
10
|
+
render(<SwiperButton className={clx} />);
|
|
11
|
+
expect(screen.getByRole("button").classList).toContain(clx);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Button } from "@stackshift-ui/button";
|
|
2
|
+
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
type Variant = "variant_a" | "variant_b";
|
|
7
|
+
|
|
8
|
+
export interface SwiperButtonProps extends Omit<HTMLProps<HTMLElement>, "as" | "size"> {
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
type?: "left" | "right";
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
as?: ElementType;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const displayName = "SwiperButton";
|
|
20
|
+
|
|
21
|
+
export const SwiperButton: React.FC<SwiperButtonProps> = ({
|
|
22
|
+
variant = "variant_a",
|
|
23
|
+
type = "left",
|
|
24
|
+
onClick,
|
|
25
|
+
ariaLabel,
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
as,
|
|
29
|
+
...props
|
|
30
|
+
}) => {
|
|
31
|
+
const { [displayName]: Component = Button } = useStackShiftUIComponents();
|
|
32
|
+
|
|
33
|
+
const variantList = {
|
|
34
|
+
variant_a: VariantA,
|
|
35
|
+
variant_b: VariantB,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const Element = variantList[variant] || VariantA;
|
|
39
|
+
const commonStyle = "inline-block p-2 text-primary rounded-full shadow focus:outline-none";
|
|
40
|
+
|
|
41
|
+
const variantClasses = {
|
|
42
|
+
variant_a: commonStyle,
|
|
43
|
+
variant_b: commonStyle,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const classes = variantClasses[variant];
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Component
|
|
50
|
+
as="button"
|
|
51
|
+
variant="unstyled"
|
|
52
|
+
onClick={onClick}
|
|
53
|
+
className={cn(classes, className)}
|
|
54
|
+
data-testid={displayName.toLowerCase()}
|
|
55
|
+
ariaLabel={ariaLabel}
|
|
56
|
+
{...props}>
|
|
57
|
+
{children ? children : <Element type={type} />}
|
|
58
|
+
</Component>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
SwiperButton.displayName = displayName;
|
|
63
|
+
|
|
64
|
+
type VariantProps = {
|
|
65
|
+
type: "left" | "right";
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const VariantA = ({ type }: VariantProps) => {
|
|
69
|
+
if (type === "right") {
|
|
70
|
+
return (
|
|
71
|
+
<svg
|
|
72
|
+
className="w-6 h-6"
|
|
73
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
74
|
+
fill="none"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
stroke="currentColor">
|
|
77
|
+
<path
|
|
78
|
+
strokeLinecap="round"
|
|
79
|
+
strokeLinejoin="round"
|
|
80
|
+
strokeWidth={2}
|
|
81
|
+
d="M14 5l7 7m0 0l-7 7m7-7H3"
|
|
82
|
+
/>
|
|
83
|
+
</svg>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<svg
|
|
89
|
+
className="w-6 h-6"
|
|
90
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
91
|
+
fill="none"
|
|
92
|
+
viewBox="0 0 24 24"
|
|
93
|
+
stroke="currentColor">
|
|
94
|
+
<path
|
|
95
|
+
strokeLinecap="round"
|
|
96
|
+
strokeLinejoin="round"
|
|
97
|
+
strokeWidth={2}
|
|
98
|
+
d="M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const VariantB = ({ type }: VariantProps) => {
|
|
105
|
+
if (type === "left") {
|
|
106
|
+
return (
|
|
107
|
+
<svg
|
|
108
|
+
width={36}
|
|
109
|
+
height={36}
|
|
110
|
+
viewBox="0 0 10 18"
|
|
111
|
+
fill="none"
|
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
+
stroke="currentColor">
|
|
114
|
+
<path
|
|
115
|
+
d="M9 16.0185C9.268 16.2905 9.268 16.7275 9 16.9975C8.732 17.2675 8.299 17.2685 8.031 16.9975L0.201 9.0895C-0.067 8.8195 -0.067 8.3825 0.201 8.1105L8.031 0.2025C8.299 -0.0675 8.732 -0.0675 9 0.2025C9.268 0.4735 9.268 0.9115 9 1.1815L1.859 8.6005L9 16.0185Z"
|
|
116
|
+
fill="#0045d8"
|
|
117
|
+
/>
|
|
118
|
+
</svg>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<svg
|
|
124
|
+
width={36}
|
|
125
|
+
height={36}
|
|
126
|
+
viewBox="0 0 10 18"
|
|
127
|
+
fill="none"
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
+
stroke="currentColor">
|
|
130
|
+
<path
|
|
131
|
+
d="M0.19922 1.1817C-0.0687795 0.909696 -0.0687794 0.472695 0.19922 0.202695C0.46722 -0.0673054 0.90022 -0.0683048 1.16822 0.202695L8.99822 8.11069C9.26622 8.3807 9.26622 8.81769 8.99822 9.08969L1.16822 16.9977C0.900219 17.2677 0.467218 17.2677 0.199219 16.9977C-0.0687809 16.7267 -0.0687808 16.2887 0.199219 16.0187L7.34022 8.5997L0.19922 1.1817Z"
|
|
132
|
+
fill="#0045d8"
|
|
133
|
+
/>
|
|
134
|
+
</svg>
|
|
135
|
+
);
|
|
136
|
+
};
|
package/dist/chunk-FD6CH4H2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Button as d}from"@stackshift-ui/button";import{useStackShiftUIComponents as u}from"@stackshift-ui/system";import g from"classnames";import{jsx as t}from"react/jsx-runtime";var n="SwiperButton",h=({variant:e="variant_a",type:s="left",onClick:i,ariaLabel:l,children:o,className:p,as:f,...c})=>{let{[n]:m=d}=u(),w={variant_a:a,variant_b:C}[e]||a,r="inline-block p-2 rounded-full shadow focus:outline-none",v={variant_a:r,variant_b:r}[e];return t(m,{as:"button",variant:"unstyled",onClick:i,className:g(v,p),"data-testid":n.toLowerCase(),ariaLabel:l,...c,children:o||t(w,{type:s})})};h.displayName=n;var a=({type:e})=>e==="right"?t("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})}):t("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),C=({type:e})=>e==="left"?t("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:t("path",{d:"M9 16.0185C9.268 16.2905 9.268 16.7275 9 16.9975C8.732 17.2675 8.299 17.2685 8.031 16.9975L0.201 9.0895C-0.067 8.8195 -0.067 8.3825 0.201 8.1105L8.031 0.2025C8.299 -0.0675 8.732 -0.0675 9 0.2025C9.268 0.4735 9.268 0.9115 9 1.1815L1.859 8.6005L9 16.0185Z",fill:"#0045d8"})}):t("svg",{width:36,height:36,viewBox:"0 0 10 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:t("path",{d:"M0.19922 1.1817C-0.0687795 0.909696 -0.0687794 0.472695 0.19922 0.202695C0.46722 -0.0673054 0.90022 -0.0683048 1.16822 0.202695L8.99822 8.11069C9.26622 8.3807 9.26622 8.81769 8.99822 9.08969L1.16822 16.9977C0.900219 17.2677 0.467218 17.2677 0.199219 16.9977C-0.0687809 16.7267 -0.0687808 16.2887 0.199219 16.0187L7.34022 8.5997L0.19922 1.1817Z",fill:"#0045d8"})});export{h as a};
|