@grantcodes/ui 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +14 -1
- package/src/components/accordion/accordion.react.js +9 -0
- package/src/components/app-bar/app-bar.react.js +12 -0
- package/src/components/avatar/avatar.react.js +9 -0
- package/src/components/badge/badge.react.js +9 -0
- package/src/components/breadcrumb/breadcrumb.react.js +15 -0
- package/src/components/button/button.react.js +9 -0
- package/src/components/button-group/button-group.react.js +9 -0
- package/src/components/card/card.react.js +9 -0
- package/src/components/code-preview/code-preview.react.js +9 -0
- package/src/components/container/container.react.js +9 -0
- package/src/components/cta/cta.react.js +9 -0
- package/src/components/dialog/dialog.react.js +9 -0
- package/src/components/dropdown/dropdown.react.js +21 -0
- package/src/components/dropzone/dropzone.react.js +9 -0
- package/src/components/feature-list/feature-list.react.js +9 -0
- package/src/components/footer/footer.react.js +15 -0
- package/src/components/form-field/form-field.react.js +9 -0
- package/src/components/gallery/gallery-image.react.js +9 -0
- package/src/components/gallery/gallery.react.js +9 -0
- package/src/components/hero/hero.react.js +9 -0
- package/src/components/icon/icon.react.js +9 -0
- package/src/components/loading/loading.react.js +9 -0
- package/src/components/logo-cloud/logo-cloud.react.js +9 -0
- package/src/components/media-text/media-text.react.js +9 -0
- package/src/components/newsletter/newsletter.react.js +9 -0
- package/src/components/notice/notice.react.js +9 -0
- package/src/components/pagination/pagination.react.js +9 -0
- package/src/components/pricing/pricing.react.js +9 -0
- package/src/components/sidebar/sidebar.react.js +13 -0
- package/src/components/stats/stats.react.js +9 -0
- package/src/components/tabs/internal/tabs-button.react.js +9 -0
- package/src/components/tabs/tab.react.js +9 -0
- package/src/components/tabs/tabs.react.js +9 -0
- package/src/components/testimonials/testimonials.react.js +9 -0
- package/src/components/toast/toast.react.js +18 -0
- package/src/components/tooltip/tooltip.react.js +9 -0
- package/src/react.js +36 -0
- package/src/react.test.js +56 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.0](https://github.com/grantcodes/ui/compare/ui-v2.2.0...ui-v2.3.0) (2026-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **01-01:** create React wrapper components for all Lit web components ([f5d47a7](https://github.com/grantcodes/ui/commit/f5d47a7e1dc45d5d5f21823dcba59c687feed56f))
|
|
9
|
+
* **ui:** add react exports ([f040673](https://github.com/grantcodes/ui/commit/f04067332e5d70803d6f72aade875f08ad05e090))
|
|
10
|
+
|
|
3
11
|
## [2.2.0](https://github.com/grantcodes/ui/compare/ui-v2.1.1...ui-v2.2.0) (2026-03-25)
|
|
4
12
|
|
|
5
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantcodes/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A personal component system built with Lit web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
"require": "./src/components/*"
|
|
34
34
|
},
|
|
35
35
|
"./fonts/*": "./src/fonts/*",
|
|
36
|
+
"./react": {
|
|
37
|
+
"import": "./src/react.js"
|
|
38
|
+
},
|
|
36
39
|
"./css-import-attributes": {
|
|
37
40
|
"types": "./css-import-attributes.d.ts"
|
|
38
41
|
},
|
|
@@ -40,6 +43,7 @@
|
|
|
40
43
|
},
|
|
41
44
|
"license": "MIT",
|
|
42
45
|
"dependencies": {
|
|
46
|
+
"@lit/react": "^1.0.8",
|
|
43
47
|
"lit": "^3.3.1",
|
|
44
48
|
"sanitize.css": "^13.0.0",
|
|
45
49
|
"shiki": "^3.17.1",
|
|
@@ -64,6 +68,7 @@
|
|
|
64
68
|
"lucide-static": "^0.555.0",
|
|
65
69
|
"npm-run-all": "^4.1.5",
|
|
66
70
|
"plop": "^4.0.4",
|
|
71
|
+
"react": "^19.2.4",
|
|
67
72
|
"storybook": "^10.1.4",
|
|
68
73
|
"vite": "^7.2.6"
|
|
69
74
|
},
|
|
@@ -77,6 +82,14 @@
|
|
|
77
82
|
"LICENCE"
|
|
78
83
|
],
|
|
79
84
|
"customElements": "custom-elements.json",
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
87
|
+
},
|
|
88
|
+
"peerDependenciesMeta": {
|
|
89
|
+
"react": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
80
93
|
"scripts": {
|
|
81
94
|
"dev": "storybook dev -p 6006",
|
|
82
95
|
"watch": "vite build --watch",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesAccordion } from "./accordion.js"
|
|
4
|
+
|
|
5
|
+
export const Accordion = createComponent({
|
|
6
|
+
tagName: "grantcodes-accordion",
|
|
7
|
+
elementClass: GrantCodesAccordion,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesAppBar } from "./app-bar.js"
|
|
4
|
+
|
|
5
|
+
export const AppBar = createComponent({
|
|
6
|
+
tagName: "grantcodes-app-bar",
|
|
7
|
+
elementClass: GrantCodesAppBar,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onMenuToggle: "menu-toggle",
|
|
11
|
+
},
|
|
12
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesBreadcrumb, GrantCodesBreadcrumbItem } from "./breadcrumb.js"
|
|
4
|
+
|
|
5
|
+
export const Breadcrumb = createComponent({
|
|
6
|
+
tagName: "grantcodes-breadcrumb",
|
|
7
|
+
elementClass: GrantCodesBreadcrumb,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const BreadcrumbItem = createComponent({
|
|
12
|
+
tagName: "grantcodes-breadcrumb-item",
|
|
13
|
+
elementClass: GrantCodesBreadcrumbItem,
|
|
14
|
+
react: React,
|
|
15
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesButtonGroup } from "./button-group.js"
|
|
4
|
+
|
|
5
|
+
export const ButtonGroup = createComponent({
|
|
6
|
+
tagName: "grantcodes-button-group",
|
|
7
|
+
elementClass: GrantCodesButtonGroup,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesCodePreview } from "./code-preview.js"
|
|
4
|
+
|
|
5
|
+
export const CodePreview = createComponent({
|
|
6
|
+
tagName: "grantcodes-code-preview",
|
|
7
|
+
elementClass: GrantCodesCodePreview,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesContainer } from "./container.js"
|
|
4
|
+
|
|
5
|
+
export const Container = createComponent({
|
|
6
|
+
tagName: "grantcodes-container",
|
|
7
|
+
elementClass: GrantCodesContainer,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesDropdown, GrantCodesDropdownItem } from "./dropdown.js"
|
|
4
|
+
|
|
5
|
+
export const Dropdown = createComponent({
|
|
6
|
+
tagName: "grantcodes-dropdown",
|
|
7
|
+
elementClass: GrantCodesDropdown,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onToggle: "toggle",
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const DropdownItem = createComponent({
|
|
15
|
+
tagName: "grantcodes-dropdown-item",
|
|
16
|
+
elementClass: GrantCodesDropdownItem,
|
|
17
|
+
react: React,
|
|
18
|
+
events: {
|
|
19
|
+
onSelect: "select",
|
|
20
|
+
},
|
|
21
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesFeatureList } from "./feature-list.js"
|
|
4
|
+
|
|
5
|
+
export const FeatureList = createComponent({
|
|
6
|
+
tagName: "grantcodes-feature-list",
|
|
7
|
+
elementClass: GrantCodesFeatureList,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesFooter, GrantCodesFooterColumn } from "./footer.js"
|
|
4
|
+
|
|
5
|
+
export const Footer = createComponent({
|
|
6
|
+
tagName: "grantcodes-footer",
|
|
7
|
+
elementClass: GrantCodesFooter,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const FooterColumn = createComponent({
|
|
12
|
+
tagName: "grantcodes-footer-column",
|
|
13
|
+
elementClass: GrantCodesFooterColumn,
|
|
14
|
+
react: React,
|
|
15
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesFormField } from "./form-field.js"
|
|
4
|
+
|
|
5
|
+
export const FormField = createComponent({
|
|
6
|
+
tagName: "grantcodes-form-field",
|
|
7
|
+
elementClass: GrantCodesFormField,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesGalleryImage } from "./gallery-image.js"
|
|
4
|
+
|
|
5
|
+
export const GalleryImage = createComponent({
|
|
6
|
+
tagName: "grantcodes-gallery-image",
|
|
7
|
+
elementClass: GrantCodesGalleryImage,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesLogoCloud } from "./logo-cloud.js"
|
|
4
|
+
|
|
5
|
+
export const LogoCloud = createComponent({
|
|
6
|
+
tagName: "grantcodes-logo-cloud",
|
|
7
|
+
elementClass: GrantCodesLogoCloud,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesMediaText } from "./media-text.js"
|
|
4
|
+
|
|
5
|
+
export const MediaText = createComponent({
|
|
6
|
+
tagName: "grantcodes-media-text",
|
|
7
|
+
elementClass: GrantCodesMediaText,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesNewsletter } from "./newsletter.js"
|
|
4
|
+
|
|
5
|
+
export const Newsletter = createComponent({
|
|
6
|
+
tagName: "grantcodes-newsletter",
|
|
7
|
+
elementClass: GrantCodesNewsletter,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesPagination } from "./pagination.js"
|
|
4
|
+
|
|
5
|
+
export const Pagination = createComponent({
|
|
6
|
+
tagName: "grantcodes-pagination",
|
|
7
|
+
elementClass: GrantCodesPagination,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesSidebar } from "./sidebar.js"
|
|
4
|
+
|
|
5
|
+
export const Sidebar = createComponent({
|
|
6
|
+
tagName: "grantcodes-sidebar",
|
|
7
|
+
elementClass: GrantCodesSidebar,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onToggle: "toggle",
|
|
11
|
+
onDrawerToggle: "drawer-toggle",
|
|
12
|
+
},
|
|
13
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesTabsButton } from "./tabs-button.js"
|
|
4
|
+
|
|
5
|
+
export const TabsButton = createComponent({
|
|
6
|
+
tagName: "grantcodes-tabs-button",
|
|
7
|
+
elementClass: GrantCodesTabsButton,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesTestimonials } from "./testimonials.js"
|
|
4
|
+
|
|
5
|
+
export const Testimonials = createComponent({
|
|
6
|
+
tagName: "grantcodes-testimonials",
|
|
7
|
+
elementClass: GrantCodesTestimonials,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { createComponent } from "@lit/react"
|
|
3
|
+
import { GrantCodesToast, GrantCodesToastContainer } from "./toast.js"
|
|
4
|
+
|
|
5
|
+
export const Toast = createComponent({
|
|
6
|
+
tagName: "grantcodes-toast",
|
|
7
|
+
elementClass: GrantCodesToast,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onDismiss: "dismiss",
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const ToastContainer = createComponent({
|
|
15
|
+
tagName: "grantcodes-toast-container",
|
|
16
|
+
elementClass: GrantCodesToastContainer,
|
|
17
|
+
react: React,
|
|
18
|
+
})
|
package/src/react.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { Accordion } from "./components/accordion/accordion.react.js"
|
|
2
|
+
export { AppBar } from "./components/app-bar/app-bar.react.js"
|
|
3
|
+
export { Avatar } from "./components/avatar/avatar.react.js"
|
|
4
|
+
export { Badge } from "./components/badge/badge.react.js"
|
|
5
|
+
export { Breadcrumb, BreadcrumbItem } from "./components/breadcrumb/breadcrumb.react.js"
|
|
6
|
+
export { Button } from "./components/button/button.react.js"
|
|
7
|
+
export { ButtonGroup } from "./components/button-group/button-group.react.js"
|
|
8
|
+
export { Card } from "./components/card/card.react.js"
|
|
9
|
+
export { CodePreview } from "./components/code-preview/code-preview.react.js"
|
|
10
|
+
export { Container } from "./components/container/container.react.js"
|
|
11
|
+
export { Cta } from "./components/cta/cta.react.js"
|
|
12
|
+
export { Dialog } from "./components/dialog/dialog.react.js"
|
|
13
|
+
export { Dropdown, DropdownItem } from "./components/dropdown/dropdown.react.js"
|
|
14
|
+
export { Dropzone } from "./components/dropzone/dropzone.react.js"
|
|
15
|
+
export { FeatureList } from "./components/feature-list/feature-list.react.js"
|
|
16
|
+
export { Footer, FooterColumn } from "./components/footer/footer.react.js"
|
|
17
|
+
export { FormField } from "./components/form-field/form-field.react.js"
|
|
18
|
+
export { Gallery } from "./components/gallery/gallery.react.js"
|
|
19
|
+
export { GalleryImage } from "./components/gallery/gallery-image.react.js"
|
|
20
|
+
export { Hero } from "./components/hero/hero.react.js"
|
|
21
|
+
export { Icon } from "./components/icon/icon.react.js"
|
|
22
|
+
export { Loading } from "./components/loading/loading.react.js"
|
|
23
|
+
export { LogoCloud } from "./components/logo-cloud/logo-cloud.react.js"
|
|
24
|
+
export { MediaText } from "./components/media-text/media-text.react.js"
|
|
25
|
+
export { Newsletter } from "./components/newsletter/newsletter.react.js"
|
|
26
|
+
export { Notice } from "./components/notice/notice.react.js"
|
|
27
|
+
export { Pagination } from "./components/pagination/pagination.react.js"
|
|
28
|
+
export { Pricing } from "./components/pricing/pricing.react.js"
|
|
29
|
+
export { Sidebar } from "./components/sidebar/sidebar.react.js"
|
|
30
|
+
export { Stats } from "./components/stats/stats.react.js"
|
|
31
|
+
export { Tab } from "./components/tabs/tab.react.js"
|
|
32
|
+
export { Tabs } from "./components/tabs/tabs.react.js"
|
|
33
|
+
export { TabsButton } from "./components/tabs/internal/tabs-button.react.js"
|
|
34
|
+
export { Testimonials } from "./components/testimonials/testimonials.react.js"
|
|
35
|
+
export { Toast, ToastContainer } from "./components/toast/toast.react.js"
|
|
36
|
+
export { Tooltip } from "./components/tooltip/tooltip.react.js"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import { strict as assert } from "node:assert";
|
|
3
|
+
|
|
4
|
+
describe("React Wrappers", () => {
|
|
5
|
+
it("should export all component wrappers", async () => {
|
|
6
|
+
const react = await import("./react.js");
|
|
7
|
+
assert.ok(react.Button, "Button wrapper should be exported");
|
|
8
|
+
assert.ok(react.Card, "Card wrapper should be exported");
|
|
9
|
+
assert.ok(react.Dialog, "Dialog wrapper should be exported");
|
|
10
|
+
assert.ok(react.Accordion, "Accordion wrapper should be exported");
|
|
11
|
+
assert.ok(react.Tooltip, "Tooltip wrapper should be exported");
|
|
12
|
+
assert.ok(react.Hero, "Hero wrapper should be exported");
|
|
13
|
+
assert.ok(react.Container, "Container wrapper should be exported");
|
|
14
|
+
assert.ok(react.Icon, "Icon wrapper should be exported");
|
|
15
|
+
assert.ok(react.Loading, "Loading wrapper should be exported");
|
|
16
|
+
assert.ok(react.Notice, "Notice wrapper should be exported");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should export at least 35 component wrappers", async () => {
|
|
20
|
+
const react = await import("./react.js");
|
|
21
|
+
const exportCount = Object.keys(react).length;
|
|
22
|
+
assert.ok(
|
|
23
|
+
exportCount >= 35,
|
|
24
|
+
`Expected at least 35 exports, got ${exportCount}`,
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should export event-mapped components", async () => {
|
|
29
|
+
const react = await import("./react.js");
|
|
30
|
+
assert.ok(react.AppBar, "AppBar wrapper should be exported");
|
|
31
|
+
assert.ok(react.Dropdown, "Dropdown wrapper should be exported");
|
|
32
|
+
assert.ok(react.DropdownItem, "DropdownItem wrapper should be exported");
|
|
33
|
+
assert.ok(react.Sidebar, "Sidebar wrapper should be exported");
|
|
34
|
+
assert.ok(react.Toast, "Toast wrapper should be exported");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("should export compound component wrappers", async () => {
|
|
38
|
+
const react = await import("./react.js");
|
|
39
|
+
assert.ok(react.Breadcrumb, "Breadcrumb wrapper should be exported");
|
|
40
|
+
assert.ok(
|
|
41
|
+
react.BreadcrumbItem,
|
|
42
|
+
"BreadcrumbItem wrapper should be exported",
|
|
43
|
+
);
|
|
44
|
+
assert.ok(react.Footer, "Footer wrapper should be exported");
|
|
45
|
+
assert.ok(react.FooterColumn, "FooterColumn wrapper should be exported");
|
|
46
|
+
assert.ok(react.Gallery, "Gallery wrapper should be exported");
|
|
47
|
+
assert.ok(react.GalleryImage, "GalleryImage wrapper should be exported");
|
|
48
|
+
assert.ok(react.Tabs, "Tabs wrapper should be exported");
|
|
49
|
+
assert.ok(react.Tab, "Tab wrapper should be exported");
|
|
50
|
+
assert.ok(react.TabsButton, "TabsButton wrapper should be exported");
|
|
51
|
+
assert.ok(
|
|
52
|
+
react.ToastContainer,
|
|
53
|
+
"ToastContainer wrapper should be exported",
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
});
|