We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to set up a TypeScript/React project and use leonardo-contrast-colors module but I can't import any of the exports.
leonardo-contrast-colors
Apparently this import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors"; points to index.d.ts rather than index.js.
import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors";
index.d.ts
index.js
I wonder if this is a problem with the package or my project configuration. I can't figure it out.
This is my tsconfig.json:
{ "compilerOptions": { "allowJs": true, "esModuleInterop": true, "target": "ES2015", "jsx": "react", "typeRoots": ["./node_modules/@types"], "module": "ESNext", "moduleResolution": "Node", "skipLibCheck": true, "allowSyntheticDefaultImports": true, "sourceMap": true }, "include": ["src/**/*.ts", "src/**/*.tsx"] }
npm install @adobe/[email protected]
Then in the code I do the following according to the example in the README.md:
import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors"; let gray = new BackgroundColor({ name: "gray", colorKeys: ["#cacaca"], ratios: [2, 3, 4.5, 8], }); let blue = new Color({ name: "blue", colorKeys: ["#5CDBFF", "#0000FF"], ratios: [3, 4.5], }); let red = new Color({ name: "red", colorKeys: ["#FF9A81", "#FF0000"], ratios: [3, 4.5], }); let theme = new Theme({ colors: [gray, blue, red], backgroundColor: gray, lightness: 97, });
but I get this error: Module '"@adobe/leonardo-contrast-colors"' has no exported member 'BackgroundColor'.
import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors"; should import BackgroundColor, Color, Theme
Tried using both 1.0.0-alpha.13 and 1.0.0-alpha.16 According to #173 the latest release is broken.
Mac OS
The text was updated successfully, but these errors were encountered:
@pabloromeroelux this issue I believe relates to #143 as Leonardo currently does not have Typescript support
Sorry, something went wrong.
Just ran into this for nth time with version ^1.0.0-alpha.17
https://stackblitz.com/edit/vitejs-vite-eaduzs?file=main.js
I also ran into this today. Like the above example with stackblitz, I was using vite with no other dependencies
Successfully merging a pull request may close this issue.
Description
I'm trying to set up a TypeScript/React project and use
leonardo-contrast-colors
module but I can't import any of the exports.Apparently this
import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors";
points toindex.d.ts
rather thanindex.js
.I wonder if this is a problem with the package or my project configuration. I can't figure it out.
This is my tsconfig.json:
Steps to reproduce
npm install @adobe/[email protected]
Then in the code I do the following according to the example in the README.md:
but I get this error:
Module '"@adobe/leonardo-contrast-colors"' has no exported member 'BackgroundColor'.
Expected behavior
import { BackgroundColor, Color, Theme } from "@adobe/leonardo-contrast-colors";
should import BackgroundColor, Color, ThemeLeonardo package and version
Tried using both 1.0.0-alpha.13 and 1.0.0-alpha.16
According to #173 the latest release is broken.
Environment
Mac OS
The text was updated successfully, but these errors were encountered: