@grantcodes/ui 2.0.0-beta.9 → 2.0.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 +12 -0
- package/README.md +6 -8
- package/custom-elements.json +4273 -0
- package/package.json +80 -90
- package/src/components/app-bar/app-bar.component.js +90 -0
- package/src/components/app-bar/app-bar.js +8 -0
- package/src/components/app-bar/app-bar.stories.js +84 -0
- package/src/components/app-bar/app-bar.styles.js +227 -0
- package/src/components/app-bar/app-bar.test.js +174 -0
- package/src/components/app-bar/index.js +3 -0
- package/src/components/avatar/avatar.component.js +78 -0
- package/src/components/avatar/avatar.js +18 -0
- package/src/components/avatar/avatar.stories.js +45 -0
- package/src/components/avatar/avatar.styles.js +42 -0
- package/src/components/avatar/avatar.test.js +85 -0
- package/src/components/avatar/index.js +13 -0
- package/src/components/badge/badge.component.js +36 -0
- package/src/components/badge/badge.js +8 -0
- package/src/components/badge/badge.stories.js +46 -0
- package/src/components/badge/badge.styles.js +94 -0
- package/src/components/badge/badge.test.js +70 -0
- package/src/components/badge/index.js +3 -0
- package/src/components/breadcrumb/breadcrumb.component.js +110 -0
- package/src/components/breadcrumb/breadcrumb.js +12 -0
- package/src/components/breadcrumb/breadcrumb.stories.js +25 -0
- package/src/components/breadcrumb/breadcrumb.styles.js +96 -0
- package/src/components/breadcrumb/breadcrumb.test.js +144 -0
- package/src/components/breadcrumb/index.js +3 -0
- package/src/components/button/button.component.js +64 -0
- package/src/components/button/button.js +6 -0
- package/src/components/button/button.stories.js +78 -0
- package/src/components/button/button.styles.js +97 -0
- package/src/components/button/button.test.js +98 -0
- package/src/components/button/index.js +1 -0
- package/src/components/button-group/button-group.component.js +27 -0
- package/src/components/button-group/button-group.js +6 -0
- package/src/components/button-group/button-group.stories.js +33 -0
- package/src/components/button-group/button-group.styles.js +43 -0
- package/src/components/button-group/button-group.test.js +57 -0
- package/src/components/button-group/index.js +1 -0
- package/src/components/card/card.component.js +17 -0
- package/src/components/card/card.js +6 -0
- package/src/components/card/card.stories.js +36 -0
- package/src/components/card/card.styles.js +128 -0
- package/src/components/card/card.test.js +59 -0
- package/src/components/card/index.js +1 -0
- package/src/components/code-preview/code-preview.component.js +53 -0
- package/src/components/code-preview/code-preview.js +7 -0
- package/src/components/code-preview/code-preview.stories.js +67 -0
- package/src/components/code-preview/code-preview.styles.js +18 -0
- package/src/components/code-preview/code-preview.test.js +118 -0
- package/src/components/code-preview/index.js +1 -0
- package/src/components/container/container.component.js +38 -0
- package/src/components/container/container.js +7 -0
- package/src/components/container/container.stories.js +59 -0
- package/src/components/container/container.styles.js +43 -0
- package/src/components/container/container.test.js +84 -0
- package/src/components/container/index.js +1 -0
- package/src/components/dialog/dialog.component.js +78 -0
- package/src/components/dialog/dialog.js +7 -0
- package/src/components/dialog/dialog.stories.js +43 -0
- package/src/components/dialog/dialog.styles.js +74 -0
- package/src/components/dialog/dialog.test.js +97 -0
- package/src/components/dialog/index.js +1 -0
- package/src/components/dropdown/dropdown.component.js +225 -0
- package/src/components/dropdown/dropdown.js +12 -0
- package/src/components/dropdown/dropdown.stories.js +107 -0
- package/src/components/dropdown/dropdown.styles.js +128 -0
- package/src/components/dropdown/dropdown.test.js +144 -0
- package/src/components/dropdown/index.js +3 -0
- package/src/components/dropzone/dropzone.component.js +141 -0
- package/src/components/dropzone/dropzone.js +6 -0
- package/src/components/dropzone/dropzone.stories.js +41 -0
- package/src/components/dropzone/dropzone.styles.js +64 -0
- package/src/components/dropzone/dropzone.test.js +112 -0
- package/src/components/dropzone/index.js +1 -0
- package/src/components/footer/footer-column.component.js +15 -0
- package/src/components/footer/footer-column.styles.js +51 -0
- package/src/components/footer/footer.component.js +38 -0
- package/src/components/footer/footer.js +9 -0
- package/src/components/footer/footer.stories.js +143 -0
- package/src/components/footer/footer.styles.js +90 -0
- package/src/components/footer/footer.test.js +107 -0
- package/src/components/footer/index.js +2 -0
- package/src/components/form-field/form-field.component.js +173 -0
- package/src/components/form-field/form-field.js +7 -0
- package/src/components/form-field/form-field.stories.js +104 -0
- package/src/components/form-field/form-field.styles.js +47 -0
- package/src/components/form-field/form-field.test.js +118 -0
- package/src/components/form-field/index.js +1 -0
- package/src/components/gallery/gallery-image.component.js +52 -0
- package/src/components/gallery/gallery-image.js +7 -0
- package/src/components/gallery/gallery.component.js +25 -0
- package/src/components/gallery/gallery.js +7 -0
- package/src/components/gallery/gallery.stories.js +60 -0
- package/src/components/gallery/gallery.styles.js +56 -0
- package/src/components/gallery/gallery.test.js +58 -0
- package/src/components/gallery/index.js +2 -0
- package/src/components/icon/icon.component.js +14 -0
- package/src/components/icon/icon.js +7 -0
- package/src/components/icon/icon.stories.js +26 -0
- package/src/components/icon/icon.styles.js +28 -0
- package/src/components/icon/icon.test.js +57 -0
- package/src/components/icon/index.js +1 -0
- package/src/components/loading/index.js +1 -0
- package/src/components/loading/loading.component.js +21 -0
- package/src/components/loading/loading.js +7 -0
- package/src/components/loading/loading.stories.js +25 -0
- package/src/components/loading/loading.styles.js +43 -0
- package/src/components/loading/loading.test.js +57 -0
- package/src/components/notice/index.js +1 -0
- package/src/components/notice/notice.component.js +77 -0
- package/src/components/notice/notice.js +7 -0
- package/src/components/notice/notice.stories.js +122 -0
- package/src/components/notice/notice.styles.js +72 -0
- package/src/components/notice/notice.test.js +146 -0
- package/src/components/pagination/index.js +1 -0
- package/src/components/pagination/pagination.component.js +62 -0
- package/src/components/pagination/pagination.js +7 -0
- package/src/components/pagination/pagination.stories.js +34 -0
- package/src/components/pagination/pagination.styles.js +19 -0
- package/src/components/pagination/pagination.test.js +98 -0
- package/src/components/sidebar/index.js +3 -0
- package/src/components/sidebar/sidebar.component.js +165 -0
- package/src/components/sidebar/sidebar.js +8 -0
- package/src/components/sidebar/sidebar.stories.js +155 -0
- package/src/components/sidebar/sidebar.styles.js +192 -0
- package/src/components/sidebar/sidebar.test.js +196 -0
- package/src/components/tabs/index.js +2 -0
- package/src/components/tabs/internal/tabs-button.component.js +39 -0
- package/src/components/tabs/internal/tabs-button.js +7 -0
- package/src/components/tabs/internal/tabs-item.component.js +39 -0
- package/src/components/tabs/tab.component.js +20 -0
- package/src/components/tabs/tab.js +7 -0
- package/src/components/tabs/tabs.component.js +130 -0
- package/src/components/tabs/tabs.js +7 -0
- package/src/components/tabs/tabs.stories.js +39 -0
- package/src/components/tabs/tabs.styles.js +88 -0
- package/src/components/tabs/tabs.test.js +148 -0
- package/src/components/toast/index.js +3 -0
- package/src/components/toast/toast.component.js +187 -0
- package/src/components/toast/toast.js +9 -0
- package/src/components/toast/toast.stories.js +169 -0
- package/src/components/toast/toast.styles.js +207 -0
- package/src/components/toast/toast.test.js +196 -0
- package/src/components/tooltip/index.js +1 -0
- package/src/components/tooltip/tooltip.component.js +70 -0
- package/src/components/tooltip/tooltip.js +7 -0
- package/src/components/tooltip/tooltip.stories.js +33 -0
- package/src/components/tooltip/tooltip.styles.js +78 -0
- package/src/components/tooltip/tooltip.test.js +150 -0
- package/src/css/all.css +1 -0
- package/src/css/base.css +31 -0
- package/src/css/colors.stories.js +192 -0
- package/src/css/elements/a.css +50 -0
- package/src/css/elements/forms/button.css +15 -0
- package/src/css/elements/forms/input.css +183 -0
- package/src/css/elements/forms/label.css +5 -0
- package/src/css/elements/media/image.css +3 -0
- package/src/css/elements.css +5 -0
- package/src/css/elements.stories.js +108 -0
- package/src/css/helpers.css +16 -0
- package/src/css/themes/grantcodes.css +3 -0
- package/src/css/themes/todomap.css +2 -0
- package/src/css/themes/wireframe.css +2 -0
- package/src/css/tokens.stories.js +183 -0
- package/src/css/typography.css +64 -0
- package/src/css/typography.stories.js +179 -0
- package/src/css/util/functions.css +16 -0
- package/src/css/util/index.css +2 -0
- package/src/css/util/mixins.css +63 -0
- package/src/icons.js +3 -0
- package/src/lib/classnames.js +61 -0
- package/src/lib/generate-id.js +10 -0
- package/src/main.js +17 -0
- package/src/test-utils/assert-helpers.js +150 -0
- package/src/test-utils/events.js +88 -0
- package/src/test-utils/fixture.js +77 -0
- package/src/test-utils/index.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js +0 -1
- package/dist/_virtual/index.js +0 -1
- package/dist/_virtual/react.production.min.js +0 -1
- package/dist/_virtual/react.production.min2.js +0 -1
- package/dist/components/avatar/avatar.component.js +0 -3
- package/dist/components/avatar/avatar.js +0 -1
- package/dist/components/avatar/avatar.react.js +0 -1
- package/dist/components/avatar/avatar.scss.js +0 -1
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/button/button.component.js +0 -5
- package/dist/components/button/button.js +0 -1
- package/dist/components/button/button.react.js +0 -1
- package/dist/components/button/button.scss.js +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/button-group/button-group.component.js +0 -5
- package/dist/components/button-group/button-group.js +0 -1
- package/dist/components/button-group/button-group.react.js +0 -1
- package/dist/components/button-group/button-group.scss.js +0 -1
- package/dist/components/button-group/index.js +0 -1
- package/dist/components/card/card.component.js +0 -8
- package/dist/components/card/card.js +0 -1
- package/dist/components/card/card.react.js +0 -1
- package/dist/components/card/card.scss.js +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/code-preview/code-preview.component.js +0 -3
- package/dist/components/code-preview/code-preview.js +0 -1
- package/dist/components/code-preview/code-preview.react.js +0 -1
- package/dist/components/code-preview/code-preview.scss.js +0 -1
- package/dist/components/code-preview/index.js +0 -1
- package/dist/components/container/container.component.js +0 -5
- package/dist/components/container/container.js +0 -1
- package/dist/components/container/container.react.js +0 -1
- package/dist/components/container/container.scss.js +0 -1
- package/dist/components/container/index.js +0 -1
- package/dist/components/dialog/dialog.component.js +0 -23
- package/dist/components/dialog/dialog.js +0 -1
- package/dist/components/dialog/dialog.react.js +0 -1
- package/dist/components/dialog/dialog.scss.js +0 -1
- package/dist/components/dialog/index.js +0 -1
- package/dist/components/dropzone/dropzone.component.js +0 -11
- package/dist/components/dropzone/dropzone.js +0 -1
- package/dist/components/dropzone/dropzone.react.js +0 -1
- package/dist/components/dropzone/dropzone.scss.js +0 -1
- package/dist/components/dropzone/index.js +0 -1
- package/dist/components/form-field/form-field.component.js +0 -22
- package/dist/components/form-field/form-field.js +0 -1
- package/dist/components/form-field/form-field.react.js +0 -1
- package/dist/components/form-field/form-field.scss.js +0 -1
- package/dist/components/form-field/index.js +0 -1
- package/dist/components/gallery/gallery-image.component.js +0 -14
- package/dist/components/gallery/gallery-image.js +0 -1
- package/dist/components/gallery/gallery.component.js +0 -5
- package/dist/components/gallery/gallery.js +0 -1
- package/dist/components/gallery/gallery.react.js +0 -1
- package/dist/components/gallery/gallery.scss.js +0 -1
- package/dist/components/gallery/index.js +0 -1
- package/dist/components/icon/icon.component.js +0 -1
- package/dist/components/icon/icon.js +0 -1
- package/dist/components/icon/icon.react.js +0 -1
- package/dist/components/icon/icon.scss.js +0 -1
- package/dist/components/icon/index.js +0 -1
- package/dist/components/loading/index.js +0 -1
- package/dist/components/loading/loading.component.js +0 -5
- package/dist/components/loading/loading.js +0 -1
- package/dist/components/loading/loading.react.js +0 -1
- package/dist/components/loading/loading.scss.js +0 -1
- package/dist/components/notice/index.js +0 -1
- package/dist/components/notice/notice.component.js +0 -16
- package/dist/components/notice/notice.js +0 -1
- package/dist/components/notice/notice.react.js +0 -1
- package/dist/components/notice/notice.scss.js +0 -1
- package/dist/components/pagination/index.js +0 -1
- package/dist/components/pagination/pagination.component.js +0 -13
- package/dist/components/pagination/pagination.js +0 -1
- package/dist/components/pagination/pagination.react.js +0 -1
- package/dist/components/pagination/pagination.scss.js +0 -1
- package/dist/components/tabs/index.js +0 -1
- package/dist/components/tabs/internal/tabs-button.component.js +0 -13
- package/dist/components/tabs/internal/tabs-button.js +0 -1
- package/dist/components/tabs/internal/tabs-item.component.js +0 -1
- package/dist/components/tabs/tab.component.js +0 -10
- package/dist/components/tabs/tab.js +0 -1
- package/dist/components/tabs/tabs.component.js +0 -22
- package/dist/components/tabs/tabs.js +0 -1
- package/dist/components/tabs/tabs.react.js +0 -1
- package/dist/components/tabs/tabs.scss.js +0 -1
- package/dist/components/tooltip/index.js +0 -1
- package/dist/components/tooltip/tooltip.component.js +0 -10
- package/dist/components/tooltip/tooltip.js +0 -1
- package/dist/components/tooltip/tooltip.react.js +0 -1
- package/dist/components/tooltip/tooltip.scss.js +0 -1
- package/dist/css/base.css +0 -1
- package/dist/css/themes/grantcodes.css +0 -1
- package/dist/fonts/greycliff-bold-oblique.woff +0 -0
- package/dist/fonts/greycliff-bold-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-bold.woff +0 -0
- package/dist/fonts/greycliff-bold.woff2 +0 -0
- package/dist/fonts/greycliff-demi-bold-oblique.woff +0 -0
- package/dist/fonts/greycliff-demi-bold-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-demi-bold.woff +0 -0
- package/dist/fonts/greycliff-demi-bold.woff2 +0 -0
- package/dist/fonts/greycliff-extra-bold-oblique.woff +0 -0
- package/dist/fonts/greycliff-extra-bold-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-extra-bold.woff +0 -0
- package/dist/fonts/greycliff-extra-bold.woff2 +0 -0
- package/dist/fonts/greycliff-extra-light-oblique.woff +0 -0
- package/dist/fonts/greycliff-extra-light-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-extra-light.woff +0 -0
- package/dist/fonts/greycliff-extra-light.woff2 +0 -0
- package/dist/fonts/greycliff-heavy-oblique.woff +0 -0
- package/dist/fonts/greycliff-heavy-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-heavy.woff +0 -0
- package/dist/fonts/greycliff-heavy.woff2 +0 -0
- package/dist/fonts/greycliff-light-oblique.woff +0 -0
- package/dist/fonts/greycliff-light-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-light.woff +0 -0
- package/dist/fonts/greycliff-light.woff2 +0 -0
- package/dist/fonts/greycliff-medium-oblique.woff +0 -0
- package/dist/fonts/greycliff-medium-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-medium.woff +0 -0
- package/dist/fonts/greycliff-medium.woff2 +0 -0
- package/dist/fonts/greycliff-regular-oblique.woff +0 -0
- package/dist/fonts/greycliff-regular-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-regular.woff +0 -0
- package/dist/fonts/greycliff-regular.woff2 +0 -0
- package/dist/fonts/greycliff-thin-oblique.woff +0 -0
- package/dist/fonts/greycliff-thin-oblique.woff2 +0 -0
- package/dist/fonts/greycliff-thin.woff +0 -0
- package/dist/fonts/greycliff-thin.woff2 +0 -0
- package/dist/icons.js +0 -1
- package/dist/lib/generate-id.js +0 -1
- package/dist/main.js +0 -1
- package/dist/node_modules/react/cjs/react.production.min.js +0 -9
- package/dist/node_modules/react/index.js +0 -1
- package/dist/react.js +0 -1
package/package.json
CHANGED
|
@@ -1,91 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
],
|
|
83
|
-
"ava": {
|
|
84
|
-
"typescript": {
|
|
85
|
-
"compile": false,
|
|
86
|
-
"rewritePaths": {
|
|
87
|
-
"src/": "tmp/tests/"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
2
|
+
"name": "@grantcodes/ui",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "A personal component system built with Lit web components",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/main.js",
|
|
7
|
+
"module": "src/main.js",
|
|
8
|
+
"types": "src/main.d.ts",
|
|
9
|
+
"author": "grantcodes",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/main.d.ts",
|
|
13
|
+
"import": "./src/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./icons": {
|
|
16
|
+
"types": "./src/icons.d.ts",
|
|
17
|
+
"import": "./src/icons.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles/base.css": {
|
|
20
|
+
"import": "./src/css/base.css",
|
|
21
|
+
"require": "./src/css/base.css"
|
|
22
|
+
},
|
|
23
|
+
"./styles/themes/grantcodes.css": {
|
|
24
|
+
"import": "./src/css/themes/grantcodes.css",
|
|
25
|
+
"require": "./src/css/themes/grantcodes.css"
|
|
26
|
+
},
|
|
27
|
+
"./components/*": {
|
|
28
|
+
"import": "./src/components/*",
|
|
29
|
+
"require": "./src/components/*"
|
|
30
|
+
},
|
|
31
|
+
"./fonts/*": "./src/fonts/*"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "storybook dev -p 6006",
|
|
35
|
+
"storybook": "storybook dev -p 6006",
|
|
36
|
+
"build-storybook": "storybook build",
|
|
37
|
+
"build": "npm run build-storybook",
|
|
38
|
+
"generate": "plop",
|
|
39
|
+
"cem": "cem analyze --config custom-elements-manifest.config.js --litelement",
|
|
40
|
+
"fix": "run-s fix:lint",
|
|
41
|
+
"fix:lint": "npx @biomejs/biome format --write src",
|
|
42
|
+
"test": "run-s lint test:unit",
|
|
43
|
+
"lint": "npx @biomejs/biome lint src",
|
|
44
|
+
"test:unit": "NODE_ENV=test node --test --test-concurrency=1 src/**/*.test.js"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@grantcodes/style-dictionary": "workspace:*",
|
|
49
|
+
"lit": "^3.3.1",
|
|
50
|
+
"sanitize.css": "^13.0.0",
|
|
51
|
+
"shiki": "^3.17.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@biomejs/biome": "2.3.8",
|
|
55
|
+
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
56
|
+
"@grantcodes/commit": "^2.0.0",
|
|
57
|
+
"@playwright/test": "^1.57.0",
|
|
58
|
+
"@storybook/addon-docs": "^10.1.4",
|
|
59
|
+
"@storybook/addon-themes": "^10.1.4",
|
|
60
|
+
"@storybook/web-components-vite": "^10.1.4",
|
|
61
|
+
"@wc-toolkit/cem-inheritance": "^1.2.2",
|
|
62
|
+
"@wc-toolkit/cem-sorter": "^1.0.1",
|
|
63
|
+
"@wc-toolkit/cem-validator": "^1.0.3",
|
|
64
|
+
"@wc-toolkit/module-path-resolver": "^1.0.0",
|
|
65
|
+
"@wc-toolkit/storybook-helpers": "^10.0.0",
|
|
66
|
+
"happy-dom": "^20.0.11",
|
|
67
|
+
"lucide-static": "^0.555.0",
|
|
68
|
+
"npm-run-all": "^4.1.5",
|
|
69
|
+
"plop": "^4.0.4",
|
|
70
|
+
"storybook": "^10.1.4",
|
|
71
|
+
"vite": "^7.2.6"
|
|
72
|
+
},
|
|
73
|
+
"files": [
|
|
74
|
+
"src/**/*",
|
|
75
|
+
"custom-elements.json",
|
|
76
|
+
"CHANGELOG.md",
|
|
77
|
+
"README.md",
|
|
78
|
+
"LICENCE"
|
|
79
|
+
],
|
|
80
|
+
"customElements": "custom-elements.json"
|
|
81
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { html } from "lit/static-html.js";
|
|
3
|
+
import { cx } from "../../lib/classnames.js";
|
|
4
|
+
import { appBarStyles } from "./app-bar.styles.js";
|
|
5
|
+
|
|
6
|
+
export class GrantCodesAppBar extends LitElement {
|
|
7
|
+
static styles = [appBarStyles];
|
|
8
|
+
|
|
9
|
+
static properties = {
|
|
10
|
+
sticky: { type: Boolean },
|
|
11
|
+
transparent: { type: Boolean },
|
|
12
|
+
_mobileMenuOpen: { type: Boolean, state: true },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Whether the app bar is sticky
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
*/
|
|
22
|
+
this.sticky = false;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Whether the app bar has transparent background
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
this.transparent = false;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Mobile menu open state
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
*/
|
|
34
|
+
this._mobileMenuOpen = false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_toggleMobileMenu() {
|
|
38
|
+
this._mobileMenuOpen = !this._mobileMenuOpen;
|
|
39
|
+
this.dispatchEvent(
|
|
40
|
+
new CustomEvent("menu-toggle", {
|
|
41
|
+
detail: { open: this._mobileMenuOpen },
|
|
42
|
+
bubbles: true,
|
|
43
|
+
composed: true,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
const appBarClass = cx("app-bar", {
|
|
50
|
+
"app-bar--sticky": this.sticky,
|
|
51
|
+
"app-bar--transparent": this.transparent,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return html`
|
|
55
|
+
<header class="${appBarClass}">
|
|
56
|
+
<div class="app-bar__container">
|
|
57
|
+
<div class="app-bar__logo">
|
|
58
|
+
<slot name="logo"></slot>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Actions (right side) -->
|
|
62
|
+
<div class="app-bar__actions">
|
|
63
|
+
<slot name="actions"></slot>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- Mobile Menu Button -->
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
class="app-bar__menu-button"
|
|
70
|
+
aria-label="${this._mobileMenuOpen ? "Close menu" : "Open menu"}"
|
|
71
|
+
aria-expanded="${this._mobileMenuOpen}"
|
|
72
|
+
@click=${this._toggleMobileMenu}
|
|
73
|
+
>
|
|
74
|
+
<span class="app-bar__menu-icon"></span>
|
|
75
|
+
</button>
|
|
76
|
+
|
|
77
|
+
<!-- Navigation (single slot, collapsible on mobile) -->
|
|
78
|
+
<nav
|
|
79
|
+
class="app-bar__nav ${this._mobileMenuOpen ? "app-bar__nav--mobile-open" : ""}"
|
|
80
|
+
aria-label="Main navigation"
|
|
81
|
+
>
|
|
82
|
+
<slot name="nav"></slot>
|
|
83
|
+
</nav>
|
|
84
|
+
</div>
|
|
85
|
+
</header>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import "./app-bar.js";
|
|
3
|
+
import "../button/button.js";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/App Bar",
|
|
7
|
+
component: "grantcodes-app-bar",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Basic app bar with logo and navigation
|
|
14
|
+
*/
|
|
15
|
+
export const AppBar = {
|
|
16
|
+
render: () => html`
|
|
17
|
+
<grantcodes-app-bar>
|
|
18
|
+
<a slot="logo" href="/" style="font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--g-color-brand-purple-900);">
|
|
19
|
+
MyApp
|
|
20
|
+
</a>
|
|
21
|
+
<div slot="nav" style="display: flex; gap: 0.5rem;">
|
|
22
|
+
<a href="/">Home</a>
|
|
23
|
+
<a href="/about">About</a>
|
|
24
|
+
<a href="/features">Features</a>
|
|
25
|
+
<a href="/pricing">Pricing</a>
|
|
26
|
+
</div>
|
|
27
|
+
<div slot="actions">
|
|
28
|
+
<grantcodes-button>Sign In</grantcodes-button>
|
|
29
|
+
</div>
|
|
30
|
+
</grantcodes-app-bar>
|
|
31
|
+
`,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Transparent app bar for hero sections
|
|
36
|
+
*/
|
|
37
|
+
export const Transparent = {
|
|
38
|
+
render: () => html`
|
|
39
|
+
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 400px;">
|
|
40
|
+
<grantcodes-app-bar transparent>
|
|
41
|
+
<a slot="logo" href="/" style="font-weight: 700; font-size: 1.25rem; text-decoration: none; color: white;">
|
|
42
|
+
MyApp
|
|
43
|
+
</a>
|
|
44
|
+
<div slot="nav" style="display: flex; gap: 0.5rem;">
|
|
45
|
+
<a href="/" style="color: white;">Home</a>
|
|
46
|
+
<a href="/about" style="color: white;">About</a>
|
|
47
|
+
<a href="/features" style="color: white;">Features</a>
|
|
48
|
+
</div>
|
|
49
|
+
<div slot="actions">
|
|
50
|
+
<grantcodes-button style="--g-theme-color-background-default: white; --g-theme-color-content-default: #667eea;">
|
|
51
|
+
Sign Up
|
|
52
|
+
</grantcodes-button>
|
|
53
|
+
</div>
|
|
54
|
+
</grantcodes-app-bar>
|
|
55
|
+
<div style="padding: 4rem 2rem; text-align: center; color: white;">
|
|
56
|
+
<h1 style="font-size: 3rem; margin: 0;">Welcome to MyApp</h1>
|
|
57
|
+
<p style="font-size: 1.5rem; margin-top: 1rem;">The transparent app bar blends seamlessly</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* App bar with multiple actions
|
|
65
|
+
*/
|
|
66
|
+
export const WithMultipleActions = {
|
|
67
|
+
render: () => html`
|
|
68
|
+
<grantcodes-app-bar>
|
|
69
|
+
<a slot="logo" href="/" style="font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--g-color-brand-purple-900);">
|
|
70
|
+
Dashboard
|
|
71
|
+
</a>
|
|
72
|
+
<div slot="nav" style="display: flex; gap: 0.5rem;">
|
|
73
|
+
<a href="/">Overview</a>
|
|
74
|
+
<a href="/analytics">Analytics</a>
|
|
75
|
+
<a href="/reports">Reports</a>
|
|
76
|
+
</div>
|
|
77
|
+
<div slot="actions" style="display: flex; gap: 0.5rem; align-items: center;">
|
|
78
|
+
<grantcodes-button>🔔</grantcodes-button>
|
|
79
|
+
<grantcodes-button>⚙️</grantcodes-button>
|
|
80
|
+
<grantcodes-button>👤</grantcodes-button>
|
|
81
|
+
</div>
|
|
82
|
+
</grantcodes-app-bar>
|
|
83
|
+
`,
|
|
84
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export const appBarStyles = css`
|
|
4
|
+
*,
|
|
5
|
+
*::before,
|
|
6
|
+
*::after {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
container-type: inline-size;
|
|
13
|
+
container-name: app-bar;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.app-bar {
|
|
17
|
+
background-color: var(--g-theme-color-background-default);
|
|
18
|
+
border-block-end: 1px solid var(--g-theme-color-border-default);
|
|
19
|
+
position: sticky;
|
|
20
|
+
inset-block-start: 0;
|
|
21
|
+
z-index: 100;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.app-bar--transparent {
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
border-block-end-color: transparent;
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.app-bar__container {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 1.5rem;
|
|
34
|
+
padding-inline: 1rem;
|
|
35
|
+
padding-block: 1rem;
|
|
36
|
+
max-inline-size: 1400px;
|
|
37
|
+
margin-inline: auto;
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Logo */
|
|
42
|
+
.app-bar__logo {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Navigation */
|
|
49
|
+
.app-bar__nav {
|
|
50
|
+
display: none;
|
|
51
|
+
flex: 1;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 1.5rem;
|
|
54
|
+
order: 5;
|
|
55
|
+
inline-size: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Mobile: when menu is open, show nav stacked vertically */
|
|
59
|
+
.app-bar__nav--mobile-open {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 0.5rem;
|
|
63
|
+
padding-inline: 1rem;
|
|
64
|
+
padding-block: 1rem;
|
|
65
|
+
border-block-start: 1px solid var(--g-theme-color-border-default);
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Show nav on larger screens using container queries */
|
|
70
|
+
@container app-bar (min-width: 768px) {
|
|
71
|
+
.app-bar__nav {
|
|
72
|
+
display: flex;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Actions */
|
|
77
|
+
.app-bar__actions {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 0.75rem;
|
|
81
|
+
margin-inline-start: auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Mobile Menu Button */
|
|
85
|
+
.app-bar__menu-button {
|
|
86
|
+
all: unset;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
inline-size: 2.5rem;
|
|
91
|
+
block-size: 2.5rem;
|
|
92
|
+
padding: 0.5rem;
|
|
93
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
color: var(--g-theme-color-content-default);
|
|
96
|
+
transition: background-color 0.2s ease;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.app-bar__menu-button:hover {
|
|
100
|
+
background-color: var(--g-theme-color-background-subtle-hover);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.app-bar__menu-button:focus-visible {
|
|
104
|
+
outline: 2px solid var(--component-focus-ring-color);
|
|
105
|
+
outline-offset: 2px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Hide menu button on larger screens */
|
|
109
|
+
@container app-bar (min-width: 768px) {
|
|
110
|
+
.app-bar__menu-button {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Hamburger Icon */
|
|
116
|
+
.app-bar__menu-icon {
|
|
117
|
+
display: block;
|
|
118
|
+
inline-size: 1.5rem;
|
|
119
|
+
block-size: 1.5rem;
|
|
120
|
+
position: relative;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.app-bar__menu-icon::before,
|
|
124
|
+
.app-bar__menu-icon::after {
|
|
125
|
+
content: "";
|
|
126
|
+
position: absolute;
|
|
127
|
+
inline-size: 100%;
|
|
128
|
+
block-size: 2px;
|
|
129
|
+
inset-inline-start: 0;
|
|
130
|
+
background-color: currentColor;
|
|
131
|
+
transition: transform 0.2s ease;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.app-bar__menu-icon::before {
|
|
135
|
+
inset-block-start: 0.25rem;
|
|
136
|
+
box-shadow: 0 0.5rem 0 currentColor;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.app-bar__menu-icon::after {
|
|
140
|
+
inset-block-end: 0.25rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Animated hamburger to X */
|
|
144
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::before {
|
|
145
|
+
inset-block-start: 0.5rem;
|
|
146
|
+
transform: rotate(45deg);
|
|
147
|
+
box-shadow: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.app-bar__menu-button[aria-expanded="true"] .app-bar__menu-icon::after {
|
|
151
|
+
inset-block-end: 0.5rem;
|
|
152
|
+
transform: rotate(-45deg);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Mobile Navigation */
|
|
156
|
+
.app-bar__mobile-nav {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: 0.5rem;
|
|
160
|
+
padding-inline: 1rem;
|
|
161
|
+
padding-block: 1rem;
|
|
162
|
+
border-block-start: 1px solid var(--g-theme-color-border-default);
|
|
163
|
+
animation: slide-down 0.2s ease-out;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Desktop: show nav inline and reset mobile styles */
|
|
167
|
+
@container app-bar (min-width: 768px) {
|
|
168
|
+
.app-bar__container {
|
|
169
|
+
flex-wrap: nowrap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.app-bar__nav {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: row;
|
|
175
|
+
gap: 1.5rem;
|
|
176
|
+
padding: 0;
|
|
177
|
+
border: 0;
|
|
178
|
+
width: auto;
|
|
179
|
+
order: 2;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.app-bar__actions {
|
|
183
|
+
order: 3;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.app-bar__menu-button {
|
|
187
|
+
order: 4;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Ensure mobile-open class doesn't affect desktop */
|
|
191
|
+
.app-bar__nav--mobile-open {
|
|
192
|
+
display: flex;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes slide-down {
|
|
197
|
+
from {
|
|
198
|
+
opacity: 0;
|
|
199
|
+
transform: translateY(-0.5rem);
|
|
200
|
+
}
|
|
201
|
+
to {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
transform: translateY(0);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Slotted content styling helpers */
|
|
208
|
+
::slotted(a) {
|
|
209
|
+
color: var(--g-theme-color-content-default);
|
|
210
|
+
text-decoration: none;
|
|
211
|
+
padding-block: 0.5rem;
|
|
212
|
+
padding-inline: 0.75rem;
|
|
213
|
+
border-radius: var(--g-theme-border-radius-md);
|
|
214
|
+
transition: all 0.2s ease;
|
|
215
|
+
font-weight: 500;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
::slotted(a:hover) {
|
|
219
|
+
color: var(--g-theme-color-content-default);
|
|
220
|
+
background-color: var(--g-theme-color-background-subtle-hover);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
::slotted(a:focus-visible) {
|
|
224
|
+
outline: 2px solid var(--component-focus-ring-color);
|
|
225
|
+
outline-offset: 2px;
|
|
226
|
+
}
|
|
227
|
+
`;
|