Skip to content

Commit

Permalink
chore: remove use client
Browse files Browse the repository at this point in the history
  • Loading branch information
SaadBazaz committed Aug 17, 2024
1 parent fe441c4 commit 4e648c7
Show file tree
Hide file tree
Showing 27 changed files with 2,713 additions and 5,375 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ To use Material Web Components for React as a **library** in your project, run:
npm install material-web-components-react
```

## Documentation
## Usage

Here's a general example of how the components can be used:

```tsx
import React from 'react';
import Button from 'material-web-components-react/button';

function Example() {
return (
<div>
<Button>Click me</Button>
</div>
);
}
```

For a detailed reference on usage, you might want to check out the source code of the [NextJS demo](./apps/demo/src/app/page.tsx). It's simple!

Under the hood, this library simply uses the official [@material/web](https://github.com/material-components/material-web/) components. Visit [the official Material Web Components docs](https://github.com/material-components/material-web/blob/main/docs/intro.md) to learn how to use those components. The props remain the same!

Expand Down
3 changes: 1 addition & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@lit-labs/ssr-react": "^0.3.0",
"@lit/react": "^1.0.5",
"@material/web": "^2.0.0",
"autoprefixer": "^10.4.19",
"lit": "^3.1.4",
"lit": "^3.2.0",
"react": "^18.2.0",
"tailwind-merge": "^2.4.0",
"tailwindcss": "^3.4.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdBadge } from "@material/web/labs/badge/badge";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Fab.react.tsx
import { MdElevatedButton } from "@material/web/button/elevated-button";
import { MdFilledButton } from "@material/web/button/filled-button";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Fab.react.tsx
import { MdElevatedCard } from "@material/web/labs/card/elevated-card";
import { MdFilledCard } from "@material/web/labs/card/filled-card";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Checkbox.react.tsx
import { MdCheckbox } from "@material/web/checkbox/checkbox";
import React from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/chip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Icon.react.tsx
import { MdChipSet } from "@material/web/chips/chip-set";
import { MdAssistChip } from "@material/web/chips/assist-chip";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdDialog } from "@material/web/dialog/dialog.js";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/divider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Divider.react.tsx
import { MdDivider } from "@material/web/divider/divider";
import React from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/elevation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Elevation.react.tsx
import { MdElevation } from "@material/web/elevation/elevation";
import React from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/fab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Fab.react.tsx
import { MdFab } from "@material/web/fab/fab.js";
import { MdBrandedFab } from "@material/web/fab/branded-fab";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/focus-ring/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: FocusRing.react.tsx
import { MdFocusRing } from "@material/web/focus/md-focus-ring";
import React from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/icon-button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: IconButton.react.tsx
import { MdIconButton } from "@material/web/iconbutton/icon-button";
import { MdFilledIconButton } from "@material/web/iconbutton/filled-icon-button";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Icon.react.tsx
import { MdIcon } from "@material/web/icon/icon.js";
import React from "react";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdItem } from "@material/web/labs/item/item";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// File: MaterialList.tsx
"use client";

import { MdList } from "@material/web/list/list";
import { MdListItem } from "@material/web/list/list-item";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// File: MaterialMenu.tsx
"use client";

import { MdMenu } from "@material/web/menu/menu";
import { MdMenuItem } from "@material/web/menu/menu-item";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/navigation-bar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdNavigationBar } from "@material/web/labs/navigationbar/navigation-bar";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/navigation-drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdNavigationDrawer } from "@material/web/labs/navigationdrawer/navigation-drawer";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/navigation-rail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdNavigationRail } from "./web-component/navigation-rail";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/ui/src/navigation-tab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import React from "react";

import { MdNavigationTab } from "@material/web/labs/navigationtab/navigation-tab";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/segmented-button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Icon.react.tsx
import { MdOutlinedSegmentedButtonSet } from "@material/web/labs/segmentedbuttonset/outlined-segmented-button-set";
import { MdOutlinedSegmentedButton } from "@material/web/labs/segmentedbutton/outlined-segmented-button";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/switch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: Icon.react.tsx
import { MdSwitch } from "@material/web/switch/switch";
import React from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/text-field/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
// file: TextField.react.tsx
import { MdFilledTextField } from "@material/web/textfield/filled-text-field";
import { MdOutlinedTextField } from "@material/web/textfield/outlined-text-field";
Expand Down
Loading

0 comments on commit 4e648c7

Please sign in to comment.