Skip to content

Commit

Permalink
Merge pull request #560 from keplersj/rewrite/web-component
Browse files Browse the repository at this point in the history
Rewrite in Web Components
  • Loading branch information
keplersj committed Oct 10, 2021
2 parents cabe177 + 59bcc6b commit 412a358
Show file tree
Hide file tree
Showing 24 changed files with 2,757 additions and 3,135 deletions.
16 changes: 16 additions & 0 deletions .storybook/main.cjs
@@ -0,0 +1,16 @@
module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
core: {
builder: "storybook-builder-vite",
},
async viteFinal(config, { configType }) {
// customize the Vite config here
config.esbuild = config.esbuild || {};
config.esbuild.jsxFactory = "_jsx";
config.esbuild.jsxInject = "import {h as _jsx, css as _css} from 'atomico'";

// return the customized config
return config;
},
};
8 changes: 0 additions & 8 deletions .storybook/main.js

This file was deleted.

4 changes: 1 addition & 3 deletions .storybook/package.json
@@ -1,3 +1 @@
{
"type": "commonjs"
}
{}
24 changes: 9 additions & 15 deletions README.md
@@ -1,6 +1,6 @@
# Starstuff Components

Minimalistic React Components Library
Minimalistic Web Components Library

## Philosophy

Expand All @@ -22,26 +22,20 @@ All components can be access via named exports on the `starstuff-components` pac

### Card

```js
import { Card } from "starstuff-components";

const CardExample = () => <Card />;
```html
<starstuff-card>
<!-- Card Content -->
</starstuff-card>
```

### Hyperbutton

```js
import { Hyperbutton } from "starstuff-components";

const HyperbuttonExample = () => (
<Hyperbutton href="#">Test Hyperbutton</Hyperbutton>
);
```html
<starstuff-hyperbutton href="#">Test Hyperbutton</starstuff-hyperbutton>
```

### Hyperlink

```js
import { Hyperlink } from "starstuff-components";

const HyperlinkExample = () => <Hyperlink href="#">Test Hyperlink</Hyperlink>;
```html
<starstuff-hyperlink href="#">Test Hyperlink</starstuff-hyperlink>;
```
3 changes: 2 additions & 1 deletion jest.config.cjs
Expand Up @@ -12,7 +12,6 @@ module.exports = {
{
displayName: "test",
preset: "ts-jest/presets/default-esm",
snapshotSerializers: ["@emotion/jest/serializer"],
testPathIgnorePatterns,
collectCoverage: true,
globals: {
Expand All @@ -23,6 +22,8 @@ module.exports = {
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
testEnvironment: "jsdom",
snapshotSerializers: ["jest-serializer-html"],
},
{
displayName: "lint:prettier",
Expand Down

0 comments on commit 412a358

Please sign in to comment.