Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
454d92f
feat(core-styles): wip fp-1499 pattern library
wesleyboar Jul 6, 2022
a469344
chore(core-styles): v0.6.0 (#18)
wesleyboar Jul 6, 2022
3e8cf79
fix(core-styles): missing css vars from portal (#24)
wesleyboar Jul 6, 2022
c226d4d
feat(core-styles): fp-1499 rename build to demo
wesleyboar Jul 10, 2022
212c502
feat(core-styles): wip fp-1499 publish demo
wesleyboar Jul 10, 2022
60e2c23
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 10, 2022
82980ee
feat(core-styles): fp-1499 export fractal & theme
wesleyboar Jul 10, 2022
677c79a
feat(core-styles): fp-1499 install 2nd dep (root)
wesleyboar Jul 10, 2022
a585071
feat(core-styles): fp-1499 isolate theme config
wesleyboar Jul 10, 2022
d99d87d
feat(core-styles): fp-1499 build:web → build:demo
wesleyboar Jul 10, 2022
5cac112
fix(core-styles): fp-1499 remove outdated comment
wesleyboar Jul 10, 2022
4337429
fix(core-styles): fp-1499 move main+cli out of src
wesleyboar Jul 10, 2022
2fa4121
Revert "fix(core-styles): fp-1499 move main+cli out of src"
wesleyboar Jul 10, 2022
1e4696d
fix(core-styles): fp-1499 frctl deps as peerDeps
wesleyboar Jul 10, 2022
88a2825
feat(core-styles): fp-1499 (minimally) custom skin
wesleyboar Jul 11, 2022
f7cf038
docs(core-styles): fp-1499 more fractal debugging
wesleyboar Jul 11, 2022
036c8e5
feat(core-styles): fp-1499 load css sans symlink
wesleyboar Jul 11, 2022
6ed5fdd
chore(core-styles): fp-1499 update package-lock
wesleyboar Jul 11, 2022
9dbf614
fix(core-styles): fp-1499 no internal cli use
wesleyboar Jul 11, 2022
d2f122d
fix(core-styles): fp-1499 build main not src/bin
wesleyboar Jul 11, 2022
f6576b0
feat(core-styles): fp-1499 global load per pattern
wesleyboar Jul 11, 2022
39653b7
chore(core-styles): fp-1499 rename fractal theme
wesleyboar Jul 12, 2022
feeb154
fix(core-styles): fp-1499/tup-308 button widths
wesleyboar Jul 12, 2022
89c55bf
feat(core-styles): fp-1499 fractal style load opts
wesleyboar Jul 12, 2022
176449e
feat(core-styles)!: fp-1499 fractal style load opts
wesleyboar Jul 12, 2022
c5485c2
Merge branch 'task/fp-1499-cms-pattern-library' of github.com:TACC/tu…
wesleyboar Jul 12, 2022
0c95c52
fix(core-styles): fp-1499 remove scripts support
wesleyboar Jul 12, 2022
bc15b32
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 15, 2022
8f0f599
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 17, 2022
7d492e6
chore(core-styles): polish fp-1499 work
wesleyboar Jul 17, 2022
073c6e0
fix(core-styles): no need for css load hack
wesleyboar Jul 18, 2022
fbf6351
fix(core-styles): fractal load base 1st unless skip
wesleyboar Jul 18, 2022
fa14d4d
fix(core-styles): npx nx format:write
wesleyboar Jul 18, 2022
9e31683
chore(core-styles): give up piecemeal .hbs ignore
wesleyboar Jul 18, 2022
d6f7f85
fix(core-styles): do not include demo in package
wesleyboar Jul 18, 2022
a7ae947
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 18, 2022
60e957d
fix(core-styles): add missing files for package
wesleyboar Jul 18, 2022
da899d4
chore(core-styles): v0.8.0-beta
wesleyboar Jul 18, 2022
debed9a
docs(core-styles): readme, ui demo & new commands
wesleyboar Jul 18, 2022
70be7a6
chore(core-styles): add missing eof line
wesleyboar Jul 19, 2022
a30002a
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 25, 2022
24db51b
fix(core-styles): demo button widths
wesleyboar Jul 25, 2022
141464f
chore(core-styles): remove superfluous css imports
wesleyboar Jul 25, 2022
5ead8bc
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 26, 2022
874ca32
fix(core-styles): fp-1499 ignore hbs via root
wesleyboar Jul 26, 2022
0901b3f
Merge branch 'main' into task/fp-1499-cms-pattern-library
wesleyboar Jul 26, 2022
a7931d2
fix(core-styles): allow int. + ext. global css
wesleyboar Jul 28, 2022
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
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
# do not format stylesheets until `nx format` ignores multiple blank lines
# https://prettier.io/docs/en/rationale.html#empty-lines
*.css

# do not format handlebars until there is a succinct solution for
# "A block may only be used inside an HTML element or another block."
*.hbs
3 changes: 3 additions & 0 deletions libs/core-styles/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# PostCSS
.postcssrc.yml
dist

# Fractal
demo
9 changes: 8 additions & 1 deletion libs/core-styles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.8.0-beta] - 2022-07-18: Pattern Demo Website using Fractal

### Added

- Task/fp 1499 core-styles pattern demo #28

## [0.7.0] - 2022-07-15: New Global Color, Fix Section Banner on Safari

### Change
Expand Down Expand Up @@ -192,7 +198,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Initial working code. (This code may not work on all environments.)

[unreleased]: https://github.com/TACC/tup-ui/compare/core-styles-v0.7.0...HEAD
[unreleased]: https://github.com/TACC/tup-ui/compare/core-styles-v0.8.0...HEAD
[0.8.0-beta]: https://github.com/TACC/Core-Styles/releases/tag/core-styles-v0.8.0-beta
[0.7.0]: https://github.com/TACC/Core-Styles/releases/tag/core-styles-v0.7.0
[0.7.0-beta]: https://github.com/TACC/Core-Styles/releases/tag/core-styles-v0.7.0-beta
[0.6.0]: https://github.com/TACC/Core-Styles/releases/tag/core-styles-v0.6.0
Expand Down
48 changes: 22 additions & 26 deletions libs/core-styles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ buildStylesheets(

## Local Development Setup

### Prequisites for Building the Styles

- Nodejs 16.x

> **Future**: The Core Styles will be rendered via a pattern library software.

### Code Configuration

Code configuration happens in repos that use these styles.
Expand All @@ -137,17 +131,21 @@ Code configuration happens in repos that use these styles.
npm ci
```

> **Future**:
>
> 2. Build stylesheets + Run the pattern library:
>
> ```bash
> npm start
> ```
>
> 3. Open the web interface.
>
> The build command will output the URL (and may even open it for you).
2. Build stylesheets:

```bash
npm run build:css
```

3. Run the pattern library:

```bash
npm start
```

4. Open the web interface.

The build command will output the URL (and may even open it for you).

[npm-install]: https://docs.npmjs.com/cli/v8/commands/npm-ci

Expand All @@ -158,11 +156,9 @@ If you changes files in a `src/lib/` directory, you may need to follow some of t
#### Quick Start

1. _(optional)_ Make changes to `/src/lib` files.
2. Build the styles: `npm run build`

> **Future**: 2. Build and preview the styles: `npm start`

3. _(to debug)_ Review respective `/dist` files' content.
2. Build the styles: `npm run build:css`
3. Build and preview the styles: `npm start`
4. _(to debug)_ Review respective `/dist` or `/demo` files' content.

#### How to Just Build Stylesheets

Expand All @@ -171,20 +167,20 @@ You can build stylesheets **from** source files **in** `src/lib` directory **to*
1. Build stylesheets:

```bash
npm run build
npm run build:css
```

**or**, for custom build id:

```bash
npm run build -- --build-id="..."
npm run build:css -- --build-id="..."
```

## Testing

Plugin testing is done manually. Run `npm run build` from root folder in this project, then review output in `/dist/_tests.css`, to ensure plugins are working correctly.
Plugin testing is done manually. Run `npm run test`, then review output in `/dist/_tests.css`, to ensure plugins are working correctly.

> **Future**: Style testing is done manually. Run `npm start` from root folder in this project, then review output at web interface, to ensure styles are rendering correctly.
Style testing is done manually. Run `npm start`, then review output at web interface, to ensure styles are rendering correctly.

## Linting

Expand Down
9 changes: 9 additions & 0 deletions libs/core-styles/bin/build-css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env node

/** Build CSS using the Core-Styles API */

const { buildStylesheets } = require('../src/main');

buildStylesheets('src/lib/_imports/**/*!(README).css', './dist', {
baseMirrorDir: 'src/lib/_imports',
});
9 changes: 9 additions & 0 deletions libs/core-styles/bin/test-css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env node

/** Test CSS plugins via the Core-Styles API */

const { buildStylesheets } = require('../src/main');

buildStylesheets('src/lib/_tests', './dist', {
baseMirrorDir: 'src/lib',
});
41 changes: 41 additions & 0 deletions libs/core-styles/docs/_fractal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# TACC Core Styles - Tips for Fractal Component Library

## Debugging

### Preview Templates

To see values available in a preview template, adapt this template code:

```html
<dl>
{{#each _target}}
<dt>
<strong><code>{{@key}}</code></strong>
</dt>
<dd><code>{{this}}</code></dd>
{{/each}}
</dl>
```

### Console Logging

To output values (like objects) in the console, adapt this config code:

```js
const hbs = require('@frctl/handlebars')({
helpers: {
debug: function (optionalValue) {
console.log('Current Context');
console.log('====================');
console.log(this);

if (optionalValue) {
console.log('Value');
console.log('====================');
console.log(optionalValue);
}
},
},
});
fractal.components.engine(hbs);
```
26 changes: 26 additions & 0 deletions libs/core-styles/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: TACC UI Patterns
---

This is the UI pattern library for TACC.

The CSS for these patterns is available from [@tacc/core-styles].

---

Known Clients:

- [TACC/Core-CMS]
- [TACC/Core-Portal]
- [@tacc/core-components]

[tacc/core-cms]: https://github.com/TACC/Core-CMS
[tacc/core-portal]: https://github.com/TACC/Core-Portal
[@tacc/core-components]: https://www.npmjs.com/package/@tacc/core-components
[@tacc/core-styles]: https://www.npmjs.com/package/@tacc/core-styles

<script type="module">
Array.from(document.body.querySelectorAll('a'))
.filter(link => link.hostname != window.location.hostname)
.forEach(link => link.target = '_blank');
</script>
53 changes: 53 additions & 0 deletions libs/core-styles/fractal.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

const mandelbrot = require('@frctl/mandelbrot');
const fractal = require('@frctl/fractal').create();

// Get base theme
const themeConfig = require('./fractal.theme.js');
const theme = mandelbrot(themeConfig);

// Configure UI
fractal.set('project.title', 'TACC UI Patterns');
fractal.components.set('label', 'Patterns'); // default is 'Components'
fractal.components.set('title', 'Patterns'); // default is 'Components'
fractal.components.set('default.status', 'wip'); // default is 'ready'

// Set source paths
// (for components)
fractal.components.set('path', __dirname + '/src/lib/_imports');
fractal.components.set('resources', {
// Render assets from component folders in a panel
// WARNING: Undocumented feature
// https://github.com/frctl/fractal/issues/150#issuecomment-254642411
// https://github.com/frctl/fractal/issues/93#issuecomment-236429871
assets: {
label: 'Assets',
match: ['**/*.css', '**/*.js'],
},
});
// (for stylesheets)
fractal.components.set('default.context', {
styles: {
internal: {
local: [
'/settings/border.css',
'/settings/color.css',
'/settings/font.css',
'/settings/max-width.css',
'/settings/space.css',
],
},
},
});

// Set website paths
fractal.docs.set('path', __dirname + '/docs');
fractal.web.set('static.path', __dirname + '/dist');
fractal.web.set('builder.dest', __dirname + '/demo');

// Customize theme
fractal.web.theme(theme);

// Export
module.exports = fractal;
12 changes: 12 additions & 0 deletions libs/core-styles/fractal.theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

// To let any client extend
module.exports = {
skin: {
accent: '#000000',
complement: '#ffffff',
links: '#784fe8',
},
panels: ['notes', 'html', 'resources', 'context', 'info'],
nav: ['search', 'docs', 'components'],
};
Loading