Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
dfe800d
Add showcase package
ncamera Nov 10, 2024
89b569c
Improve showcase implementation
ncamera Nov 11, 2024
1685c9c
Improve showcase implementation
ncamera Nov 11, 2024
fcd024a
Improve showcase implementation
ncamera Nov 11, 2024
ebd78b9
Add radio group page
ncamera Nov 11, 2024
e8abd69
Add support to choose the DS and color scheme
ncamera Nov 11, 2024
3fee29e
Refactor navigation to update navigation-list links
ncamera Nov 11, 2024
97324ea
Add "elevation" page
ncamera Nov 11, 2024
927813b
Add "icons" page
ncamera Nov 12, 2024
373b02f
Add search in the icons page
ncamera Nov 12, 2024
d16e1be
Improve style
ncamera Nov 12, 2024
38a57ea
Improve customization and refactor some code to extract logic into se…
ncamera Nov 13, 2024
d436d11
Add Chameleon Compatibility page and refactor some services
ncamera Nov 13, 2024
126e579
Update templates, routes and package-lock
ncamera Nov 13, 2024
b0907e1
Merge branch 'main' into feat/showcase
ncamera Jan 4, 2025
972bc1d
Update compatibility tables
ncamera Jan 5, 2025
04cae1c
[unanimo] Rename "switch" class to "toggle"
ncamera Jan 5, 2025
1055baa
Add missing commit
ncamera Jan 5, 2025
1080590
Add dropdown, navigation-list, segmented-control and slider bundles
ncamera Jan 5, 2025
a08422d
[mercury] Add support to customize the theme names of the bundles wit…
ncamera Jan 5, 2025
ed5d3bf
[unanimo] Add support for loading bundles the same way Mercury does
ncamera Jan 5, 2025
44727ea
Update package-lock.json
ncamera Jan 5, 2025
b4d663b
Fix breaking changes and improve CSS loading performance
ncamera Jan 5, 2025
6d7d3ad
Bump versions and use local DSs
ncamera Jan 5, 2025
992ab97
[mercury] Export MERCURY_ASSETS entry
ncamera Jan 5, 2025
96cc0b0
Create package-lock.json
ncamera Jan 5, 2025
754868f
Add support to conditional render categories
ncamera Jan 6, 2025
37d01df
Add support for displaying templates of different frameworks
ncamera Jan 7, 2025
24bbaac
Add "Introduction" routes and add some fixes
ncamera Jan 7, 2025
b164d38
"Getting started" routes, first bits
ncamera Jan 8, 2025
a3e42e6
Reduce flickering when navigating in the app
ncamera Jan 8, 2025
48cdc15
Simplify development by declaring the metadata for each page
ncamera Jan 8, 2025
2b5894c
Create netlify.toml
ncamera Jan 8, 2025
20bd102
Reduce the flickering even more
ncamera Jan 8, 2025
54ba635
Simplify template definition
ncamera Jan 8, 2025
9fd66cc
Add showcase for the combo-box
ncamera Jan 8, 2025
4a6755f
Add showcase for the slider
ncamera Jan 8, 2025
15b44cc
Add showcase for the search component
ncamera Jan 8, 2025
add0bd8
Improve examples
ncamera Jan 8, 2025
8d9ad97
Start adding "label" showcase and fix some issues with icons
ncamera Jan 8, 2025
23092aa
Use onPush change detection
ncamera Jan 8, 2025
22b2f29
Add logos and improve styles
ncamera Jan 9, 2025
099ffd8
Simplify routing
ncamera Jan 9, 2025
a3a9533
Add showcase for typographies
ncamera Jan 9, 2025
ee71da7
Improve showcase for typograpies
ncamera Jan 9, 2025
185bdf6
Improve styles
ncamera Jan 9, 2025
67c091f
Improve code templates and start adding "Gemini migration" showcase
ncamera Jan 9, 2025
004d4c5
Improve examples
ncamera Jan 9, 2025
388a165
Improve code templates and add more cases for the "Gemini migration" …
ncamera Jan 10, 2025
d99aad8
Improve showcase
ncamera Jan 10, 2025
efa787c
Add more cases for the "label" showcase
ncamera Jan 10, 2025
3277afa
Fix change detection bugs
ncamera Jan 10, 2025
a84cb8d
Add showcase for the icon components and minor improvements
ncamera Jan 10, 2025
6a1a429
Improve examples
ncamera Jan 10, 2025
4b693e1
Improve examples
ncamera Jan 10, 2025
b4ef975
Add showcase for the dialog component and minor fixes
ncamera Jan 10, 2025
e82c065
Merge branch 'main' into feat/showcase
Jan 14, 2025
8e10f2d
Revert change for renaming "switch" to "toggle"
ncamera Jan 14, 2025
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
5,372 changes: 5,372 additions & 0 deletions packages/mercury/package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/mercury/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"default": "./dist/index.js"
}
},
"./MERCURY_ASSETS.js": {
"import": {
"types": "./dist/assets/MERCURY_ASSETS.d.ts",
"default": "./dist/assets/MERCURY_ASSETS.js"
}
},
"./assets-manager.js": {
"import": {
"types": "./dist/assets-manager.d.ts",
Expand Down
120 changes: 73 additions & 47 deletions packages/mercury/src/bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,28 @@ type BundleNames =
| MercuryBundleUtil
| MercuryBundleUtilFormFull;

const getThemeModelItem = <T extends BundleNames>(
const getThemeModelItem = <T extends BundleNames, S extends string>(
basePath: string,
bundleName: T,
bundleNamePrefix: S | undefined,
attachStyleSheet: boolean | undefined = undefined
) =>
attachStyleSheet === undefined
) => {
const bundleNameWithPrefix = bundleNamePrefix
? bundleNamePrefix + bundleName
: bundleName;
const bundleURL = `${basePath}${bundleName}.css`;

return attachStyleSheet === undefined
? ({
name: bundleName,
url: `${basePath}${bundleName}.css`
name: bundleNameWithPrefix,
url: bundleURL
} as const satisfies ThemeItemModel)
: ({
name: bundleName,
url: `${basePath}${bundleName}.css`,
name: bundleNameWithPrefix,
url: bundleURL,
attachStyleSheet
} as const satisfies ThemeItemModel);
};

/**
* Given the basePath, returns all bundles (except base and icons) in the
Expand All @@ -49,50 +56,65 @@ const getThemeModelItem = <T extends BundleNames>(
* </body>
* ```
*/
export const getThemeBundles = (basePath: string) =>
export const getThemeBundles = (basePath: string, bundleNamePrefix?: string) =>
[
// Components
getThemeModelItem(basePath, "components/accordion"),
getThemeModelItem(basePath, "components/button"),
getThemeModelItem(basePath, "components/chat"),
getThemeModelItem(basePath, "components/checkbox"),
getThemeModelItem(basePath, "components/code"),
getThemeModelItem(basePath, "components/combo-box"),
getThemeModelItem(basePath, "components/flexible-layout"),
getThemeModelItem(basePath, "components/dialog"),
getThemeModelItem(basePath, "components/dropdown"),
getThemeModelItem(basePath, "components/icon"),
getThemeModelItem(basePath, "components/edit"),
getThemeModelItem(basePath, "components/layout-splitter"),
getThemeModelItem(basePath, "components/list-box"),
getThemeModelItem(basePath, "components/markdown-viewer", false),
getThemeModelItem(basePath, "components/navigation-list"),
getThemeModelItem(basePath, "components/pills"),
getThemeModelItem(basePath, "components/radio-group"),
getThemeModelItem(basePath, "components/segmented-control"),
getThemeModelItem(basePath, "components/sidebar"),
getThemeModelItem(basePath, "components/slider"),
getThemeModelItem(basePath, "components/tab"),
getThemeModelItem(basePath, "components/tabular-grid"),
getThemeModelItem(basePath, "components/ticket-list"),
getThemeModelItem(basePath, "components/switch"),
getThemeModelItem(basePath, "components/tooltip"),
getThemeModelItem(basePath, "components/tree-view"),
getThemeModelItem(basePath, "components/widget"),
getThemeModelItem(basePath, "components/accordion", bundleNamePrefix),
getThemeModelItem(basePath, "components/button", bundleNamePrefix),
getThemeModelItem(basePath, "components/chat", bundleNamePrefix),
getThemeModelItem(basePath, "components/checkbox", bundleNamePrefix),
getThemeModelItem(basePath, "components/code", bundleNamePrefix),
getThemeModelItem(basePath, "components/combo-box", bundleNamePrefix),
getThemeModelItem(basePath, "components/flexible-layout", bundleNamePrefix),
getThemeModelItem(basePath, "components/dialog", bundleNamePrefix),
getThemeModelItem(basePath, "components/dropdown", bundleNamePrefix),
getThemeModelItem(basePath, "components/icon", bundleNamePrefix),
getThemeModelItem(basePath, "components/edit", bundleNamePrefix),
getThemeModelItem(basePath, "components/layout-splitter", bundleNamePrefix),
getThemeModelItem(basePath, "components/list-box", bundleNamePrefix),
getThemeModelItem(
basePath,
"components/markdown-viewer",
bundleNamePrefix,
false
),
getThemeModelItem(basePath, "components/navigation-list", bundleNamePrefix),
getThemeModelItem(basePath, "components/pills", bundleNamePrefix),
getThemeModelItem(basePath, "components/radio-group", bundleNamePrefix),
getThemeModelItem(
basePath,
"components/segmented-control",
bundleNamePrefix
),
getThemeModelItem(basePath, "components/sidebar", bundleNamePrefix),
getThemeModelItem(basePath, "components/slider", bundleNamePrefix),
getThemeModelItem(basePath, "components/switch", bundleNamePrefix),
getThemeModelItem(basePath, "components/tab", bundleNamePrefix),
getThemeModelItem(basePath, "components/tabular-grid", bundleNamePrefix),
getThemeModelItem(basePath, "components/ticket-list", bundleNamePrefix),
getThemeModelItem(basePath, "components/tooltip", bundleNamePrefix),
getThemeModelItem(basePath, "components/tree-view", bundleNamePrefix),
getThemeModelItem(basePath, "components/widget", bundleNamePrefix),

// Resets
getThemeModelItem(basePath, "resets/box-sizing"),
getThemeModelItem(basePath, "resets/box-sizing", bundleNamePrefix),

// Utils
getThemeModelItem(basePath, "utils/form"),
getThemeModelItem(basePath, "utils/elevation"),
getThemeModelItem(basePath, "utils/form--full"),
getThemeModelItem(basePath, "utils/layout"),
getThemeModelItem(basePath, "utils/spacing"),
getThemeModelItem(basePath, "utils/typography"),
getThemeModelItem(basePath, "chameleon/scrollbar")
getThemeModelItem(basePath, "utils/form", bundleNamePrefix),
getThemeModelItem(basePath, "utils/elevation", bundleNamePrefix),
getThemeModelItem(basePath, "utils/form--full", bundleNamePrefix),
getThemeModelItem(basePath, "utils/layout", bundleNamePrefix),
getThemeModelItem(basePath, "utils/spacing", bundleNamePrefix),
getThemeModelItem(basePath, "utils/typography", bundleNamePrefix),
getThemeModelItem(basePath, "chameleon/scrollbar", bundleNamePrefix)
] as const satisfies ThemeModel;

const addPrefixToBundleNames = (
bundles: MercuryBundleOptimized[] | MercuryBundleFull[],
bundleNamePrefix?: string
) =>
bundleNamePrefix ? bundles.map(bundle => bundleNamePrefix + bundle) : bundles;

/**
* Given the bundles array and the basePath (optional), returns the given
* bundles in the format of type `ThemeModel`.
Expand All @@ -111,7 +133,8 @@ export const getThemeBundles = (basePath: string) =>
* "utils/form",
* "utils/layout",
* ],
* "./assets/css/"
* "./assets/css/", (optional)
* "mercury" (optional)
* );
*
* HTML/render/template:
Expand All @@ -123,8 +146,11 @@ export const getThemeBundles = (basePath: string) =>
*/
export const getBundles = (
bundles: MercuryBundleOptimized[] | MercuryBundleFull[],
basePath?: string
basePath?: string,
bundleNamePrefix?: string
): ThemeModel =>
basePath
? bundles.map(bundle => getThemeModelItem(basePath, bundle))
: bundles;
? bundles.map(bundle =>
getThemeModelItem(basePath, bundle, bundleNamePrefix)
)
: addPrefixToBundleNames(bundles, bundleNamePrefix);
2 changes: 2 additions & 0 deletions packages/mercury/src/components/code/_tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
--code__border: var(--mer-border__width--sm) solid
var(--mer-surface__elevation--03);
--code__border-radius: var(--mer-border__radius--sm);

// TODO: Fix this. It MUST be two separated properties (padding-block and padding-inline)
--code__padding: var(--mer-spacing--xs) var(--mer-spacing--sm);

--ch-code__doctag: var(--code__color-blue);
Expand Down
17 changes: 17 additions & 0 deletions packages/showcase/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single
ij_typescript_use_double_quotes = false

[*.md]
max_line_length = off
trim_trailing_whitespace = false
42 changes: 42 additions & 0 deletions packages/showcase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
13 changes: 13 additions & 0 deletions packages/showcase/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"printWidth": 80,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
}
27 changes: 27 additions & 0 deletions packages/showcase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Showcase

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.11.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
Loading
Loading