Skip to content

Commit 4df0129

Browse files
committed
minor #2268 [Site] Isolate React/Svelte build (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] Isolate React/Svelte build Ease the website install (no more JS needed) * group react source/build/dist files * group svelte source/build/dist files * remove root packages.json Also * rework the shared "PackageList" demo * clean the homepage FileTree Commits ------- 2cff156 [Site] Isolate React/Svelte build
2 parents 320e635 + 2cff156 commit 4df0129

34 files changed

+175
-859
lines changed

ux.symfony.com/assets/build/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {registerReactControllerComponents} from '@symfony/ux-react';
22

3-
import './app.js';
3+
import '../app.js';
44

55
registerReactControllerComponents();

ux.symfony.com/assets/react/components/PackageList.jsx

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
3+
export default function (props) {
4+
if (props.packages.length === 0) {
5+
return 'No packages found';
6+
}
7+
8+
return (
9+
props.packages.map(item => (
10+
<div class="PackageListItem">
11+
<div class="PackageListItem__icon" style={`--gradient: ${item.gradient}`}>
12+
<img src={item.imageUrl} alt={`Image for the ${item.humanName} UX package`} />
13+
</div>
14+
<h3 class="PackageListItem__title">
15+
<a href={item.url}>{item.humanName}</a>
16+
</h3>
17+
</div>
18+
))
19+
);
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"devDependencies": {
3+
"@babel/cli": "^7.25.6",
4+
"@babel/core": "^7.25.2",
5+
"@babel/preset-react": "^7.24.7"
6+
},
7+
"license": "MIT",
8+
"private": true,
9+
"scripts": {
10+
"build": "../build/node_modules/.bin/babel ../. --out-dir ../../build/react --presets=@babel/preset-react"
11+
}
12+
}

ux.symfony.com/assets/styles/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ $utilities: map-remove(
143143
@import "components/ProductGrid";
144144
@import "components/PackageHeader";
145145
@import "components/PackageBox";
146+
@import "components/PackageList";
146147
@import "components/Cookbook";
147148
@import "components/SupportBox";
148149
@import "components/Tabs";
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.PackageList {
2+
--gradient: #202427;
3+
--color: #C8CED2;
4+
display: grid;
5+
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
6+
gap: .75rem;
7+
}
8+
9+
.PackageListItem {
10+
background: var(--bs-body-bg);
11+
border-radius: .75rem;
12+
border: 0.66px solid var(--bs-secondary-bg-subtle);
13+
padding: .5rem;
14+
display: flex;
15+
align-items: center;
16+
justify-content: flex-start;
17+
gap: .75rem;
18+
position: relative;
19+
}
20+
21+
.PackageListItem__icon {
22+
width: 3rem;
23+
aspect-ratio: 1;
24+
border-radius: 14%;
25+
background: var(--gradient);
26+
display: grid;
27+
place-items: center;
28+
29+
img {
30+
width: 100%;
31+
height: 100%;
32+
max-width: 50%;
33+
max-height: 50%;
34+
transition: transform 0.35s;
35+
.PackageListItem:hover & {
36+
transform: scale(1.05);
37+
}
38+
}
39+
}
40+
41+
.PackageListItem__label {
42+
font-size: 1.25rem;
43+
font-family: var(--font-family-title);
44+
font-weight: 600;
45+
margin: 0;
46+
flex: 1;
47+
opacity: .85;
48+
transition: opacity 0.5s;
49+
letter-spacing: -0.07ch;
50+
51+
.PackageListItem:hover & {
52+
opacity: 1;
53+
transition: opacity 0.25s;
54+
}
55+
56+
a:after {
57+
content: " ";
58+
inset: 0;
59+
position: absolute;
60+
}
61+
}

0 commit comments

Comments
 (0)