@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
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
|
+
|
|
11
|
+
## [2.2.0](https://github.com/grantcodes/ui/compare/ui-v2.1.1...ui-v2.2.0) (2026-03-25)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **01-01:** configure Vite and Storybook for CSS import attributes ([039436c](https://github.com/grantcodes/ui/commit/039436c20b160f1889944df02cab958641e768fe))
|
|
17
|
+
* **02-01:** migrate button component to CSS import attributes with shared focus-ring ([a579ffd](https://github.com/grantcodes/ui/commit/a579ffd08916b37050d46ef459c458c1474567f9))
|
|
18
|
+
* **02-01:** migrate focus-ring and badge to CSS import attributes ([becaad7](https://github.com/grantcodes/ui/commit/becaad7eed6ea0f233deb675b07edf1109840925))
|
|
19
|
+
* **02-01:** update button to use #styles alias for focus-ring import ([6d1be3d](https://github.com/grantcodes/ui/commit/6d1be3db08f0575288436dc0eff25517060b1f1e))
|
|
20
|
+
* **03-01:** migrate all 31 remaining components to CSS import attributes ([89eb3cd](https://github.com/grantcodes/ui/commit/89eb3cdbddf200dac6b606eba28f3f5f99bb663d))
|
|
21
|
+
* **04-01:** add explicit CSS subpath exports for all components ([348746f](https://github.com/grantcodes/ui/commit/348746f0cf2b6de049b6ec20b6ed0887ed5dadfd))
|
|
22
|
+
* **ui:** add Lit CSSResult for SSR and TypeScript declarations ([bada435](https://github.com/grantcodes/ui/commit/bada435b8dcd0fbfae75310e32c1e152ca736d84))
|
|
23
|
+
* **ui:** migrate CSS styles from JS to CSS import attributes ([b9cac40](https://github.com/grantcodes/ui/commit/b9cac406ab902b3837a39b184d683849fe242402))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **04-01:** remove unused import in exports test ([ab70a17](https://github.com/grantcodes/ui/commit/ab70a1759545d837169d10eebe4c4da7e9387e59))
|
|
29
|
+
* **ui:** add SSR-safe CSSStyleSheet guard and Astro vite plugin ([b75bddc](https://github.com/grantcodes/ui/commit/b75bddc7315107fe6f84f17f7320efb699f40f45))
|
|
30
|
+
* **ui:** extract CSS import attributes plugin and fix Storybook compatibility ([5c282fc](https://github.com/grantcodes/ui/commit/5c282fc82387ef8278bb9273bf3b3522c3c7226b))
|
|
31
|
+
|
|
3
32
|
## [2.1.1](https://github.com/grantcodes/ui/compare/ui-v2.1.0...ui-v2.1.1) (2026-03-15)
|
|
4
33
|
|
|
5
34
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for CSS files imported with `{ type: "css" }`.
|
|
3
|
+
*
|
|
4
|
+
* Usage: Add to your tsconfig.json compilerOptions.types or reference directly:
|
|
5
|
+
* /// <reference types="@grantcodes/ui/css-import-attributes" />
|
|
6
|
+
*
|
|
7
|
+
* At build time, the Vite plugin returns a CSSStyleSheet (client) or
|
|
8
|
+
* a Lit CSSResult (SSR). Both are accepted by Lit's `static styles`.
|
|
9
|
+
*/
|
|
10
|
+
declare module "*.css" {
|
|
11
|
+
const styles: CSSStyleSheet;
|
|
12
|
+
export default styles;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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",
|
|
7
7
|
"module": "src/main.js",
|
|
8
8
|
"types": "src/main.d.ts",
|
|
9
9
|
"author": "grantcodes",
|
|
10
|
+
"imports": {
|
|
11
|
+
"#styles/*": "./src/lib/styles/*"
|
|
12
|
+
},
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
15
|
"types": "./src/main.d.ts",
|
|
@@ -24,23 +27,34 @@
|
|
|
24
27
|
"import": "./src/css/themes/*",
|
|
25
28
|
"require": "./src/css/themes/*"
|
|
26
29
|
},
|
|
30
|
+
"./styles/focus-ring.css": "./src/lib/styles/focus-ring.css",
|
|
27
31
|
"./components/*": {
|
|
28
32
|
"import": "./src/components/*",
|
|
29
33
|
"require": "./src/components/*"
|
|
30
34
|
},
|
|
31
|
-
"./fonts/*": "./src/fonts/*"
|
|
35
|
+
"./fonts/*": "./src/fonts/*",
|
|
36
|
+
"./react": {
|
|
37
|
+
"import": "./src/react.js"
|
|
38
|
+
},
|
|
39
|
+
"./css-import-attributes": {
|
|
40
|
+
"types": "./css-import-attributes.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./vite-plugin": "./vite-plugin-css-import-attributes.js"
|
|
32
43
|
},
|
|
33
44
|
"license": "MIT",
|
|
34
45
|
"dependencies": {
|
|
46
|
+
"@lit/react": "^1.0.8",
|
|
35
47
|
"lit": "^3.3.1",
|
|
36
48
|
"sanitize.css": "^13.0.0",
|
|
37
49
|
"shiki": "^3.17.1",
|
|
38
|
-
"@grantcodes/style-dictionary": "^1.3.
|
|
50
|
+
"@grantcodes/style-dictionary": "^1.3.1"
|
|
39
51
|
},
|
|
40
52
|
"devDependencies": {
|
|
53
|
+
"@arcmantle/vite-plugin-import-css-sheet": "^1.0.12",
|
|
41
54
|
"@biomejs/biome": "2.3.8",
|
|
42
55
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
43
56
|
"@grantcodes/commit": "^2.0.0",
|
|
57
|
+
"@lit-labs/ssr-dom-shim": "^1.5.1",
|
|
44
58
|
"@playwright/test": "^1.57.0",
|
|
45
59
|
"@storybook/addon-docs": "^10.1.4",
|
|
46
60
|
"@storybook/addon-themes": "^10.1.4",
|
|
@@ -54,17 +68,28 @@
|
|
|
54
68
|
"lucide-static": "^0.555.0",
|
|
55
69
|
"npm-run-all": "^4.1.5",
|
|
56
70
|
"plop": "^4.0.4",
|
|
71
|
+
"react": "^19.2.4",
|
|
57
72
|
"storybook": "^10.1.4",
|
|
58
73
|
"vite": "^7.2.6"
|
|
59
74
|
},
|
|
60
75
|
"files": [
|
|
61
76
|
"src/**/*",
|
|
62
77
|
"custom-elements.json",
|
|
78
|
+
"css-import-attributes.d.ts",
|
|
79
|
+
"vite-plugin-css-import-attributes.js",
|
|
63
80
|
"CHANGELOG.md",
|
|
64
81
|
"README.md",
|
|
65
82
|
"LICENCE"
|
|
66
83
|
],
|
|
67
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
|
+
},
|
|
68
93
|
"scripts": {
|
|
69
94
|
"dev": "storybook dev -p 6006",
|
|
70
95
|
"watch": "vite build --watch",
|
|
@@ -77,6 +102,6 @@
|
|
|
77
102
|
"fix:lint": "npx @biomejs/biome format --write src",
|
|
78
103
|
"test": "run-s lint test:unit",
|
|
79
104
|
"lint": "npx @biomejs/biome lint src",
|
|
80
|
-
"test:unit": "NODE_ENV=test node --test --test-concurrency=1 src/**/*.test.js"
|
|
105
|
+
"test:unit": "NODE_ENV=test node --import @lit-labs/ssr-dom-shim/register-css-hook.js --test --test-concurrency=1 src/**/*.test.js"
|
|
81
106
|
}
|
|
82
107
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
|
|
4
|
+
import accordionStyles from "./accordion.css" with { type: "css" };
|
|
4
5
|
|
|
5
6
|
export class GrantCodesAccordion extends LitElement {
|
|
6
|
-
static styles = [accordionStyles];
|
|
7
|
+
static styles = [focusRingStyles, accordionStyles];
|
|
7
8
|
|
|
8
9
|
static properties = {
|
|
9
10
|
items: { type: Array },
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
import { focusRingStyles } from "../../lib/styles/focus-ring.styles.js";
|
|
3
|
-
|
|
4
|
-
export const accordionStyles = css`
|
|
5
|
-
${focusRingStyles}
|
|
6
|
-
|
|
7
1
|
:host {
|
|
8
2
|
display: block;
|
|
9
3
|
}
|
|
@@ -63,4 +57,3 @@ export const accordionStyles = css`
|
|
|
63
57
|
padding: var(--g-theme-spacing-md);
|
|
64
58
|
background: var(--g-theme-color-background-default);
|
|
65
59
|
}
|
|
66
|
-
`;
|
|
@@ -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
|
+
})
|
|
@@ -1,10 +1,11 @@
|
|
|
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 focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
|
|
5
|
+
import appBarStyles from "./app-bar.css" with { type: "css" };
|
|
5
6
|
|
|
6
7
|
export class GrantCodesAppBar extends LitElement {
|
|
7
|
-
static styles = [appBarStyles];
|
|
8
|
+
static styles = [focusRingStyles, appBarStyles];
|
|
8
9
|
|
|
9
10
|
static properties = {
|
|
10
11
|
sticky: { type: Boolean },
|
|
@@ -46,13 +47,14 @@ export class GrantCodesAppBar extends LitElement {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
render() {
|
|
49
|
-
const
|
|
50
|
+
const classes = classMap({
|
|
51
|
+
"app-bar": true,
|
|
50
52
|
"app-bar--sticky": this.sticky,
|
|
51
53
|
"app-bar--transparent": this.transparent,
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
return html`
|
|
55
|
-
<header class
|
|
57
|
+
<header class=${classes}>
|
|
56
58
|
<div class="app-bar__container">
|
|
57
59
|
<div class="app-bar__logo">
|
|
58
60
|
<slot name="logo"></slot>
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
import { focusRingStyles } from "../../lib/styles/focus-ring.styles.js";
|
|
3
|
-
|
|
4
|
-
export const appBarStyles = css`
|
|
5
|
-
${focusRingStyles}
|
|
6
|
-
|
|
7
1
|
*,
|
|
8
2
|
*::before,
|
|
9
3
|
*::after {
|
|
@@ -225,4 +219,3 @@ export const appBarStyles = css`
|
|
|
225
219
|
padding: 0;
|
|
226
220
|
list-style: none;
|
|
227
221
|
}
|
|
228
|
-
`;
|
|
@@ -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
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import avatarStyles from "./avatar.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesAvatar extends LitElement {
|
|
6
6
|
static properties = {
|
|
@@ -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 badgeStyles from "./badge.css" with { type: "css" };
|
|
5
5
|
|
|
6
6
|
export class GrantCodesBadge extends LitElement {
|
|
7
7
|
static styles = [badgeStyles];
|
|
@@ -21,12 +21,13 @@ export class GrantCodesBadge extends LitElement {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
render() {
|
|
24
|
-
const
|
|
24
|
+
const classes = classMap({
|
|
25
|
+
badge: true,
|
|
25
26
|
[`badge--${this.variant}`]: Boolean(this.variant),
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
return html`
|
|
29
|
-
<span class
|
|
30
|
+
<span class=${classes}>
|
|
30
31
|
<span class="badge__content">
|
|
31
32
|
<slot></slot>
|
|
32
33
|
</span>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.badge {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: var(--g-theme-spacing-xs);
|
|
15
|
+
padding-inline: 0.625em;
|
|
16
|
+
padding-block: 0.375em;
|
|
17
|
+
border-radius: var(--g-theme-border-radius-md, 0.375rem);
|
|
18
|
+
font: var(--g-typography-font-label-sm);
|
|
19
|
+
line-height: 1;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
border-width: 1px;
|
|
22
|
+
border-style: solid;
|
|
23
|
+
transition: all 0.2s ease;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Soft style variants */
|
|
27
|
+
.badge--primary {
|
|
28
|
+
background-color: color-mix(
|
|
29
|
+
in srgb,
|
|
30
|
+
var(--g-color-brand-purple-500) 15%,
|
|
31
|
+
transparent
|
|
32
|
+
);
|
|
33
|
+
color: var(--g-color-brand-purple-700);
|
|
34
|
+
border-color: transparent;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.badge--success {
|
|
38
|
+
background-color: color-mix(
|
|
39
|
+
in srgb,
|
|
40
|
+
var(--g-color-utility-green-500) 15%,
|
|
41
|
+
transparent
|
|
42
|
+
);
|
|
43
|
+
color: var(--g-color-utility-green-700);
|
|
44
|
+
border-color: transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.badge--warning {
|
|
48
|
+
background-color: color-mix(
|
|
49
|
+
in srgb,
|
|
50
|
+
var(--g-color-utility-yellow-500) 15%,
|
|
51
|
+
transparent
|
|
52
|
+
);
|
|
53
|
+
color: var(--g-color-utility-yellow-700);
|
|
54
|
+
border-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.badge--error {
|
|
58
|
+
background-color: color-mix(
|
|
59
|
+
in srgb,
|
|
60
|
+
var(--g-color-utility-red-500) 15%,
|
|
61
|
+
transparent
|
|
62
|
+
);
|
|
63
|
+
color: var(--g-color-utility-red-700);
|
|
64
|
+
border-color: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.badge--info {
|
|
68
|
+
background-color: color-mix(
|
|
69
|
+
in srgb,
|
|
70
|
+
var(--g-color-utility-blue-500) 15%,
|
|
71
|
+
transparent
|
|
72
|
+
);
|
|
73
|
+
color: var(--g-color-utility-blue-700);
|
|
74
|
+
border-color: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.badge--neutral {
|
|
78
|
+
background-color: var(--g-color-brand-purple-100);
|
|
79
|
+
color: var(--g-color-brand-purple-800);
|
|
80
|
+
border-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.badge__content {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 0.25em;
|
|
87
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
|
|
4
|
+
import breadcrumbStyles from "./breadcrumb.css" with { type: "css" };
|
|
4
5
|
|
|
5
6
|
export class GrantCodesBreadcrumb extends LitElement {
|
|
6
|
-
static styles = [breadcrumbStyles];
|
|
7
|
+
static styles = [focusRingStyles, breadcrumbStyles];
|
|
7
8
|
|
|
8
9
|
static properties = {
|
|
9
10
|
separator: { type: String },
|
|
@@ -71,7 +72,7 @@ export class GrantCodesBreadcrumb extends LitElement {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export class GrantCodesBreadcrumbItem extends LitElement {
|
|
74
|
-
static styles = [breadcrumbStyles];
|
|
75
|
+
static styles = [focusRingStyles, breadcrumbStyles];
|
|
75
76
|
|
|
76
77
|
static properties = {
|
|
77
78
|
href: { type: String },
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
import { focusRingStyles } from "../../lib/styles/focus-ring.styles.js";
|
|
3
|
-
|
|
4
|
-
export const breadcrumbStyles = css`
|
|
5
|
-
${focusRingStyles}
|
|
6
|
-
|
|
7
1
|
*,
|
|
8
2
|
*::before,
|
|
9
3
|
*::after {
|
|
@@ -89,4 +83,3 @@ export const breadcrumbStyles = css`
|
|
|
89
83
|
color: var(--g-color-brand-purple-400);
|
|
90
84
|
}
|
|
91
85
|
}
|
|
92
|
-
`;
|
|
@@ -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
|
+
})
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
3
|
import { literal } from "lit/static-html.js";
|
|
4
|
-
import
|
|
4
|
+
import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
|
|
5
|
+
import buttonStyles from "./button.css" with { type: "css" };
|
|
5
6
|
|
|
6
7
|
export class GrantCodesButton extends LitElement {
|
|
7
8
|
// Styles are scoped to this element: they won't conflict with styles
|
|
8
9
|
// on the main page or in other components. Styling API can be exposed
|
|
9
10
|
// via CSS custom properties.
|
|
10
|
-
static styles = [buttonStyles];
|
|
11
|
+
static styles = [focusRingStyles, buttonStyles];
|
|
11
12
|
|
|
12
13
|
static properties = {
|
|
13
14
|
href: { type: String },
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Inlined component-base mixin */
|
|
2
|
+
*,
|
|
3
|
+
*::before,
|
|
4
|
+
*::after {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
--button-border-radius-start: var(--g-theme-border-radius-md);
|
|
11
|
+
--button-border-radius-end: var(--g-theme-border-radius-md);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--g-theme-spacing-sm);
|
|
19
|
+
background: var(--g-theme-button-primary-color-background-default);
|
|
20
|
+
color: var(--g-theme-button-primary-color-content-default);
|
|
21
|
+
border-width: var(--g-theme-border-width-md);
|
|
22
|
+
border-style: solid;
|
|
23
|
+
border-color: var(--g-theme-button-primary-color-border-default);
|
|
24
|
+
padding-block: var(--g-theme-spacing-sm);
|
|
25
|
+
padding-inline: var(--g-theme-spacing-md);
|
|
26
|
+
border-start-start-radius: var(--button-border-radius-start);
|
|
27
|
+
border-start-end-radius: var(--button-border-radius-end);
|
|
28
|
+
border-end-start-radius: var(--button-border-radius-start);
|
|
29
|
+
border-end-end-radius: var(--button-border-radius-end);
|
|
30
|
+
font: var(--g-theme-typography-label-default);
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
transition-property: color, border-color, background-color, outline;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.button:hover,
|
|
37
|
+
.button:focus-visible {
|
|
38
|
+
color: var(--g-theme-button-primary-color-content-hover);
|
|
39
|
+
background: var(--g-theme-button-primary-color-background-hover);
|
|
40
|
+
border-color: var(--g-theme-button-primary-color-border-hover);
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.button:active {
|
|
46
|
+
color: var(--g-theme-button-primary-color-content-active);
|
|
47
|
+
background: var(--g-theme-button-primary-color-background-active);
|
|
48
|
+
border-color: var(--g-theme-button-primary-color-border-active);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.button:active {
|
|
52
|
+
transform: translateY(1px);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.button[disabled] {
|
|
56
|
+
background: var(--g-theme-button-primary-color-background-disabled);
|
|
57
|
+
color: var(--g-theme-button-primary-color-content-disabled);
|
|
58
|
+
border-color: var(--g-theme-button-primary-color-border-disabled);
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
filter: grayscale(70%);
|
|
61
|
+
opacity: 0.8;
|
|
62
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import buttonGroupStyles from "./button-group.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesButtonGroup 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 { GrantCodesButtonGroup } from "./button-group.js"
|
|
4
|
+
|
|
5
|
+
export const ButtonGroup = createComponent({
|
|
6
|
+
tagName: "grantcodes-button-group",
|
|
7
|
+
elementClass: GrantCodesButtonGroup,
|
|
8
|
+
react: React,
|
|
9
|
+
})
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
|
|
3
|
-
export const cardStyles = css`
|
|
4
1
|
/* Inlined component-base mixin */
|
|
5
2
|
*,
|
|
6
3
|
*::before,
|
|
@@ -151,4 +148,3 @@ export const cardStyles = css`
|
|
|
151
148
|
transform: translateY(-1px);
|
|
152
149
|
border-color: var(--g-theme-color-border-active);
|
|
153
150
|
}
|
|
154
|
-
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { html } from "lit/static-html.js";
|
|
3
|
-
import
|
|
3
|
+
import codePreviewStyles from "./code-preview.css" with { type: "css" };
|
|
4
4
|
|
|
5
5
|
export class GrantCodesCodePreview extends LitElement {
|
|
6
6
|
static styles = [codePreviewStyles];
|
|
@@ -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
|
+
})
|