-
Notifications
You must be signed in to change notification settings - Fork 0
feat: button component #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rfaria107
wants to merge
9
commits into
main
Choose a base branch
from
rf/button-component
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3daf5dc
feat: button component
rfaria107 797d6e0
small-fixes
rfaria107 877e919
Fix: updated and simplified Props + Storybook
rfaria107 8d58263
Merge remote-tracking branch 'origin/main' into rf/button-component
rfaria107 a5537fb
format fix
rfaria107 8659019
format fix
rfaria107 77fc3ef
storybook import fix
rfaria107 db04faa
merge fixes
rfaria107 3314292
format fixes (again)
rfaria107 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -236,6 +236,8 @@ | |
|
|
||
| "@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg=="], | ||
|
|
||
| "@jridgewell/remapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], | ||
|
|
||
| "@jridgewell/resolve-uri": ["@jridgewell/[email protected]", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], | ||
|
|
||
| "@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw=="], | ||
|
|
@@ -362,35 +364,35 @@ | |
|
|
||
| "@swc/helpers": ["@swc/[email protected]", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g=="], | ||
|
|
||
| "@tailwindcss/node": ["@tailwindcss/[email protected].11", "", { "dependencies": { "@ampproject/remapping": "^2.3.0", "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", "lightningcss": "1.30.1", "magic-string": "^0.30.17", "source-map-js": "^1.2.1", "tailwindcss": "4.1.11" } }, "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q=="], | ||
| "@tailwindcss/node": ["@tailwindcss/[email protected].12", "", { "dependencies": { "@jridgewell/remapping": "^2.3.4", "enhanced-resolve": "^5.18.3", "jiti": "^2.5.1", "lightningcss": "1.30.1", "magic-string": "^0.30.17", "source-map-js": "^1.2.1", "tailwindcss": "4.1.12" } }, "sha512-3hm9brwvQkZFe++SBt+oLjo4OLDtkvlE8q2WalaD/7QWaeM7KEJbAiY/LJZUaCs7Xa8aUu4xy3uoyX4q54UVdQ=="], | ||
|
|
||
| "@tailwindcss/oxide": ["@tailwindcss/[email protected].11", "", { "dependencies": { "detect-libc": "^2.0.4", "tar": "^7.4.3" }, "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.11", "@tailwindcss/oxide-darwin-arm64": "4.1.11", "@tailwindcss/oxide-darwin-x64": "4.1.11", "@tailwindcss/oxide-freebsd-x64": "4.1.11", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", "@tailwindcss/oxide-linux-x64-musl": "4.1.11", "@tailwindcss/oxide-wasm32-wasi": "4.1.11", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", "@tailwindcss/oxide-win32-x64-msvc": "4.1.11" } }, "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg=="], | ||
| "@tailwindcss/oxide": ["@tailwindcss/[email protected].12", "", { "dependencies": { "detect-libc": "^2.0.4", "tar": "^7.4.3" }, "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.12", "@tailwindcss/oxide-darwin-arm64": "4.1.12", "@tailwindcss/oxide-darwin-x64": "4.1.12", "@tailwindcss/oxide-freebsd-x64": "4.1.12", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.12", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.12", "@tailwindcss/oxide-linux-arm64-musl": "4.1.12", "@tailwindcss/oxide-linux-x64-gnu": "4.1.12", "@tailwindcss/oxide-linux-x64-musl": "4.1.12", "@tailwindcss/oxide-wasm32-wasi": "4.1.12", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.12", "@tailwindcss/oxide-win32-x64-msvc": "4.1.12" } }, "sha512-gM5EoKHW/ukmlEtphNwaGx45fGoEmP10v51t9unv55voWh6WrOL19hfuIdo2FjxIaZzw776/BUQg7Pck++cIVw=="], | ||
|
|
||
| "@tailwindcss/oxide-android-arm64": ["@tailwindcss/[email protected].11", "", { "os": "android", "cpu": "arm64" }, "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg=="], | ||
| "@tailwindcss/oxide-android-arm64": ["@tailwindcss/[email protected].12", "", { "os": "android", "cpu": "arm64" }, "sha512-oNY5pq+1gc4T6QVTsZKwZaGpBb2N1H1fsc1GD4o7yinFySqIuRZ2E4NvGasWc6PhYJwGK2+5YT1f9Tp80zUQZQ=="], | ||
|
|
||
| "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/[email protected].11", "", { "os": "darwin", "cpu": "arm64" }, "sha512-ESgStEOEsyg8J5YcMb1xl8WFOXfeBmrhAwGsFxxB2CxY9evy63+AtpbDLAyRkJnxLy2WsD1qF13E97uQyP1lfQ=="], | ||
| "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/[email protected].12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cq1qmq2HEtDV9HvZlTtrj671mCdGB93bVY6J29mwCyaMYCP/JaUBXxrQQQm7Qn33AXXASPUb2HFZlWiiHWFytw=="], | ||
|
|
||
| "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/[email protected].11", "", { "os": "darwin", "cpu": "x64" }, "sha512-EgnK8kRchgmgzG6jE10UQNaH9Mwi2n+yw1jWmof9Vyg2lpKNX2ioe7CJdf9M5f8V9uaQxInenZkOxnTVL3fhAw=="], | ||
| "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/[email protected].12", "", { "os": "darwin", "cpu": "x64" }, "sha512-6UCsIeFUcBfpangqlXay9Ffty9XhFH1QuUFn0WV83W8lGdX8cD5/+2ONLluALJD5+yJ7k8mVtwy3zMZmzEfbLg=="], | ||
|
|
||
| "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/[email protected].11", "", { "os": "freebsd", "cpu": "x64" }, "sha512-xdqKtbpHs7pQhIKmqVpxStnY1skuNh4CtbcyOHeX1YBE0hArj2romsFGb6yUmzkq/6M24nkxDqU8GYrKrz+UcA=="], | ||
| "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/[email protected].12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JOH/f7j6+nYXIrHobRYCtoArJdMJh5zy5lr0FV0Qu47MID/vqJAY3r/OElPzx1C/wdT1uS7cPq+xdYYelny1ww=="], | ||
|
|
||
| "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/[email protected].11", "", { "os": "linux", "cpu": "arm" }, "sha512-ryHQK2eyDYYMwB5wZL46uoxz2zzDZsFBwfjssgB7pzytAeCCa6glsiJGjhTEddq/4OsIjsLNMAiMlHNYnkEEeg=="], | ||
| "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/[email protected].12", "", { "os": "linux", "cpu": "arm" }, "sha512-v4Ghvi9AU1SYgGr3/j38PD8PEe6bRfTnNSUE3YCMIRrrNigCFtHZ2TCm8142X8fcSqHBZBceDx+JlFJEfNg5zQ=="], | ||
|
|
||
| "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/[email protected].11", "", { "os": "linux", "cpu": "arm64" }, "sha512-mYwqheq4BXF83j/w75ewkPJmPZIqqP1nhoghS9D57CLjsh3Nfq0m4ftTotRYtGnZd3eCztgbSPJ9QhfC91gDZQ=="], | ||
| "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/[email protected].12", "", { "os": "linux", "cpu": "arm64" }, "sha512-YP5s1LmetL9UsvVAKusHSyPlzSRqYyRB0f+Kl/xcYQSPLEw/BvGfxzbH+ihUciePDjiXwHh+p+qbSP3SlJw+6g=="], | ||
|
|
||
| "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/[email protected].11", "", { "os": "linux", "cpu": "arm64" }, "sha512-m/NVRFNGlEHJrNVk3O6I9ggVuNjXHIPoD6bqay/pubtYC9QIdAMpS+cswZQPBLvVvEF6GtSNONbDkZrjWZXYNQ=="], | ||
| "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/[email protected].12", "", { "os": "linux", "cpu": "arm64" }, "sha512-V8pAM3s8gsrXcCv6kCHSuwyb/gPsd863iT+v1PGXC4fSL/OJqsKhfK//v8P+w9ThKIoqNbEnsZqNy+WDnwQqCA=="], | ||
|
|
||
| "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/[email protected].11", "", { "os": "linux", "cpu": "x64" }, "sha512-YW6sblI7xukSD2TdbbaeQVDysIm/UPJtObHJHKxDEcW2exAtY47j52f8jZXkqE1krdnkhCMGqP3dbniu1Te2Fg=="], | ||
| "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/[email protected].12", "", { "os": "linux", "cpu": "x64" }, "sha512-xYfqYLjvm2UQ3TZggTGrwxjYaLB62b1Wiysw/YE3Yqbh86sOMoTn0feF98PonP7LtjsWOWcXEbGqDL7zv0uW8Q=="], | ||
|
|
||
| "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/[email protected].11", "", { "os": "linux", "cpu": "x64" }, "sha512-e3C/RRhGunWYNC3aSF7exsQkdXzQ/M+aYuZHKnw4U7KQwTJotnWsGOIVih0s2qQzmEzOFIJ3+xt7iq67K/p56Q=="], | ||
| "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/[email protected].12", "", { "os": "linux", "cpu": "x64" }, "sha512-ha0pHPamN+fWZY7GCzz5rKunlv9L5R8kdh+YNvP5awe3LtuXb5nRi/H27GeL2U+TdhDOptU7T6Is7mdwh5Ar3A=="], | ||
|
|
||
| "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/[email protected].11", "", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@emnapi/wasi-threads": "^1.0.2", "@napi-rs/wasm-runtime": "^0.2.11", "@tybys/wasm-util": "^0.9.0", "tslib": "^2.8.0" }, "cpu": "none" }, "sha512-Xo1+/GU0JEN/C/dvcammKHzeM6NqKovG+6921MR6oadee5XPBaKOumrJCXvopJ/Qb5TH7LX/UAywbqrP4lax0g=="], | ||
| "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/[email protected].12", "", { "dependencies": { "@emnapi/core": "^1.4.5", "@emnapi/runtime": "^1.4.5", "@emnapi/wasi-threads": "^1.0.4", "@napi-rs/wasm-runtime": "^0.2.12", "@tybys/wasm-util": "^0.10.0", "tslib": "^2.8.0" }, "cpu": "none" }, "sha512-4tSyu3dW+ktzdEpuk6g49KdEangu3eCYoqPhWNsZgUhyegEda3M9rG0/j1GV/JjVVsj+lG7jWAyrTlLzd/WEBg=="], | ||
|
|
||
| "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/[email protected].11", "", { "os": "win32", "cpu": "arm64" }, "sha512-UgKYx5PwEKrac3GPNPf6HVMNhUIGuUh4wlDFR2jYYdkX6pL/rn73zTq/4pzUm8fOjAn5L8zDeHp9iXmUGOXZ+w=="], | ||
| "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/[email protected].12", "", { "os": "win32", "cpu": "arm64" }, "sha512-iGLyD/cVP724+FGtMWslhcFyg4xyYyM+5F4hGvKA7eifPkXHRAUDFaimu53fpNg9X8dfP75pXx/zFt/jlNF+lg=="], | ||
|
|
||
| "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/[email protected].11", "", { "os": "win32", "cpu": "x64" }, "sha512-YfHoggn1j0LK7wR82TOucWc5LDCguHnoS879idHekmmiR7g9HUtMw9MI0NHatS28u/Xlkfi9w5RJWgz2Dl+5Qg=="], | ||
| "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/[email protected].12", "", { "os": "win32", "cpu": "x64" }, "sha512-NKIh5rzw6CpEodv/++r0hGLlfgT/gFN+5WNdZtvh6wpU2BpGNgdjvj6H2oFc8nCM839QM1YOhjpgbAONUb4IxA=="], | ||
|
|
||
| "@tailwindcss/postcss": ["@tailwindcss/[email protected].11", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.1.11", "@tailwindcss/oxide": "4.1.11", "postcss": "^8.4.41", "tailwindcss": "4.1.11" } }, "sha512-q/EAIIpF6WpLhKEuQSEVMZNMIY8KhWoAemZ9eylNAih9jxMGAYPPWBn3I9QL/2jZ+e7OEz/tZkX5HwbBR4HohA=="], | ||
| "@tailwindcss/postcss": ["@tailwindcss/[email protected].12", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.1.12", "@tailwindcss/oxide": "4.1.12", "postcss": "^8.4.41", "tailwindcss": "4.1.12" } }, "sha512-5PpLYhCAwf9SJEeIsSmCDLgyVfdBhdBpzX1OJ87anT9IVR0Z9pjM0FNixCAUAHGnMBGB8K99SwAheXrT0Kh6QQ=="], | ||
|
|
||
| "@tanstack/react-virtual": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/virtual-core": "3.13.12" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Gd13QdxPSukP8ZrkbgS2RwoZseTTbQPLnQEn7HY/rqtM+8Zt95f7xKC7N0EsKs7aoz0WzZ+fditZux+F8EzYxA=="], | ||
|
|
||
|
|
@@ -428,7 +430,7 @@ | |
|
|
||
| "@types/mdx": ["@types/[email protected]", "", {}, "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw=="], | ||
|
|
||
| "@types/node": ["@types/[email protected].10", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-iAFpG6DokED3roLSP0K+ybeDdIX6Bc0Vd3mLW5uDqThPWtNos3E+EqOM11mPQHKzfWHqEBuLjIlsBQQ8CsISmQ=="], | ||
| "@types/node": ["@types/[email protected].11", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow=="], | ||
|
|
||
| "@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-WmdoynAX8Stew/36uTSVMcLJJ1KRh6L3IZRx1PZ7qJtBqT3dYTgyDTx8H1qoRghErydW7xw9mSJ3wS//tCRpFA=="], | ||
|
|
||
|
|
@@ -1156,7 +1158,7 @@ | |
|
|
||
| "tailwind-merge": ["[email protected]", "", {}, "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g=="], | ||
|
|
||
| "tailwindcss": ["[email protected].11", "", {}, "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA=="], | ||
| "tailwindcss": ["[email protected].12", "", {}, "sha512-DzFtxOi+7NsFf7DBtI3BJsynR+0Yp6etH+nRPTbpWnS2pZBaSksv/JGctNwSWzbFjp0vxSqknaUylseZqMDGrA=="], | ||
|
|
||
| "tapable": ["[email protected]", "", {}, "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg=="], | ||
|
|
||
|
|
@@ -1268,7 +1270,7 @@ | |
|
|
||
| "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@tybys/wasm-util": "^0.10.0" }, "bundled": true }, "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ=="], | ||
|
|
||
| "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.9.0", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw=="], | ||
| "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.0", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ=="], | ||
|
|
||
| "@tailwindcss/oxide-wasm32-wasi/tslib": ["[email protected]", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], | ||
|
|
||
|
|
@@ -1332,8 +1334,6 @@ | |
|
|
||
| "@storybook/react-vite/find-up/path-exists": ["[email protected]", "", {}, "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ=="], | ||
|
|
||
| "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime/@tybys/wasm-util": ["@tybys/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ=="], | ||
|
|
||
| "@typescript-eslint/typescript-estree/fast-glob/glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], | ||
|
|
||
| "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], | ||
|
|
||
This file contains hidden or 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 hidden or 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,96 @@ | ||
| "use client"; | ||
|
|
||
| import React, { ReactNode } from "react"; | ||
| import Link from "next/link"; | ||
|
|
||
| interface IButtonProps { | ||
rfaria107 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| children?: ReactNode; | ||
| className?: string; | ||
| icon?: ReactNode; | ||
| iconPosition?: "left" | "right"; | ||
| href?: string; | ||
| onClick?: () => void; | ||
| type?: "button" | "submit" | "reset"; | ||
| ariaLabel?: string; | ||
| disabled?: boolean; | ||
| } | ||
|
|
||
| const Button = ({ | ||
| children, | ||
| className = "", | ||
| icon, | ||
| iconPosition = "left", | ||
| href, | ||
| onClick, | ||
| type = "button", | ||
| ariaLabel, | ||
| disabled = false, | ||
| }: IButtonProps) => { | ||
| const baseStyle = "inline-flex items-center justify-center font-medium"; | ||
| const isIconOnly = icon && !children; | ||
| const disabledStyle = disabled ? "pointer-events-none opacity-50" : ""; | ||
|
|
||
| const finalClassName = [baseStyle, className, disabledStyle] | ||
| .filter(Boolean) | ||
| .join(" "); | ||
|
|
||
| const content = isIconOnly ? ( | ||
| <span className="flex items-center justify-center">{icon}</span> | ||
| ) : ( | ||
| <> | ||
| {icon && iconPosition === "left" && ( | ||
| <span className="mr-2 flex">{icon}</span> | ||
| )} | ||
|
|
||
| {children && <span>{children}</span>} | ||
|
|
||
| {icon && iconPosition === "right" && ( | ||
| <span className="ml-2 flex">{icon}</span> | ||
| )} | ||
| </> | ||
| ); | ||
|
|
||
| if (href) { | ||
| const external = | ||
| href.startsWith("http") || | ||
| href.startsWith("mailto:") || | ||
| href.startsWith("tel:"); | ||
|
|
||
| if (disabled) { | ||
| return ( | ||
| <span | ||
| className={finalClassName} | ||
| aria-label={ariaLabel} | ||
| aria-disabled="true" | ||
| > | ||
| {content} | ||
| </span> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Link | ||
| href={href} | ||
| className={finalClassName} | ||
| aria-label={ariaLabel} | ||
| {...(external ? { target: "_blank", rel: "noopener noreferrer" } : {})} | ||
| > | ||
| {content} | ||
| </Link> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <button | ||
| type={type} | ||
| onClick={disabled ? undefined : onClick} | ||
| className={finalClassName} | ||
| aria-label={ariaLabel} | ||
| disabled={disabled} | ||
| > | ||
| {content} | ||
| </button> | ||
| ); | ||
| }; | ||
|
|
||
| export default Button; | ||
This file contains hidden or 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,60 @@ | ||
| import React from "react"; | ||
| import type { Meta, StoryObj } from "@storybook/nextjs-vite"; | ||
| import { MdKey, MdDownload } from "react-icons/md"; | ||
| import Button from "@/components/button"; | ||
|
|
||
| type T = typeof Button; | ||
|
|
||
| const meta: Meta<T> = { | ||
| title: "Components/Button", | ||
| component: Button, | ||
| tags: ["autodocs"], | ||
| argTypes: { | ||
| iconPosition: { control: "radio", options: ["left", "right"] }, | ||
| onClick: { action: "clicked" }, | ||
| href: { control: "text" }, | ||
| disabled: { control: "boolean" }, | ||
| ariaLabel: { control: "text" }, | ||
| icon: { control: false }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| export const TextAndIcon: StoryObj<T> = { | ||
| args: { | ||
| children: "Entrar", | ||
| onClick: () => alert("Entrar"), | ||
| icon: <MdDownload />, | ||
| iconPosition: "left", | ||
| className: | ||
| "border-black border-0 bg-gray-100 px-4 py-3 text-black rounded-full transition duration-200 ease-in-out hover:scale-105 active:scale-95", | ||
| }, | ||
| }; | ||
|
|
||
| export const IconOnly: StoryObj<T> = { | ||
| args: { | ||
| icon: <MdDownload />, | ||
| iconPosition: "right", | ||
| ariaLabel: "Transferir", | ||
| onClick: () => console.log("Transferir"), | ||
| className: "text-orange-500 border-0", | ||
| }, | ||
| }; | ||
|
|
||
| export const TextOnly: StoryObj<T> = { | ||
| args: { | ||
| children: "Editar", | ||
| className: "text-orange-400", | ||
| }, | ||
| }; | ||
|
|
||
| export const Link: StoryObj<T> = { | ||
| args: { | ||
| href: "https://github.com/cesium/astra/issues/2", | ||
| children: "Issue", | ||
| icon: <MdKey />, | ||
| iconPosition: "left", | ||
| className: "border-orange-500 text-orange-500", | ||
| }, | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.