@utrecht/root-react 1.0.0 → 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/dist/css.d.ts +0 -1
- package/dist/css.d.ts.map +1 -1
- package/dist/css.mjs +17 -44
- package/dist/css.mjs.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/insert-style.d.ts +2 -0
- package/dist/insert-style.d.ts.map +1 -0
- package/package.json +54 -33
- package/src/css.tsx +4 -1
- package/src/insert-style.ts +8 -0
- package/dist/css.js +0 -57
- package/dist/css.js.map +0 -1
- package/dist/index.cjs.js +0 -27
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -25
- package/dist/index.esm.js.map +0 -1
package/dist/css.d.ts
CHANGED
package/dist/css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,cAAc,SAAS,CAAC"}
|
package/dist/css.mjs
CHANGED
|
@@ -1,55 +1,28 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
2
|
import { forwardRef } from 'react';
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
if ( ref === void 0 ) ref = {};
|
|
9
|
-
var insertAt = ref.insertAt;
|
|
4
|
+
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
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (insertAt === 'top') {
|
|
18
|
-
if (head.firstChild) {
|
|
19
|
-
head.insertBefore(style, head.firstChild);
|
|
20
|
-
} else {
|
|
21
|
-
head.appendChild(style);
|
|
6
|
+
const insertStyle = function (css) {
|
|
7
|
+
if (typeof document !== 'undefined') {
|
|
8
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
9
|
+
var style = document.createElement('style');
|
|
10
|
+
style.appendChild(document.createTextNode(css));
|
|
11
|
+
head.appendChild(style);
|
|
22
12
|
}
|
|
23
|
-
|
|
24
|
-
head.appendChild(style);
|
|
25
|
-
}
|
|
13
|
+
};
|
|
26
14
|
|
|
27
|
-
|
|
28
|
-
style.styleSheet.cssText = css;
|
|
29
|
-
} else {
|
|
30
|
-
style.appendChild(document.createTextNode(css));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
15
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
33
16
|
|
|
34
|
-
|
|
35
|
-
styleInject(css_248z);
|
|
36
|
-
|
|
37
|
-
var _excluded = ["children", "className", "Component"];
|
|
38
|
-
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; }
|
|
39
|
-
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; }
|
|
40
|
-
var Root = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
41
|
-
var children = _ref.children,
|
|
42
|
-
className = _ref.className,
|
|
43
|
-
_ref$Component = _ref.Component,
|
|
44
|
-
Component = _ref$Component === void 0 ? 'html' : _ref$Component,
|
|
45
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
return jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
47
|
-
ref: ref,
|
|
48
|
-
className: clsx('utrecht-root', className),
|
|
49
|
-
children: children
|
|
50
|
-
}));
|
|
51
|
-
});
|
|
17
|
+
const Root = forwardRef(({ children, className, Component = 'html', ...restProps }, ref) => (jsx(Component, { ...restProps, ref: ref, className: clsx('utrecht-root', className), children: children })));
|
|
52
18
|
Root.displayName = 'Root';
|
|
53
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @license EUPL-1.2
|
|
22
|
+
* Copyright (c) 2020-2024 Frameless B.V.
|
|
23
|
+
* Copyright (c) 2021-2024 Gemeente Utrecht
|
|
24
|
+
*/
|
|
25
|
+
insertStyle(css);
|
|
26
|
+
|
|
54
27
|
export { Root };
|
|
55
28
|
//# sourceMappingURL=css.mjs.map
|
package/dist/css.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.mjs","sources":["../../../../node_modules/.pnpm/
|
|
1
|
+
{"version":3,"file":"css.mjs","sources":["../../../../components/root/dist/index.mjs","../src/insert-style.ts","../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../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","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\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":["_jsx"],"mappings":";;;AAAA,UAAe,4aAA4a;;ACApb,MAAM,WAAW,GAAG,UAAU,GAAW,EAAA;AAC9C,IAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AACnC,QAAA,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5C,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,QAAA,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;AACH,CAAC;;ACPD,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAQ,SAAS,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;;MCiBlW,IAAI,GAAG,UAAU,CAC5B,CACE,EACE,QAAQ,EACR,SAAS,EACT,SAAS,GAAG,MAAM,EAClB,GAAG,SAAS,EACuD,EACrE,GAA8B,MAE9BA,GAAA,CAAC,SAAS,EAAK,EAAA,GAAA,SAAS,EAAE,GAAG,EAAE,GAAU,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,YAClF,QAAQ,EAAA,CACC,CACb,EACD;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM;;ACjCzB;;;;AAIG;AAKH,WAAW,CAAC,GAAG,CAAC;;;;","x_google_ignoreList":[2]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
5
|
+
|
|
6
|
+
const Root = forwardRef(({ children, className, Component = 'html', ...restProps }, ref) => (jsx(Component, { ...restProps, ref: ref, className: clsx('utrecht-root', className), children: children })));
|
|
7
|
+
Root.displayName = 'Root';
|
|
8
|
+
|
|
9
|
+
export { Root };
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../src/index.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\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":["_jsx"],"mappings":";;;AAAA,SAAS,CAAC,CAAC,CAAC,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AAS,EAAE,GAAG,EAAE,GAAU,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,YAClF,QAAQ,EAAA,CACC,CACb,EACD;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-style.d.ts","sourceRoot":"","sources":["../src/insert-style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAkB,MAAM,SAO/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,61 @@
|
|
|
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
|
-
"@babel/plugin-transform-runtime": "7.24.7",
|
|
17
|
-
"@babel/preset-env": "7.24.7",
|
|
18
|
-
"@babel/preset-react": "7.24.7",
|
|
19
|
-
"@babel/preset-typescript": "7.24.7",
|
|
20
|
-
"@rollup/plugin-babel": "6.0.4",
|
|
21
|
-
"@rollup/plugin-commonjs": "26.0.1",
|
|
22
|
-
"@rollup/plugin-json": "6.1.0",
|
|
23
|
-
"@rollup/plugin-node-resolve": "15.2.3",
|
|
24
|
-
"@rollup/plugin-typescript": "12.1.0",
|
|
25
59
|
"@testing-library/dom": "8.20.1",
|
|
26
60
|
"@testing-library/jest-dom": "6.5.0",
|
|
27
61
|
"@testing-library/react": "16.0.1",
|
|
@@ -33,35 +67,22 @@
|
|
|
33
67
|
"jest-environment-jsdom": "29.7.0",
|
|
34
68
|
"react": "18.3.1",
|
|
35
69
|
"rollup": "4.23.0",
|
|
36
|
-
"rollup-plugin-filesize": "10.0.0",
|
|
37
|
-
"rollup-plugin-node-externals": "7.1.2",
|
|
38
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
39
|
-
"rollup-plugin-postcss": "4.0.2",
|
|
40
70
|
"typescript": "5.6.2",
|
|
71
|
+
"@utrecht/build-utils-react": "0.0.1",
|
|
41
72
|
"@utrecht/root-css": "1.0.0"
|
|
42
73
|
},
|
|
43
|
-
"keywords": [
|
|
44
|
-
"nl-design-system"
|
|
45
|
-
],
|
|
46
|
-
"publishConfig": {
|
|
47
|
-
"access": "public"
|
|
48
|
-
},
|
|
49
|
-
"repository": {
|
|
50
|
-
"type": "git+ssh",
|
|
51
|
-
"url": "git@github.com:nl-design-system/utrecht.git",
|
|
52
|
-
"directory": "packages/components-react/root-react"
|
|
53
|
-
},
|
|
54
74
|
"peerDependencies": {
|
|
55
75
|
"@babel/runtime": "*",
|
|
56
76
|
"react": "18",
|
|
57
77
|
"react-dom": "18"
|
|
58
78
|
},
|
|
59
|
-
"
|
|
60
|
-
"
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
61
81
|
},
|
|
62
82
|
"scripts": {
|
|
63
|
-
"clean": "rimraf dist *.tsbuildinfo .rollup.cache coverage",
|
|
64
83
|
"build": "rollup --config ./rollup.config.mjs",
|
|
84
|
+
"clean": "rimraf dist *.tsbuildinfo .rollup.cache coverage",
|
|
85
|
+
"init": "init-react-package",
|
|
65
86
|
"test": "mkdir -p pages && jest --coverage --verbose",
|
|
66
87
|
"typecheck": "tsc --noEmit"
|
|
67
88
|
}
|
package/src/css.tsx
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const insertStyle = function (css: string) {
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
4
|
+
var style = document.createElement('style');
|
|
5
|
+
style.appendChild(document.createTextNode(css));
|
|
6
|
+
head.appendChild(style);
|
|
7
|
+
}
|
|
8
|
+
};
|
package/dist/css.js
DELETED
|
@@ -1,57 +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
|
-
function styleInject(css, ref) {
|
|
10
|
-
if ( ref === void 0 ) ref = {};
|
|
11
|
-
var insertAt = ref.insertAt;
|
|
12
|
-
|
|
13
|
-
if (typeof document === 'undefined') { return; }
|
|
14
|
-
|
|
15
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
16
|
-
var style = document.createElement('style');
|
|
17
|
-
style.type = 'text/css';
|
|
18
|
-
|
|
19
|
-
if (insertAt === 'top') {
|
|
20
|
-
if (head.firstChild) {
|
|
21
|
-
head.insertBefore(style, head.firstChild);
|
|
22
|
-
} else {
|
|
23
|
-
head.appendChild(style);
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
head.appendChild(style);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (style.styleSheet) {
|
|
30
|
-
style.styleSheet.cssText = css;
|
|
31
|
-
} else {
|
|
32
|
-
style.appendChild(document.createTextNode(css));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var css_248z = ".utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;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}";
|
|
37
|
-
styleInject(css_248z);
|
|
38
|
-
|
|
39
|
-
var _excluded = ["children", "className", "Component"];
|
|
40
|
-
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; }
|
|
41
|
-
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; }
|
|
42
|
-
var Root = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
43
|
-
var children = _ref.children,
|
|
44
|
-
className = _ref.className,
|
|
45
|
-
_ref$Component = _ref.Component,
|
|
46
|
-
Component = _ref$Component === void 0 ? 'html' : _ref$Component,
|
|
47
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
49
|
-
ref: ref,
|
|
50
|
-
className: clsx('utrecht-root', className),
|
|
51
|
-
children: children
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
Root.displayName = 'Root';
|
|
55
|
-
|
|
56
|
-
exports.Root = Root;
|
|
57
|
-
//# sourceMappingURL=css.js.map
|
package/dist/css.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/index.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\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"],"names":["Root","forwardRef","_ref","ref","children","className","_ref$Component","Component","restProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","clsx","displayName"],"mappings":";;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAY,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC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F;AAEDJ,IAAI,CAACc,WAAW,GAAG,MAAM;;;;","x_google_ignoreList":[0]}
|
package/dist/index.cjs.js
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.js.map
|
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","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;;;;"}
|
package/dist/index.esm.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { forwardRef } from 'react';
|
|
6
|
-
|
|
7
|
-
var _excluded = ["children", "className", "Component"];
|
|
8
|
-
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; }
|
|
9
|
-
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; }
|
|
10
|
-
var Root = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
11
|
-
var children = _ref.children,
|
|
12
|
-
className = _ref.className,
|
|
13
|
-
_ref$Component = _ref.Component,
|
|
14
|
-
Component = _ref$Component === void 0 ? 'html' : _ref$Component,
|
|
15
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
return jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
17
|
-
ref: ref,
|
|
18
|
-
className: clsx('utrecht-root', className),
|
|
19
|
-
children: children
|
|
20
|
-
}));
|
|
21
|
-
});
|
|
22
|
-
Root.displayName = 'Root';
|
|
23
|
-
|
|
24
|
-
export { Root };
|
|
25
|
-
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","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,UAAU,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,GAAA,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;;;;"}
|