diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e09b7..b954730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,23 +1,15 @@ # Changelog -## v0.2.0-beta.3 +## v0.2.0-beta.4 -### Added the `Gradient` component - - `/components/Gradient/index.tsx` - - `/components/Footer/index.tsx` - - `/components/Header/index.tsx` +### Added the `Gradient` component to the `Card`` component + - `/components/Card/index.tsx` - `/components/Gradient/setup.tsx` - - `/components/Footer/setup.tsx` - - `/components/Header/setup.tsx` + - `/components/Card/setup.tsx` - `/routes/index.tsx` - - `/src/enums.ts` - -### Prepared the `Card` and `Header` componets for the `Gradient` compoennt. - - `/components/Card/index.tsx` - - `/components/Card/setup.ts` - - `/components/Header/index.tsx` ### Minor updates + - `/src/scss/components.scss` - `/src/scss/twind.scss` - `/static/style.css` @@ -30,6 +22,8 @@ - Added a `Gradient` component for decoration. - **Footer** - Added a `Gradient` component for decoration. + - **Card** + - Added a `Gradient` component for decoration. ### New components: - ✅ Gradient diff --git a/components/Card/index.tsx b/components/Card/index.tsx index d373a2c..a32ad99 100644 --- a/components/Card/index.tsx +++ b/components/Card/index.tsx @@ -1,15 +1,30 @@ import setup, { iCard } from './setup.ts'; import Panel from '../Panel/index.tsx'; +import Gradient from '../Gradient/index.tsx'; export default function (props: Partial) { - const { c, fref, fwd, children, ...p } = setup(props); + const { c, fref, fwd, children, top_gradient_pattern, bottom_gradient_pattern, ...p } = setup(props); return (
+ {top_gradient_pattern ? ( + + ) : null} {children} - {/*
*/} + {bottom_gradient_pattern ? ( + + ) : null}
); } diff --git a/components/Card/setup.ts b/components/Card/setup.ts index 51e0044..07e4604 100644 --- a/components/Card/setup.ts +++ b/components/Card/setup.ts @@ -1,25 +1,35 @@ import { cn, opt, applyDefaults, partializeClasses } from '../../src/utils.ts'; import { iComponent, iFwd } from '../../src/types.ts'; +import { iGradient } from '../Gradient/setup.ts'; +import { GRADIENT_PATTERNS } from '../../src/enums.ts'; export type iCard = iComponent & { + top_gradient_pattern: GRADIENT_PATTERNS | null; + bottom_gradient_pattern: GRADIENT_PATTERNS | null; fwd: Partial<{ wrapper: iFwd; gradient: iFwd; + top_gradient: iGradient; + bottom_gradient: iGradient; }>; }; const defaults: iCard = { + top_gradient_pattern: null, + bottom_gradient_pattern: null, fwd: {}, }; export default (props: Partial) => { const p = applyDefaults(defaults, props); - const { wrapper, gradient } = p.fwd; + const { wrapper, gradient, top_gradient, bottom_gradient } = p.fwd; const classes = partializeClasses({ card: opt(cn('comp-card clr-bg-panel'), p.class, p.nostyle), wrapper: opt(cn('comp-card_wrapper'), wrapper?.class, wrapper?.nostyle), + top_gradient: opt(cn('comp-card_gradient'), top_gradient?.class, top_gradient?.nostyle), + bottom_gradient: opt(cn('comp-card_gradient'), bottom_gradient?.class, bottom_gradient?.nostyle), gradient: opt( cn('comp-card_gradient comp-gradient comp-gradient_zigzag'), gradient?.class, diff --git a/components/Gradient/setup.ts b/components/Gradient/setup.ts index a0b8fd7..d1965f1 100644 --- a/components/Gradient/setup.ts +++ b/components/Gradient/setup.ts @@ -20,7 +20,7 @@ export default (props: Partial) => { cn( 'comp-gradient', p.gradient_pattern ? `comp-gradient_${p.gradient_pattern}` : null, - p.flip ? 'y-flip' : null + p.flip ? 'flip' : null ), p.class, p.nostyle diff --git a/routes/index.tsx b/routes/index.tsx index 3301cd0..2bdcc55 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -111,7 +111,7 @@ export default function Home() {
-
+
{TestTinyText('title')}
{TestLargeText('paragraph')} @@ -128,14 +128,14 @@ export default function Home() { {TestTinyText('title')} {TestTinyText('display')} - + {TestSmallText('subheading')} {TestLargeText('paragraph')} {TestInputs()} -