-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21cb506
commit d98423d
Showing
13 changed files
with
218 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@einride/ui-labs": minor | ||
--- | ||
|
||
Add @einride/ui-labs package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Example } from "./src/components/Example/Example" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"name": "@einride/ui-labs", | ||
"version": "7.60.0", | ||
"description": "Experimental new components that are not yet included in the core package", | ||
"scripts": { | ||
"build": "rollup --config" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "11.1.1", | ||
"@storybook/jest": "0.1.0", | ||
"@storybook/react": "7.0.20", | ||
"@storybook/testing-library": "0.1.0", | ||
"@types/react": "18.2.12", | ||
"@types/react-dom": "18.2.5", | ||
"@vitejs/plugin-react": "4.0.0", | ||
"framer-motion": "10.12.16", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"rollup": "3.25.1", | ||
"typescript": "5.1.3" | ||
}, | ||
"peerDependencies": { | ||
"@einride/ui": "^7.45.3", | ||
"@emotion/react": "^11.10.6", | ||
"@emotion/styled": "^11.10.6", | ||
"react": "^18.0.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "./dist/index.d.ts", | ||
"main": "./dist/main.cjs.js", | ||
"module": "./dist/main.esm.js", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/main.esm.js", | ||
"require": "./dist/main.cjs.js" | ||
} | ||
}, | ||
"keywords": [ | ||
"react", | ||
"typescript", | ||
"ui", | ||
"components", | ||
"library" | ||
], | ||
"homepage": "https://github.com/einride/ui", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/einride/ui.git", | ||
"directory": "packages/einride-ui-labs" | ||
}, | ||
"bugs": { | ||
"email": "open-source@einride.tech", | ||
"url": "https://github.com/einride/ui/issues" | ||
}, | ||
"license": "MIT", | ||
"author": "Filip Tammergård <filip.tammergard@einride.tech> https://github.com/filiptammergard", | ||
"engines": { | ||
"node": "16 || 18" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"packageManager": "yarn@3.4.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import typescript from "@rollup/plugin-typescript" | ||
import pkg from "./package.json" assert { type: "json" } | ||
|
||
export default { | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: "cjs", | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: "esm", | ||
}, | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies ?? {}), | ||
...Object.keys(pkg.peerDependencies ?? {}), | ||
"react/jsx-runtime", | ||
], | ||
plugins: [typescript({ tsconfig: "./tsconfig.build.json" })], | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/einride-ui-labs/src/components/Example/Example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
Meta, | ||
Primary, | ||
Description, | ||
Source, | ||
Title, | ||
ArgTypes, | ||
Subtitle, | ||
Controls, | ||
Story, | ||
Canvas, | ||
Stories, | ||
Markdown, | ||
} from "@storybook/blocks" | ||
import * as Example from "./Example.stories.tsx" | ||
|
||
<Meta of={Example} /> | ||
<Title /> | ||
<Description of={Example} /> | ||
|
||
```tsx | ||
import { Example } from "@einride/ui-labs" | ||
``` | ||
|
||
## Basic | ||
|
||
<Description of={Example.Basic} /> | ||
<Canvas of={Example.Basic} /> | ||
<Controls of={Example.Basic} /> |
15 changes: 15 additions & 0 deletions
15
packages/einride-ui-labs/src/components/Example/Example.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Meta, StoryObj } from "@storybook/react" | ||
import { Example } from "./Example" | ||
|
||
const meta = { | ||
component: Example, | ||
} satisfies Meta<typeof Example> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Basic = { | ||
args: { | ||
background: "secondary", | ||
}, | ||
} satisfies Story |
18 changes: 18 additions & 0 deletions
18
packages/einride-ui-labs/src/components/Example/Example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Box } from "@einride/ui" | ||
import { forwardRef } from "react" | ||
|
||
export interface ExampleProps { | ||
/** Example prop. */ | ||
background?: "secondary" | "tertiary" | ||
} | ||
|
||
/** An example component. */ | ||
export const Example = forwardRef<HTMLDivElement, ExampleProps>( | ||
({ background = "secondary", ...props }, ref) => { | ||
return ( | ||
<Box background={background} {...props} ref={ref}> | ||
Example | ||
</Box> | ||
) | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import "@emotion/react" | ||
import type { Theme as EinrideTheme } from "../lib/theme/types" | ||
|
||
declare module "@emotion/react" { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface Theme extends EinrideTheme {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"noEmit": false, | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
}, | ||
"include": ["./src"], | ||
"exclude": ["**/*.stories.tsx", "**/*.test.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"composite": true, | ||
"moduleResolution": "node", | ||
"rootDir": "./src", | ||
"paths": { | ||
"@einride/ui": ["../einride-ui/src"] | ||
} | ||
}, | ||
"references": [{ "path": "../einride-ui" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters