@ilo-org/twig 0.14.0 → 0.14.2
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/.turbo/turbo-build:lib.log +2 -2
- package/CHANGELOG.md +16 -0
- package/apps/storybook/patterns/intro.stories.mdx +132 -264
- package/apps/storybook/patterns/welcome.stories.mdx +10 -1
- package/package.json +3 -3
- package/src/patterns/components/localnav/localnav.twig +7 -4
- package/src/patterns/components/navigation/navigation.twig +35 -29
- package/src/patterns/components/tooltip/tooltip.twig +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @ilo-org/twig@0.14.
|
|
2
|
+
> @ilo-org/twig@0.14.2 build:lib /home/runner/work/designsystem/designsystem/packages/twig
|
|
3
3
|
> node importprefix.js && node importsvgs.js && pnpm output
|
|
4
4
|
|
|
5
5
|
theme prefix added
|
|
6
6
|
|
|
7
|
-
> @ilo-org/twig@0.14.
|
|
7
|
+
> @ilo-org/twig@0.14.2 output /home/runner/work/designsystem/designsystem/packages/twig
|
|
8
8
|
> node outputtwigs.js
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ilo-org/twig
|
|
2
2
|
|
|
3
|
+
## 0.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d67dc414b: Don't show language selector in Nav if no links are passed to the Language Context Menu
|
|
8
|
+
- Updated dependencies [08a2141cc]
|
|
9
|
+
- Updated dependencies [dea2d0a07]
|
|
10
|
+
- @ilo-org/styles@0.13.1
|
|
11
|
+
|
|
12
|
+
## 0.14.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 9d79b2a6f: Modify tooltip label and icon condition
|
|
17
|
+
- 1e6365385: Add popperjs as a dependency in twig instead of as a dev dependency
|
|
18
|
+
|
|
3
19
|
## 0.14.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -4,23 +4,12 @@ import { getStorybook, storiesOf } from "@storybook/react";
|
|
|
4
4
|
import LinkTo from "@storybook/addon-links/react";
|
|
5
5
|
|
|
6
6
|
<Meta
|
|
7
|
-
title="
|
|
7
|
+
title="Getting Started"
|
|
8
8
|
parameters={{ viewMode: "docs", previewTabs: { canvas: { hidden: true } } }}
|
|
9
9
|
/>
|
|
10
10
|
|
|
11
11
|
<div style={{ paddingTop: "40px", color: "inherit" }}>
|
|
12
|
-
<
|
|
13
|
-
style={{
|
|
14
|
-
fontFamily: "Overpass",
|
|
15
|
-
fontSize: "56.95px",
|
|
16
|
-
fontWeight: "700",
|
|
17
|
-
marginBottom: "40px",
|
|
18
|
-
border: "none",
|
|
19
|
-
}}
|
|
20
|
-
>
|
|
21
|
-
ILO Design System
|
|
22
|
-
</h2>
|
|
23
|
-
<h3
|
|
12
|
+
<h1
|
|
24
13
|
style={{
|
|
25
14
|
fontFamily: "Overpass",
|
|
26
15
|
fontSize: "45.56px",
|
|
@@ -29,288 +18,167 @@ import LinkTo from "@storybook/addon-links/react";
|
|
|
29
18
|
}}
|
|
30
19
|
>
|
|
31
20
|
Getting Started
|
|
32
|
-
</
|
|
21
|
+
</h1>
|
|
33
22
|
</div>
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- [@ilo-org/themes](./packages/themes)
|
|
38
|
-
- [@ilo-org/fonts](./packages/fonts)
|
|
39
|
-
- [@ilo-org/styles](./packages/styles)
|
|
40
|
-
- [@ilo-org/utils](./packages/utils)
|
|
41
|
-
- [@ilo-org/icons](./packages/icons)
|
|
42
|
-
|
|
43
|
-
<h4
|
|
44
|
-
style={{
|
|
45
|
-
fontFamily: "Overpass",
|
|
46
|
-
fontSize: "29px",
|
|
47
|
-
fontWeight: "700",
|
|
48
|
-
marginBottom: "40px",
|
|
49
|
-
marginTop: "40px",
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
Installation and PNPM Commands
|
|
53
|
-
</h4>
|
|
54
|
-
|
|
55
|
-
To install
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm i @ilo-org/twig
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
To start storybook
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pnpm storybook
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
To build storybook
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pnpm build:storybook
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
To build and start storybook
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm build
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
To build Twigs to be used in a CMS like Drupal (this will output Twigs and necessary JavaScript to a `/dist` folder.)
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pnpm output
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
This package imports the `prefix` from the `themes` package; to manually import it, run
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
pnpm import:prefix
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
This package imports icon svgs from the `icons` package; to manually import them, run
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
pnpm import:svgs
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
<h4
|
|
98
|
-
style={{
|
|
99
|
-
fontFamily: "Overpass",
|
|
100
|
-
fontSize: "29px",
|
|
101
|
-
fontWeight: "700",
|
|
102
|
-
marginBottom: "40px",
|
|
103
|
-
marginTop: "40px",
|
|
104
|
-
}}
|
|
105
|
-
>
|
|
106
|
-
Architecture
|
|
107
|
-
</h4>
|
|
108
|
-
|
|
109
|
-
Because this is a modified version of Storybook which compliles and displays Twigs instead of React components, there are some notable differences between this and vanilla versions of Storybook. One prominent difference is in directory structure. Each component folder, located in `src/patterns/components`, contains the following files:
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
component.stories.jsx
|
|
113
|
-
component.twig
|
|
114
|
-
component.wingsuit.yml
|
|
115
|
-
index.js
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
and potentially, if Javascript interactivity exists, also the following:
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
component.behavior.js
|
|
122
|
-
component.js
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Wingsuit consumes the `component.wingsuit.yml` file, which is a [UI Pattern YAML](https://wingsuit-designsystem.github.io/components/wingsuit/) borrowed from [Drupal](https://www.drupal.org/project/ui_patterns_settings), and uses this to populate and format the Storybook story for each components. **As such, one is limited in how much one can customize the Storybook experience.**
|
|
126
|
-
|
|
127
|
-
<h4
|
|
128
|
-
style={{
|
|
129
|
-
fontFamily: "Overpass",
|
|
130
|
-
fontSize: "29px",
|
|
131
|
-
fontWeight: "700",
|
|
132
|
-
marginBottom: "40px",
|
|
133
|
-
marginTop: "40px",
|
|
134
|
-
}}
|
|
135
|
-
>
|
|
136
|
-
Javascript
|
|
137
|
-
</h4>
|
|
24
|
+
Welcome to the ILO Design System Twig component library. This resource is crafted to assist developers in creating accessible, user-friendly websites for Drupal that with the International Labour Organization's Visual Identity. The library offers a variety of easy-to-use components tailored for these popular platforms, ensuring both compliance with web accessibility standards and a cohesive visual style. Components are responsive and are ready-made for RTL layouts.
|
|
138
25
|
|
|
139
|
-
|
|
26
|
+
## Requirements
|
|
140
27
|
|
|
141
|
-
The
|
|
28
|
+
The Design System comprises a series of packages that you can install from the [npm](https://www.npmjs.com/) registry directly into your custom theme. As such, you'll need to have `npm` or similar package manager (`yarn` or `pnpm`) installed in your environment.
|
|
142
29
|
|
|
143
|
-
|
|
30
|
+
## Installation
|
|
144
31
|
|
|
145
|
-
|
|
146
|
-
<section class="component componentname" data-loadcomponent="ComponentName">
|
|
147
|
-
<!-- component HTML goes here -->
|
|
148
|
-
</section>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Javascript will look in the `ComponentMap` Class for a JS Class called `ComponentName` and then create a new instance of that class and call it. If you've added a new JS Class specific to the module you've built, you'll need to import the JS file to `ComponenetMap` and add it to `ComponenteMap`'s exports. If you've created a new Class, you'll need to make sure to pass the param `element` into the constructor - this is a reference to the DOM element with the `data-loadcomponent` attribute on it. This allows you to scope your JS to each instance of an HTML module.
|
|
152
|
-
|
|
153
|
-
<h4
|
|
154
|
-
style={{
|
|
155
|
-
fontFamily: "Overpass",
|
|
156
|
-
fontSize: "29px",
|
|
157
|
-
fontWeight: "700",
|
|
158
|
-
marginBottom: "40px",
|
|
159
|
-
marginTop: "40px",
|
|
160
|
-
}}
|
|
161
|
-
>
|
|
162
|
-
Questions and Feedback
|
|
163
|
-
</h4>
|
|
164
|
-
|
|
165
|
-
(TBD)
|
|
166
|
-
|
|
167
|
-
<h4
|
|
168
|
-
style={{
|
|
169
|
-
fontFamily: "Overpass",
|
|
170
|
-
fontSize: "29px",
|
|
171
|
-
fontWeight: "700",
|
|
172
|
-
marginBottom: "40px",
|
|
173
|
-
marginTop: "40px",
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
Accessibility Standards
|
|
177
|
-
</h4>
|
|
178
|
-
|
|
179
|
-
(TBD)
|
|
180
|
-
|
|
181
|
-
<h4
|
|
182
|
-
style={{
|
|
183
|
-
fontFamily: "Overpass",
|
|
184
|
-
fontSize: "29px",
|
|
185
|
-
fontWeight: "700",
|
|
186
|
-
marginBottom: "40px",
|
|
187
|
-
marginTop: "40px",
|
|
188
|
-
}}
|
|
189
|
-
>
|
|
190
|
-
Contributing
|
|
191
|
-
</h4>
|
|
192
|
-
|
|
193
|
-
ILO Design System is an open-source project and we welcome your contributions! Before submitting a pull request, please take a moment to review the following guidelines.
|
|
194
|
-
|
|
195
|
-
## Branches
|
|
196
|
-
|
|
197
|
-
| Branch | Purpose |
|
|
198
|
-
| --------- | ---------------------------------- |
|
|
199
|
-
| `main` | The latest version of all packages |
|
|
200
|
-
| `develop` | The next release of all packages |
|
|
201
|
-
|
|
202
|
-
## Contribution workflow
|
|
203
|
-
|
|
204
|
-
1. Fork and clone the repo
|
|
205
|
-
2. Create a new branch from the `develop` branch
|
|
206
|
-
3. Make your changes and [add a changeset](#versioning) identifying the changes and affected packages
|
|
207
|
-
4. Push your branch to the forked version of the repo
|
|
208
|
-
5. Open a pull request back to the `develop` branch of the main repo
|
|
209
|
-
|
|
210
|
-
## Versioning
|
|
211
|
-
|
|
212
|
-
The project uses [changesets](https://github.com/changesets/changesets) to manage package versioning. All pull requests that will affect the project's semantic versioning must include a changest.
|
|
213
|
-
|
|
214
|
-
See more information on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
|
|
215
|
-
|
|
216
|
-
## Conventions
|
|
217
|
-
|
|
218
|
-
Contributions should respect the following conventions for branch names, commit messages and pull request descriptions
|
|
32
|
+
You will want to install the latest versions of both `@ilo-org/twig` and `@ilo-org/styles`. The first includes all of the Twig and JavaScript files that you'll need to use the component, whereas the second includes the stylesheets that you'll need to render them.
|
|
219
33
|
|
|
220
|
-
|
|
34
|
+
In the root of your custom theme, run the following command:
|
|
221
35
|
|
|
222
|
-
|
|
36
|
+
`$ npm i @ilo-org/twig @ilo-org/styles`
|
|
223
37
|
|
|
224
|
-
|
|
225
|
-
<type>(<scope>): <subject>
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
Examples:
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
fix(react): change button color on hover
|
|
232
|
-
feat(twig): add button component
|
|
233
|
-
ci(github): add release workflow
|
|
234
|
-
perf(react): improve modal animations
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
#### Types
|
|
238
|
-
|
|
239
|
-
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
|
240
|
-
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
|
241
|
-
- docs: Documentation only changes
|
|
242
|
-
- feat: A new feature
|
|
243
|
-
- fix: A bug fix
|
|
244
|
-
- perf: A code change that improves performance
|
|
245
|
-
- refactor: A code change that neither fixes a bug nor adds a feature
|
|
246
|
-
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
|
247
|
-
- test: Adding missing tests or correcting existing tests
|
|
248
|
-
|
|
249
|
-
#### Scopes
|
|
38
|
+
⚠️ Note that the two libraries are versioned separately so you'll want to make sure that you're always using the latest versions of both to ensure they're both in sync. You should see an installation warning if you try to install incompatible versions.
|
|
250
39
|
|
|
251
|
-
|
|
40
|
+
## Usage
|
|
252
41
|
|
|
253
|
-
|
|
42
|
+
Now that you have installed the component library, you'll need to expose them so that you can integrate them into your templates.
|
|
254
43
|
|
|
255
|
-
|
|
44
|
+
### Bundle JavaScript
|
|
256
45
|
|
|
257
|
-
|
|
46
|
+
You'll want to start by moving the components' JavaScript to a distribution folder where you can serve it as static assets. The easiest way to do this is with a JavaScript bundler like [Rollup.js](https://rollupjs.org/). Here's a sample configuration to illustrate.
|
|
258
47
|
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
### Pull requests
|
|
265
|
-
|
|
266
|
-
Pull requests should include a descriptive name and detailed explanation of what merging the pull request will accomplish. Authors should make sure to reference Github issues that the the pull request will fix or affect.
|
|
267
|
-
|
|
268
|
-
## Building the project
|
|
48
|
+
```js
|
|
49
|
+
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
50
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
51
|
+
import { globSync } from "glob";
|
|
269
52
|
|
|
270
|
-
|
|
53
|
+
const designSystemEntries = globSync(
|
|
54
|
+
"node_modules/@ilo-org/twig/dist/components/**"
|
|
55
|
+
);
|
|
271
56
|
|
|
272
|
-
|
|
273
|
-
|
|
57
|
+
export default () => {
|
|
58
|
+
return designSystemEntries.map((entry) => {
|
|
59
|
+
return {
|
|
60
|
+
input: entry,
|
|
61
|
+
output: {
|
|
62
|
+
dir: "dist/js",
|
|
63
|
+
compact: true,
|
|
64
|
+
format: "umd",
|
|
65
|
+
name: entry.match(/([^\/]+)\.js$/)[1],
|
|
66
|
+
},
|
|
67
|
+
plugins: [nodeResolve(), commonjs()],
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
};
|
|
274
71
|
```
|
|
275
72
|
|
|
276
|
-
|
|
73
|
+
This will output all of the Components JavaScript files into a `dist/js` directory so you'll have a list of both the component JavaScript and the `Drupal.behavior` declarations that you'll need to attach them to components.
|
|
277
74
|
|
|
278
|
-
```
|
|
279
|
-
|
|
75
|
+
```tree
|
|
76
|
+
📦js
|
|
77
|
+
┣ 📜accordion.behavior.js
|
|
78
|
+
┣ 📜accordion.js
|
|
79
|
+
┣ 📜breadcrumb.behavior.js
|
|
80
|
+
┣ 📜breadcrumb.js
|
|
81
|
+
┣ 📜callout.behavior.js
|
|
82
|
+
┣ 📜callout.js
|
|
83
|
+
...
|
|
280
84
|
```
|
|
281
85
|
|
|
282
|
-
|
|
86
|
+
### Bundle CSS
|
|
283
87
|
|
|
284
|
-
|
|
285
|
-
pnpm recursive install
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
Build all packages.
|
|
88
|
+
The CSS files are available in the 'dist/css' subdirectories:
|
|
289
89
|
|
|
290
|
-
```
|
|
291
|
-
|
|
90
|
+
```tree
|
|
91
|
+
📦css
|
|
92
|
+
┣ 📂00-base
|
|
93
|
+
┃ ┣ 📜base.css
|
|
94
|
+
┣ 📂01-paragraphs
|
|
95
|
+
┃ ┣ 📜paragraphs.css
|
|
96
|
+
┃ ┗ 📜breadcrumb.css
|
|
97
|
+
┣ 📂02-templates
|
|
98
|
+
┃ ┣ 📜maintenance-page.css
|
|
99
|
+
...
|
|
292
100
|
```
|
|
293
101
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
```bash
|
|
297
|
-
pnpm start:react-storybook
|
|
298
|
-
```
|
|
102
|
+
### Populating the theme.libraries.yml file
|
|
299
103
|
|
|
300
|
-
|
|
104
|
+
The theme.libraries.yml should first include the base CSS file:
|
|
301
105
|
|
|
302
|
-
```
|
|
303
|
-
|
|
106
|
+
```yaml
|
|
107
|
+
base:
|
|
108
|
+
css:
|
|
109
|
+
theme:
|
|
110
|
+
dist/css/00-base/base.css: {}
|
|
111
|
+
node_modules/@ilo-org/styles/css/global.css: {}
|
|
112
|
+
node_modules/@ilo-org/styles/css/components/container.css: {}
|
|
304
113
|
```
|
|
305
114
|
|
|
306
|
-
|
|
115
|
+
Then, for each component, you have to declare the CSS file in the theme.libraries.yml file. For example, for the breadcrumb component:
|
|
307
116
|
|
|
308
|
-
```
|
|
309
|
-
|
|
117
|
+
```yaml
|
|
118
|
+
breadcrumb:
|
|
119
|
+
css:
|
|
120
|
+
theme:
|
|
121
|
+
dist/css/01-paragraphs/breadcrumb.css: {}
|
|
310
122
|
```
|
|
311
123
|
|
|
312
|
-
|
|
124
|
+
With the 'dist' directory in your theme, you have to declare the components in the theme.libraries.yml file. For example, for the breadcrumb component:
|
|
313
125
|
|
|
314
|
-
```
|
|
315
|
-
|
|
126
|
+
```yaml
|
|
127
|
+
breadcrumb:
|
|
128
|
+
css:
|
|
129
|
+
theme:
|
|
130
|
+
dist/css/01-paragraphs/breadcrumb.css: {}
|
|
131
|
+
embeds:
|
|
132
|
+
js:
|
|
133
|
+
dist/js/embeds.js: { defer: true }
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The documentation for the theme.libraries.yml file is available [here](https://www.drupal.org/docs/8/creating-custom-modules/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-module).
|
|
137
|
+
|
|
138
|
+
In the template file of the component, you have to declare the component in the Twig file. For example, for the breadcrumb component:
|
|
139
|
+
|
|
140
|
+
```twig
|
|
141
|
+
{{ attach_library('ilo/breadcrumb') }}
|
|
142
|
+
|
|
143
|
+
{% include '@ilo-org/twig/breadcrumb/breadcrumb.twig' with {
|
|
144
|
+
home: breadcrumb_home,
|
|
145
|
+
links: breadcrumb_links,
|
|
146
|
+
} %}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
A helper function in your theme.theme file to aggregate all .behavior.js files:
|
|
150
|
+
|
|
151
|
+
```php
|
|
152
|
+
/**
|
|
153
|
+
* Implements hook_library_info_build().
|
|
154
|
+
*
|
|
155
|
+
* Generate libraries for all components if they don't already exist.
|
|
156
|
+
* The library name will mapped be the name of the source CSS / JS file,
|
|
157
|
+
* e.g. site_header.css will be mapped to `{THEME}/site_header`.
|
|
158
|
+
*
|
|
159
|
+
*/
|
|
160
|
+
function theme_library_info_build() {
|
|
161
|
+
// Define libraries based on the components.
|
|
162
|
+
$extensions = ['css'];
|
|
163
|
+
$directory = 'themes/custom/ilo/node_modules/@ilo-org/styles/css/components';
|
|
164
|
+
$css = 'node_modules/@ilo-org/styles/css/components';
|
|
165
|
+
$js = 'dist/js';
|
|
166
|
+
$extensions = array_map('preg_quote', $extensions);
|
|
167
|
+
$extensions = implode('|', $extensions);
|
|
168
|
+
$file_scan = \Drupal::service('file_system')->scanDirectory($directory, "/{$extensions}$/");
|
|
169
|
+
$libraries = [];
|
|
170
|
+
foreach ($file_scan as $file) {
|
|
171
|
+
$libraries[$file->name]['css'] = [
|
|
172
|
+
'component' => [
|
|
173
|
+
$css . '/' . $file->name . '.css' => [],
|
|
174
|
+
],
|
|
175
|
+
];
|
|
176
|
+
if (file_exists('themes/custom/ilo/' . $js . '/' . $file->name . '.behavior.js')) {
|
|
177
|
+
$libraries[$file->name]['js'] = [
|
|
178
|
+
$js . '/' . $file->name . '.behavior.js' => [],
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return $libraries;
|
|
183
|
+
}
|
|
316
184
|
```
|
|
@@ -24,12 +24,21 @@ import LinkTo from "@storybook/addon-links/react";
|
|
|
24
24
|
</a>
|
|
25
25
|
<a
|
|
26
26
|
class="ilo--button ilo--button--large ilo--button--tertiary optionalclass"
|
|
27
|
-
href="https://brand.ilo.org"
|
|
27
|
+
href="https://brand.ilo.org/designsystem"
|
|
28
28
|
target="true"
|
|
29
29
|
rel="noopener noreferrer"
|
|
30
30
|
style={{ margin: "1rem 20px 0 0" }}
|
|
31
31
|
>
|
|
32
32
|
<span class="link__label">Design Docs</span>
|
|
33
|
+
</a>
|
|
34
|
+
<a
|
|
35
|
+
class="ilo--button ilo--button--large ilo--button--tertiary optionalclass"
|
|
36
|
+
href="https://www.figma.com/file/RRxsfLNxjoypKrfJg1EwJf/ILO-Components-Library?type=design&node-id=34%3A1554&mode=design&t=mMJCQdfOgEz1AsYP-1"
|
|
37
|
+
target="true"
|
|
38
|
+
rel="noopener noreferrer"
|
|
39
|
+
style={{ margin: "1rem 20px 0 0" }}
|
|
40
|
+
>
|
|
41
|
+
<span class="link__label">Figma</span>
|
|
33
42
|
</a>
|
|
34
43
|
<a
|
|
35
44
|
class="ilo--button ilo--button--large ilo--button--tertiary optionalclass"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/twig",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Twig components for the ILO's Design System",
|
|
6
6
|
"main": "",
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"components"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@popperjs/core": "^2.11.8",
|
|
24
25
|
"video.js": "^7.21.2",
|
|
25
26
|
"@ilo-org/brand-assets": "0.2.0",
|
|
26
27
|
"@ilo-org/fonts": "0.1.2",
|
|
27
28
|
"@ilo-org/icons": "0.2.1",
|
|
28
|
-
"@ilo-org/styles": "0.13.
|
|
29
|
+
"@ilo-org/styles": "0.13.1",
|
|
29
30
|
"@ilo-org/themes": "0.7.0",
|
|
30
31
|
"@ilo-org/utils": "0.0.11"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@babel/core": "^7.20.12",
|
|
34
35
|
"@babel/preset-env": "^7.20.2",
|
|
35
|
-
"@popperjs/core": "^2.11.8",
|
|
36
36
|
"@storybook/addon-actions": "^6.5.16",
|
|
37
37
|
"@storybook/addon-essentials": "^6.5.16",
|
|
38
38
|
"@storybook/addon-links": "^6.5.16",
|
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
<a href="{{mainlink.url}}" class="{{prefix}}--language-switcher--link">{{mainlink.label}}</a>
|
|
28
28
|
</span>
|
|
29
29
|
{% endif %}
|
|
30
|
-
|
|
30
|
+
{% if languagecontextmenu.links is not empty %}
|
|
31
|
+
<button class="{{prefix}}--language-switcher--button" type="button">
|
|
31
32
|
{{languagelabel}}
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
</button>
|
|
34
|
+
{% include '@components/contextmenu/contextmenu.twig' with {
|
|
34
35
|
links: languagecontextmenu.links,
|
|
35
36
|
prefix: prefix
|
|
36
37
|
}
|
|
37
38
|
%}
|
|
39
|
+
{% endif %}
|
|
38
40
|
</div> <!-- /.{{prefix}}--language-switcher--wrap -->
|
|
39
41
|
</div> <!-- /.{{prefix}}--language-switcher -->
|
|
40
42
|
<button class="{{prefix}}--header--menu">Menu</button>
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
</a>
|
|
50
52
|
<button class="{{prefix}}--header--menu--close">{{menucloselabel}}</button>
|
|
51
53
|
</div> <!-- /.{{prefix}}--mobile--logo -->
|
|
52
|
-
|
|
54
|
+
{% if languagecontextmenu.links is not empty %}
|
|
53
55
|
<div class="{{prefix}}--mobile--nav--language--switcher">
|
|
54
56
|
<button class="{{prefix}}--mobile--nav--language--switcher--button" type="button">{{languagelabel}}</button>
|
|
55
57
|
</div> <!-- /.{{prefix}}--mobile--nav--language--switcher -->
|
|
@@ -69,6 +71,7 @@
|
|
|
69
71
|
</ul>
|
|
70
72
|
</div>
|
|
71
73
|
</div>
|
|
74
|
+
{% endif %}
|
|
72
75
|
</div> <!-- /.{{prefix}}--mobile--nav -->
|
|
73
76
|
<nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
|
|
74
77
|
<h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
|
|
@@ -5,20 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
<header class="{{prefix}}--header" data-loadcomponent="Navigation" data-prefix="{{prefix}}">
|
|
7
7
|
<div class="{{prefix}}--header--utility-bar">
|
|
8
|
-
|
|
9
|
-
<div class="{{prefix}}--language-switcher
|
|
10
|
-
<
|
|
11
|
-
{{
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
{% if languagecontextmenu.links is not empty %}
|
|
9
|
+
<div class="{{prefix}}--language-switcher">
|
|
10
|
+
<div class="{{prefix}}--language-switcher--wrap">
|
|
11
|
+
<button class="{{prefix}}--language-switcher--button" type="button">
|
|
12
|
+
{{languagelabel}}
|
|
13
|
+
</button>
|
|
14
|
+
{% include '@components/contextmenu/contextmenu.twig' with {
|
|
14
15
|
links: languagecontextmenu.links,
|
|
15
16
|
prefix: prefix
|
|
16
17
|
}
|
|
17
18
|
%}
|
|
19
|
+
</div>
|
|
20
|
+
<!-- /.{{prefix}}--language-switcher--wrap -->
|
|
18
21
|
</div>
|
|
19
|
-
<!-- /.{{prefix}}--language-switcher
|
|
20
|
-
|
|
21
|
-
<!-- /.{{prefix}}--language-switcher -->
|
|
22
|
+
<!-- /.{{prefix}}--language-switcher -->
|
|
23
|
+
{% endif %}
|
|
22
24
|
</div>
|
|
23
25
|
<!-- /.{{prefix}}--header--utility-bar -->
|
|
24
26
|
<div class="{{prefix}}--header--logo-bar">
|
|
@@ -67,29 +69,33 @@
|
|
|
67
69
|
{% endblock %}
|
|
68
70
|
</div>
|
|
69
71
|
<!-- /.{{prefix}}--mobile--search -->
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<div class="{{prefix}}--
|
|
77
|
-
<div class="{{prefix}}--
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
{% if languagecontextmenu.links is not empty %}
|
|
73
|
+
<div class="{{prefix}}--mobile--nav--language--switcher">
|
|
74
|
+
<button class="{{prefix}}--mobile--nav--language--switcher--button" type="button">{{languagelabel}}</button>
|
|
75
|
+
</div>
|
|
76
|
+
{% endif %}
|
|
77
|
+
<!-- /.{{prefix}}--mobile--nav--language--switcher -->
|
|
78
|
+
<div class="{{prefix}}--mobile--nav--language--select">
|
|
79
|
+
<div class="{{prefix}}--header--inner {{ prefix }}--container">
|
|
80
|
+
<div class="{{prefix}}--mobile--subnav--menu">
|
|
81
|
+
<button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
|
|
82
|
+
<button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
|
|
83
|
+
<h6 class="{{prefix}}--mobile--subnav--label">{{languagelabel}}</h6>
|
|
84
|
+
</div>
|
|
85
|
+
<!-- /{{prefix}}--mobile--subnav--menu -->
|
|
86
|
+
<ul class="{{prefix}}--nav--set">
|
|
87
|
+
{% for item in languagecontextmenu.links %}
|
|
88
|
+
<li class="{{prefix}}--nav--items">
|
|
89
|
+
<a href="{{item.url}}" class="{{prefix}}--nav--link {{prefix}}--nav--language">
|
|
90
|
+
{{item.label}}
|
|
91
|
+
</a>
|
|
92
|
+
</li>
|
|
93
|
+
{% endfor %}
|
|
94
|
+
</ul>
|
|
81
95
|
</div>
|
|
82
|
-
<!-- /{{prefix}}--mobile--subnav--menu -->
|
|
83
|
-
<ul class="{{prefix}}--nav--set">
|
|
84
|
-
{% for item in languagecontextmenu.links %}
|
|
85
|
-
<li class="{{prefix}}--nav--items">
|
|
86
|
-
<a href="{{item.url}}" class="{{prefix}}--nav--link {{prefix}}--nav--language">{{item.label}}</a>
|
|
87
|
-
</li>
|
|
88
|
-
{% endfor %}
|
|
89
|
-
</ul>
|
|
90
96
|
</div>
|
|
91
97
|
</div>
|
|
92
|
-
|
|
98
|
+
|
|
93
99
|
<!-- /.{{prefix}}--mobile--nav -->
|
|
94
100
|
<nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
|
|
95
101
|
<h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% set icontheme = icontheme|default("light") %}
|
|
4
4
|
{% set theme = theme|default("dark") %}
|
|
5
5
|
|
|
6
|
-
<div class="{{prefix}}--tooltip--wrapper {% if icon %} {{prefix}}--tooltip--wrapper__icon {{prefix}}--tooltip--wrapper__icon__theme__{{icontheme}} {% endif %}" role="status" aria-live="polite" aria-relevant="additions" data-loadcomponent="Tooltip" data-prefix="{{prefix}}">
|
|
6
|
+
<div class="{{prefix}}--tooltip--wrapper {% if icon and icon != "false" %} {{prefix}}--tooltip--wrapper__icon {{prefix}}--tooltip--wrapper__icon__theme__{{icontheme}} {% endif %}" role="status" aria-live="polite" aria-relevant="additions" data-loadcomponent="Tooltip" data-prefix="{{prefix}}">
|
|
7
7
|
{% if not icon or icon == "false" %}
|
|
8
8
|
{{ children|raw }}
|
|
9
9
|
{% endif %}
|