Skip to content

Commit 8906771

Browse files
authored
fix: docs and website (#172)
* fix: add missing devDependency * chore: fix className --> class * docs: fix run library command
1 parent 627628e commit 8906771

File tree

5 files changed

+29
-35
lines changed

5 files changed

+29
-35
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ git checkout -b my-fix-branch main
6060

6161
- From the root of the project run `pnpm install`.
6262

63-
- Then run `pnpm run dev --workspace=apps/website`.
63+
- Then run `npx nx@latest serve website`.
6464

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

apps/website/src/routes/docs/headless/rating/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default component$(() => {
2828

2929
export const MyStarIcon = component$(() => <>💩</>);
3030
export const MyHeartIcon = component$(() => (
31-
<div className="text-red-500 text-4xl">♥️</div>
31+
<div class="text-red-500 text-4xl">♥️</div>
3232
));
3333
export const MyComponentIcon = component$(() => (
3434
<div class="bg-green-400 rounded-xl w-8 h-8 p-1 m-1 flex justify-center items-center" />

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@commitlint/config-conventional": "^17.4.3",
2121
"@cypress/code-coverage": "3.10.0",
2222
"@cypress/vite-dev-server": "^2.2.1",
23+
"@floating-ui/dom": "1.0.10",
2324
"@jscutlery/semver": "^2.30.1",
2425
"@nrwl/cli": "15.7.1",
2526
"@nrwl/cypress": "15.7.1",
Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
1-
import { component$, createContext, useContext, useContextProvider, useStore, useStyles$ } from '@builder.io/qwik';
21
import {
3-
Rating as HeadlessRating, RatingProps,
4-
} from '@qwik-ui/headless';
2+
component$,
3+
createContext,
4+
useContext,
5+
useContextProvider,
6+
useStore,
7+
useStyles$,
8+
} from '@builder.io/qwik';
9+
import { Rating as HeadlessRating, RatingProps } from '@qwik-ui/headless';
510
import styles from './rating.css?inline';
611

7-
812
export type DaisyRatingProps = {
913
/**
1014
* Daisy Custom mask
1115
* https://daisyui.com/components/mask/
1216
*/
1317
mask?: string;
14-
} & RatingProps
18+
} & RatingProps;
1519

1620
export const ContextService = createContext<{ mask: string }>('my-context');
1721

18-
export const Rating = component$(
19-
(props: DaisyRatingProps) => {
20-
useStyles$(styles)
21-
const { mask = 'mask-star bg-yellow-500', ...rest } = props;
22-
23-
const state = useStore({ mask });
24-
useContextProvider(ContextService, state);
25-
26-
return (
27-
<div className="rating gap-1">
28-
<HeadlessRating
29-
{...rest}
30-
icon={props.icon || DaisyIcon}
31-
/>
32-
</div>
33-
);
34-
}
35-
);
22+
export const Rating = component$((props: DaisyRatingProps) => {
23+
useStyles$(styles);
24+
const { mask = 'mask-star bg-yellow-500', ...rest } = props;
3625

26+
const state = useStore({ mask });
27+
useContextProvider(ContextService, state);
3728

38-
export const DaisyIcon = component$(
39-
() => {
40-
const state = useContext(ContextService);
41-
return <div className={`w-4 h-4 mask ${state.mask} `} />
42-
})
29+
return (
30+
<div class="rating gap-1">
31+
<HeadlessRating {...rest} icon={props.icon || DaisyIcon} />
32+
</div>
33+
);
34+
});
4335

36+
export const DaisyIcon = component$(() => {
37+
const state = useContext(ContextService);
38+
return <div class={`w-4 h-4 mask ${state.mask} `} />;
39+
});

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)