@ons/design-system 70.0.11 → 70.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -144,6 +144,42 @@ Generate a build into `./build`.
144
144
  yarn build
145
145
  ```
146
146
 
147
+ ## Manually publish to NPM
148
+
149
+ Make sure you are logged into the CLI with the DS shared npm account
150
+
151
+ Make sure dependencies are installed:
152
+
153
+ ```bash
154
+ yarn install
155
+ ```
156
+
157
+ Set the version (replacing "<DS release version>" with actual release version e.g. 70.0.0):
158
+
159
+ ```bash
160
+ npm version <DS release version>
161
+ ```
162
+
163
+ Create an NPM package by running:
164
+
165
+ ```bash
166
+ yarn npm-bundle
167
+ ```
168
+
169
+ **_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:_**
170
+
171
+ ```bash
172
+ npm pack
173
+ ```
174
+
175
+ Then compare this list with the list of the current version here (https://www.npmjs.com/package/@ons/design-system?activeTab=code)
176
+
177
+ If these match or have some expected changes then run this to publish:
178
+
179
+ ```bash
180
+ npm publish --access public
181
+ ```
182
+
147
183
  ## Recommended Visual Studio Code Extensions for this project
148
184
 
149
185
  - [axe Accessibility Linter](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter)
@@ -2,7 +2,7 @@
2
2
  {% set headingLevel = params.headingLevel | default(2) | string %}
3
3
  {% set openingHeadingTag = "<h" + headingLevel %}
4
4
  {% set closingHeadingTag = "</h" + headingLevel + ">" %}
5
- {% 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" %}
5
+ {% 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" %}
6
6
 
7
7
  <div class="ons-card">
8
8
  <a href="{{ params.url }}" class="ons-card__link">
@@ -21,7 +21,7 @@
21
21
 
22
22
  {% if params.button %}
23
23
  {% from "components/button/_macro.njk" import onsButton %}
24
- {% set btnClasses = params.button.classes if params.button.classes %}
24
+ {% set btnClasses = params.button.classes if params.button.classes else '' %}
25
25
  {% if params.variants and 'dark' in params.variants %}
26
26
  {% set btnClasses = btnClasses + ' ons-btn--ghost' %}
27
27
  {% endif %}
@@ -103,7 +103,7 @@
103
103
  aria-label="{{ abbr.title }}" role="figure"
104
104
  {% endif %}
105
105
  {% if abbr.title %}title="{{ abbr.title }}"{% endif %}
106
- >{{ abbr.text }}
106
+ >{{- abbr.text -}}
107
107
  {{ endTag | safe }}
108
108
  </span>
109
109
  </span>
@@ -107,6 +107,12 @@
107
107
  @extend .ons-u-pb-s;
108
108
  @extend .ons-u-m-no;
109
109
  }
110
+ .ons-list__prefix,
111
+ .ons-list__suffix {
112
+ &--icon-check .ons-icon {
113
+ fill: var(--ons-color-leaf-green) !important;
114
+ }
115
+ }
110
116
  }
111
117
  }
112
118
 
@@ -22,7 +22,6 @@
22
22
  {% endif %}
23
23
  {% set openingTag = "<" + listEl %}
24
24
  {% set closingTag = "</" + listEl + ">" %}
25
-
26
25
  {{ openingTag | safe }}{% if params.id %}{{ ' ' }}id="{{ params.id }}"{% endif %}
27
26
  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 %}>
28
27
  {%- for item in params.itemsList -%}
@@ -48,7 +47,10 @@
48
47
  {% endif %}
49
48
 
50
49
  {%- if item.prefix or (params.iconPosition == 'before') -%}
51
- <span class="ons-list__prefix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
50
+ <span
51
+ class="ons-list__prefix {{ 'ons-list__prefix--icon-check' if params.variants == 'summary' and params.iconType == 'check' }}"
52
+ {% if listEl != 'ol' %}aria-hidden="true"{% endif %}
53
+ >
52
54
  {%- if item.prefix -%}
53
55
  {{- item.prefix -}}.
54
56
  {% elif params.iconPosition == 'before' %}
@@ -87,7 +89,10 @@
87
89
  {{- itemText | safe -}}
88
90
  {%- endif -%}
89
91
  {%- if item.suffix or (params.iconPosition == 'after') -%}
90
- <span class="ons-list__suffix" {% if listEl != 'ol' %}aria-hidden="true"{% endif %}>
92
+ <span
93
+ class="ons-list__suffix {{ 'ons-list__suffix--icon-check' if params.variants == 'summary' and params.iconType == 'check' }}"
94
+ {% if listEl != 'ol' %}aria-hidden="true"{% endif %}
95
+ >
91
96
  {%- if item.suffix -%}
92
97
  {{- item.suffix -}}
93
98
  {%- elif (item.index and listEl != 'ol') or (item.index and listEl == 'ol' and 'bare' in variants) -%}
@@ -109,6 +109,32 @@ describe('macro: list', () => {
109
109
  expect($('.ons-list').hasClass('ons-list--icons')).toBe(true);
110
110
  });
111
111
 
112
+ it('has the correct icon class when variants is `summary`, `iconType` is `check` and `iconPosition` is before', () => {
113
+ const $ = cheerio.load(
114
+ renderComponent('list', {
115
+ ...EXAMPLE_LIST_TEXT_ITEMS,
116
+ iconPosition: 'before',
117
+ iconType: 'check',
118
+ variants: 'summary',
119
+ }),
120
+ );
121
+
122
+ expect($('.ons-list__prefix').hasClass('ons-list__prefix--icon-check')).toBe(true);
123
+ });
124
+
125
+ it('has the correct icon class when variants is `summary`, `iconType` is `check` and `iconPosition` is `after`', () => {
126
+ const $ = cheerio.load(
127
+ renderComponent('list', {
128
+ ...EXAMPLE_LIST_TEXT_ITEMS,
129
+ iconPosition: 'after',
130
+ iconType: 'check',
131
+ variants: 'summary',
132
+ }),
133
+ );
134
+
135
+ expect($('.ons-list__suffix').hasClass('ons-list__suffix--icon-check')).toBe(true);
136
+ });
137
+
112
138
  it('renders a <ul> element by default', () => {
113
139
  const $ = cheerio.load(renderComponent('list', EXAMPLE_LIST_TEXT_ITEMS));
114
140