-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from aversini/feat-first-release
feat: first release
- Loading branch information
Showing
21 changed files
with
454 additions
and
427 deletions.
There are no files selected for viewing
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,26 @@ | ||
name: Inspect Pull Requests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
inspect: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- run: yarn install | ||
- run: npx lerna run build | ||
- run: npx lerna run lint | ||
- run: npx lerna run test:coverage |
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 |
---|---|---|
@@ -1,29 +1,44 @@ | ||
{ | ||
"name": "@versini/ui-components", | ||
"version": "1.0.0", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"author": "Arno Versini", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rimraf dist", | ||
"dev": "vite --host", | ||
"build": "yarn run clean && vite build", | ||
"build": "yarn run clean && tsc && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix --color", | ||
"start": "static-server dist --port 5173", | ||
"test": "vitest run", | ||
"test:coverage": "vitest run --coverage", | ||
"test:coverage:ui": "vitest --coverage --ui", | ||
"test:watch": "vitest" | ||
}, | ||
"dependencies": { | ||
"@floating-ui/react": "0.26.0", | ||
"peerDependencies": { | ||
"@floating-ui/react": "^0.26.0", | ||
"@tailwindcss/typography": "^0.5.10", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"tailwindcss": "^3.3.3" | ||
}, | ||
"devDependencies": { | ||
"@floating-ui/react": "0.26.1", | ||
"@tailwindcss/typography": "0.5.10", | ||
"autoprefixer": "10.4.16", | ||
"clsx": "2.0.0", | ||
"postcss": "8.4.31", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"tailwindcss": "3.3.3", | ||
"tailwindcss": "3.3.5" | ||
}, | ||
"dependencies": { | ||
"clsx": "2.0.0", | ||
"uuid": "9.0.1" | ||
} | ||
}, | ||
"sideEffects": [ | ||
"**/*.css" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
57 changes: 57 additions & 0 deletions
57
packages/ui-components/src/components/Button/ButtonLink.tsx
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,57 @@ | ||
import React from "react"; | ||
|
||
import { truncate } from "../../common/utilities"; | ||
import type { ButtonLinkProps } from "./ButtonTypes"; | ||
import { getButtonClasses, TYPE_LINK } from "./utilities"; | ||
|
||
export const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>( | ||
( | ||
{ | ||
children, | ||
kind = "dark", | ||
fullWidth = false, | ||
className, | ||
slim = false, | ||
raw = false, | ||
"aria-label": ariaLabel, | ||
link, | ||
target, | ||
maxLabelLength, | ||
}, | ||
ref, | ||
) => { | ||
const buttonClass = getButtonClasses({ | ||
type: TYPE_LINK, | ||
kind, | ||
fullWidth, | ||
disabled: false, | ||
raw, | ||
className, | ||
slim, | ||
}); | ||
|
||
const formattedLabel = | ||
maxLabelLength && typeof children === "string" | ||
? truncate(children, maxLabelLength) | ||
: null; | ||
|
||
const extraProps = { | ||
target, | ||
rel: target === "_blank" ? "noopener noreferrer" : undefined, | ||
}; | ||
|
||
return ( | ||
<> | ||
<a | ||
ref={ref} | ||
aria-label={ariaLabel || formattedLabel?.fullString} | ||
className={buttonClass} | ||
href={link} | ||
{...extraProps} | ||
> | ||
{formattedLabel?.truncatedString || children} | ||
</a> | ||
</> | ||
); | ||
}, | ||
); |
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
Oops, something went wrong.