Skip to content

Commit

Permalink
v0.2.0-beta.5
Browse files Browse the repository at this point in the history
  • Loading branch information
CarcajadaArtificial committed Jul 18, 2023
1 parent 0007902 commit e46ed84
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
13 changes: 4 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Changelog

## v0.2.0-beta.4
## v0.2.0-beta.5

### Added the `Gradient` component to the `Card`` component
### Added a title to the `Card` component.
- `/components/Card/index.tsx`
- `/components/Gradient/setup.tsx`
- `/components/Card/setup.tsx`
- `/routes/index.tsx`

### Minor updates
- `/src/scss/components.scss`
- `/src/scss/twind.scss`
- `/static/style.css`

## Changes so far

- Added the `ìComponent` type.
Expand All @@ -23,6 +17,7 @@
- **Footer**
- Added a `Gradient` component for decoration.
- **Card**
- Added a `card_title` prop.
- Added a `Gradient` component for decoration.

### New components:
Expand All @@ -42,7 +37,7 @@
- [ ] Link
- [ ] Create an organized collection of island functions
- [ ] Update component features
- [ ] **Card**: Add text, image, gradient spacers, and linkmap feature.
- [ ] **Card**: Add text, image, gradient spacers, and chips feature.
- [ ] **Navigation**: Add appear/disappear when scrolling interaction on a fixed navigation.
- [ ] **Code**: Add copy to clipboard.
- [ ] **Separator**: Add gradient separators.
Expand Down
8 changes: 6 additions & 2 deletions components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import setup, { iCard } from './setup.ts';
import Panel from '../Panel/index.tsx';
import Gradient from '../Gradient/index.tsx';
import Text from '../Text/index.tsx';
import Linkmap from '../Linkmap/index.tsx';

export default function (props: Partial<iCard>) {
const { c, fref, fwd, children, top_gradient_pattern, bottom_gradient_pattern, ...p } = setup(props);
const { c, fref, fwd, children, card_title, top_gradient_pattern, bottom_gradient_pattern, ...p } =
setup(props);

return (
<div ref={fwd.wrapper?.ref!} class={c.wrapper}>
Expand All @@ -16,7 +19,8 @@ export default function (props: Partial<iCard>) {
/>
) : null}
<Panel fref={fref} class={c.card} {...p}>
{children}
{card_title ? <Text type="subheading">{card_title}</Text> : null}
<div class="comp-card_content">{children}</div>
</Panel>
{bottom_gradient_pattern ? (
<Gradient
Expand Down
4 changes: 3 additions & 1 deletion components/Card/setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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';
import { iGradient } from '../Gradient/setup.ts';

export type iCard = iComponent<HTMLDivElement> & {
card_title: string | null;
top_gradient_pattern: GRADIENT_PATTERNS | null;
bottom_gradient_pattern: GRADIENT_PATTERNS | null;
fwd: Partial<{
Expand All @@ -15,6 +16,7 @@ export type iCard = iComponent<HTMLDivElement> & {
};

const defaults: iCard = {
card_title: null,
top_gradient_pattern: null,
bottom_gradient_pattern: null,
fwd: {},
Expand Down
6 changes: 4 additions & 2 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ export default function Home() {
{TestTinyText('title')}
<Separator />
{TestTinyText('display')}
<Card top_gradient_pattern="cloud" bottom_gradient_pattern="cloud">
{TestSmallText('subheading')}
<Card
card_title="Lorem ipsum dolor sit amet consectetur adipisicing elit."
bottom_gradient_pattern="cloud"
>
{TestLargeText('paragraph')}
</Card>
{TestInputs()}
Expand Down

0 comments on commit e46ed84

Please sign in to comment.