Skip to content
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

Spinner #1332

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Spinner #1332

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/cuddly-jeans-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@alfalab/core-components-spinner': major
'@alfalab/core-components-shared': minor
---

Крупное обновление Спиннера

* Обновленный вид спиннера.
* Добавлены новые пропсы для тонкой настройки внешнего вида:
- `preset` - преднастроенный вариант спиннера;
- `size` - теперь отвечает за размер кольца спиннера;
- `lineWidth` - толщина линии спиннера;
- `style` - позволяет регулировать отступы, цвет и т.п.
* Добавлен [`codemod`](https://www.npmjs.com/package/@alfalab/core-components-codemod/v/2.7.0) для бесшовной миграции `Spinner`:
```bash
npx @alfalab/core-components-codemod --transformers=spinner --glob='src/**/*.tsx'
```
| Внимание |
|---|
| `codemod` может не работать в случаях использования [Spread Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#spread_in_object_literals) в коде. |
46 changes: 46 additions & 0 deletions .github/workflows/codemod-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish codemod

on:
workflow_dispatch:
inputs:
version:
description: 'Введите версию x.x.x'
required: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check permissions
if: ${{ contains(fromJSON('["reme3d2y","hextion","SiebenSieben","fulcanellee"]'), github.actor) == false }}
uses: actions/github-script@v6
with:
script: |
core.setFailed("you don't have permission to run this workflow!");

- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Set version
if: success()
run: |
cd ./packages/codemod
git config user.name core-ds-bot
git config user.email ds@gitmax.tech
yarn --new-version version ${{ github.event.inputs.version }}
git push

- name: Publish
if: success()
run: |
cd ./packages/codemod
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions packages/action-button/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const ActionButton = forwardRef<HTMLAnchorElement | HTMLButtonElement, Ac
>
{showLoader ? (
<Spinner
preset={24}
dataTestId={getDataTestId(dataTestId, 'loader')}
visible={true}
className={cn(styles.loader, colorStyles[colors].loader)}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/action-button/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"rootDirs": ["src"],
"baseUrl": ".",
"paths": {
"@alfalab/core-components-*": ["../*/src"]
"@alfalab/core-components-*": ["../*/src"],
"@alfalab/core-components-spinner/*": ["../spinner/src/*"]
}
},
"references": [{ "path": "../spinner" }, { "path": "../shared" }]
Expand Down
Loading
Loading