Skip to content

Commit

Permalink
Merge pull request #911 from dpc-sdp/develop
Browse files Browse the repository at this point in the history
Update docs site
  • Loading branch information
waitingallday authored Oct 25, 2023
2 parents fa875c2 + ffd15fd commit 579bf08
Show file tree
Hide file tree
Showing 215 changed files with 7,425 additions and 4,197 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Publish

on:
push:
branches:
- main
- test-release
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/studio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: studio-nuxt-build
run-name: studio nuxt build

on:
# Runs on pushes targeting the default branch
push:
branches:
- 'develop'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Add write workflow permissions
permissions:
contents: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
# Build job
build-and-deploy:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: docs

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Identify package manager
id: pkgman
run: |
cache=`[ -f "docs/pnpm-lock.yaml" ] && echo "pnpm" || ([ -f "docs/package-lock.json" ] && echo "npm" || ([ -f "docs/yarn.lock" ] && echo "yarn" || echo ""))`
package_manager=`[ ! -z "$cache" ] && echo "$cache" || echo "pnpm"`
echo "cache=$cache" >> $GITHUB_OUTPUT
echo "package_manager=$package_manager" >> $GITHUB_OUTPUT
- uses: pnpm/[email protected]
if: ${{ steps.pkgman.outputs.package_manager == 'pnpm' }}
name: Install pnpm
id: pnpm-install
with:
version: 8.6.2

- uses: actions/setup-node@v3
with:
version: ${{ matrix.node }}
cache: ${{ steps.pkgman.outputs.cache }}

- name: Install dependencies
run: ${{ steps.pkgman.outputs.package_manager }} install

- name: Install @nuxthq/studio
run: ${{ steps.pkgman.outputs.package_manager }} add -D @nuxthq/studio

- name: Create .nuxtrc
run: echo '\nautoImport=true\nmodules[]=@nuxthq/studio' >> .nuxtrc

- name: Generate
run: npx nuxi generate
env:
NUXT_PUBLIC_STUDIO_API_URL: https://api.nuxt.studio
NUXT_PUBLIC_STUDIO_TOKENS: 7ae2515146ef474b6daa2184d4cdf98a00e724791e002e791a928ee41fe5e267

- name: Add .nojekyll file
run: touch .output/public/.nojekyll

# Deployment job
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/.output/public
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"nuxt-ripple",
"@dpc-sdp/nuxt-ripple-cli",
"@dpc-sdp/ripple-test-utils",
"@dpc-sdp/nuxt-ripple-analytics"
"@dpc-sdp/nuxt-ripple-analytics",
"eslint-config-ripple"
],
"cSpell.words": [
"colour",
Expand Down
342 changes: 342 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
<img src="https://img.shields.io/badge/ripple_framework-storybook-ef4b5e" alt="ripple storybook">
</a>

<a href="https://www.npmjs.com/package/@dpc-sdp/ripple-ui-core">
<img src="https://img.shields.io/npm/dw/%40dpc-sdp/ripple-ui-core?logo=npm&logoColor=white&color=%23ef4b5e" alt="ripple ui core npm">
<a href="https://github.com/dpc-sdp/ripple-framework/actions/workflows/components.yml">
<img src="https://img.shields.io/github/actions/workflow/status/dpc-sdp/ripple-framework/main.yml" alt="build status">
</a>

<a href="https://app.circleci.com/pipelines/github/dpc-sdp/ripple-framework?branch=develop">
<img src="https://img.shields.io/circleci/build/github/dpc-sdp/ripple-framework/develop?logo=circle" alt="ripple develop branch build status">
</a>

# Ripple 2.0

Expand All @@ -25,6 +22,8 @@
**Table of Contents**
- [About the project](#about-the-project)
- [Ripple Framework](#ripple-framework)
- [Usage](#usage)
- [Availability](#availability)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [License](#license)
Expand All @@ -42,19 +41,34 @@ Ripple is a system of reusable styles, components, patterns and tools for buildi

Over 50 government websites use Ripple to date, including our main vic.gov.au platform. These sites attract the visitation of millions of views per month.


### Ripple Framework

The Ripple design system consists of the design elements and components used to build websites using the Victorian government brand and Ripple _framework_, a collection of [Nuxt 3](https://www.ripple.sdp.vic.gov.au/framework/key-concepts/nuxt/) modules and [layers](https://www.ripple.sdp.vic.gov.au/framework/key-concepts/nuxt-layers) primarily used to create headless SDP websites using the [Tide Drupal CMS](https://github.com/dpc-sdp/tide).
The Ripple design system consists of the design elements and components used to build websites using the Victorian government brand and Ripple _framework_, a collection of [Nuxt](https://www.ripple.sdp.vic.gov.au/framework/key-concepts/nuxt/) modules and [layers](https://www.ripple.sdp.vic.gov.au/framework/key-concepts/nuxt-layers) primarily used to create headless SDP websites using the [Tide Drupal CMS](https://github.com/dpc-sdp/tide).

Ripple components are built using Vue 3 and [TypeScript](https://github.com/dpc-sdp/ripple-framework/blob/develop/tsconfig.json).

The monorepo is managed with pnpm [workspaces](https://github.com/dpc-sdp/ripple-framework/blob/develop/pnpm-workspace.yaml), using [Node.js](.nvmrc).

Tests use [Jest](https://github.com/dpc-sdp/ripple-framework/blob/develop/jest.config.js), [Axe-core](https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/ripple-ui-core/stories/interactions.js) and [Cypress](packages/ripple-test-utils).

We use custom rules for [ESLint](https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/eslint-config-ripple/index.js) and [Stylelint](https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/stylelint-config-ripple/index.js).

### Usage

Ripple was built as a whole to implement front end sites for SDP using a framework of Vue 3 and Nuxt 3, but parts of the modular architecture can be used independently: `ripple-ui-core` and `ripple-ui-forms` can be used as UI component libraries for any Vue 3 project.

There is also an experimental web components implementation, and a standalone export of all Ripple design system CSS. See the [relevant section](https://ripple.sdp.vic.gov.au/design-system/develop/usage/) on the Ripple documentation site for more details.

### Availability

Note: Ripple 2 will only be hosted on Github Packages, any packages still published to npm are either pre-release or deprecated, and should not be used. Please see the section [Access to Github Packages repos](https://www.ripple.vic.gov.au/design-system/develop/usage#access-to-github-packages-repos) for instructions on how to set up a personal access token, and where to use it.

## Documentation

See https://www.ripple.sdp.vic.gov.au/ for more information about the Ripple design system.

For information about using Ripple in SDP websites see the [Ripple Framework](https://www.ripple.sdp.vic.gov.au/framework) section.


## Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md) as well as https://www.ripple.sdp.vic.gov.au/design-system/develop/contributing/ for information about how to submit changes to Ripple.
Expand Down
86 changes: 3 additions & 83 deletions docs/content/design-system/3.develop/3.usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,101 +16,21 @@ Whilst Ripple is built to implement sites using a framework built on Vue JS and

![ripple is made up of Figma design, CSS styles, Vue JS components and Nuxt JS Sites](/assets/img/modules/rpl-modules.png)


Ripple UI libraries are usable in the following contexts:

<svg id="docs-sprite" aria-hidden="true" class="rpl-svg-sprite--hidden"><defs><symbol xmlns="http://www.w3.org/2000/svg" id="icon-check" viewBox="0 0 24 24"><path d="M22.9.4c-1.1-.7-2.6-.4-3.3.8L9.2 17.8l-5.1-5.1c-.9-.9-2.5-.9-3.4 0s-.9 2.5 0 3.4l7.2 7.2c1.1 1.1 2.9.9 3.7-.4l12-19.2c.7-1.2.4-2.6-.7-3.3z"></path></symbol></defs></svg>

| Library | CSS styles | Vue Components | Ripple Framework (Nuxt) | Web components |
| Library | CSS styles | Vue Components | Ripple Framework (Nuxt) | Web components |
| --------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------- |
| Ripple UI Core | <svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> | <svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> |<svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> | Partial support |
| Ripple UI Forms | <svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> | <svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> |<svg width="12" height="12"><title>supported</title><use xlink:href="#icon-check"></use></svg> | <svg width="12" height="12"><title>not supported</title><use xlink:href="#icon-cancel"></use></svg> |




### Using in an SDP website

> If you are using Ripple 2 to build a site on the SDP platform, the UI libraries will be included automatically when scaffolding your project.
>
> For documentation on using Ripple with Nuxt in SDP sites, visit the [Ripple Framework documentation](/framework)
### Using in a Vue app

To install Ripple UI in your project, run:

`npm install @dpc-sdp/ripple-ui-core --save`

In order for the styles to appear correctly, you will need to import them. Do this at the root of your project (usually in your app.vue or index.js file):

```js
import '@dpc-sdp/ripple-ui-core/style';
import '@dpc-sdp/ripple-ui-core/style/components';
```

To use a component, import it from `@dpc-sdp/ripple-ui-core/vue`, note the addition of `/vue`.

```js
<script setup>
import { RplButton } from '@dpc-sdp/ripple-ui-core/vue';
</script>

<template>
<RplButton variant="outlined" />
</template>
```

### Using in a Nuxt app

To install Ripple UI in your project, run:

`npm install @dpc-sdp/ripple-ui-core --save`

Ripple UI exports a nuxt module that you can add to your nuxt config, note the addition of `/nuxt`:

```js
export default defineNuxtConfig({
modules: [
'@dpc-sdp/ripple-ui-core/nuxt'
]
})
```

In order for the styles to appear correctly, you will need to import them. Do this at the root of your project (usually in your app.vue file):

```js
import '@dpc-sdp/ripple-ui-core/style';
import '@dpc-sdp/ripple-ui-core/style/components';
```

There is no need to import the components as they will be registered globally by the nuxt module

```js
<template>
<RplButton variant="outlined" />
</template>
```

### Webcomponents

> Web components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML.
>
> Web components are based on existing web standards. Features to support web components are currently being added to the HTML and DOM specs, letting web developers easily extend HTML with new elements with encapsulated styling and custom behavior.
> https://www.webcomponents.org/
Ripple exports a limited set of components as standard browser native webcomponents. The advantage of using Webcomponents is they can be dropped straight into traditional webpages and CMS's that do not have javascript build pipeline such as Squiz Matrix and Salesforce.

Support for this output target is currently experimental, if you think you have a use case for using Webcomponents in your project please add a comment [here](https://github.com/dpc-sdp/ripple-framework/discussions/658).

### Using Ripple CSS styles only

Ripple UI core exports it's CSS stylesheets directly. If you have a use case where you can't use any of the other outputs, you can use our styles directly and provide your own markup based upon the rendered examples in Storybook.

To import CSS styles only you can import them from the ripple-ui-core package.

```js
import '@dpc-sdp/ripple-ui-core/style';
import '@dpc-sdp/ripple-ui-core/style/components';
```
### Github Packages

We recommend that you lock the version of `@dpc-sdp/ripple-ui-core` so that any future changes of styles without changes to markup do not break your application.
Ripple 2 is hosted publicly on Github Packages (ghcr) under the **@dpc/sdp** namespace, please read these [setup instructions for accessing Github Packages](/design-system/develop/usage/access-to-github-packages).
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Access to Github Packages
description: How to access and use repos hosted on Github Packages.
layout: page
---

NPM allows the use of multiple repo hosts, as long as they can be identified by namespace.

Ripple 2 is hosted publicly on Github Packages (ghcr) under the **@dpc/sdp** namespace, so a few steps need to be followed access these packages, while also co-existing with the npm ecosystem.

First, create a Personal Access Token on Github:

1. Visit https://github.com/settings/tokens and select **Generate new token** > **Generate new token (classic)**

::DocsImageExample
---
src: /img/generate.jpg
alt: "Screenshot of a clicked button (title Generate new token) that has opened a drop-down menu with two options: fine-grained and classic"
style: "width:360px"
---
::

2. Fill in the **Note** and choose an **Expiration** - the 30 day default is generally fine, you'll receive a reminder to regenerate the token just before expiry

::DocsImageExample
---
src: /img/token.jpg
alt: "Screenshot of personal access token setup form, with 'Note' filled in as 'public ghcr access' and 'Expiration' set to default of 30 days"
style: "width:505px"
---
::

3. Set the scope to only allow `read:packages`, and **Generate** token

::DocsImageExample
---
src: /img/permissions.jpg
alt: "Screenshot of scope, with only read:packages selected"
style: "width:827px"
---
::

4. Store the resulting token somewhere secure, and add it to either a user `.npmrc` (recommended) or the project-level `.npmrc` (the url on line 2 below is protocol-less, not a comment):

```
@dpc-sdp:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<github personal access token>
```
32 changes: 32 additions & 0 deletions docs/content/design-system/3.develop/4.usage/2.vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Vue
description: How to use Ripple components with Vue.
layout: page
---

First, set up [access to Github Packages](access-to-github-packages).

Next, install Ripple UI in your project:

`npm install @dpc-sdp/ripple-ui-core --save`

In order for the styles to appear correctly, you will need to import them. Do this at the root of your project (usually in your app.vue or index.js file):

```js
import '@dpc-sdp/ripple-ui-core/style';
import '@dpc-sdp/ripple-ui-core/style/components';
```

To use a component, import it from `@dpc-sdp/ripple-ui-core/vue`, note the addition of `/vue`.

```js
<script setup>
import { RplButton } from '@dpc-sdp/ripple-ui-core/vue';
</script>

<template>
<RplButton variant="outlined" />
</template>
```

Please see this [example app](https://github.com/dpc-sdp/ripple-vue-example) for a basic demonstration of how to use Ripple components in a Vue app.
38 changes: 38 additions & 0 deletions docs/content/design-system/3.develop/4.usage/3.nuxt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Nuxt
description: How to use Ripple components with Nuxt in a non-SDP context.
layout: page
---

First, set up [access to Github Packages](access-to-github-packages).

Next, install Ripple UI in your project:

`npm install @dpc-sdp/ripple-ui-core --save`

Ripple UI exports a nuxt module that you can add to your nuxt config, note the addition of `/nuxt`:

```js
export default defineNuxtConfig({
modules: [
'@dpc-sdp/ripple-ui-core/nuxt'
]
})
```

In order for the styles to appear correctly, you will need to import them. Do this at the root of your project (usually in your app.vue file):

```js
import '@dpc-sdp/ripple-ui-core/style';
import '@dpc-sdp/ripple-ui-core/style/components';
```

There is no need to import the components as they will be registered globally by the nuxt module

```js
<template>
<RplButton variant="outlined" />
</template>
```

Even if you are not using SDP, the [Ripple Framework documentation](/framework) is a good starting point for any Nuxt development using Ripple.
Loading

0 comments on commit 579bf08

Please sign in to comment.