Skip to content

Commit

Permalink
Merge pull request #284 from qwikifiers/pr-change-daisy
Browse files Browse the repository at this point in the history
  • Loading branch information
shairez authored Apr 29, 2023
2 parents d945b72 + ca03213 commit e758aa4
Show file tree
Hide file tree
Showing 195 changed files with 3,442 additions and 3,065 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ runs:
shell: bash
run: npx nx build headless

# - name: Build Daisy Theme
# - name: Build Tailwind Theme
# shell: bash
# run: npx nx build daisy
# run: npx nx build tailwind

# - name: Build
# shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"git.pullTags": false,
"conventionalCommits.scopes": ["daisy"]
"conventionalCommits.scopes": ["tailwind"]
}
12 changes: 6 additions & 6 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export type TooltipProps = QwikIntrinsicElements['div'] & {
};
```

For **Daisy, Material and other components variations**, you can define the new props in a new type, named with the component name and the variation as prefix. For example:
For **Tailwind, Material and other components variations**, you can define the new props in a new type, named with the component name and the variation as prefix. For example:

```ts
type DaisyTooltipProps = {
type TailwindTooltipProps = {
size?: 'sm' | 'md';
};
```
Expand All @@ -77,7 +77,7 @@ The final exported type will extend from the headless props type. For example:
```ts
import { TooltipProps as HeadlessTooltipProps } from '@qwik-ui/headless';

export type TooltipProps = HeadlessTooltipProps & DaisyTooltipProps;
export type TooltipProps = HeadlessTooltipProps & TailwindTooltipProps;
```

- Use object destructuring in the component$ declaration on all the props you are going to use. For example:
Expand All @@ -104,15 +104,15 @@ return (
- Use accessibility attributes whenever they are needed.
- For simple primitive states use signals. For object state, use stores.

## Example of headless button customisation with Daisy
## Example of headless button customisation with Tailwind

```tsx
import { component$, QwikIntrinsicElements, Slot } from '@builder.io/qwik';
import { Button as HeadlessButton, ButtonProps as ButtonHeadlessProps } from '@qwik-ui/headless';
import { clsq } from '@qwik-ui/shared';

type DaisyButtonProps = { size?: 'sm' | 'md', ... };
export type ButtonProps = ButtonHeadlessProps & DaisyButtonProps;
type TailwindButtonProps = { size?: 'sm' | 'md', ... };
export type ButtonProps = ButtonHeadlessProps & TailwindButtonProps;

export const Button = component$(
({ size = 'md', class: classNames, ...rest }: ButtonProps) => {
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ git checkout -b my-fix-branch main

- Visit the URL printed in the console and you'll have a page opened with the suite of widgets.

- Once you made some changes in either package (`headless`, `daisy` or `material`), you will see them immediately reflected on the page.
- Once you made some changes in either package (`headless`, `tailwind` or `material`), you will see them immediately reflected on the page.

### ▶ 5. Make sure you add / modify tests

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
This library is still in early stages and once we'll collect enough feedback from the community we'll release the first beta version.

### ROADMAP
- [ ] Deploy the documentation site

- [ ] Deploy the documentation site
- [ ] Add "Readiness" statuses to the components
- [ ] Add a getting started video tutorial
- [ ] Make a public storybook url
- [ ] Deploy the daisy-theme package
- [ ] Deploy the tailwind-kit package
- [ ] Cover all of the components with storybook tests
- [ ] Add testing coverage reports
- [ ] Add a contribution tutorial video
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/components/selectTheme/selectTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useLocation } from '@builder.io/qwik-city';
import { APP_STATE } from '../../constants';
import { ThemeIcon } from '../icons/ThemeIcon';

export type Theme = 'HEADLESS' | 'DAISY' | 'MATERIAL' | 'NOT_DEFINED';
export type Theme = 'HEADLESS' | 'TAILWIND' | 'MATERIAL' | 'NOT_DEFINED';

export const SelectTheme = component$(() => {
const location = useLocation();
const appState = useContext(APP_STATE);
const openThemeSignal = useSignal<boolean>(false);

const themes: Theme[] = ['HEADLESS', 'DAISY', 'MATERIAL'];
const themes: Theme[] = ['HEADLESS', 'TAILWIND', 'MATERIAL'];
return (
<div
title="Change Theme"
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/wrapper/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
useSignal,
useStylesScoped$,
} from '@builder.io/qwik';
import { Tab, TabPanel, Tabs } from '@qwik-ui/theme-daisy';
import { Tab, TabPanel, Tabs } from '@qwik-ui/tailwind';
import styles from './wrapper.css?inline';

export interface WrapperProps {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStylesScoped$ } from '@builder.io/qwik';
import { Accordion, AccordionItem } from '@qwik-ui/theme-daisy';
import { Accordion, AccordionItem } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
28 changes: 15 additions & 13 deletions apps/website/src/routes/docs/daisy/alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { $, component$ } from '@builder.io/qwik';
import { Alert as DaisyAlert } from '@qwik-ui/theme-daisy';
import { Alert as TailwindAlert } from '@qwik-ui/tailwind';
import { GitHubIcon } from '../../../../components/icons/GitHubIcon';

export default component$(() => {
Expand All @@ -8,40 +8,42 @@ export default component$(() => {
<h2>This is the documentation for the Alert</h2>

<div class="flex flex-col gap-4">
<DaisyAlert>This is a success alert.</DaisyAlert>
<DaisyAlert variant="error">This is an error alert.</DaisyAlert>
<DaisyAlert variant="warning">This is a warning alert.</DaisyAlert>
<DaisyAlert variant="info">This is an info alert.</DaisyAlert>
<TailwindAlert>This is a success alert.</TailwindAlert>
<TailwindAlert variant="error">This is an error alert.</TailwindAlert>
<TailwindAlert variant="warning">
This is a warning alert.
</TailwindAlert>
<TailwindAlert variant="info">This is an info alert.</TailwindAlert>
</div>

<div class="flex flex-col gap-2">
<h3>With a title</h3>
<DaisyAlert variant="warning" title="Watch out!">
<TailwindAlert variant="warning" title="Watch out!">
This is a warning alert.
</DaisyAlert>
</TailwindAlert>
</div>

<div class="flex flex-col gap-2">
<h3>With an icon</h3>
<DaisyAlert variant="success">
<TailwindAlert variant="success">
<div q:slot="icon">💸</div>
This is a success alert with an icon.
</DaisyAlert>
</TailwindAlert>
</div>

<div class="flex flex-col gap-2">
<h3>With a action</h3>
<DaisyAlert
<TailwindAlert
variant="error"
action={{ label: 'undo', onClick$: $(() => alert('Undoing...')) }}
>
This is a success alert with an action.
</DaisyAlert>
</TailwindAlert>
</div>

<div class="flex flex-col gap-2">
<h3>A mix</h3>
<DaisyAlert
<TailwindAlert
variant="info"
title="Did you know?"
action={{ label: 'cool!', onClick$: $(() => alert('Hi!')) }}
Expand All @@ -50,7 +52,7 @@ export default component$(() => {
<GitHubIcon />
</div>
This is an info alert with an action, icon, and title.
</DaisyAlert>
</TailwindAlert>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStylesScoped$ } from '@builder.io/qwik';
import { Badge, Button } from '@qwik-ui/theme-daisy';
import { Badge, Button } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/breadcrumb/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { component$ } from '@builder.io/qwik';
import { useLocation } from '@builder.io/qwik-city';
import { Breadcrumb, BreadcrumbItem } from '@qwik-ui/theme-daisy';
import { Breadcrumb, BreadcrumbItem } from '@qwik-ui/tailwind';
import BreadcrumbWrapper from './BreadcrumbWrapper';
import PathIcon from './PathIcon';

Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/button-group/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStyles$ } from '@builder.io/qwik';
import { Button, ButtonGroup } from '@qwik-ui/theme-daisy';
import { Button, ButtonGroup } from '@qwik-ui/tailwind';
import styles from './button-group.css?inline';

export default component$(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, $, useStylesScoped$ } from '@builder.io/qwik';
import { Button } from '@qwik-ui/theme-daisy';
import { Button } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
6 changes: 3 additions & 3 deletions apps/website/src/routes/docs/daisy/card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CardActions,
Button,
CardImage,
} from '@qwik-ui/theme-daisy';
} from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down Expand Up @@ -36,7 +36,7 @@ export default component$(() => {
<h1>Card with Image Example</h1>
<Card>
<CardImage
src="https://daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.jpg"
src="https://tailwindui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.jpg"
alt="shoes"
/>
<CardBody>
Expand All @@ -48,7 +48,7 @@ export default component$(() => {
<h1>Card Completed</h1>
<Card>
<CardImage
src="https://daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.jpg"
src="https://tailwindui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.jpg"
alt="shoes"
/>
<CardBody>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStylesScoped$ } from '@builder.io/qwik';
import { Checkbox } from '@qwik-ui/theme-daisy';
import { Checkbox } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/collapse/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$ } from '@builder.io/qwik';
import { Collapse } from '@qwik-ui/theme-daisy';
import { Collapse } from '@qwik-ui/tailwind';

export default component$(() => {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$ } from '@builder.io/qwik';
import { Drawer } from '@qwik-ui/theme-daisy';
import { Drawer } from '@qwik-ui/tailwind';

export default component$(() => {
return (
Expand Down
10 changes: 5 additions & 5 deletions apps/website/src/routes/docs/daisy/navigation-bar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$ } from '@builder.io/qwik';
import { NavigationBar } from '@qwik-ui/theme-daisy';
import { NavigationBar } from '@qwik-ui/tailwind';

export default component$(() => {
return (
Expand All @@ -11,7 +11,7 @@ export default component$(() => {

<NavigationBar class="bg-base-100 rounded-lg">
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
daisyUI
tailwindUI
</a>
<ul q:slot="navbar-center" class="menu menu-horizontal px-1">
<li>
Expand Down Expand Up @@ -44,13 +44,13 @@ export default component$(() => {
</li>
</ul>
<a q:slot="navbar-right" class="btn btn-ghost normal-case text-xl">
daisyUI
tailwindUI
</a>
</NavigationBar>

<NavigationBar class="bg-base-100 rounded-lg">
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
daisyUI
tailwindUI
</a>
<ul q:slot="navbar-right" class="menu menu-horizontal px-1">
<li>
Expand Down Expand Up @@ -86,7 +86,7 @@ export default component$(() => {
<h2>Custom css</h2>
<NavigationBar class=" bg-primary rounded-lg">
<a q:slot="navbar-left" class="btn btn-ghost normal-case text-xl">
daisyUI
tailwindUI
</a>
<ul q:slot="navbar-right" class="menu menu-horizontal px-1">
<li>
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/routes/docs/daisy/pagination/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { component$, useSignal } from '@builder.io/qwik';
import { Pagination } from '@qwik-ui/theme-daisy';
import { Toggle } from '@qwik-ui/theme-daisy';
import { Pagination } from '@qwik-ui/tailwind';
import { Toggle } from '@qwik-ui/tailwind';

export default component$(() => {
const page = useSignal(50);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/popover/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { component$, useSignal } from '@builder.io/qwik';
import { Popover, PopoverContent, PopoverTrigger } from '@qwik-ui/headless';

import { Button, Card, CardBody, CardTitle } from '@qwik-ui/theme-daisy';
import { Button, Card, CardBody, CardTitle } from '@qwik-ui/tailwind';

export default component$(() => {
const controlledPopover = useSignal<boolean>(true);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/progress/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, $, useStylesScoped$ } from '@builder.io/qwik';
import { Progress } from '@qwik-ui/theme-daisy';
import { Progress } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/radio/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';
import { Radio } from '@qwik-ui/theme-daisy';
import { Radio } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/rating/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStylesScoped$ } from '@builder.io/qwik';
import { Rating } from '@qwik-ui/theme-daisy';
import { Rating } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default component$(() => {
<h2>This is the documentation for the Select</h2>
<Select.Root>
<Select.Label class="mr-2">
Alternate Daisy Select implementation
Alternate Tailwind Select implementation
</Select.Label>
<Select.Trigger class="select-caret inline-flex items-center justify-between w-full h-12 max-w-xs px-4 text-sm font-semibold leading-loose border rounded-lg cursor-pointer border-base-content border-opacity-20 bg-base-100 shrink-0">
<Select.Value placeholder="Select an option! ⚡" />
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useSignal } from '@builder.io/qwik';
import { Slider } from '@qwik-ui/theme-daisy';
import { Slider } from '@qwik-ui/tailwind';

export default component$(() => {
const sliderValue = useSignal(55);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/spinner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useStylesScoped$ } from '@builder.io/qwik';
import { Spinner } from '@qwik-ui/theme-daisy';
import { Spinner } from '@qwik-ui/tailwind';

export default component$(() => {
useStylesScoped$(`
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/routes/docs/daisy/tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useSignal } from '@builder.io/qwik';
import { Tab, TabPanel, Tabs } from '@qwik-ui/theme-daisy';
import { Tab, TabPanel, Tabs } from '@qwik-ui/tailwind';
import { Wrapper } from '../../../../components/wrapper/wrapper';

export default component$(() => {
Expand All @@ -11,7 +11,7 @@ export default component$(() => {

<Wrapper
title="Tabs"
subtitle="Daisy"
subtitle="Tailwind"
description="This is the documentation for the Tabs"
>
<div q:slot="preview">
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/toast/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$ } from '@builder.io/qwik';
import { Toast } from '@qwik-ui/theme-daisy';
import { Toast } from '@qwik-ui/tailwind';
import ToastContainer from './ToastContainer';

export default component$(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/routes/docs/daisy/toggle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { component$, useSignal } from '@builder.io/qwik';
import { Toggle } from '@qwik-ui/theme-daisy';
import { Toggle } from '@qwik-ui/tailwind';

export default component$(() => {
const toggleChecked = useSignal(false);
Expand Down
Loading

0 comments on commit e758aa4

Please sign in to comment.