mirror of
https://github.com/symfony/ux-toolkit.git
synced 2026-03-24 00:02:08 +01:00
Drop Biome.js for oxfmt and oxlint
This commit is contained in:
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,5 +1,4 @@
|
||||
Please do not submit any Pull Requests here. They will be closed.
|
||||
---
|
||||
## Please do not submit any Pull Requests here. They will be closed.
|
||||
|
||||
Please submit your PR here instead:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
30
.github/workflows/close-pull-request.yml
vendored
30
.github/workflows/close-pull-request.yml
vendored
@@ -1,20 +1,20 @@
|
||||
name: Close Pull Request
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Thanks for your Pull Request! We love contributions.
|
||||
|
||||
However, you should instead open your PR on the main repository:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
This repository is what we call a "subtree split": a read-only subset of that main repository.
|
||||
We're looking forward to your PR there!
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Thanks for your Pull Request! We love contributions.
|
||||
|
||||
However, you should instead open your PR on the main repository:
|
||||
https://github.com/symfony/ux
|
||||
|
||||
This repository is what we call a "subtree split": a read-only subset of that main repository.
|
||||
We're looking forward to your PR there!
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -2,22 +2,22 @@
|
||||
|
||||
## 2.33.0
|
||||
|
||||
- [Shadcn] Add `accordion` recipe
|
||||
- [Shadcn] Add `tooltip` recipe
|
||||
- [Shadcn] Rework templates of `alert` recipe
|
||||
- [Shadcn] Rework templates of `avatar` recipe
|
||||
- [Shadcn] Rework templates of `badge` recipe
|
||||
- [Shadcn] Rework templates of `button` recipe
|
||||
- [Shadcn] Rework templates of `card` recipe
|
||||
- [Shadcn] Rework templates of `input-group` recipe
|
||||
- [Shadcn] Rework templates of `table` recipe
|
||||
- [Shadcn] Rework templates of `textarea` recipe
|
||||
- [Shadcn] Add `Alert:Action` component
|
||||
- [Shadcn] Add `accordion` recipe
|
||||
- [Shadcn] Add `tooltip` recipe
|
||||
- [Shadcn] Rework templates of `alert` recipe
|
||||
- [Shadcn] Rework templates of `avatar` recipe
|
||||
- [Shadcn] Rework templates of `badge` recipe
|
||||
- [Shadcn] Rework templates of `button` recipe
|
||||
- [Shadcn] Rework templates of `card` recipe
|
||||
- [Shadcn] Rework templates of `input-group` recipe
|
||||
- [Shadcn] Rework templates of `table` recipe
|
||||
- [Shadcn] Rework templates of `textarea` recipe
|
||||
- [Shadcn] Add `Alert:Action` component
|
||||
|
||||
## 2.29.0
|
||||
|
||||
- Add Symfony 8 support
|
||||
- Add Symfony 8 support
|
||||
|
||||
## 2.25
|
||||
|
||||
- Package added
|
||||
- Package added
|
||||
|
||||
@@ -7,6 +7,7 @@ Due to its nature, the Symfony UX Toolkit requires a specific setup to develop a
|
||||
First, ensure you have followed the [Symfony UX's Contribution Guide](https://github.com/symfony/ux/blob/2.x/CONTRIBUTING.md) to set up your fork of the main repository, install dependencies, etc.
|
||||
|
||||
Then, install the UX Toolkit dependencies:
|
||||
|
||||
```shell
|
||||
# src/Toolkit
|
||||
composer install
|
||||
@@ -17,6 +18,7 @@ composer install
|
||||
Currently, kits can only be previewed through the Symfony UX Website. Installation instructions can be found in the [Symfony UX Website's `README.md`](https://github.com/symfony/ux/tree/2.x/ux.symfony.com).
|
||||
|
||||
Then, run the following commands from the `ux.symfony.com/` directory:
|
||||
|
||||
```shell
|
||||
# Link local UX packages
|
||||
php ../link
|
||||
@@ -26,6 +28,7 @@ symfony serve -d
|
||||
```
|
||||
|
||||
When the server is running, you can access:
|
||||
|
||||
- The UX Toolkit homepage at https://127.0.0.1:9044/toolkit
|
||||
- The list of available kits at https://127.0.0.1:9044/toolkit#kits
|
||||
- A dedicated section for each kit, e.g., https://127.0.0.1:9044/toolkit/kits/shadcn for the Shadcn UI Kit
|
||||
@@ -65,6 +68,7 @@ The Twig code examples are rendered in an isolated environment.
|
||||
The rendered output is then compared to stored snapshots to ensure that the kit's recipes work as expected.
|
||||
|
||||
To update the snapshots, run the following command from the `src/Toolkit/` directory:
|
||||
|
||||
```shell
|
||||
# Remove existing snapshots (may be useful if some Twig code examples were removed)
|
||||
rm -fr tests/Functional/__snapshots__
|
||||
|
||||
@@ -10,6 +10,6 @@ https://github.com/symfony/ux to create issues or submit pull requests.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
- [Report issues](https://github.com/symfony/ux/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
||||
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
||||
|
||||
@@ -7,6 +7,7 @@ Please note that not every Shadcn UI component is available in this kit, but we
|
||||
## Requirements
|
||||
|
||||
This kit requires TailwindCSS to work:
|
||||
|
||||
- If you use Symfony AssetMapper, you can install TailwindCSS with the [TailwindBundle](https://symfony.com/bundles/TailwindBundle/current/index.html),
|
||||
- If you use Webpack Encore, you can follow the [TailwindCSS installation guide for Symfony](https://tailwindcss.com/docs/installation/framework-guides/symfony)
|
||||
|
||||
@@ -15,7 +16,7 @@ This kit requires TailwindCSS to work:
|
||||
Modify the file `assets/styles/app.css` with the following content:
|
||||
|
||||
```css
|
||||
@import "tailwindcss";
|
||||
@import 'tailwindcss';
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ export default class extends Controller {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
#isDisabled(item) {
|
||||
return item.hasAttribute('disabled')
|
||||
return item.hasAttribute('disabled');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
|
||||
static targets = ['trigger', 'dialog'];
|
||||
|
||||
async open() {
|
||||
@@ -11,7 +10,7 @@ export default class extends Controller {
|
||||
if (this.dialogTarget.getAnimations().length > 0) {
|
||||
this.dialogTarget.addEventListener('transitionend', () => {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'true');
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
@@ -25,7 +24,7 @@ export default class extends Controller {
|
||||
if (this.dialogTarget.getAnimations().length > 0) {
|
||||
this.dialogTarget.addEventListener('transitionend', () => {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'false');
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
|
||||
static targets = ['trigger', 'dialog'];
|
||||
|
||||
open() {
|
||||
@@ -11,7 +10,7 @@ export default class extends Controller {
|
||||
if (this.dialogTarget.getAnimations().length > 0) {
|
||||
this.dialogTarget.addEventListener('transitionend', () => {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'true');
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
@@ -20,7 +19,7 @@ export default class extends Controller {
|
||||
|
||||
closeOnClickOutside({ target }) {
|
||||
if (target === this.dialogTarget) {
|
||||
this.close()
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +30,7 @@ export default class extends Controller {
|
||||
if (this.dialogTarget.getAnimations().length > 0) {
|
||||
this.dialogTarget.addEventListener('transitionend', () => {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'false');
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.triggerTarget.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class extends Controller {
|
||||
wrapperSelector: String,
|
||||
contentSelector: String,
|
||||
arrowSelector: String,
|
||||
}
|
||||
};
|
||||
static targets = ['trigger'];
|
||||
|
||||
connect() {
|
||||
@@ -90,24 +90,24 @@ export default class extends Controller {
|
||||
let arrowTop = null;
|
||||
switch (this.side) {
|
||||
case 'left':
|
||||
wrapperLeft = triggerRect.left - contentRect.width - (arrowRect.width / 2) - this.sideOffset;
|
||||
wrapperTop = triggerRect.top - (contentRect.height / 2) + (triggerRect.height / 2);
|
||||
arrowTop = contentRect.height / 2 - (arrowRect.height / 2);
|
||||
wrapperLeft = triggerRect.left - contentRect.width - arrowRect.width / 2 - this.sideOffset;
|
||||
wrapperTop = triggerRect.top - contentRect.height / 2 + triggerRect.height / 2;
|
||||
arrowTop = contentRect.height / 2 - arrowRect.height / 2;
|
||||
break;
|
||||
case 'top':
|
||||
wrapperLeft = triggerRect.left - (contentRect.width / 2) + (triggerRect.width / 2);
|
||||
wrapperTop = triggerRect.top - contentRect.height - (arrowRect.height / 2) - this.sideOffset;
|
||||
arrowLeft = contentRect.width / 2 - (arrowRect.width / 2);
|
||||
wrapperLeft = triggerRect.left - contentRect.width / 2 + triggerRect.width / 2;
|
||||
wrapperTop = triggerRect.top - contentRect.height - arrowRect.height / 2 - this.sideOffset;
|
||||
arrowLeft = contentRect.width / 2 - arrowRect.width / 2;
|
||||
break;
|
||||
case 'right':
|
||||
wrapperLeft = triggerRect.right + (arrowRect.width / 2) + this.sideOffset;
|
||||
wrapperTop = triggerRect.top - (contentRect.height / 2) + (triggerRect.height / 2);
|
||||
arrowTop = contentRect.height / 2 - (arrowRect.height / 2);
|
||||
wrapperLeft = triggerRect.right + arrowRect.width / 2 + this.sideOffset;
|
||||
wrapperTop = triggerRect.top - contentRect.height / 2 + triggerRect.height / 2;
|
||||
arrowTop = contentRect.height / 2 - arrowRect.height / 2;
|
||||
break;
|
||||
case 'bottom':
|
||||
wrapperLeft = triggerRect.left - (contentRect.width / 2) + (triggerRect.width / 2);
|
||||
wrapperTop = triggerRect.bottom + (arrowRect.height / 2) + this.sideOffset;
|
||||
arrowLeft = contentRect.width / 2 - (arrowRect.width / 2);
|
||||
wrapperLeft = triggerRect.left - contentRect.width / 2 + triggerRect.width / 2;
|
||||
wrapperTop = triggerRect.bottom + arrowRect.height / 2 + this.sideOffset;
|
||||
arrowLeft = contentRect.width / 2 - arrowRect.width / 2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user