@utrecht/component-library-react 1.0.0-alpha.100 → 1.0.0-alpha.103
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 +25 -1
- package/dist/cjs/ButtonLink.d.ts +0 -4
- package/dist/cjs/ButtonLink.js +2 -7
- package/dist/cjs/Link.d.ts +0 -5
- package/dist/cjs/Link.js +2 -9
- package/dist/cjs/tsconfig.tsbuildinfo +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ import { Heading1 } from "@utrecht/component-library-react/Heading1";
|
|
|
48
48
|
import "@utrecht/component-library-css";
|
|
49
49
|
|
|
50
50
|
// Package with Utrecht design tokens for the white-label components
|
|
51
|
-
// Substitute with your another theme for other
|
|
51
|
+
// Substitute with your another theme for other organizations.
|
|
52
52
|
import "@utrecht/design-tokens/dist/index.css";
|
|
53
53
|
|
|
54
54
|
export const MyPage = () => (
|
|
@@ -59,6 +59,30 @@ export const MyPage = () => (
|
|
|
59
59
|
);
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
Only when you use the `<HTMLContent/>` component, you should import the `html.css` from the `component-library-css`
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
import { HTMLContent } from "@utrecht/component-library-react";
|
|
66
|
+
|
|
67
|
+
import "@utrecht/component-library-css/dist/html.css";
|
|
68
|
+
import "@utrecht/design-tokens/dist/index.css";
|
|
69
|
+
|
|
70
|
+
export const MyPage = () => (
|
|
71
|
+
// Class name to apply the design tokens from the theme
|
|
72
|
+
<HTMLContent
|
|
73
|
+
className="utrecht-theme"
|
|
74
|
+
dangerouslySetInnerHTML={{
|
|
75
|
+
_html: `<h1>Heading 1</h1>
|
|
76
|
+
<h2>Heading 2</h2>
|
|
77
|
+
<h3>Heading 3</h3>
|
|
78
|
+
<h4>Heading 4</h4>
|
|
79
|
+
<h5>Heading 5</h5>
|
|
80
|
+
<h6>Heading 6</h6>`,
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
```
|
|
85
|
+
|
|
62
86
|
## Components overview
|
|
63
87
|
|
|
64
88
|
We make components for React available when needed in a project. Not every component is available yet, and we welcome you to discuss contributions.
|
package/dist/cjs/ButtonLink.d.ts
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
import { AnchorHTMLAttributes } from 'react';
|
|
7
7
|
interface ButtonLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
8
8
|
external?: boolean;
|
|
9
|
-
focusStyle?: boolean;
|
|
10
|
-
focusVisibleStyle?: boolean;
|
|
11
|
-
hoverStyle?: boolean;
|
|
12
|
-
visitedStyle?: boolean;
|
|
13
9
|
}
|
|
14
10
|
export declare const ButtonLink: import("react").ForwardRefExoticComponent<ButtonLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
15
11
|
export {};
|
package/dist/cjs/ButtonLink.js
CHANGED
|
@@ -33,7 +33,7 @@ const onKeyDown = (evt) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
exports.ButtonLink = react_1.forwardRef((_a, ref) => {
|
|
36
|
-
var { children, className, external,
|
|
36
|
+
var { children, className, external, role } = _a, restProps = __rest(_a, ["children", "className", "external", "role"]);
|
|
37
37
|
let props = restProps;
|
|
38
38
|
if (role === 'button') {
|
|
39
39
|
// When this link is announced as button by accessibility tools,
|
|
@@ -42,11 +42,6 @@ exports.ButtonLink = react_1.forwardRef((_a, ref) => {
|
|
|
42
42
|
// to reach parity with the `button` element.
|
|
43
43
|
props = Object.assign(Object.assign({}, restProps), { onKeyDown });
|
|
44
44
|
}
|
|
45
|
-
return (jsx_runtime_1.jsx("a", Object.assign({}, props, { ref: ref, role: role, className: clsx_1.default('utrecht-button-link', {
|
|
46
|
-
'utrecht-button-link--external': external,
|
|
47
|
-
'utrecht-button-link--focus': focusStyle,
|
|
48
|
-
'utrecht-button-link--focus-visible': focusVisibleStyle,
|
|
49
|
-
'utrecht-button-link--hover': hoverStyle,
|
|
50
|
-
}, className), rel: external ? 'external noopener noreferrer' : undefined }, { children: children }), void 0));
|
|
45
|
+
return (jsx_runtime_1.jsx("a", Object.assign({}, props, { ref: ref, role: role, className: clsx_1.default('utrecht-button-link', 'utrecht-button-link--html-button', { 'utrecht-button-link--external': external }, className), rel: external ? 'external noopener noreferrer' : undefined }, { children: children }), void 0));
|
|
51
46
|
});
|
|
52
47
|
exports.ButtonLink.displayName = 'ButtonLink';
|
package/dist/cjs/Link.d.ts
CHANGED
|
@@ -5,11 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { AnchorHTMLAttributes } from 'react';
|
|
7
7
|
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
8
|
-
activeStyle?: boolean;
|
|
9
8
|
external?: boolean;
|
|
10
|
-
focusStyle?: boolean;
|
|
11
|
-
focusVisibleStyle?: boolean;
|
|
12
|
-
hoverStyle?: boolean;
|
|
13
|
-
visitedStyle?: boolean;
|
|
14
9
|
}
|
|
15
10
|
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
package/dist/cjs/Link.js
CHANGED
|
@@ -24,19 +24,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
const clsx_1 = __importDefault(require("clsx"));
|
|
25
25
|
const react_1 = require("react");
|
|
26
26
|
exports.Link = react_1.forwardRef((_a, ref) => {
|
|
27
|
-
var { children, className,
|
|
27
|
+
var { children, className, external } = _a, restProps = __rest(_a, ["children", "className", "external"]);
|
|
28
28
|
return (
|
|
29
29
|
// "utrecht-link--telephone" does not have a corresponding API,
|
|
30
30
|
// since it is primarily a basis for implementing input[href^="tel"].
|
|
31
31
|
// Telephone number rendering in React is best achieved using composition
|
|
32
32
|
// of the TelephoneValue component.
|
|
33
|
-
jsx_runtime_1.jsx("a", Object.assign({}, restProps, { ref: ref, className: clsx_1.default('utrecht-link', {
|
|
34
|
-
'utrecht-link--active': activeStyle,
|
|
35
|
-
'utrecht-link--external': external,
|
|
36
|
-
'utrecht-link--focus': focusStyle,
|
|
37
|
-
'utrecht-link--focus-visible': focusVisibleStyle,
|
|
38
|
-
'utrecht-link--hover': hoverStyle,
|
|
39
|
-
'utrecht-link--visited': visitedStyle,
|
|
40
|
-
}, className), rel: external ? 'external noopener noreferrer' : undefined }, { children: children }), void 0));
|
|
33
|
+
jsx_runtime_1.jsx("a", Object.assign({}, restProps, { ref: ref, className: clsx_1.default('utrecht-link', { 'utrecht-link--external': external }, className), rel: external ? 'external noopener noreferrer' : undefined }, { children: children }), void 0));
|
|
41
34
|
});
|
|
42
35
|
exports.Link.displayName = 'Link';
|
|
@@ -247,8 +247,8 @@
|
|
|
247
247
|
"affectsGlobalScope": false
|
|
248
248
|
},
|
|
249
249
|
"../../src/ButtonLink.tsx": {
|
|
250
|
-
"version": "
|
|
251
|
-
"signature": "
|
|
250
|
+
"version": "7c63627202382e76b9994bb5b2a22d9d01e8bb30eca2be5ff2627650c5d3e6fc",
|
|
251
|
+
"signature": "f673656c10a96499774be1103a847d59553a908e6e4aaecb95026b01b2381d2d",
|
|
252
252
|
"affectsGlobalScope": false
|
|
253
253
|
},
|
|
254
254
|
"../../src/Checkbox.tsx": {
|
|
@@ -327,8 +327,8 @@
|
|
|
327
327
|
"affectsGlobalScope": false
|
|
328
328
|
},
|
|
329
329
|
"../../src/Link.tsx": {
|
|
330
|
-
"version": "
|
|
331
|
-
"signature": "
|
|
330
|
+
"version": "912ebb7e21623103a4fd89a1de8724830d9b2dfd86215ca26462ee9d7fedce59",
|
|
331
|
+
"signature": "d663c57a4e5efebf3b2cd9bc0b84a92bfa0784dbcea1d026cce939c00db0359b",
|
|
332
332
|
"affectsGlobalScope": false
|
|
333
333
|
},
|
|
334
334
|
"../../src/OrderedList.tsx": {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.0-alpha.
|
|
2
|
+
"version": "1.0.0-alpha.103",
|
|
3
3
|
"author": "Community for NL Design System",
|
|
4
4
|
"description": "React component library bundle for the Municipality of Utrecht based on the NL Design System architecture",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
@@ -373,5 +373,5 @@
|
|
|
373
373
|
"react": "^17.0.0",
|
|
374
374
|
"react-dom": "^17.0.0"
|
|
375
375
|
},
|
|
376
|
-
"gitHead": "
|
|
376
|
+
"gitHead": "fee03baa149ec04dae8fceca6281824851b900ea"
|
|
377
377
|
}
|