Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Alert Component #157

Merged
merged 23 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9f5eec1
feat(alert): add base for component
hobbescodes Sep 22, 2023
1316261
feat(alert): add base for recipe
hobbescodes Sep 22, 2023
2a2854a
feat(alert): add base for stories
hobbescodes Sep 22, 2023
52cdb59
Merge branch 'master' into feature/alert-component
hobbescodes Sep 22, 2023
007f58e
chore(alert): add base for warning variant
hobbescodes Sep 24, 2023
3f41401
feature(panda): add static CSS pregeneration for alert recipes
coopbri Sep 26, 2023
63e7a17
Merge branch 'master' into feature/alert-component
hobbescodes Sep 27, 2023
f59da1a
fix(alert): add alert to correct component directory in storybook
hobbescodes Sep 27, 2023
2cef3f9
refactor(alert): update component and recipe, add variants story
hobbescodes Sep 27, 2023
b08b199
Merge branch 'master' into feature/alert-component
hobbescodes Sep 27, 2023
006829a
chore(alert): remove explicit type annotation from storybook meta
hobbescodes Sep 27, 2023
59cb43f
refactor(alert): update alert recipe and component
hobbescodes Sep 27, 2023
889387e
Merge branch 'master' into feature/alert-component
hobbescodes Sep 27, 2023
d94b1c0
feat(examples): add alert demos to example apps
hobbescodes Sep 27, 2023
4c40aba
fix(build): update faulty lock file
hobbescodes Sep 28, 2023
0719135
Merge branch 'master' into feature/alert-component
hobbescodes Oct 6, 2023
8b502a7
refactor: update component styles and recipes
hobbescodes Oct 7, 2023
61049a4
fix(alert): update component props
hobbescodes Oct 7, 2023
d06fc77
Merge branch 'master' into feature/alert-component
hobbescodes Oct 14, 2023
f5e8ccf
refactor(alert): update recipe
hobbescodes Oct 14, 2023
d954217
ci(changesets): add changeset for Alert component
hobbescodes Oct 14, 2023
7f137f0
build(examples): update dependencies
hobbescodes Oct 14, 2023
549afeb
Merge branch 'master' into feature/alert-component
hobbescodes Oct 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into feature/alert-component
  • Loading branch information
hobbescodes committed Sep 27, 2023
commit 63e7a1706fd8ead63a1d1373fec37004a94b6bf5
5 changes: 5 additions & 0 deletions .changeset/tricky-spoons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@animareflection/ui": minor
---

**Breaking:** Refactor library structure with client component focus
5 changes: 5 additions & 0 deletions .changeset/unlucky-hats-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@animareflection/ui": minor
---

Add `Stat` component
4 changes: 2 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const preview: Preview = {
backgrounds: {
default: "dark",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#161616" },
{ name: "light", value: "#fdfdfd" },
{ name: "dark", value: "#0a0a0a" },
],
},
controls: {
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ import "main.css";
const App = () => <></>;
```

5. (_for TypeScript users_) If you are using TypeScript, make sure your consuming application has `compilerOptions.moduleResolution` set to `node16` or higher (e.g. `nodenext`) in `tsconfig.json`. This will allow you to properly import from subpaths from the library. Read more about this [here](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js).
5. (_for TypeScript users_) If you are using TypeScript, make sure your consuming application has `compilerOptions.module` and `compilerOptions.moduleResolution` set to `node16` or higher (e.g. `nodenext`) in `tsconfig.json`. This will allow you to properly import from subpaths from the library. Read more about this [here](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js).

Now you are ready to install the UI library. You can either install it [from the published package](#from-published-package) or from a [local clone](#local) on your local filesystem. The latter is useful if you are developing the library.

## Remote

Install from remote repository: `yarn add @animareflection/ui`
Install from remote repository along with required dependencies: `yarn add @animareflection/ui @ark-ui/react framer-motion react-hot-toast`

## Local

Expand Down
58 changes: 0 additions & 58 deletions examples/next/src/app/client/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion examples/next/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface Props {
}

import "main.css";
import { BreadcrumbDemo } from "components";
import { BreadcrumbDemo } from "components/core";

/**
* Root application layout.
Expand Down
54 changes: 46 additions & 8 deletions examples/next/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
import {
Box,
Circle,
Flex,
Grid,
Hide,
Show,
Skeleton,
Square,
Text,
} from "@animareflection/ui";
import Link from "next/link";

import {
AccordionDemo,
BadgeDemo,
BannerDemo,
BreadcrumbDemo,
ButtonDemo,
CardDemo,
CarouselDemo,
CheckboxDemo,
CollapseDemo,
DrawerDemo,
FlyoutDemo,
IconDemo,
ImageDemo,
InputDemo,
KbdDemo,
MenuDemo,
ModalDemo,
NumberInputDemo,
RadioGroupDemo,
SkeletonToggleDemo,
SliderDemo,
SpinnerDemo,
TabsDemo,
TextareaDemo,
ToastDemo,
ToggleDemo,
TooltipDemo,
StatDemo,
} from "components";

const HomePage = () => (
Expand Down Expand Up @@ -60,11 +80,34 @@ const HomePage = () => (
</Grid>

<Flex direction="column" w="100%" gap={2} p={4}>
<ButtonDemo />
<AccordionDemo />
<DrawerDemo />
<IconDemo />
<MenuDemo />
<ModalDemo />
<SliderDemo />
<BadgeDemo />
<CardDemo />
<ImageDemo />
<SpinnerDemo />
<TabsDemo />
<ToggleDemo />
<SkeletonToggleDemo />
<CheckboxDemo />
<KbdDemo />
<CollapseDemo />
<BannerDemo />
<InputDemo />
<NumberInputDemo />
<TextareaDemo />
<FlyoutDemo />
<TooltipDemo />
<ToastDemo />
<CarouselDemo />
<BreadcrumbDemo />
<RadioGroupDemo />
<StatDemo />
<Hide below="md">
<Text color="brand.primary.500" fontSize="3xl" fontWeight="bold">
Hide below md breakpoint
Expand All @@ -85,12 +128,7 @@ const HomePage = () => (
Show from md breakpoint and up
</Text>
</Show>
<Skeleton variant="circle" w={12} h={12} />
</Flex>

<Box color="blue" _hover={{ textDecoration: "underline" }}>
<Link href="/client">Go to client page demo</Link>
</Box>
</Flex>
);

Expand Down
4 changes: 2 additions & 2 deletions examples/next/src/components/AccordionDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Accordion } from "@animareflection/ui/client";
import { Accordion } from "@animareflection/ui";

import { Wrapper } from "components";

import type { AccordionItemRecord } from "@animareflection/ui/client";
import type { AccordionItemRecord } from "@animareflection/ui";

const ITEMS: AccordionItemRecord[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/BannerDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Banner } from "@animareflection/ui/client";
import { Banner } from "@animareflection/ui";

import { Wrapper } from "components";

Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/BreadcrumbDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Breadcrumb, BreadcrumbRecord, Icon } from "@animareflection/ui/client";
import { Breadcrumb, BreadcrumbRecord, Icon } from "@animareflection/ui";
import { FiChevronRight as ChevronRightIcon } from "react-icons/fi";

import { Wrapper } from "components";
Expand Down
4 changes: 3 additions & 1 deletion examples/next/src/components/ButtonDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Button } from "@animareflection/ui/client";
"use client";

import { Button } from "@animareflection/ui";

import { Wrapper } from "components";

Expand Down
3 changes: 3 additions & 0 deletions examples/next/src/components/CardDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// TODO: update `Card` component so that `use client` is not needed
"use client";

import { Card, CardBody, CardFooter, CardHeader } from "@animareflection/ui";

import { Wrapper } from "components";
Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/CarouselDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Carousel } from "@animareflection/ui/client";
import { Carousel } from "@animareflection/ui";
import { Image } from "@animareflection/ui/next";

import { Wrapper } from "components";
Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/CheckboxDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Checkbox } from "@animareflection/ui/client";
import { Checkbox } from "@animareflection/ui";
import { useState } from "react";

import { Wrapper } from "components";
Expand Down
3 changes: 1 addition & 2 deletions examples/next/src/components/CollapseDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Flex, Text } from "@animareflection/ui";
import { Collapse } from "@animareflection/ui/client";
import { Collapse, Flex, Text } from "@animareflection/ui";
import { Image } from "@animareflection/ui/next";

import { Wrapper } from "components";
Expand Down
5 changes: 2 additions & 3 deletions examples/next/src/components/DrawerDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Text } from "@animareflection/ui";
import { Button, Drawer } from "@animareflection/ui/client";
import { Drawer, Text } from "@animareflection/ui";

import { Wrapper } from "components";

const DrawerDemo = () => (
<Wrapper title="Drawer">
<Drawer
trigger={<Button>Open Drawer</Button>}
trigger="Open Drawer"
title="Drawer Title"
description="Drawer Description"
>
Expand Down
5 changes: 2 additions & 3 deletions examples/next/src/components/FlyoutDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Text } from "@animareflection/ui";
import { Button, Flyout } from "@animareflection/ui/client";
import { Flyout, Text } from "@animareflection/ui";

import { Wrapper } from "components";

const FlyoutDemo = () => {
return (
<Wrapper title="Flyout">
<Flyout title="Flyout Title" trigger={<Button>Open Flyout</Button>}>
<Flyout title="Flyout Title" trigger="Open Flyout">
<Text mt={2}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
Expand Down
3 changes: 1 addition & 2 deletions examples/next/src/components/IconDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Flex } from "@animareflection/ui";
import { Icon } from "@animareflection/ui/client";
import { Flex, Icon } from "@animareflection/ui";
import {
FiHeart,
FiCheck,
Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/InputDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input } from "@animareflection/ui/client";
import { Input } from "@animareflection/ui";

import { Wrapper } from "components";

Expand Down
8 changes: 2 additions & 6 deletions examples/next/src/components/MenuDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { HStack, Text } from "@animareflection/ui";
import { Menu } from "@animareflection/ui/client";
import { HStack, Menu, Text } from "@animareflection/ui";

import { Wrapper } from "components";

import type {
MenuItemGroupRecord,
MenuItemRecord,
} from "@animareflection/ui/client";
import type { MenuItemGroupRecord, MenuItemRecord } from "@animareflection/ui";

const SUBMENU_GROUP_ITEMS: MenuItemRecord[] = [
{ id: "item-7", child: "Item 7" },
Expand Down
5 changes: 2 additions & 3 deletions examples/next/src/components/ModalDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Text } from "@animareflection/ui";
import { Button, Modal } from "@animareflection/ui/client";
import { Modal, Text } from "@animareflection/ui";

import { Wrapper } from "components";

const ModalDemo = () => (
<Wrapper title="Modal">
<Modal
trigger={<Button>Open Modal</Button>}
trigger="Open Modal"
title="Modal Title"
description="Modal Description"
>
Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/components/NumberInputDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NumberInput } from "@animareflection/ui/client";
import { NumberInput } from "@animareflection/ui";

import { Wrapper } from "components";

Expand Down
4 changes: 2 additions & 2 deletions examples/next/src/components/RadioGroupDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { RadioGroup } from "@animareflection/ui/client";
import { RadioGroup } from "@animareflection/ui";

import { Wrapper } from "components";

import type { RadioGroupRecord } from "@animareflection/ui/client";
import type { RadioGroupRecord } from "@animareflection/ui";

const ITEMS: RadioGroupRecord[] = [
{ value: "react", label: "React" },
Expand Down
3 changes: 1 addition & 2 deletions examples/next/src/components/SkeletonToggleDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import { useState } from "react";

import { Skeleton, Text } from "@animareflection/ui";
import { Button } from "@animareflection/ui/client";
import { Button, Skeleton, Text } from "@animareflection/ui";

import { Wrapper } from "components";

Expand Down
4 changes: 2 additions & 2 deletions examples/next/src/components/SliderDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Slider } from "@animareflection/ui/client";
import { Slider } from "@animareflection/ui";

import { Wrapper } from "components";

import type { SliderMarkerRecord } from "@animareflection/ui/client";
import type { SliderMarkerRecord } from "@animareflection/ui";

const MARKERS: SliderMarkerRecord[] = [
{ id: "marker-1", value: 25, label: "25%" },
Expand Down
15 changes: 15 additions & 0 deletions examples/next/src/components/StatDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Stat } from "@animareflection/ui";
import { Wrapper } from "components";

const TabsDemo = () => (
<Wrapper title="Stat">
<Stat
label="Floor Price"
helpText="12.35%"
indicator="increase"
value="$10.85"
/>
</Wrapper>
);

export default TabsDemo;
4 changes: 2 additions & 2 deletions examples/next/src/components/TabsDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Tabs } from "@animareflection/ui/client";
import { Tabs } from "@animareflection/ui";

import { Wrapper } from "components";

import type { TabRecord } from "@animareflection/ui/client";
import type { TabRecord } from "@animareflection/ui";

const TABS: TabRecord[] = [
{
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.