Skip to content

Commit

Permalink
Merge pull request #117 from break-stuff/add-class-to-jsx-types
Browse files Browse the repository at this point in the history
Add class to jsx types
  • Loading branch information
break-stuff authored May 9, 2024
2 parents 6129520 + 4edc41c commit 160ddd8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions demo/lit-app/custom-element-jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type BaseProps = {
/** Content added between the opening and closing tags of the element */
children?: any;
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
class?: string;
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
className?: string;
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
classList?: Record<string, boolean | undefined>;
Expand Down
4 changes: 3 additions & 1 deletion packages/jsx-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CHANGELOG

## 1.3.2
## 1.4.0

- Added `class` prop back into types
- Added StackBlitz sandbox to README
- Export type of component props.

## 1.3.1
Expand Down
6 changes: 6 additions & 0 deletions packages/jsx-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ This package is designed to generate types for your custom elements in a project
![demo of autocomplete features for custom elements in a solidjs project](https://github.com/break-stuff/cem-tools/blob/main/demo/images/solid-js-integration/solid-js-integration.gif?raw=true)

<a href="https://stackblitz.com/edit/vitejs-vite-cm3xdr">
<img
alt="Open in StackBlitz"
src="https://developer.stackblitz.com/img/open_in_stackblitz.svg"
/>
</a>

## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/jsx-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-jsx-integration",
"version": "1.3.2",
"version": "1.4.0",
"description": "Tools for integrating custom elements into JSX projects",
"main": "index.js",
"module": "index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/jsx-integration/src/type-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ type BaseProps = {
/** Content added between the opening and closing tags of the element */
children?: any;
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
class?: string;
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
className?: string;
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
classList?: Record<string, boolean | undefined>;
Expand Down

0 comments on commit 160ddd8

Please sign in to comment.