Skip to content

Commit 5b22b6f

Browse files
feat: updated to latest version
1 parent 8e52079 commit 5b22b6f

File tree

12 files changed

+601
-126
lines changed

12 files changed

+601
-126
lines changed

package-lock.json

Lines changed: 371 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@
3737
"@commitlint/config-conventional": "^19.8.1",
3838
"@turbo/gen": "^2.5.3",
3939
"@types/cli-progress": "^3.11.6",
40+
"@types/fs-extra": "^11.0.4",
4041
"@types/prompts": "^2.4.9",
4142
"@types/unzipper": "^0.10.11",
43+
"fs-extra": "^11.3.1",
4244
"husky": "^9.1.7",
4345
"lint-staged": "^16.0.0",
4446
"prettier": "^3.5.3",
47+
"simple-git": "^3.28.0",
4548
"syncpack": "^14.0.0-alpha.11",
4649
"turbo": "^2.5.3",
4750
"typescript": "5.8.3"

packages/ui/src/components/Cards/PricingCard/PricingCard.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import { TooltipHover } from '@dxp/ui/components/TooltipHover';
1212

1313
import { Badge } from '@dxp/ui/elements/badge';
1414
import { Button } from '@dxp/ui/elements/button';
15-
import { Link } from '@dxp/ui/elements/link';
1615
import { Typography } from '@dxp/ui/elements/typography';
1716

17+
import { LinkList } from '../../LinkList';
18+
1819
import { FeatureItemProps, PricingCardProps } from './PricingCard.types';
1920

2021
export const FeatureItem: React.FC<FeatureItemProps> = ({ title, description, icon }) => {
@@ -100,24 +101,7 @@ export const PricingCard: React.FC<Readonly<PricingCardProps>> = (props) => {
100101
</Typography>
101102
)}
102103

103-
{links && links.length > 0 && (
104-
<ul className="flex flex-col gap-2 w-full items-center">
105-
{links.map((link, index) => (
106-
<li key={`${link.label}-${index}`} className="w-full">
107-
{link.label && (
108-
<Link asChild variant={link.variant} key={link.label} className="w-full">
109-
<LinkComponent href={link.url}>
110-
<>
111-
{link.label}
112-
{link.icon && <DynamicIcon name={link.icon} size={16} />}
113-
</>
114-
</LinkComponent>
115-
</Link>
116-
)}
117-
</li>
118-
))}
119-
</ul>
120-
)}
104+
<LinkList className="justify-center sm:flex-col" links={links} LinkComponent={LinkComponent} />
121105
</div>
122106

123107
<div className="flex flex-col gap-4">

packages/ui/src/components/Container/Container.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ export const Container: React.FC<ContainerProps> = ({
4545
className,
4646
spacing = 'medium',
4747
background = 'none',
48+
theme,
4849
}) => {
50+
let finalTheme = theme;
51+
if (theme) {
52+
finalTheme = `theme-${theme}`;
53+
}
54+
4955
return (
50-
<div className={cn(containerBackgroundVariants({ background }), className)}>
56+
<div className={cn(finalTheme, containerBackgroundVariants({ background }), className)}>
5157
<div className={containerVariants({ variant, spacing })}>
5258
<div className="">{children}</div>
5359
</div>

packages/ui/src/components/Container/Container.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export interface ContainerProps {
66
className?: string;
77
spacing?: 'none' | 'small' | 'medium' | 'large';
88
background?: 'none' | 'light' | 'dark' | 'brand';
9+
theme?: string;
910
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
3+
import { cn } from '@dxp/ui/lib/utils';
4+
5+
import { Link } from '@dxp/ui/elements/link';
6+
7+
import { DynamicIcon } from '../DynamicIcon';
8+
9+
import { LinkListProps } from './LinkList.types';
10+
11+
export const LinkList: React.FC<Readonly<LinkListProps>> = ({ className, links, LinkComponent }) => {
12+
if (!links) {
13+
return null;
14+
}
15+
16+
return (
17+
<div className={cn('w-full sm:w-auto flex flex-col sm:flex-row gap-4', className)}>
18+
{links?.map(
19+
(link) =>
20+
link.label && (
21+
<Link asChild variant={link.variant} key={link.label}>
22+
<LinkComponent href={link.url}>
23+
<>
24+
{link.label}
25+
{link.icon && <DynamicIcon name={link.icon} size={16} />}
26+
</>
27+
</LinkComponent>
28+
</Link>
29+
),
30+
)}
31+
</div>
32+
);
33+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Models } from '@dxp/framework/modules';
2+
import { Models as FrontendModels } from '@dxp/utils.frontend';
3+
4+
export type LinkListProps = {
5+
children?: React.ReactNode;
6+
links?: Models.Link.Link[];
7+
LinkComponent: FrontendModels.Link.LinkComponent;
8+
className?: string;
9+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { LinkList } from './LinkList';
2+
export type { LinkListProps } from './LinkList.types';

packages/ui/src/providers/GlobalProvider/GlobalProvider.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ interface GlobalProviderProps {
2121
};
2222
labels: CMS.Model.AppConfig.Labels;
2323
locale: string;
24+
themes: CMS.Model.AppConfig.Themes;
25+
currentTheme?: string;
2426
children: ReactNode;
2527
}
2628

@@ -42,11 +44,15 @@ export interface GlobalContextType {
4244
isVisible: boolean;
4345
toggle: (show: boolean) => void;
4446
};
47+
themes: {
48+
available: CMS.Model.AppConfig.Themes;
49+
current?: string;
50+
};
4551
}
4652

4753
export const GlobalContext = createContext({} as GlobalContextType);
4854

49-
export const GlobalProvider = ({ config, labels, locale, children }: GlobalProviderProps) => {
55+
export const GlobalProvider = ({ config, labels, locale, themes, currentTheme, children }: GlobalProviderProps) => {
5056
const priceService = usePriceService(locale);
5157

5258
const [isSpinnerVisible, setIsSpinnerVisible] = useState(false);
@@ -61,6 +67,10 @@ export const GlobalProvider = ({ config, labels, locale, children }: GlobalProvi
6167
isVisible: isSpinnerVisible,
6268
toggle: setIsSpinnerVisible,
6369
},
70+
themes: {
71+
available: themes,
72+
current: currentTheme,
73+
},
6474
}}
6575
>
6676
{children}

packages/ui/src/theme.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,28 @@
5858
--tertiary-hover: hsl(220 13% 95%);
5959
}
6060

61-
.dark {
61+
.theme-personal {
62+
}
63+
64+
.theme-business {
65+
--primary: hsl(346 100% 41%);
66+
--primary-foreground: hsl(0 0% 100%);
67+
--secondary: hsl(165.9, 100%, 41%);
68+
--secondary-foreground: hsl(0 0% 0%);
69+
--navbar-background: hsl(234 25% 92%);
70+
--navbar-foreground: hsl(215 28% 17%);
71+
--navbar-primary: hsl(228 100% 19%);
72+
--navbar-primary-foreground: hsl(0 0% 100%);
73+
--navbar-border: hsl(232 12% 87%);
74+
--navbar-muted: hsl(228 100% 19%);
75+
--navbar-accent-background: hsl(214 95% 93%);
76+
--navbar-accent-foreground: hsl(224 64% 33%);
77+
--navbar-sub-background: hsl(346, 100%, 29%);
78+
--navbar-sub-foreground: hsl(0 0% 100%);
79+
--navbar-sub-accent: hsl(346 100% 41%);
80+
}
81+
82+
.theme-dark {
6283
--background: hsl(226 57% 21%);
6384
--foreground: hsl(0 0% 98%);
6485
--card: hsl(224 64% 33%);

0 commit comments

Comments
 (0)