@utrecht/root-react 1.0.1 → 1.0.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/package.json +53 -20
- package/dist/css.cjs +0 -45
- package/dist/css.cjs.map +0 -1
- package/dist/index.cjs +0 -27
- package/dist/index.cjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utrecht/root-react",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"author": "Community for NL Design System",
|
|
3
|
+
"version": "1.0.2",
|
|
5
4
|
"description": "Root component for the Municipality of Utrecht based on the NL Design System architecture",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nl-design-system"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/nl-design-system/utrecht/tree/main/packages/components-react/root-react#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/nl-design-system/utrecht/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git+ssh",
|
|
14
|
+
"url": "git+https://github.com/nl-design-system/utrecht.git",
|
|
15
|
+
"directory": "packages/components-react/root-react"
|
|
16
|
+
},
|
|
6
17
|
"license": "EUPL-1.2",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
18
|
+
"author": "Community for NL Design System",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./css": {
|
|
27
|
+
"types": "./dist/css.d.ts",
|
|
28
|
+
"import": "./dist/css.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./dist": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./dist/index": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./dist/index.mjs": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./dist/css": {
|
|
43
|
+
"types": "./dist/css.d.ts",
|
|
44
|
+
"import": "./dist/css.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./dist/css.mjs": {
|
|
47
|
+
"types": "./dist/css.d.ts",
|
|
48
|
+
"import": "./dist/css.mjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
10
51
|
"files": [
|
|
11
52
|
"dist/",
|
|
12
53
|
"src/"
|
|
13
54
|
],
|
|
14
|
-
"
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"clsx": "2.1.1"
|
|
57
|
+
},
|
|
15
58
|
"devDependencies": {
|
|
16
59
|
"@testing-library/dom": "8.20.1",
|
|
17
60
|
"@testing-library/jest-dom": "6.5.0",
|
|
@@ -28,28 +71,18 @@
|
|
|
28
71
|
"@utrecht/build-utils-react": "0.0.1",
|
|
29
72
|
"@utrecht/root-css": "1.0.0"
|
|
30
73
|
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"nl-design-system"
|
|
33
|
-
],
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public"
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git+ssh",
|
|
39
|
-
"url": "git@github.com:nl-design-system/utrecht.git",
|
|
40
|
-
"directory": "packages/components-react/root-react"
|
|
41
|
-
},
|
|
42
74
|
"peerDependencies": {
|
|
43
75
|
"@babel/runtime": "*",
|
|
44
76
|
"react": "18",
|
|
45
77
|
"react-dom": "18"
|
|
46
78
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
49
81
|
},
|
|
50
82
|
"scripts": {
|
|
51
|
-
"clean": "rimraf dist *.tsbuildinfo .rollup.cache coverage",
|
|
52
83
|
"build": "rollup --config ./rollup.config.mjs",
|
|
84
|
+
"clean": "rimraf dist *.tsbuildinfo .rollup.cache coverage",
|
|
85
|
+
"init": "init-react-package",
|
|
53
86
|
"test": "mkdir -p pages && jest --coverage --verbose",
|
|
54
87
|
"typecheck": "tsc --noEmit"
|
|
55
88
|
}
|
package/dist/css.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
|
|
9
|
-
var css = ".utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}";
|
|
10
|
-
|
|
11
|
-
var insertStyle = function insertStyle(css) {
|
|
12
|
-
if (typeof document !== 'undefined') {
|
|
13
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
14
|
-
var style = document.createElement('style');
|
|
15
|
-
style.appendChild(document.createTextNode(css));
|
|
16
|
-
head.appendChild(style);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var _excluded = ["children", "className", "Component"];
|
|
21
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
-
var Root = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
24
|
-
var children = _ref.children,
|
|
25
|
-
className = _ref.className,
|
|
26
|
-
_ref$Component = _ref.Component,
|
|
27
|
-
Component = _ref$Component === void 0 ? 'html' : _ref$Component,
|
|
28
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
30
|
-
ref: ref,
|
|
31
|
-
className: clsx('utrecht-root', className),
|
|
32
|
-
children: children
|
|
33
|
-
}));
|
|
34
|
-
});
|
|
35
|
-
Root.displayName = 'Root';
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @license EUPL-1.2
|
|
39
|
-
* Copyright (c) 2020-2024 Frameless B.V.
|
|
40
|
-
* Copyright (c) 2021-2024 Gemeente Utrecht
|
|
41
|
-
*/
|
|
42
|
-
insertStyle(css);
|
|
43
|
-
|
|
44
|
-
exports.Root = Root;
|
|
45
|
-
//# sourceMappingURL=css.cjs.map
|
package/dist/css.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.cjs","sources":["../../../../components/root/dist/index.mjs","../src/insert-style.ts","../src/index.tsx","../src/css.tsx"],"sourcesContent":["export default \".utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}\";\n","export const insertStyle = function (css: string) {\n if (typeof document !== 'undefined') {\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.appendChild(document.createTextNode(css));\n head.appendChild(style);\n }\n};\n","/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n\nimport clsx from 'clsx';\nimport { ForwardedRef, forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\nexport interface HtmlRootProps extends HTMLAttributes<HTMLElement> {\n Component?: 'html';\n}\n\nexport interface DivRootProps extends HTMLAttributes<HTMLElement> {\n Component: 'div';\n}\n\nexport const Root = forwardRef(\n (\n {\n children,\n className,\n Component = 'html',\n ...restProps\n }: PropsWithChildren<HtmlRootProps> | PropsWithChildren<DivRootProps>,\n ref: ForwardedRef<HTMLElement>,\n ) => (\n <Component {...restProps} ref={ref as any} className={clsx('utrecht-root', className)}>\n {children}\n </Component>\n ),\n);\n\nRoot.displayName = 'Root';\n","/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n\nimport css from '@utrecht/root-css/dist/index.mjs';\nimport { insertStyle } from './insert-style';\n\ninsertStyle(css);\n\nexport * from './index';\n"],"names":["insertStyle","css","document","head","getElementsByTagName","style","createElement","appendChild","createTextNode","Root","forwardRef","_ref","ref","children","className","_ref$Component","Component","restProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","clsx","displayName"],"mappings":";;;;;;;;AAAA,UAAe,4aAA4a;;ACApb,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAaC,GAAW,EAAA;AAC9C,EAAA,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;AACnC,IAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,IAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;IAC3CD,KAAK,CAACE,WAAW,CAACL,QAAQ,CAACM,cAAc,CAACP,GAAG,CAAC,CAAC,CAAA;AAC/CE,IAAAA,IAAI,CAACI,WAAW,CAACF,KAAK,CAAC,CAAA;AACzB,GAAA;AACF,CAAC;;;;;ACUM,IAAMI,IAAI,gBAAGC,gBAAU,CAC5B,UAAAC,IAAA,EAOEC,GAA8B,EAAA;AAAA,EAAA,IAL5BC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAAC,cAAA,GAAAJ,IAAA,CACTK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,cAAA;AACfE,IAAAA,SAAS,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;EAAA,OAIdC,cAAA,CAACJ,SAAS,EAAAK,aAAA,CAAAA,aAAA,KAAKJ,SAAS,CAAA,EAAA,EAAA,EAAA;AAAEL,IAAAA,GAAG,EAAEA,GAAU;AAAEE,IAAAA,SAAS,EAAEQ,IAAI,CAAC,cAAc,EAAER,SAAS,CAAC;cAClFD,QAAAA;AAAQ,GAAA,CAAA,CACC,CAAA;AAAA,CACb,EACF;AAEDJ,IAAI,CAACc,WAAW,GAAG,MAAM;;ACjCzB;;;;AAIG;AAKHvB,WAAW,CAACC,GAAG,CAAC;;;;"}
|
package/dist/index.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
|
|
9
|
-
var _excluded = ["children", "className", "Component"];
|
|
10
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
var Root = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
13
|
-
var children = _ref.children,
|
|
14
|
-
className = _ref.className,
|
|
15
|
-
_ref$Component = _ref.Component,
|
|
16
|
-
Component = _ref$Component === void 0 ? 'html' : _ref$Component,
|
|
17
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
19
|
-
ref: ref,
|
|
20
|
-
className: clsx('utrecht-root', className),
|
|
21
|
-
children: children
|
|
22
|
-
}));
|
|
23
|
-
});
|
|
24
|
-
Root.displayName = 'Root';
|
|
25
|
-
|
|
26
|
-
exports.Root = Root;
|
|
27
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.tsx"],"sourcesContent":["/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n\nimport clsx from 'clsx';\nimport { ForwardedRef, forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\nexport interface HtmlRootProps extends HTMLAttributes<HTMLElement> {\n Component?: 'html';\n}\n\nexport interface DivRootProps extends HTMLAttributes<HTMLElement> {\n Component: 'div';\n}\n\nexport const Root = forwardRef(\n (\n {\n children,\n className,\n Component = 'html',\n ...restProps\n }: PropsWithChildren<HtmlRootProps> | PropsWithChildren<DivRootProps>,\n ref: ForwardedRef<HTMLElement>,\n ) => (\n <Component {...restProps} ref={ref as any} className={clsx('utrecht-root', className)}>\n {children}\n </Component>\n ),\n);\n\nRoot.displayName = 'Root';\n"],"names":["Root","forwardRef","_ref","ref","children","className","_ref$Component","Component","restProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","clsx","displayName"],"mappings":";;;;;;;;;;;AAiBO,IAAMA,IAAI,gBAAGC,gBAAU,CAC5B,UAAAC,IAAA,EAOEC,GAA8B,EAAA;AAAA,EAAA,IAL5BC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAAC,cAAA,GAAAJ,IAAA,CACTK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,cAAA;AACfE,IAAAA,SAAS,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;EAAA,OAIdC,cAAA,CAACJ,SAAS,EAAAK,aAAA,CAAAA,aAAA,KAAKJ,SAAS,CAAA,EAAA,EAAA,EAAA;AAAEL,IAAAA,GAAG,EAAEA,GAAU;AAAEE,IAAAA,SAAS,EAAEQ,IAAI,CAAC,cAAc,EAAER,SAAS,CAAC;cAClFD,QAAAA;AAAQ,GAAA,CAAA,CACC,CAAA;AAAA,CACb,EACF;AAEDJ,IAAI,CAACc,WAAW,GAAG,MAAM;;;;"}
|