@undrr/undrr-mangrove 2.0.0-alpha.4 → 2.0.0-beta.3
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 +51 -306
- package/components/BookCard.js +2 -2
- package/components/BookCard.js.LICENSE.txt +0 -2
- package/components/Breadcrumbs.js +2 -2
- package/components/Checkbox.js +2 -2
- package/components/Chips.js +2 -2
- package/components/CtaButton.js +2 -2
- package/components/EmbedContainer.js +2 -2
- package/components/Footer.js +2 -2
- package/components/FormAction.js +2 -2
- package/components/FormErrorSummary.js +2 -2
- package/components/FormGroup.js +2 -2
- package/components/FullWidth.js +2 -2
- package/components/Gallery.js +2 -2
- package/components/Hero.js +2 -2
- package/components/HighlightBox.js +2 -2
- package/components/HorizontalBookCard.js +2 -2
- package/components/HorizontalBookCard.js.LICENSE.txt +1 -1
- package/components/HorizontalCard.js +2 -2
- package/components/HorizontalCard.js.LICENSE.txt +1 -1
- package/components/IconCard.js +2 -2
- package/components/IconCard.js.LICENSE.txt +1 -1
- package/components/Loader.js +2 -2
- package/components/MegaMenu.js +2 -2
- package/components/PageHeader.js +2 -2
- package/components/Pager.js +2 -2
- package/components/QuoteHighlight.js +2 -2
- package/components/Radio.js +2 -2
- package/components/ScrollContainer.js +2 -2
- package/components/Select.js +2 -2
- package/components/ShareButtons.js +2 -2
- package/components/ShowMore.js +2 -2
- package/components/SkipLink.js +6 -0
- package/components/SkipLink.js.LICENSE.txt +9 -0
- package/components/StatsCard.js +2 -2
- package/components/StatsCard.js.LICENSE.txt +1 -1
- package/components/SyndicationSearchWidget.js +2 -2
- package/components/Tab.js +2 -2
- package/components/TextCta.js +2 -2
- package/components/TextCta.js.LICENSE.txt +1 -1
- package/components/TextInput.js +2 -2
- package/components/Textarea.js +2 -2
- package/components/UserFeedback.js +2 -2
- package/components/VerticalCard.js +2 -2
- package/components/VerticalCard.js.LICENSE.txt +1 -1
- package/components/assets/a4133008bd4d2c4a42e5ca0c6db8fe9b.svg +22 -0
- package/components/assets/f1605b17c97ebdc56cfaa75033e7283d.svg +21 -0
- package/components/hydrate.js +1 -1
- package/css/style-all.css +51 -45
- package/css/style-all.css.map +1 -1
- package/css/style-delta.css +50 -44
- package/css/style-delta.css.map +1 -1
- package/css/style-gutenberg.css +23 -24
- package/css/style-gutenberg.css.map +1 -1
- package/css/style-irp.css +51 -45
- package/css/style-irp.css.map +1 -1
- package/css/style-mcr.css +51 -45
- package/css/style-mcr.css.map +1 -1
- package/css/style-preventionweb.css +51 -45
- package/css/style-preventionweb.css.map +1 -1
- package/css/style.css +50 -44
- package/css/style.css.map +1 -1
- package/error-pages/401.html +2 -2
- package/error-pages/403.html +2 -2
- package/error-pages/404.html +2 -2
- package/error-pages/429.html +2 -2
- package/error-pages/500.html +2 -2
- package/error-pages/502.html +2 -2
- package/error-pages/503.html +2 -2
- package/error-pages/504.html +2 -2
- package/error-pages/5xx.html +2 -2
- package/error-pages/challenge.html +2 -2
- package/error-pages/managed-challenge.html +2 -2
- package/fonts/mangrove-icon-set/config.json +2 -4
- package/js/README.md +12 -12
- package/js/__tests__/show-more.test.js +6 -2
- package/js/__tests__/table-of-contents.test.js +1 -3
- package/js/on-this-page-nav.js +117 -73
- package/js/preview-access.js +35 -31
- package/js/show-more.js +6 -2
- package/package.json +9 -9
- package/scss/Atom/BaseTypography/Code/code.scss +16 -8
- package/scss/Atom/Icons/_icon-definitions.scss +77 -1
- package/scss/Atom/Icons/icons.scss +110 -38
- package/scss/Atom/Images/AuthorImage/author-image.scss +197 -51
- package/scss/Atom/Layout/Grid/grid.scss +14 -8
- package/scss/Atom/Logo/logo.scss +37 -0
- package/scss/Atom/Table/table.scss +20 -21
- package/scss/Atom/Tag/tag.scss +99 -86
- package/scss/Components/Breadcrumbs/breadcrumbs.scss +49 -86
- package/scss/Components/Buttons/CtaButton/cta-button.scss +23 -3
- package/scss/Components/Buttons/ShareButtons/share-buttons.scss +51 -58
- package/scss/Components/Cards/Card/card.scss +143 -2
- package/scss/Components/Cards/StatsCard/stats-card.scss +1 -1
- package/scss/Components/ErrorPages/error-pages.scss +1 -1
- package/scss/Components/Gallery/gallery.scss +2 -1
- package/scss/Components/Hero/hero.scss +30 -80
- package/scss/Components/MegaMenu/mega-menu.scss +77 -10
- package/scss/Components/OnThisPageNav/on-this-page-nav.scss +33 -8
- package/scss/Components/PageHeader/page-header.scss +179 -52
- package/scss/Components/Pager/pager.scss +4 -3
- package/scss/Components/ScrollContainer/scroll-container.scss +35 -8
- package/scss/Components/SyndicationSearchWidget/_deprecated-teaser-hide.scss +21 -7
- package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +48 -17
- package/scss/Components/TableOfContents/table-of-contents.scss +34 -12
- package/scss/Components/TextCta/text-cta.scss +94 -33
- package/scss/Patterns/HubHeader/hub-header.scss +406 -0
- package/scss/Patterns/_shared/pattern-demo.scss +47 -0
- package/scss/Utilities/FullWidth/full-width.scss +10 -1
- package/scss/Utilities/PagePatterns/page-patterns.scss +42 -0
- package/scss/Utilities/SkipLink/skip-link.scss +40 -0
- package/scss/assets/fonts/noto-kufi-arabic/noto-kufi-arabic.scss +52 -18
- package/scss/assets/fonts/noto-sans-arabic/noto-sans-arabic.scss +52 -18
- package/scss/assets/scss/_components.scss +4 -0
- package/scss/assets/scss/_fonts.scss +2 -2
- package/scss/assets/scss/_mixins.scss +4 -3
- package/scss/assets/scss/_utility.scss +348 -115
- package/scss/assets/scss/_variables.scss +16 -15
- package/scss/assets/scss/generated/_tokens-irp.scss +9 -0
- package/scss/assets/scss/generated/_tokens-mangrove.scss +1 -1
- package/scss/assets/scss/generated/_tokens-mcr.scss +8 -0
- package/scss/assets/scss/generated/_tokens-preventionweb.scss +9 -0
package/README.md
CHANGED
|
@@ -1,347 +1,92 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/@undrr/undrr-mangrove)
|
|
2
|
-
[](https://
|
|
2
|
+
[](https://preventionweb.github.io/undrr-mangrove/)
|
|
3
3
|
[](https://github.com/unisdr/undrr-mangrove/actions)
|
|
4
4
|
[](https://github.com/unisdr/undrr-mangrove/blob/main/LICENSE)
|
|
5
5
|
<!-- React Doctor score is a periodic snapshot, not live. Refresh after audit sweeps by re-running `npx -y react-doctor@latest .` and updating the s/e/w/f params below. See docs/AI-CODING-AGENTS.md#component-quality-checks-with-react-doctor. -->
|
|
6
|
+
|
|
6
7
|
[](https://www.react.doctor/share?p=%40undrr%2Fundrr-mangrove&s=100&e=0&w=0&f=0)
|
|
7
8
|
|
|
8
9
|
# Mangrove: the UNDRR component library
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
These components offer consistency, documentation, and portability to speed up quality development with the expected look and feel. They also help reduce entropy, which is critical to ensuring websites remain accessible.
|
|
13
|
-
|
|
14
|
-
If there is a Component or Pattern that you need, or you have any other feedback, question, or comment, please contact us in the issue queue.
|
|
15
|
-
|
|
16
|
-
[View the component library](https://unisdr.github.io/undrr-mangrove/)
|
|
17
|
-
|
|
18
|
-
## Getting started
|
|
19
|
-
|
|
20
|
-
**[→ View the complete getting started guide](https://unisdr.github.io/undrr-mangrove/?path=/docs/getting-started-getting-started-guide--docs)** for detailed integration instructions, code examples, and best practices.
|
|
21
|
-
|
|
22
|
-
### Installation
|
|
23
|
-
|
|
24
|
-
Install Mangrove as an npm or yarn dependency (<https://www.npmjs.com/package/@undrr/undrr-mangrove>):
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# NPM
|
|
28
|
-
npm install @undrr/undrr-mangrove
|
|
29
|
-
|
|
30
|
-
# Yarn
|
|
31
|
-
yarn add @undrr/undrr-mangrove
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The package includes:
|
|
35
|
-
|
|
36
|
-
- **Compiled React components** for dynamic applications
|
|
37
|
-
- **CSS files** for styling (base and theme variants)
|
|
38
|
-
- **JavaScript files** for interactive functionality
|
|
39
|
-
- **Sass source files** for custom theming
|
|
40
|
-
- Explore the contents: <https://www.npmjs.com/package/@undrr/undrr-mangrove?activeTab=code>
|
|
41
|
-
|
|
42
|
-
## Developing Mangrove
|
|
43
|
-
|
|
44
|
-
You can use the provided npm scripts to simplify running commands inside Docker containers. These scripts are defined in the `package.json` file and can be run using `yarn`.
|
|
45
|
-
|
|
46
|
-
**For detailed development setup and workflow instructions, see the [Development Guide](./docs/DEVELOPMENT.md).**
|
|
47
|
-
|
|
48
|
-
### Making commits
|
|
49
|
-
|
|
50
|
-
The project uses the following branching strategy:
|
|
51
|
-
|
|
52
|
-
- `main` is the primary branch and all commits to it are automatically deployed to the GitHub Pages website
|
|
53
|
-
- Development work should be done on feature branches
|
|
54
|
-
- Pull requests should be opened against `main` and should reference either:
|
|
55
|
-
- An internal GitLab issue
|
|
56
|
-
- A public GitHub issue
|
|
57
|
-
|
|
58
|
-
For production use:
|
|
59
|
-
|
|
60
|
-
- Stable releases are published as [tagged releases on GitHub](https://github.com/unisdr/undrr-mangrove/releases) and on [npm](https://www.npmjs.com/package/@undrr/undrr-mangrove)
|
|
61
|
-
- The `dev` branch is not used
|
|
62
|
-
|
|
63
|
-
When creating a new feature or fix:
|
|
64
|
-
|
|
65
|
-
1. Create a new branch from `main`
|
|
66
|
-
2. Make your changes
|
|
67
|
-
3. Open a pull request against `main`
|
|
68
|
-
4. Reference the relevant issue from Github or the private UNDRR GitLab
|
|
69
|
-
5. Once approved, the changes will be merged and automatically deployed
|
|
70
|
-
|
|
71
|
-
### NPM Scripts
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# Start the application: brings up Docker containers, installs dependencies, and runs Storybook locally on port 6006
|
|
75
|
-
yarn docker-run
|
|
76
|
-
|
|
77
|
-
# Install project dependencies inside the Docker container
|
|
78
|
-
yarn docker-install
|
|
79
|
-
|
|
80
|
-
# Build the project for release inside the Docker container
|
|
81
|
-
yarn docker-build
|
|
82
|
-
|
|
83
|
-
# Watch for component changes and rebuild (inside Docker)
|
|
84
|
-
yarn docker-watch
|
|
85
|
-
|
|
86
|
-
# Watch for component changes and rebuild (direct)
|
|
87
|
-
yarn watch
|
|
88
|
-
|
|
89
|
-
# Lint the codebase inside the Docker container
|
|
90
|
-
yarn docker-lint
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Makefile Commands
|
|
94
|
-
|
|
95
|
-
You can use the provided `Makefile` to simplify running commands inside Docker containers. Run the following commands to create/update the codebase:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
# Start the application, runs Storybook locally via port 6006
|
|
99
|
-
make up
|
|
100
|
-
|
|
101
|
-
# Install project dependencies
|
|
102
|
-
make install
|
|
103
|
-
|
|
104
|
-
# Run Storybook locally
|
|
105
|
-
make run
|
|
106
|
-
|
|
107
|
-
# Lint the codebase
|
|
108
|
-
make lint
|
|
109
|
-
|
|
110
|
-
# Watch for component changes and rebuild
|
|
111
|
-
make watch
|
|
11
|
+
Mangrove is UNDRR's component library for accessible, reusable UI across React and server-rendered sites.
|
|
112
12
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
### Manual Docker Commands
|
|
118
|
-
|
|
119
|
-
If you prefer running Docker commands manually, the following commands are available:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Clone the codebase
|
|
123
|
-
git clone git@github.com:unisdr/undrr-mangrove.git
|
|
124
|
-
|
|
125
|
-
cd undrr-mangrove
|
|
126
|
-
|
|
127
|
-
# Start the application, runs Storybook locally via port 6006
|
|
128
|
-
docker-compose up -d
|
|
13
|
+
- Storybook docs and live examples: <https://preventionweb.github.io/undrr-mangrove/>
|
|
14
|
+
- npm package: <https://www.npmjs.com/package/@undrr/undrr-mangrove>
|
|
15
|
+
- Issue tracker: <https://github.com/unisdr/undrr-mangrove/issues>
|
|
129
16
|
|
|
130
|
-
|
|
131
|
-
docker exec -it undrr-mangrove-client-1 bash -c "yarn install"
|
|
17
|
+
## Quick start
|
|
132
18
|
|
|
133
|
-
|
|
134
|
-
docker exec -it undrr-mangrove-client-1 bash -c "yarn run storybook --ci"
|
|
19
|
+
### Use prebuilt CSS from CDN
|
|
135
20
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
# Lint the codebase
|
|
143
|
-
docker exec -it undrr-mangrove-client-1 bash -c "yarn run lint"
|
|
21
|
+
```html
|
|
22
|
+
<link
|
|
23
|
+
rel="stylesheet"
|
|
24
|
+
href="https://assets.undrr.org/mangrove/2.0.0-beta.3/css/style.css"
|
|
25
|
+
/>
|
|
144
26
|
```
|
|
145
27
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
**For detailed release procedures and versioning information, see the [Release Process Guide](./docs/RELEASES.md).**
|
|
149
|
-
|
|
150
|
-
## Testing
|
|
151
|
-
|
|
152
|
-
When adding new components, we rely on the Jest library to test the library. Jest is a JavaScript testing framework that is easy to use and provides a variety of features for testing React components.
|
|
153
|
-
|
|
154
|
-
**For comprehensive testing guidelines and procedures, see the [Testing Guide](./docs/TESTING.md).**
|
|
155
|
-
|
|
156
|
-
### Visual Testing with Chromatic
|
|
157
|
-
|
|
158
|
-
This project uses [Chromatic](https://www.chromatic.com/) for visual regression testing. Chromatic automatically captures screenshots of your stories and compares them against previous versions to detect visual changes.
|
|
159
|
-
|
|
160
|
-
#### When Chromatic Runs
|
|
161
|
-
|
|
162
|
-
The Chromatic workflow executes automatically:
|
|
163
|
-
|
|
164
|
-
- On pushes to `main` or `develop` branches
|
|
165
|
-
- On pull requests targeting `main` or `develop`
|
|
166
|
-
- Only when relevant files change:
|
|
167
|
-
- Stories (`stories/**`)
|
|
168
|
-
- Storybook configuration (`.storybook/**`)
|
|
169
|
-
- Package configuration (`package.json`, `*.config.js`)
|
|
170
|
-
- The workflow file itself
|
|
171
|
-
|
|
172
|
-
#### Viewing Test Results
|
|
173
|
-
|
|
174
|
-
1. **Pull Request Comments**: Chromatic automatically adds a comment to PRs with:
|
|
175
|
-
- Link to the visual review
|
|
176
|
-
- Summary of changes detected
|
|
177
|
-
- Build status
|
|
178
|
-
|
|
179
|
-
2. **GitHub Actions**: Check the "Chromatic Visual Testing" workflow run for:
|
|
180
|
-
- Build logs
|
|
181
|
-
- Direct link to Chromatic build
|
|
182
|
-
|
|
183
|
-
3. **Chromatic Dashboard**: Visit the build link to:
|
|
184
|
-
- Review visual changes side-by-side
|
|
185
|
-
- Accept or reject changes
|
|
186
|
-
- Leave comments for reviewers
|
|
187
|
-
- View component history
|
|
188
|
-
|
|
189
|
-
#### Skipping Chromatic
|
|
190
|
-
|
|
191
|
-
To skip Chromatic for a specific commit, include `[skip chromatic]` in your commit message:
|
|
28
|
+
### Use npm package
|
|
192
29
|
|
|
193
30
|
```bash
|
|
194
|
-
|
|
31
|
+
npm install @undrr/undrr-mangrove
|
|
195
32
|
```
|
|
196
33
|
|
|
197
|
-
|
|
34
|
+
Package contents:
|
|
198
35
|
|
|
199
|
-
|
|
36
|
+
- `components/` compiled React component ES modules
|
|
37
|
+
- `css/` compiled theme stylesheets
|
|
38
|
+
- `js/` vanilla JS utilities
|
|
39
|
+
- `scss/` source Sass files
|
|
200
40
|
|
|
201
|
-
|
|
41
|
+
## Choose an integration path
|
|
202
42
|
|
|
203
|
-
|
|
43
|
+
- CDN reference: [`docs/CDN-REFERENCE.md`](docs/CDN-REFERENCE.md)
|
|
44
|
+
- Vanilla HTML/CSS: Storybook "Vanilla HTML and CSS"
|
|
45
|
+
- Hydration for Drupal/Astro/server-rendered apps: [`docs/HYDRATION.md`](docs/HYDRATION.md)
|
|
46
|
+
- Sass integration: Storybook "Sass integration"
|
|
47
|
+
- React integration: Storybook "React integration"
|
|
204
48
|
|
|
205
|
-
|
|
49
|
+
## Development
|
|
206
50
|
|
|
207
|
-
|
|
51
|
+
For full setup and workflow details, use the development guide:
|
|
52
|
+
[`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md)
|
|
208
53
|
|
|
209
|
-
|
|
54
|
+
Common commands:
|
|
210
55
|
|
|
211
56
|
```bash
|
|
57
|
+
yarn install
|
|
58
|
+
yarn storybook
|
|
212
59
|
yarn test
|
|
60
|
+
yarn lint
|
|
61
|
+
yarn build
|
|
213
62
|
```
|
|
214
63
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
yarn test:coverage
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Compiled assets
|
|
222
|
-
|
|
223
|
-
Compiled assets are available via npm (`@undrr/undrr-mangrove`) and the [UNDRR CDN](https://assets.undrr.org/static/mangrove/). The `dist` directory contains:
|
|
224
|
-
|
|
225
|
-
- `dist/components/`: compiled React component ES modules (e.g., `ShareButtons.js`)
|
|
226
|
-
- `dist/css/`: compiled theme stylesheets
|
|
227
|
-
- `dist/js/`: vanilla JS utilities
|
|
228
|
-
|
|
229
|
-
## Non-React site integration (Drupal, Astro, etc.)
|
|
230
|
-
|
|
231
|
-
Mangrove components can hydrate into server-rendered HTML on non-React consumers. The common wrapper pattern is `createHydrator` plus a framework/site hook that re-scans when new DOM is injected.
|
|
232
|
-
|
|
233
|
-
### Drupal behavior pattern
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
// Uses @mangrove/* import map aliases provided by the undrr_common theme
|
|
237
|
-
import createHydrator from "@mangrove/hydrate";
|
|
238
|
-
import Component, { fromElement } from "@mangrove/ComponentName";
|
|
239
|
-
|
|
240
|
-
const hydrator = createHydrator({
|
|
241
|
-
selector: "[data-mg-component-name]",
|
|
242
|
-
component: Component,
|
|
243
|
-
fromElement,
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
Drupal.behaviors.mangroveComponentName = {
|
|
247
|
-
attach(context) { hydrator.update(context); },
|
|
248
|
-
};
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
For other consumers (Astro/Vite/vanilla wrappers), use the same hydrator setup and call `hydrator.update(...)` from that platform's lifecycle hook when injecting new DOM. On error, `createHydrator` automatically restores the original server HTML — no blank regions on failure. See [`docs/HYDRATION.md`](./docs/HYDRATION.md) for full examples and platform variants.
|
|
252
|
-
|
|
253
|
-
## AI and agent integration
|
|
254
|
-
|
|
255
|
-
The build generates static JSON files with component metadata so AI coding agents can look up Mangrove components without parsing the Storybook SPA. After deploy, these are available at:
|
|
256
|
-
|
|
257
|
-
- [`llms.txt`](https://unisdr.github.io/undrr-mangrove/llms.txt) -- project summary and conventions
|
|
258
|
-
- [`ai-components/index.json`](https://unisdr.github.io/undrr-mangrove/ai-components/index.json) -- all components with names, imports, and links to detail files
|
|
259
|
-
- `ai-components/{id}.json` -- per-component props, types, defaults, and code examples
|
|
260
|
-
|
|
261
|
-
See the [AI and MCP integration guide](https://unisdr.github.io/undrr-mangrove/?path=/docs/getting-started-ai-and-mcp-integration--docs) for details on directing agents to Mangrove and configuring Claude Code, Cursor, or Copilot.
|
|
262
|
-
|
|
263
|
-
## Developer resources
|
|
264
|
-
|
|
265
|
-
For contributing to this library:
|
|
266
|
-
|
|
267
|
-
- [All documentation](./docs/README.md) - Complete guide index
|
|
268
|
-
- [Component guide](./docs/COMPONENT-GUIDE.md) - Step-by-step tutorial for building a component
|
|
269
|
-
- [Development guide](./docs/DEVELOPMENT.md) - Setup, workflow, and coding standards
|
|
270
|
-
- [Storybook developer docs](https://unisdr.github.io/undrr-mangrove/?path=/docs/getting-started-getting-started-guide--docs) - Interactive component documentation and usage examples
|
|
271
|
-
- [Testing guide](./docs/TESTING.md) - Unit, visual, and accessibility testing
|
|
272
|
-
- [Accessibility](./docs/ACCESSIBILITY.md) - WCAG 2.2 AA requirements and testing
|
|
273
|
-
- [Release process](./docs/RELEASES.md) - Versioning and publishing
|
|
274
|
-
|
|
275
|
-
## Package Contents
|
|
276
|
-
|
|
277
|
-
```
|
|
278
|
-
@undrr/undrr-mangrove/
|
|
279
|
-
├── components/ # React components
|
|
280
|
-
├── css/ # Compiled CSS files
|
|
281
|
-
├── js/ # Compiled JavaScript files
|
|
282
|
-
└── scss/ # Component stories (SCSS only)
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
## CDN Distribution
|
|
286
|
-
|
|
287
|
-
For CDN and static asset hosting in the [UNDRR Static assets repo](https://gitlab.com/undrr/common/shared-web-assets/). The primary use case for this feature is static sites with no build process.
|
|
288
|
-
|
|
289
|
-
### Production CDN
|
|
290
|
-
|
|
291
|
-
Production sites should pin to a specific version:
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
https://assets.undrr.org/static/sitemap.html#mangrove-1-2-10
|
|
295
|
-
https://assets.undrr.org/static/mangrove/README.md
|
|
296
|
-
https://assets.undrr.org/static/mangrove/2.0.0-alpha.4/css/style.css
|
|
297
|
-
https://assets.undrr.org/static/mangrove/2.0.0-alpha.4/components/MegaMenu.js
|
|
298
|
-
https://assets.undrr.org/static/mangrove/2.0.0-alpha.4/js/tabs.js
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
#### Bleeding edge test rep
|
|
302
|
-
|
|
303
|
-
```
|
|
304
|
-
https://assets.undrr.org/testing/static/sitemap.html#mangrove-1-2-4
|
|
305
|
-
https://assets.undrr.org/testing/static/mangrove/latest/css/style.css
|
|
306
|
-
https://assets.undrr.org/static/mangrove/2.0.0-alpha.4/css/style.css
|
|
307
|
-
... etc
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### Checking and updating to the latest version
|
|
311
|
-
|
|
312
|
-
To check the current latest version available on npm:
|
|
64
|
+
## Releases
|
|
313
65
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
npm info @undrr/undrr-mangrove version
|
|
318
|
-
```
|
|
66
|
+
- Release process: [`docs/RELEASES.md`](docs/RELEASES.md)
|
|
67
|
+
- Release notes index in Storybook: "Getting started/Release notes"
|
|
68
|
+
- GitHub releases: <https://github.com/unisdr/undrr-mangrove/releases>
|
|
319
69
|
|
|
320
|
-
|
|
70
|
+
## AI and MCP integration
|
|
321
71
|
|
|
322
|
-
|
|
323
|
-
npm install @undrr/undrr-mangrove@latest
|
|
324
|
-
```
|
|
72
|
+
Mangrove publishes static metadata for coding agents after Storybook deploy:
|
|
325
73
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
npm outdated
|
|
330
|
-
npm update
|
|
331
|
-
```
|
|
74
|
+
- `llms.txt`: <https://preventionweb.github.io/undrr-mangrove/llms.txt>
|
|
75
|
+
- component index: <https://preventionweb.github.io/undrr-mangrove/ai-components/index.json>
|
|
76
|
+
- per-component details: `ai-components/{id}.json`
|
|
332
77
|
|
|
333
|
-
|
|
78
|
+
Guide: [`docs/AI-MCP-INTEGRATION.md`](docs/AI-MCP-INTEGRATION.md)
|
|
334
79
|
|
|
335
|
-
##
|
|
80
|
+
## Documentation index
|
|
336
81
|
|
|
337
|
-
|
|
338
|
-
- **Preact vs React**: After initially planning to use Preact, we've stayed with `react-dom` for using the components in other systems. This ensures that the Storybook and other system runtimes remain similar, avoiding issues with React-only components (e.g. `react-leaflet`).
|
|
339
|
-
- **TypeScript support**: While the default implementation uses JSX and JavaScript, TypeScript is fully supported. You can view examples of TypeScript components in the [TypeScript Example Component](https://unisdr.github.io/undrr-mangrove/?path=/docs/example-typescript-component--docs) (code location: `stories/Components/TypeScriptExampleComponent`)
|
|
82
|
+
All project docs: [`docs/README.md`](docs/README.md)
|
|
340
83
|
|
|
341
|
-
##
|
|
84
|
+
## License
|
|
342
85
|
|
|
343
|
-
Components and code are Apache
|
|
86
|
+
Components and code are Apache-2.0 licensed. The UNDRR look and feel is proprietary.
|
|
344
87
|
|
|
345
88
|
## Credit
|
|
346
89
|
|
|
347
|
-
The
|
|
90
|
+
The initial Storybook setup was adapted from the
|
|
91
|
+
[UNDP Design System](https://github.com/undp/design-system) (MIT), with
|
|
92
|
+
permission.
|
package/components/BookCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* This is a UNDRR Mangrove component: https://github.com/unisdr/undrr-mangrove?tab=readme-ov-file
|
|
3
|
-
* Compiled on: 2026-09-
|
|
3
|
+
* Compiled on: 2026-09-15T18:17:37.724Z
|
|
4
4
|
*/
|
|
5
5
|
/*! For license information please see BookCard.js.LICENSE.txt */
|
|
6
|
-
import*as e from"react";var t={7888(e,t,n){n(1649);var r=n(8433),o=n.n(r);n(2783),o().string.isRequired,o().oneOf(["Primary","Secondary"]),o().oneOf(["Default","CTA"]),o().bool,o().oneOf(["Default","Disabled"]),o().string,o().func,o().string},7261(e,t,n){var r=n(654);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},8433(e,t,n){e.exports=n(7261)()},654(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9755(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},2783(e,t,n){e.exports=n(9755)},1649(e,t,n){e.exports=(()=>{const e={};return n.d(e,{}),e})()}};const n={};function r(e){const o=n[e];if(void 0!==o)return o.exports;const a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],a=t[n++];r.o(e,o)?0===a&&n++:0===a?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:a})}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r(1649);var o=r(8433),a=r.n(o);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const c=Object.entries,s=Object.setPrototypeOf,u=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor;let m=Object.freeze,d=Object.seal,h=Object.create,y="undefined"!=typeof Reflect&&Reflect,g=y.apply,b=y.construct;m||(m=function(e){return e}),d||(d=function(e){return e}),g||(g=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),b||(b=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const T=j(Array.prototype.forEach),S=j(Array.prototype.lastIndexOf),E=j(Array.prototype.pop),A=j(Array.prototype.push),_=j(Array.prototype.splice),N=Array.isArray,v=j(String.prototype.toLowerCase),O=j(String.prototype.toString),w=j(String.prototype.match),x=j(String.prototype.replace),R=j(String.prototype.indexOf),k=j(String.prototype.trim),D=j(Number.prototype.toString),C=j(Boolean.prototype.toString),I="undefined"==typeof BigInt?null:j(BigInt.prototype.toString),L="undefined"==typeof Symbol?null:j(Symbol.prototype.toString),M=j(Object.prototype.hasOwnProperty),P=j(Object.prototype.toString),z=j(RegExp.prototype.test),U=(F=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b(F,t)});var F;function j(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return g(e,t,r)}}function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;if(s&&s(e,null),!N(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(u(t)||(t[r]=e),o=e)}e[o]=!0}return e}function B(e){for(let t=0;t<e.length;t++)M(e,t)||(e[t]=null);return e}function W(e){const t=h(null);for(const r of c(e)){var n=l(r,2);const o=n[0],a=n[1];M(e,o)&&(N(a)?t[o]=B(a):a&&"object"==typeof a&&a.constructor===Object?t[o]=W(a):t[o]=a)}return t}function G(e,t){for(;null!==e;){const n=p(e,t);if(n){if(n.get)return j(n.get);if("function"==typeof n.value)return j(n.value)}e=f(e)}return function(){return null}}const Y=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),q=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),X=m(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),V=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Z=m(["#text"]),J=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Q=m(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ee=m(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),te=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ne=d(/{{[\w\W]*|^[\w\W]*}}/g),re=d(/<%[\w\W]*|^[\w\W]*%>/g),oe=d(/\${[\w\W]*/g),ae=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),ie=d(/^aria-[\-\w]+$/),le=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ce=d(/^(?:\w+script|data):/i),se=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ue=d(/^html$/i),fe=d(/^[a-z][.\w]*(-[.\w]+)+$/i),pe=d(/<[/\w!]/g),me=d(/<[/\w]/g),de=d(/<\/no(script|embed|frames)/i),he=d(/\/>/i),ye=function(){return"undefined"==typeof window?null:window},ge=function(e,t,n,r){return M(e,t)&&N(e[t])?H(r.base?W(r.base):{},e[t],r.transform):n};(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ye();const n=t=>e(t);if(n.version="3.4.12",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,a=o.currentScript;t.DocumentFragment;const i=t.HTMLTemplateElement,l=t.Node,s=t.Element,u=t.NodeFilter;void 0===t.NamedNodeMap&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const f=t.DOMParser,p=t.trustedTypes,y=s.prototype,g=G(y,"cloneNode"),b=G(y,"remove"),F=G(y,"nextSibling"),j=G(y,"childNodes"),B=G(y,"parentNode"),be=G(y,"shadowRoot"),Te=G(y,"attributes"),Se=l&&l.prototype?G(l.prototype,"nodeType"):null,Ee=l&&l.prototype?G(l.prototype,"nodeName"):null;if("function"==typeof i){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Ae,_e,Ne="",ve=!1,Oe=0;const we=function(){if(Oe>0)throw U('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},xe=function(e){we(),Oe++;try{return Ae.createHTML(e)}finally{Oe--}},Re=r,ke=Re.implementation,De=Re.createNodeIterator,Ce=Re.createDocumentFragment,Ie=Re.getElementsByTagName,Le=o.importNode;let Me={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof c&&"function"==typeof B&&ke&&void 0!==ke.createHTMLDocument;const Pe=ne,ze=re,Ue=oe,Fe=ae,je=ie,He=ce,Be=se,We=fe;let Ge=le,Ye=null;const qe=H({},[...Y,...q,...$,...K,...Z]);let $e=null;const Xe=H({},[...J,...Q,...ee,...te]);let Ke=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ve=null,Ze=null;const Je=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,et=!0,tt=!1,nt=!0,rt=!1,ot=!0,at=!1,it=!1,lt=null,ct=null,st=!1,ut=!1,ft=!1,pt=!1,mt=!0,dt=!1;const ht="user-content-";let yt=!0,gt=!1,bt={},Tt=null;const St=H({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Et=null;const At=H({},["audio","video","img","source","image","track"]);let _t=null;const Nt=H({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",wt="http://www.w3.org/1999/xhtml";let xt=wt,Rt=!1,kt=null;const Dt=H({},[vt,Ot,wt],O),Ct=m(["mi","mo","mn","ms","mtext"]);let It=H({},Ct);const Lt=m(["annotation-xml"]);let Mt=H({},Lt);const Pt=H({},["title","style","font","a","script"]);let zt=null;const Ut=["application/xhtml+xml","text/html"];let Ft=null,jt=null;const Ht=r.createElement("form"),Bt=function(e){return e instanceof RegExp||e instanceof Function},Wt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(jt&&jt===e)return;e&&"object"==typeof e||(e={}),e=W(e),zt=-1===Ut.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ft="application/xhtml+xml"===zt?O:v,Ye=ge(e,"ALLOWED_TAGS",qe,{transform:Ft}),$e=ge(e,"ALLOWED_ATTR",Xe,{transform:Ft}),kt=ge(e,"ALLOWED_NAMESPACES",Dt,{transform:O}),_t=ge(e,"ADD_URI_SAFE_ATTR",Nt,{transform:Ft,base:Nt}),Et=ge(e,"ADD_DATA_URI_TAGS",At,{transform:Ft,base:At}),Tt=ge(e,"FORBID_CONTENTS",St,{transform:Ft}),Ve=ge(e,"FORBID_TAGS",W({}),{transform:Ft}),Ze=ge(e,"FORBID_ATTR",W({}),{transform:Ft}),bt=!!M(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?W(e.USE_PROFILES):e.USE_PROFILES),Qe=!1!==e.ALLOW_ARIA_ATTR,et=!1!==e.ALLOW_DATA_ATTR,tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,rt=e.SAFE_FOR_TEMPLATES||!1,ot=!1!==e.SAFE_FOR_XML,at=e.WHOLE_DOCUMENT||!1,ut=e.RETURN_DOM||!1,ft=e.RETURN_DOM_FRAGMENT||!1,pt=e.RETURN_TRUSTED_TYPE||!1,st=e.FORCE_BODY||!1,mt=!1!==e.SANITIZE_DOM,dt=e.SANITIZE_NAMED_PROPS||!1,yt=!1!==e.KEEP_CONTENT,gt=e.IN_PLACE||!1,Ge=function(e){try{return z(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:le,xt="string"==typeof e.NAMESPACE?e.NAMESPACE:wt,It=M(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?W(e.MATHML_TEXT_INTEGRATION_POINTS):H({},Ct),Mt=M(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?W(e.HTML_INTEGRATION_POINTS):H({},Lt);const t=M(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?W(e.CUSTOM_ELEMENT_HANDLING):h(null);if(Ke=h(null),M(t,"tagNameCheck")&&Bt(t.tagNameCheck)&&(Ke.tagNameCheck=t.tagNameCheck),M(t,"attributeNameCheck")&&Bt(t.attributeNameCheck)&&(Ke.attributeNameCheck=t.attributeNameCheck),M(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(Ke.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),d(Ke),rt&&(et=!1),ft&&(ut=!0),bt&&(Ye=H({},Z),$e=h(null),!0===bt.html&&(H(Ye,Y),H($e,J)),!0===bt.svg&&(H(Ye,q),H($e,Q),H($e,te)),!0===bt.svgFilters&&(H(Ye,$),H($e,Q),H($e,te)),!0===bt.mathMl&&(H(Ye,K),H($e,ee),H($e,te))),Je.tagCheck=null,Je.attributeCheck=null,M(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?Je.tagCheck=e.ADD_TAGS:N(e.ADD_TAGS)&&(Ye===qe&&(Ye=W(Ye)),H(Ye,e.ADD_TAGS,Ft))),M(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?Je.attributeCheck=e.ADD_ATTR:N(e.ADD_ATTR)&&($e===Xe&&($e=W($e)),H($e,e.ADD_ATTR,Ft))),M(e,"ADD_URI_SAFE_ATTR")&&N(e.ADD_URI_SAFE_ATTR)&&H(_t,e.ADD_URI_SAFE_ATTR,Ft),M(e,"FORBID_CONTENTS")&&N(e.FORBID_CONTENTS)&&(Tt===St&&(Tt=W(Tt)),H(Tt,e.FORBID_CONTENTS,Ft)),M(e,"ADD_FORBID_CONTENTS")&&N(e.ADD_FORBID_CONTENTS)&&(Tt===St&&(Tt=W(Tt)),H(Tt,e.ADD_FORBID_CONTENTS,Ft)),yt&&(Ye["#text"]=!0),at&&H(Ye,["html","head","body"]),Ye.table&&(H(Ye,["tbody"]),delete Ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=Ae;Ae=e.TRUSTED_TYPES_POLICY;try{Ne=xe("")}catch(e){throw Ae=t,e}}else null===e.TRUSTED_TYPES_POLICY?(Ae=void 0,Ne=""):(void 0===Ae&&(ve||(_e=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,a),ve=!0),Ae=_e),Ae&&"string"==typeof Ne&&(Ne=xe("")));m&&m(e),jt=e},Gt=H({},[...q,...$,...X]),Yt=H({},[...K,...V]),qt=function(e){A(n.removed,{element:e});try{B(e).removeChild(e)}catch(t){if(b(e),!B(e))throw U("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},$t=function(e){Vt(e);const t=j(e);if(t){const e=[];T(t,t=>{A(e,t)}),T(e,e=>{try{b(e)}catch(e){}})}const n=Te(e);if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],o=r&&r.name;if("string"==typeof o)try{e.removeAttribute(o)}catch(e){}}},Xt=function(e,t){try{A(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ut||ft)try{qt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Kt=function(e){const t=Te(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],o=r&&r.name;if("string"==typeof o&&!$e[Ft(o)])try{e.removeAttribute(o)}catch(e){}}},Vt=function(e){const t=[e];for(;t.length>0;){const e=t.pop();1===(Se?Se(e):e.nodeType)&&Kt(e);const n=j(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Zt=function(e){let t=null,n=null;if(st)e="<remove></remove>"+e;else{const t=w(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===zt&&xt===wt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Ae?xe(e):e;if(xt===wt)try{t=(new f).parseFromString(o,zt)}catch(e){}if(!t||!t.documentElement){t=ke.createDocument(xt,"template",null);try{t.documentElement.innerHTML=Rt?Ne:o}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),xt===wt?Ie.call(t,at?"html":"body")[0]:at?t.documentElement:a},Jt=function(e){return De.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Qt=function(e){return e=x(e,Pe," "),e=x(e,ze," "),x(e,Ue," ")},en=function(e){var t;e.normalize();const n=De.call(e.ownerDocument||e,e,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=Qt(r.data),r=n.nextNode();const o=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");o&&T(o,e=>{nn(e.content)&&en(e.content)})},tn=function(e){const t=Ee?Ee(e):null;return"string"==typeof t&&"form"===Ft(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==Te(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==Se(e)||e.childNodes!==j(e))},nn=function(e){if(!Se||"object"!=typeof e||null===e)return!1;try{return 11===Se(e)}catch(e){return!1}},rn=function(e){if(!Se||"object"!=typeof e||null===e)return!1;try{return"number"==typeof Se(e)}catch(e){return!1}};function on(e,t,r){0!==e.length&&T(e,e=>{e.call(n,t,r,jt)})}const an=function(e,t){if(on(Me.beforeSanitizeElements,e,null),e!==t&&null===B(e))return!0;if(tn(e))return qt(e),!0;const r=Ft(Ee?Ee(e):e.nodeName);if(on(Me.uponSanitizeElement,e,{tagName:r,allowedTags:Ye}),e!==t&&null===B(e))return!0;if(function(e,t){return!!(ot&&e.hasChildNodes()&&!rn(e.firstElementChild)&&z(pe,e.textContent)&&z(pe,e.innerHTML))||!(!ot||e.namespaceURI!==wt||"style"!==t||!rn(e.firstElementChild))||7===e.nodeType||!(!ot||8!==e.nodeType||!z(me,e.data))}(e,r))return qt(e),!0;if(Ve[r]||!(Je.tagCheck instanceof Function&&Je.tagCheck(r))&&!Ye[r]){const t=function(e,t){if(!Ve[t]&&sn(t)){if(Ke.tagNameCheck instanceof RegExp&&z(Ke.tagNameCheck,t))return!1;if(Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(t))return!1}if(yt&&!Tt[t]){const t=B(e),n=j(e);if(n&&t)for(let r=n.length-1;r>=0;--r){const o=gt?n[r]:g(n[r],!0);t.insertBefore(o,F(e))}}return qt(e),!0}(e,r);return!1===t&&on(Me.afterSanitizeElements,e,null),t}if(1===(Se?Se(e):e.nodeType)&&!function(e){let t=B(e);t&&t.tagName||(t={namespaceURI:xt,tagName:"template"});const n=v(e.tagName),r=v(t.tagName);return!!kt[e.namespaceURI]&&(e.namespaceURI===Ot?function(e,t,n){return t.namespaceURI===wt?"svg"===e:t.namespaceURI===vt?"svg"===e&&("annotation-xml"===n||It[n]):Boolean(Gt[e])}(n,t,r):e.namespaceURI===vt?function(e,t,n){return t.namespaceURI===wt?"math"===e:t.namespaceURI===Ot?"math"===e&&Mt[n]:Boolean(Yt[e])}(n,t,r):e.namespaceURI===wt?function(e,t,n){return!(t.namespaceURI===Ot&&!Mt[n])&&!(t.namespaceURI===vt&&!It[n])&&!Yt[e]&&(Pt[e]||!Gt[e])}(n,t,r):!("application/xhtml+xml"!==zt||!kt[e.namespaceURI]))}(e))return qt(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&z(de,e.innerHTML))return qt(e),!0;if(rt&&3===e.nodeType){const t=Qt(e.textContent);e.textContent!==t&&(A(n.removed,{element:e.cloneNode()}),e.textContent=t)}return on(Me.afterSanitizeElements,e,null),!1},ln=function(e,t,n){if(Ze[t])return!1;if(ot&&"patchsrc"===t)return!1;if(ot&&"for"===t&&"label"!==e&&"output"!==e)return!1;if(mt&&("id"===t||"name"===t)&&(n in r||n in Ht))return!1;const o=$e[t]||Je.attributeCheck instanceof Function&&Je.attributeCheck(t,e);if(et&&z(Fe,t));else if(Qe&&z(je,t));else if(o){if(_t[t]);else if(z(Ge,x(n,Be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==R(n,"data:")||!Et[e])if(tt&&!z(He,x(n,Be,"")));else if(n)return!1}else if(!(sn(e)&&(Ke.tagNameCheck instanceof RegExp&&z(Ke.tagNameCheck,e)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(e))&&(Ke.attributeNameCheck instanceof RegExp&&z(Ke.attributeNameCheck,t)||Ke.attributeNameCheck instanceof Function&&Ke.attributeNameCheck(t,e))||"is"===t&&Ke.allowCustomizedBuiltInElements&&(Ke.tagNameCheck instanceof RegExp&&z(Ke.tagNameCheck,n)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(n))))return!1;return!0},cn=H({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),sn=function(e){return!cn[v(e)]&&z(We,e)},un=function(e,t,n,r){if(Ae&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!n)switch(p.getAttributeType(e,t)){case"TrustedHTML":return xe(r);case"TrustedScriptURL":return function(e){we(),Oe++;try{return Ae.createScriptURL(e)}finally{Oe--}}(r)}return r},fn=function(e,t,r,o){try{r?e.setAttributeNS(r,t,o):e.setAttribute(t,o),tn(e)?qt(e):E(n.removed)}catch(n){Xt(t,e)}},pn=function(e){on(Me.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||tn(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let r=t.length;const o=Ft(e.nodeName);for(;r--;){const a=t[r],i=a.name,l=a.namespaceURI,c=a.value,s=Ft(i),u=c;let f="value"===i?u:k(u);n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,on(Me.uponSanitizeAttribute,e,n),f=n.attrValue,!dt||"id"!==s&&"name"!==s||0===R(f,ht)||(Xt(i,e),f=ht+f),ot&&z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||"attributename"===s&&w(f,"href")?Xt(i,e):n.forceKeepAttr||(!n.keepAttr||!nt&&z(he,f)?Xt(i,e):(rt&&(f=Qt(f)),ln(o,s,f)?(f=un(o,s,l,f),f!==u&&fn(e,i,l,f)):Xt(i,e)))}on(Me.afterSanitizeAttributes,e,null)},mn=function(e){let t=null;const n=Jt(e);for(on(Me.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(on(Me.uponSanitizeShadowNode,t,null),an(t,e),pn(t),nn(t.content)&&mn(t.content),1===(Se?Se(t):t.nodeType)){const e=be(t);nn(e)&&(dn(e),mn(e))}on(Me.afterSanitizeShadowDOM,e,null)},dn=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){mn(e.shadow);continue}const n=e.node,r=1===(Se?Se(n):n.nodeType),o=j(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){const e=Ee?Ee(n):null;if("string"==typeof e&&"template"===Ft(e)){const e=n.content;nn(e)&&t.push({node:e,shadow:null})}}if(r){const e=be(n);nn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,i=null,l=null;if(Rt=!e,Rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!rn(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return D(e);case"boolean":return C(e);case"bigint":return I?I(e):"0";case"symbol":return L?L(e):"Symbol()";case"undefined":default:return P(e);case"function":case"object":{if(null===e)return P(e);const t=e,n=G(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:P(e)}return P(e)}}}(e)))throw U("dirty is not a string, aborting");if(!n.isSupported)return e;it?(Ye=lt,$e=ct):Wt(t),(Me.uponSanitizeElement.length>0||Me.uponSanitizeAttribute.length>0)&&(Ye=W(Ye)),Me.uponSanitizeAttribute.length>0&&($e=W($e)),n.removed=[];const c=gt&&"string"!=typeof e&&rn(e);if(c){!function(e){if(!ot)return;const t=[e];for(;t.length>0;){const e=t.pop(),n=Se?Se(e):e.nodeType;if(7===n||8===n&&z(me,e.data)){try{b(e)}catch(e){}continue}if(1===n){const t=e,n=Ft(Ee?Ee(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&"label"!==n&&"output"!==n&&t.removeAttribute("for")}catch(e){}}const r=j(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}}(e);const t=Ee?Ee(e):e.nodeName;if("string"==typeof t){const n=Ft(t);if(!Ye[n]||Ve[n])throw $t(e),U("root node is forbidden and cannot be sanitized in-place")}if(tn(e))throw $t(e),U("root node is clobbered and cannot be sanitized in-place");try{dn(e)}catch(t){throw $t(e),t}}else if(rn(e))r=Zt("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a),dn(a);else{if(!ut&&!rt&&!at&&-1===e.indexOf("<"))return Ae&&pt?xe(e):e;if(r=Zt(e),!r)return ut?null:pt?Ne:""}r&&st&&qt(r.firstChild);const s=c?e:r,u=Jt(s);try{for(;i=u.nextNode();)an(i,s),pn(i),nn(i.content)&&mn(i.content)}catch(t){throw c&&($t(e),T(n.removed,e=>{e.element&&Vt(e.element)})),t}if(c)return T(n.removed,e=>{e.element&&Vt(e.element)}),rt&&en(e),e;if(ut){if(rt&&en(r),ft)for(l=Ce.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return($e.shadowroot||$e.shadowrootmode)&&(l=Le.call(o,l,!0)),l}let f=at?r.outerHTML:r.innerHTML;return at&&Ye["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&z(ue,r.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+f),rt&&(f=Qt(f)),Ae&&pt?xe(f):f},n.setConfig=function(){Wt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),it=!0,lt=Ye,ct=$e},n.clearConfig=function(){jt=null,it=!1,lt=null,ct=null,Ae=_e,Ne=""},n.isValidAttribute=function(e,t,n){jt||Wt({});const r=Ft(e),o=Ft(t);return ln(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&M(Me,e)&&A(Me[e],t)},n.removeHook=function(e,t){if(M(Me,e)){if(void 0!==t){const n=S(Me[e],t);return-1===n?void 0:_(Me[e],n,1)[0]}return E(Me[e])}},n.removeHooks=function(e){M(Me,e)&&(Me[e]=[])},n.removeAllHooks=function(){Me={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})(),r(7888);var be=r(2783);const Te=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null;function Se({data:e,variant:t="primary",className:n}){const r=t&&"primary"!==t?`mg-card--${t}`:null;return(0,be.jsx)(be.Fragment,{children:e.map((e,t)=>(0,be.jsxs)("article",{className:Te("mg-card","mg-card__vc","mg-card__book",r,n),children:[(0,be.jsx)("div",{className:"mg-card__visual",children:(0,be.jsx)("img",{src:e.imgback,alt:e.imgalt,className:"mg-card__image"})}),(0,be.jsx)("div",{className:"mg-card__content",children:(0,be.jsx)("header",{className:"mg-card__title",children:(0,be.jsx)("a",{href:e.link,children:e.title?.trim()})})})]},t))})}Se.propTypes={data:a().array.isRequired,variant:a().oneOf(["primary","secondary","tertiary","quaternary"]),className:a().string};export{Se as BookCard};
|
|
6
|
+
import"react";var r={2694(r,e,t){var n=t(6925);function a(){}function o(){}o.resetWarningCache=a,r.exports=function(){function r(r,e,t,a,o,i){if(i!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return r}r.isRequired=r;var t={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:a};return t.PropTypes=t,t}},5556(r,e,t){r.exports=t(2694)()},6925(r){r.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const e={};function t(n){const a=e[n];if(void 0!==a)return a.exports;const o=e[n]={exports:{}};return r[n](o,o.exports,t),o.exports}t.n=r=>{const e=r&&r.__esModule?()=>r.default:()=>r;return t.d(e,{a:e}),e},t.cw=r=>{var e;return()=>{if(r){var t=r;r=0,e={exports:{}},t.call(e.exports,e,e.exports)}return e.exports}},t.d=(r,e)=>{for(var n in e)t.o(e,n)&&!t.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var n=t.cw(function(r,e){var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,e,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==e.key&&(a=""+e.key),"key"in e)for(var o in n={},e)"key"!==o&&(n[o]=e[o]);else n=e;return e=n.ref,{$$typeof:t,type:r,key:a,ref:void 0!==e?e:null,props:n}}e.Fragment=n,e.jsx=a,e.jsxs=a}),a=t.cw(function(r,e){r.exports=n()}),o=t(5556),i=t.n(o);function s({title:r,link:e=null,target:t,rel:a}){const o=r?.trim();return(0,n().jsx)("header",{className:"mg-card__title",children:e?(0,n().jsx)("a",{href:e,target:t,rel:a,children:o}):o})}a(),s.propTypes={title:i().string,link:i().string,target:i().string,rel:i().string},i().string,i().string;const c=(...r)=>r.filter(Boolean).length>0?r.filter(Boolean).join(" "):null;function l({data:r,variant:e="primary",className:t}){const a=e&&"primary"!==e?`mg-card--${e}`:null;return(0,n().jsx)(n().Fragment,{children:r.map((r,e)=>{const o="string"==typeof(i=r.link)&&""!==i.trim()?i:null;var i;return(0,n().jsxs)("article",{className:c("mg-card","mg-card__vc","mg-card__book",a,!o&&"mg-card--no-link",t),children:[r.imgback&&(0,n().jsx)("div",{className:"mg-card__visual",children:(0,n().jsx)("img",{src:r.imgback,alt:r.imgalt,className:"mg-card__image"})}),(0,n().jsx)("div",{className:"mg-card__content",children:(0,n().jsx)(s,{title:r.title,link:o,target:r.target,rel:r.rel})})]},e)})})}l.propTypes={data:i().array.isRequired,variant:i().oneOf(["primary","secondary","tertiary","quaternary"]),className:i().string};export{l as BookCard};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* This is a UNDRR Mangrove component: https://github.com/unisdr/undrr-mangrove?tab=readme-ov-file
|
|
3
|
-
* Compiled on: 2026-09-
|
|
3
|
+
* Compiled on: 2026-09-15T18:17:37.724Z
|
|
4
4
|
*/
|
|
5
5
|
/*! For license information please see Breadcrumbs.js.LICENSE.txt */
|
|
6
|
-
import"react";var e={
|
|
6
|
+
import"react";var e={2694(e,r,t){var n=t(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,r,t,o,a,i){if(i!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:o};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(n){const o=r[n];if(void 0!==o)return o.exports;const a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n=t.cw(function(e,r){var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var a in n={},r)"key"!==a&&(n[a]=r[a]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}}),o=t.cw(function(e,r){e.exports=n()}),a=t(5556),i=t.n(a);function s({data:e,Color:r,navLabel:t="breadcrumbs",...o}){const a=e.length-1;let i="";return"White"==r&&(i="mg-breadcrumb--white"),(0,n().jsx)("nav",{"aria-label":t,className:["mg-breadcrumb",`${i}`].join(" ").trim(),children:(0,n().jsx)("ul",{children:e.map((e,r)=>r===a?(0,n().jsx)("li",{"aria-current":"page",children:e.text},r):(0,n().jsx)("li",{children:(0,n().jsx)("a",{href:"#",children:e.text})},r))})})}o(),s.propTypes={data:i().arrayOf(i().shape({text:i().string.isRequired})).isRequired,Color:i().string,navLabel:i().string};export{s as Breadcrumbcomponent};
|
package/components/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* This is a UNDRR Mangrove component: https://github.com/unisdr/undrr-mangrove?tab=readme-ov-file
|
|
3
|
-
* Compiled on: 2026-09-
|
|
3
|
+
* Compiled on: 2026-09-15T18:17:37.724Z
|
|
4
4
|
*/
|
|
5
5
|
/*! For license information please see Checkbox.js.LICENSE.txt */
|
|
6
|
-
import{useId as e}from"react";var r={
|
|
6
|
+
import{useId as e}from"react";var r={2694(e,r,o){var t=o(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,o,n,a,i){if(i!==t){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:n};return o.PropTypes=o,o}},5556(e,r,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function t(e){const n=o[e];if(void 0!==n)return n.exports;const a=o[e]={exports:{}};return r[e](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var o=e;e=0,r={exports:{}},o.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n=t.cw(function(e,r){var o=Symbol.for("react.transitional.element");function t(e,r,t){var n=null;if(void 0!==t&&(n=""+t),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in t={},r)"key"!==a&&(t[a]=r[a]);else t=r;return r=t.ref,{$$typeof:o,type:e,key:n,ref:void 0!==r?r:null,props:t}}Symbol.for("react.fragment"),r.jsx=t,r.jsxs=t}),a=t.cw(function(e,r){e.exports=n()}),i=t(5556),s=t.n(i);function c({id:r,name:o,label:t,value:a,checked:i,defaultChecked:s,onChange:c,disabled:l=!1,error:p=!1,errorText:f,labelPosition:d="after",className:u,...m}){const b=e(),h=r||b,y=p&&f?`${h}-error`:void 0,g=["mg-form-check__input","mg-form-check__input--checkbox",l&&"mg-form-check__input--disabled",p&&"mg-form-check__input--error"].filter(Boolean).join(" "),v=t&&(0,n().jsx)("label",{className:"mg-form-check__label",htmlFor:h,children:t});return(0,n().jsxs)("div",{className:["mg-form-check",u].filter(Boolean).join(" "),children:["before"===d&&v,(0,n().jsx)("input",{className:g,type:"checkbox",id:h,name:o,value:a,checked:i,defaultChecked:s,onChange:c,disabled:l,"aria-invalid":p||void 0,"aria-describedby":y,...t?{}:{"aria-label":a},...m}),"after"===d&&v,p&&f&&(0,n().jsx)("p",{className:"mg-form-error",id:y,role:"alert",children:f})]})}a(),c.propTypes={id:s().string,name:s().string,label:s().string,value:s().string,checked:s().bool,defaultChecked:s().bool,onChange:s().func,disabled:s().bool,error:s().bool,errorText:s().string,labelPosition:s().oneOf(["before","after"]),className:s().string};const l=c;export{c as Checkbox,l as default};
|
package/components/Chips.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* This is a UNDRR Mangrove component: https://github.com/unisdr/undrr-mangrove?tab=readme-ov-file
|
|
3
|
-
* Compiled on: 2026-09-
|
|
3
|
+
* Compiled on: 2026-09-15T18:17:37.724Z
|
|
4
4
|
*/
|
|
5
5
|
/*! For license information please see Chips.js.LICENSE.txt */
|
|
6
|
-
import"react";var e={
|
|
6
|
+
import"react";var e={2694(e,r,t){var o=t(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,a,s){if(s!==o){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(o){const n=r[o];if(void 0!==n)return n.exports;const a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o=t.cw(function(e,r){var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in o={},r)"key"!==a&&(o[a]=r[a]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:n,ref:void 0!==r?r:null,props:o}}}),n=t.cw(function(e,r){e.exports=o()}),a=t(5556),s=t.n(a);function i({label:e,Type:r="Default",href:t="#",onDismiss:n,removeLabel:a,className:s,...i}){const p=["mg-chip","With X"===r&&"mg-chip__cross",s].filter(Boolean).join(" ");return"With X"===r?(0,o().jsx)("button",{...i,type:"button",className:p,"aria-label":a||`Remove filter: ${e}`,onClick:n,children:e}):(0,o().jsx)("a",{...i,className:p,href:t,children:e})}n(),i.propTypes={label:s().string.isRequired,Type:s().oneOf(["Default","With X"]),href:s().string,onDismiss:s().func,removeLabel:s().string,className:s().string};export{i as Chips};
|
package/components/CtaButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* This is a UNDRR Mangrove component: https://github.com/unisdr/undrr-mangrove?tab=readme-ov-file
|
|
3
|
-
* Compiled on: 2026-09-
|
|
3
|
+
* Compiled on: 2026-09-15T18:17:37.724Z
|
|
4
4
|
*/
|
|
5
5
|
/*! For license information please see CtaButton.js.LICENSE.txt */
|
|
6
|
-
import
|
|
6
|
+
import"react";var e={2694(e,r,t){var n=t(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,r,t,o,a,i){if(i!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:o};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(n){const o=r[n];if(void 0!==o)return o.exports;const a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n=t.cw(function(e,r){var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var a in n={},r)"key"!==a&&(n[a]=r[a]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==r?r:null,props:n}}}),o=t.cw(function(e,r){e.exports=n()}),a=t(5556),i=t.n(a);function s({label:e,Type:r="Primary",Variant:t="Default",Outline:o=!1,State:a="Default",href:i="#",onClick:s,className:c,...l}){const p="Disabled"===a,f=["mg-button","CTA"===t&&"mg-button-cta","mg-button-"+("Secondary"===r?"secondary":"primary"),o&&"mg-button-outline",p&&"disabled",c].filter(Boolean).join(" ");return(0,n().jsx)("a",{className:f,...l,...p?{"aria-disabled":"true",tabIndex:-1}:{href:i,onClick:s},children:e})}o(),s.propTypes={label:i().string.isRequired,Type:i().oneOf(["Primary","Secondary"]),Variant:i().oneOf(["Default","CTA"]),Outline:i().bool,State:i().oneOf(["Default","Disabled"]),href:i().string,onClick:i().func,className:i().string};export{s as CtaButton};
|