Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/stencil updates1 #91

Merged
merged 13 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 85 additions & 21 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"react-sb": "npm run storybook -w packages/react-components",
"react-build": "npm run build -w packages/react-components",
"stencil-build": "npm run build -w packages/web-components",
"stencil-start": "npm run start -w packages/web-components",
"stencil-sb": "npm run storybook -w packages/web-components",
"stencil-generate": "npm run generate -w packages/web-components",
"test": "echo \"Error: no test specified\" && exit 1",
"build-all": "npm run vanilla-build && npm run build-pages -w packages/ux-guidelines && npm run build-pages -w packages/vanilla && npm run build-pages -w packages/react-components"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/web-components/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ $RECYCLE.BIN/
Thumbs.db
UserInterfaceState.xcuserstate
.env

# Generated files that will cause constant conflicts
components.d.ts
readme.md
1 change: 1 addition & 0 deletions packages/web-components/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="icon" type="image/x-icon" href="assets/images/cbp-seal.svg">
2 changes: 1 addition & 1 deletion packages/web-components/.storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { addons } from '@storybook/addons';
import { create } from '@storybook/theming';

import cbpLogo from '../assets/images/CBP_SEAL.svg';
import cbpLogo from '../assets/images/cbp-seal.svg';

const theme = create({
base: 'light',
Expand Down
3 changes: 3 additions & 0 deletions packages/web-components/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

<!-- Loading the CBP DS components as a module allows them to be rebuilt and watched properly -->
<!--<script type="module" src="../www/build/cbp-web-components.esm.js" /> -->
4 changes: 2 additions & 2 deletions packages/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
],
"scripts": {
"build": "stencil build --docs",
"start": "stencil build --dev --watch --serve",
"start": "stencil build --dev --watch",
"test": "stencil test --spec --e2e",
"test.watch": "stencil test --spec --e2e --watchAll",
"generate": "stencil generate",
"storybook": "storybook dev -p 6008",
"build-storybook": "storybook build"
},
"dependencies": {
"@stencil/core": "^4.0.0",
"@stencil/core": "^4.7.0",
"npm": "^10.2.1"
},
"devDependencies": {
Expand Down
37 changes: 0 additions & 37 deletions packages/web-components/src/components.d.ts

This file was deleted.

4 changes: 4 additions & 0 deletions packages/web-components/src/components/cbp-app/cbp-app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@use 'reset.scss';
@use 'roboto.scss';
@use 'css-variables.scss';
@use 'core.scss';
24 changes: 24 additions & 0 deletions packages/web-components/src/components/cbp-app/cbp-app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, Host, h } from '@stencil/core';

/*
An overarching "app" tag can act as a low-barrier way to get core design system elements (CSS, fonts)
as well as a way to manage site/page-level settings such as dark mode.
*/

@Component({
tag: 'cbp-app',
styleUrl: 'cbp-app.scss'
//this is not working: appears to be a Stencil bug - verify
//styleUrls: ['reset.scss', 'roboto.scss', 'css-variables.scss', 'core.scss']
})
export class CbpApp {

render() {
return (
<Host>
<slot />
</Host>
);
}

}
43 changes: 43 additions & 0 deletions packages/web-components/src/components/cbp-app/core.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
html {
font-size: 100%;
}

body {
color: var(--cbp-color-text-darkest);
background-color: var(--cbp-color-branding-cbp-light);
font: var(--cbp-font-size-body)/1rem var(--cbp-font-family-roboto);
}

[data-cbp-theme="dark"] body {
color: var(--cbp-color-text-lightest);
background-color: var(--cbp-color-branding-cbp-dark);
}

p,
blockquote,
ul:not(ul ul):not(ul ol),
ol:not(ol ol):not(ol ul) {
margin-bottom: var(--cbp-space-4x);
}

// TODO: Should this include blockquote and list items?
p {
line-height: 1.25rem;
}

a[href],
button {
cursor: pointer;
}

[aria-disabled=true],
:disabled,
input:read-only:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]),
textarea:read-only {
cursor: not-allowed;
}

/* Ensure that `hidden` is not overridden by other selectors setting display, such as flex or grid */
[hidden] {
display: none !important;
}
Loading