@grantcodes/ui 2.1.1 → 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 +29 -0
- package/css-import-attributes.d.ts +13 -0
- package/package.json +29 -4
- package/src/components/accordion/accordion.component.js +3 -2
- package/src/components/accordion/{accordion.styles.js → accordion.css} +0 -7
- package/src/components/accordion/accordion.react.js +9 -0
- package/src/components/app-bar/app-bar.component.js +7 -5
- package/src/components/app-bar/{app-bar.styles.js → app-bar.css} +0 -7
- package/src/components/app-bar/app-bar.react.js +12 -0
- package/src/components/avatar/avatar.component.js +1 -1
- package/src/components/avatar/{avatar.styles.js → avatar.css} +0 -4
- package/src/components/avatar/avatar.react.js +9 -0
- package/src/components/badge/badge.component.js +5 -4
- package/src/components/badge/badge.css +87 -0
- package/src/components/badge/badge.react.js +9 -0
- package/src/components/breadcrumb/breadcrumb.component.js +4 -3
- package/src/components/breadcrumb/{breadcrumb.styles.js → breadcrumb.css} +0 -7
- package/src/components/breadcrumb/breadcrumb.react.js +15 -0
- package/src/components/button/button.component.js +3 -2
- package/src/components/button/button.css +62 -0
- package/src/components/button/button.react.js +9 -0
- package/src/components/button-group/button-group.component.js +1 -1
- package/src/components/button-group/{button-group.styles.js → button-group.css} +0 -4
- package/src/components/button-group/button-group.react.js +9 -0
- package/src/components/card/card.component.js +1 -1
- package/src/components/card/{card.styles.js → card.css} +0 -4
- package/src/components/card/card.react.js +9 -0
- package/src/components/code-preview/code-preview.component.js +1 -1
- package/src/components/code-preview/{code-preview.styles.js → code-preview.css} +0 -4
- package/src/components/code-preview/code-preview.react.js +9 -0
- package/src/components/container/container.component.js +5 -4
- package/src/components/container/{container.styles.js → container.css} +0 -8
- package/src/components/container/container.react.js +9 -0
- package/src/components/cta/cta.component.js +1 -1
- package/src/components/cta/{cta.styles.js → cta.css} +0 -4
- package/src/components/cta/cta.react.js +9 -0
- package/src/components/dialog/dialog.component.js +1 -1
- package/src/components/dialog/{dialog.styles.js → dialog.css} +0 -4
- package/src/components/dialog/dialog.react.js +9 -0
- package/src/components/dropdown/dropdown.component.js +1 -1
- package/src/components/dropdown/{dropdown.styles.js → dropdown.css} +0 -4
- package/src/components/dropdown/dropdown.react.js +21 -0
- package/src/components/dropzone/dropzone.component.js +5 -4
- package/src/components/dropzone/{dropzone.styles.js → dropzone.css} +0 -4
- package/src/components/dropzone/dropzone.react.js +9 -0
- package/src/components/feature-list/feature-list.component.js +1 -1
- package/src/components/feature-list/{feature-list.styles.js → feature-list.css} +0 -4
- package/src/components/feature-list/feature-list.react.js +9 -0
- package/src/components/footer/footer-column.component.js +1 -1
- package/src/components/footer/{footer-column.styles.js → footer-column.css} +0 -4
- package/src/components/footer/footer.component.js +1 -1
- package/src/components/footer/{footer.styles.js → footer.css} +0 -4
- package/src/components/footer/footer.react.js +15 -0
- package/src/components/form-field/form-field.component.js +12 -22
- package/src/components/form-field/{form-field.styles.js → form-field.css} +0 -4
- package/src/components/form-field/form-field.react.js +9 -0
- package/src/components/gallery/gallery-image.component.js +1 -1
- package/src/components/gallery/gallery-image.react.js +9 -0
- package/src/components/gallery/gallery.component.js +1 -1
- package/src/components/gallery/{gallery.styles.js → gallery.css} +0 -4
- package/src/components/gallery/gallery.react.js +9 -0
- package/src/components/hero/hero.component.js +1 -1
- package/src/components/hero/{hero.styles.js → hero.css} +0 -4
- package/src/components/hero/hero.react.js +9 -0
- package/src/components/icon/icon.component.js +1 -1
- package/src/components/icon/{icon.styles.js → icon.css} +0 -4
- package/src/components/icon/icon.react.js +9 -0
- package/src/components/loading/loading.component.js +1 -1
- package/src/components/loading/{loading.styles.js → loading.css} +0 -4
- package/src/components/loading/loading.react.js +9 -0
- package/src/components/logo-cloud/logo-cloud.component.js +1 -1
- package/src/components/logo-cloud/{logo-cloud.styles.js → logo-cloud.css} +0 -4
- package/src/components/logo-cloud/logo-cloud.react.js +9 -0
- package/src/components/media-text/media-text.component.js +1 -1
- package/src/components/media-text/{media-text.styles.js → media-text.css} +0 -4
- package/src/components/media-text/media-text.react.js +9 -0
- package/src/components/newsletter/newsletter.component.js +1 -1
- package/src/components/newsletter/{newsletter.styles.js → newsletter.css} +0 -4
- package/src/components/newsletter/newsletter.react.js +9 -0
- package/src/components/notice/notice.component.js +7 -3
- package/src/components/notice/{notice.styles.js → notice.css} +0 -4
- package/src/components/notice/notice.react.js +9 -0
- package/src/components/pagination/pagination.component.js +1 -1
- package/src/components/pagination/{pagination.styles.js → pagination.css} +0 -4
- package/src/components/pagination/pagination.react.js +9 -0
- package/src/components/pricing/pricing.component.js +1 -1
- package/src/components/pricing/{pricing.styles.js → pricing.css} +0 -4
- package/src/components/pricing/pricing.react.js +9 -0
- package/src/components/sidebar/sidebar.component.js +7 -5
- package/src/components/sidebar/{sidebar.styles.js → sidebar.css} +0 -7
- package/src/components/sidebar/sidebar.react.js +13 -0
- package/src/components/stats/stats.component.js +1 -1
- package/src/components/stats/{stats.styles.js → stats.css} +0 -4
- package/src/components/stats/stats.react.js +9 -0
- package/src/components/tabs/internal/tabs-button.component.js +3 -2
- package/src/components/tabs/internal/tabs-button.react.js +9 -0
- package/src/components/tabs/tab.component.js +3 -2
- package/src/components/tabs/tab.react.js +9 -0
- package/src/components/tabs/tabs.component.js +3 -2
- package/src/components/tabs/{tabs.styles.js → tabs.css} +0 -7
- package/src/components/tabs/tabs.react.js +9 -0
- package/src/components/testimonials/testimonials.component.js +1 -1
- package/src/components/testimonials/{testimonials.styles.js → testimonials.css} +0 -4
- package/src/components/testimonials/testimonials.react.js +9 -0
- package/src/components/toast/toast.component.js +11 -8
- package/src/components/toast/{toast.styles.js → toast.css} +0 -7
- package/src/components/toast/toast.react.js +18 -0
- package/src/components/tooltip/tooltip.component.js +1 -1
- package/src/components/tooltip/{tooltip.styles.js → tooltip.css} +1 -6
- package/src/components/tooltip/tooltip.react.js +9 -0
- package/src/exports.test.js +119 -0
- package/src/lib/styles/focus-ring.css +30 -0
- package/src/react.js +36 -0
- package/src/react.test.js +56 -0
- package/vite-plugin-css-import-attributes.js +96 -0
- package/src/components/badge/badge.styles.js +0 -91
- package/src/components/button/button.styles.js +0 -69
- package/src/lib/classnames.js +0 -61
- package/src/lib/styles/focus-ring.styles.js +0 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import containerStyles from "./container.css" with { type: "css" };
|
|
5
5
|
|
|
6
6
|
export class GrantCodesContainer extends LitElement {
|
|
7
7
|
// Styles are scoped to this element: they won't conflict with styles
|
|
@@ -22,7 +22,8 @@ export class GrantCodesContainer extends LitElement {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
render() {
|
|
25
|
-
const
|
|
25
|
+
const classes = classMap({
|
|
26
|
+
container: true,
|
|
26
27
|
"container--wide": this.align === "wide",
|
|
27
28
|
"container--full": this.align === "full",
|
|
28
29
|
"container--prose": this.align === "prose",
|
|
@@ -31,7 +32,7 @@ export class GrantCodesContainer extends LitElement {
|
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
return html`
|
|
34
|
-
<div class
|
|
35
|
+
<div class=${classes}>
|
|
35
36
|
<slot></slot>
|
|
36
37
|
</div>
|
|
37
38
|
`;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
|
|
3
|
-
export const containerStyles = css`
|
|
4
1
|
.container {
|
|
5
2
|
display: flex;
|
|
6
3
|
flex-direction: column;
|
|
@@ -29,10 +26,6 @@ export const containerStyles = css`
|
|
|
29
26
|
inset-inline-start: 50%;
|
|
30
27
|
position: relative;
|
|
31
28
|
inset-inline-end: 50%;
|
|
32
|
-
margin-inline-start: -50vw;
|
|
33
|
-
margin-inline-end: -50vw;
|
|
34
|
-
max-inline-size: 100vw;
|
|
35
|
-
inline-size: 100vw;
|
|
36
29
|
margin-inline-start: -50dvw;
|
|
37
30
|
margin-inline-end: -50dvw;
|
|
38
31
|
max-inline-size: 100dvw;
|
|
@@ -42,4 +35,3 @@ export const containerStyles = css`
|
|
|
42
35
|
.container--nopad {
|
|
43
36
|
padding-inline: 0;
|
|
44
37
|
}
|
|
45
|
-
`;
|
|
@@ -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
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import dialogStyles from "./dialog.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesDialog extends LitElement {
|
|
6
6
|
// Styles are scoped to this element: they won't conflict with styles
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
3
|
import { generateId } from "../../lib/generate-id.js";
|
|
4
|
-
import
|
|
4
|
+
import dropdownStyles from "./dropdown.css" with { type: "css" };
|
|
5
5
|
|
|
6
6
|
export class GrantCodesDropdown extends LitElement {
|
|
7
7
|
static styles = [dropdownStyles];
|
|
@@ -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
|
+
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import dropzoneStyles from "./dropzone.css" with { type: "css" };
|
|
5
5
|
|
|
6
6
|
export class GrantCodesDropzone extends LitElement {
|
|
7
7
|
static styles = [dropzoneStyles];
|
|
@@ -121,13 +121,14 @@ export class GrantCodesDropzone extends LitElement {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
render() {
|
|
124
|
-
const
|
|
124
|
+
const classes = classMap({
|
|
125
|
+
dropzone: true,
|
|
125
126
|
"dropzone--fullscreen": this._fullscreen,
|
|
126
127
|
});
|
|
127
128
|
|
|
128
129
|
return html`
|
|
129
130
|
<div
|
|
130
|
-
class=${
|
|
131
|
+
class=${classes}
|
|
131
132
|
@mouseleave=${this._forceDisableFullscreen}
|
|
132
133
|
@dragend=${this._disableFullscreen}
|
|
133
134
|
@dragleave=${this._disableFullscreen}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
3
3
|
import * as icons from "lucide-static";
|
|
4
|
-
import
|
|
4
|
+
import featureListStyles from "./feature-list.css" with { type: "css" };
|
|
5
5
|
import "../icon/icon.js";
|
|
6
6
|
|
|
7
7
|
export class GrantCodesFeatureList extends LitElement {
|
|
@@ -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
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import footerColumnStyles from "./footer-column.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesFooterColumn extends LitElement {
|
|
6
6
|
static styles = [footerColumnStyles];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import footerStyles from "./footer.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesFooter extends LitElement {
|
|
6
6
|
static styles = [footerStyles];
|
|
@@ -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
|
+
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import formFieldStyles from "./form-field.css" with { type: "css" };
|
|
4
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
5
5
|
import { generateId } from "../../lib/generate-id.js";
|
|
6
6
|
|
|
7
7
|
export class GrantCodesFormField extends LitElement {
|
|
@@ -129,34 +129,24 @@ export class GrantCodesFormField extends LitElement {
|
|
|
129
129
|
`;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
/**
|
|
133
|
-
* Template for a group of form components
|
|
134
|
-
*
|
|
135
|
-
* @param {string} className html class attribute
|
|
136
|
-
*
|
|
137
|
-
* @return {} [return description]
|
|
138
|
-
*/
|
|
139
|
-
groupTemplate(className) {
|
|
140
|
-
return html`
|
|
141
|
-
<fieldset class="${className}">
|
|
142
|
-
<legend class="form-field__label">${this.label}</legend>
|
|
143
|
-
<slot></slot>
|
|
144
|
-
${this.errorTemplate()}
|
|
145
|
-
</fieldset>
|
|
146
|
-
`;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
132
|
render() {
|
|
150
|
-
const
|
|
133
|
+
const classes = classMap({
|
|
134
|
+
"form-field": true,
|
|
151
135
|
"form-field--inline": this.inlineInput,
|
|
152
136
|
});
|
|
153
137
|
|
|
154
138
|
if (this.groupInput) {
|
|
155
|
-
return
|
|
139
|
+
return html`
|
|
140
|
+
<fieldset class=${classes}>
|
|
141
|
+
<legend class="form-field__label">${this.label}</legend>
|
|
142
|
+
<slot></slot>
|
|
143
|
+
${this.errorTemplate()}
|
|
144
|
+
</fieldset>
|
|
145
|
+
`;
|
|
156
146
|
}
|
|
157
147
|
|
|
158
148
|
return html`
|
|
159
|
-
<div class
|
|
149
|
+
<div class=${classes}>
|
|
160
150
|
<label>
|
|
161
151
|
<span class="form-field__label" @click=${this.handleLabelClick}
|
|
162
152
|
>${this.label}</span
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
|
|
3
|
-
export const formFieldStyles = css`
|
|
4
1
|
.form-field {
|
|
5
2
|
display: flex;
|
|
6
3
|
flex-direction: column;
|
|
@@ -42,4 +39,3 @@ export const formFieldStyles = css`
|
|
|
42
39
|
font-size: var(--g-theme-typography-body-sm-font-size);
|
|
43
40
|
color: var(--g-color-utility-red-700);
|
|
44
41
|
}
|
|
45
|
-
`;
|
|
@@ -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
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import galleryStyles from "./gallery.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesGalleryImage extends LitElement {
|
|
6
6
|
static styles = [galleryStyles];
|
|
@@ -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
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import galleryStyles from "./gallery.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesGallery extends LitElement {
|
|
6
6
|
// Styles are scoped to this element: they won't conflict with styles
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import iconStyles from "./icon.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesIcon extends LitElement {
|
|
6
6
|
// Styles are scoped to this element: they won't conflict with styles
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import loadingStyles from "./loading.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesLoading extends LitElement {
|
|
6
6
|
// Styles are scoped to this element: they won't conflict with styles
|
|
@@ -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
|
+
})
|