Skip to content

Commit

Permalink
Merge branch 'main' into feature/132/refactor-address-input-test
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons authored Sep 2, 2024
2 parents 76fa362 + 650f48a commit 70b5a3e
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- run: yarn npm-bundle
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,42 @@ Generate a build into `./build`.
yarn build
```

## Manually publish to NPM

Make sure you are logged into the CLI with the DS shared npm account

Make sure dependencies are installed:

```bash
yarn install
```

Set the version (replacing "<DS release version>" with actual release version e.g. 70.0.0):

```bash
npm version <DS release version>
```

Create an NPM package by running:

```bash
yarn npm-bundle
```

**_Once you have published to npm, the version you have published can never be used again so you want to make sure you have the right files included to do this run:_**

```bash
npm pack
```

Then compare this list with the list of the current version here (https://www.npmjs.com/package/@ons/design-system?activeTab=code)

If these match or have some expected changes then run this to publish:

```bash
npm publish --access public
```

## Recommended Visual Studio Code Extensions for this project

- [axe Accessibility Linter](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter)
Expand Down
4 changes: 0 additions & 4 deletions __snapshots__/layout/_template.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `




<ul class="ons-list ons-u-mb-no ons-list--bare">


Expand Down Expand Up @@ -1460,7 +1459,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `




<ul class="ons-list ons-u-mb-no ons-list--bare">


Expand Down Expand Up @@ -1525,7 +1523,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `




<ul class="ons-list ons-u-mb-no ons-list--bare">


Expand Down Expand Up @@ -1606,7 +1603,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `




<ul class="ons-list ons-u-mb-s ons-footer--rows ons-list--bare ons-list--inline">


Expand Down
2 changes: 1 addition & 1 deletion src/components/card/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set headingLevel = params.headingLevel | default(2) | string %}
{% set openingHeadingTag = "<h" + headingLevel %}
{% set closingHeadingTag = "</h" + headingLevel + ">" %}
{% set placeholderSrcset = (params.image.placeholderURL if params.image.placeholderURL) + "/img/small/placeholder-card.png 1x, " + (params.image.placeholderURL if params.image.placeholderURL else "") + "/img/large/placeholder-card.png 2x" %}
{% set placeholderSrcset = (params.image.placeholderURL if params.image.placeholderURL else "") + "/img/small/placeholder-card.png 1x, " + (params.image.placeholderURL if params.image.placeholderURL else "") + "/img/large/placeholder-card.png 2x" %}

<div class="ons-card">
<a href="{{ params.url }}" class="ons-card__link">
Expand Down
2 changes: 1 addition & 1 deletion src/components/hero/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

{% if params.button %}
{% from "components/button/_macro.njk" import onsButton %}
{% set btnClasses = params.button.classes if params.button.classes %}
{% set btnClasses = params.button.classes if params.button.classes else '' %}
{% if params.variants and 'dark' in params.variants %}
{% set btnClasses = btnClasses + ' ons-btn--ghost' %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
aria-label="{{ abbr.title }}" role="figure"
{% endif %}
{% if abbr.title %}title="{{ abbr.title }}"{% endif %}
>{{ abbr.text }}
>{{- abbr.text -}}
{{ endTag | safe }}
</span>
</span>
Expand Down
6 changes: 6 additions & 0 deletions src/components/list/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@
@extend .ons-u-pb-s;
@extend .ons-u-m-no;
}
.ons-list__prefix,
.ons-list__suffix {
&--icon-check .ons-icon {
fill: var(--ons-color-leaf-green) !important;
}
}
}
}

Expand Down
11 changes: 8 additions & 3 deletions src/components/list/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
{% endif %}
{% set openingTag = "<" + listEl %}
{% set closingTag = "</" + listEl + ">" %}

{{ openingTag | safe }}{% if params.id %}{{ ' ' }}id="{{ params.id }}"{% endif %}
class="ons-list{{ ' ons-list--p' if listEl == 'p' }}{{ ' ' + params.classes if params.classes else '' }}{% if params.variants %}{% if params.variants is not string %}{% for variant in variants %}{{ ' ' }}ons-list--{{ variant }}{% endfor %}{% else %}{{ ' ' }}ons-list--{{ variants }}{% endif %}{% endif %}{{ ' ' + otherClasses if otherClasses else '' }}"{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}>
{%- for item in params.itemsList -%}
Expand All @@ -48,7 +47,10 @@
{% endif %}

{%- if item.prefix or (params.iconPosition == 'before') -%}
<span class="ons-list__prefix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
<span
class="ons-list__prefix {{ 'ons-list__prefix--icon-check' if params.variants == 'summary' and params.iconType == 'check' }}"
{% if listEl != 'ol' %}aria-hidden="true"{% endif %}
>
{%- if item.prefix -%}
{{- item.prefix -}}.
{% elif params.iconPosition == 'before' %}
Expand Down Expand Up @@ -87,7 +89,10 @@
{{- itemText | safe -}}
{%- endif -%}
{%- if item.suffix or (params.iconPosition == 'after') -%}
<span class="ons-list__suffix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
<span
class="ons-list__suffix {{ 'ons-list__suffix--icon-check' if params.variants == 'summary' and params.iconType == 'check' }}"
{% if listEl != 'ol' %}aria-hidden="true"{% endif %}
>
{%- if item.suffix -%}
{{- item.suffix -}}
{%- elif (item.index and listEl != 'ol') or (item.index and listEl == 'ol' and 'bare' in variants) -%}
Expand Down
26 changes: 26 additions & 0 deletions src/components/list/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,32 @@ describe('macro: list', () => {
expect($('.ons-list').hasClass('ons-list--icons')).toBe(true);
});

it('has the correct icon class when variants is `summary`, `iconType` is `check` and `iconPosition` is before', () => {
const $ = cheerio.load(
renderComponent('list', {
...EXAMPLE_LIST_TEXT_ITEMS,
iconPosition: 'before',
iconType: 'check',
variants: 'summary',
}),
);

expect($('.ons-list__prefix').hasClass('ons-list__prefix--icon-check')).toBe(true);
});

it('has the correct icon class when variants is `summary`, `iconType` is `check` and `iconPosition` is `after`', () => {
const $ = cheerio.load(
renderComponent('list', {
...EXAMPLE_LIST_TEXT_ITEMS,
iconPosition: 'after',
iconType: 'check',
variants: 'summary',
}),
);

expect($('.ons-list__suffix').hasClass('ons-list__suffix--icon-check')).toBe(true);
});

it('renders a <ul> element by default', () => {
const $ = cheerio.load(renderComponent('list', EXAMPLE_LIST_TEXT_ITEMS));

Expand Down
21 changes: 4 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4141,23 +4141,10 @@ electron-to-chromium@^1.4.535:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.557.tgz#f3941b569c82b7bb909411855c6ff9bfe1507829"
integrity sha512-6x0zsxyMXpnMJnHrondrD3SuAeKcwij9S+83j2qHAQPXbGTDDfgImzzwgGlzrIcXbHQ42tkG4qA6U860cImNhw==

elliptic@^6.5.3:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
dependencies:
bn.js "^4.11.9"
brorand "^1.1.0"
hash.js "^1.0.0"
hmac-drbg "^1.0.1"
inherits "^2.0.4"
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"

elliptic@^6.5.5:
version "6.5.5"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded"
integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==
elliptic@^6.5.3, elliptic@^6.5.5:
version "6.5.7"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b"
integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==
dependencies:
bn.js "^4.11.9"
brorand "^1.1.0"
Expand Down

0 comments on commit 70b5a3e

Please sign in to comment.