@dfds-ui/storybook-design 2.0.8 → 2.0.9-alpha.3f7e7a4e
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 +3 -3
- package/cjs/components/ExampleContainer.d.ts +0 -8
- package/cjs/components/ExampleContainer.js +0 -16
- package/cjs/components/GlobalStorybookStyles.d.ts +0 -2
- package/cjs/components/GlobalStorybookStyles.js +0 -28
- package/cjs/components/MarkdownStory.d.ts +0 -8
- package/cjs/components/MarkdownStory.js +0 -42
- package/cjs/components/Paper.d.ts +0 -8
- package/cjs/components/Paper.js +0 -18
- package/cjs/components/Placeholder.d.ts +0 -7
- package/cjs/components/Placeholder.js +0 -23
- package/cjs/components/StoryPage.d.ts +0 -5
- package/cjs/components/StoryPage.js +0 -25
- package/cjs/components/index.d.ts +0 -6
- package/cjs/components/index.js +0 -48
- package/cjs/createDfdsTheme.d.ts +0 -1
- package/cjs/createDfdsTheme.js +0 -14
- package/cjs/helpers/components.d.ts +0 -40
- package/cjs/helpers/components.js +0 -367
- package/cjs/helpers/decorators.d.ts +0 -3
- package/cjs/helpers/decorators.js +0 -27
- package/cjs/index.d.ts +0 -5
- package/cjs/index.js +0 -64
- package/cjs/markdown/Markdown.d.ts +0 -6
- package/cjs/markdown/Markdown.js +0 -59
- package/cjs/markdown/Md.d.ts +0 -2
- package/cjs/markdown/Md.js +0 -19
- package/cjs/markdown/index.d.ts +0 -2
- package/cjs/markdown/index.js +0 -20
- package/cjs/mdx/index.js +0 -3
- package/cjs/mdx/mdxLoaderRenderer.js +0 -17
- package/cjs/types/global.d.js +0 -1
- package/components/ExampleContainer.d.ts +0 -8
- package/components/ExampleContainer.js +0 -16
- package/components/GlobalStorybookStyles.d.ts +0 -2
- package/components/GlobalStorybookStyles.js +0 -21
- package/components/MarkdownStory.d.ts +0 -8
- package/components/MarkdownStory.js +0 -33
- package/components/Paper.d.ts +0 -8
- package/components/Paper.js +0 -11
- package/components/Placeholder.d.ts +0 -7
- package/components/Placeholder.js +0 -16
- package/components/StoryPage.d.ts +0 -5
- package/components/StoryPage.js +0 -17
- package/components/index.d.ts +0 -6
- package/components/index.js +0 -6
- package/createDfdsTheme.d.ts +0 -1
- package/createDfdsTheme.js +0 -8
- package/helpers/components.d.ts +0 -40
- package/helpers/components.js +0 -349
- package/helpers/decorators.d.ts +0 -3
- package/helpers/decorators.js +0 -26
- package/index.d.ts +0 -5
- package/index.js +0 -5
- package/markdown/Markdown.d.ts +0 -6
- package/markdown/Markdown.js +0 -52
- package/markdown/Md.d.ts +0 -2
- package/markdown/Md.js +0 -13
- package/markdown/index.d.ts +0 -2
- package/markdown/index.js +0 -2
- package/mdx/index.js +0 -1
- package/mdx/mdxLoaderRenderer.js +0 -4
- package/types/global.d.js +0 -0
package/helpers/decorators.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const withPadding: (space?: string) => (storyFn: (...args: any) => any) => JSX.Element;
|
|
2
|
-
export declare const withBackground: (color?: string) => (storyFn: (...args: any) => any) => JSX.Element;
|
|
3
|
-
export declare const withWidth: (width: string) => (storyFn: (...args: any) => any) => JSX.Element;
|
package/helpers/decorators.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
4
|
-
export var withPadding = function withPadding() {
|
|
5
|
-
var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '16px';
|
|
6
|
-
return function (storyFn) {
|
|
7
|
-
return ___EmotionJSX("div", {
|
|
8
|
-
css: /*#__PURE__*/css("margin:", space, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:withPadding;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oZWxwZXJzL2RlY29yYXRvcnMudHN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xuICAgICAgICAmOjphZnRlciB7XG4gICAgICAgICAgZm9udC1mYW1pbHk6IFZlcmRhbmEsIHN5c3RlbS11aSwgQXJpYWwsICdIZWx2ZXRpY2EgTmV1ZScsIEhlbHZldGljYSwgc2Fucy1zZXJpZjtcbiAgICAgICAgICBwYWRkaW5nLXRvcDogNHB4O1xuICAgICAgICAgIGZvbnQtc2l6ZTogMTBweDtcbiAgICAgICAgICBjb250ZW50OiAnd2l0aFdpZHRoOiAke3dpZHRofSc7XG4gICAgICAgICAgb3BhY2l0eTogMC43NTtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgfVxuICAgICAgYH1cbiAgICA+XG4gICAgICB7c3RvcnlGbigpfVxuICAgIDwvZGl2PlxuICApXG59XG4iXX0= */")
|
|
9
|
-
}, storyFn());
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export var withBackground = function withBackground() {
|
|
13
|
-
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transparent';
|
|
14
|
-
return function (storyFn) {
|
|
15
|
-
return ___EmotionJSX("div", {
|
|
16
|
-
css: /*#__PURE__*/css("background-color:", color, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:withBackground;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oZWxwZXJzL2RlY29yYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCZ0IiLCJmaWxlIjoiLi4vLi4vc3JjL2hlbHBlcnMvZGVjb3JhdG9ycy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxuZXhwb3J0IGNvbnN0IHdpdGhQYWRkaW5nID1cbiAgKHNwYWNlID0gJzE2cHg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aH0nO1xuICAgICAgICAgIG9wYWNpdHk6IDAuNzU7XG4gICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgIH1cbiAgICAgIGB9XG4gICAgPlxuICAgICAge3N0b3J5Rm4oKX1cbiAgICA8L2Rpdj5cbiAgKVxufVxuIl19 */")
|
|
17
|
-
}, storyFn());
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export var withWidth = function withWidth(width) {
|
|
21
|
-
return function (storyFn) {
|
|
22
|
-
return ___EmotionJSX("div", {
|
|
23
|
-
css: /*#__PURE__*/css("width:", width, ";background-color:#eee;&::after{font-family:Verdana,system-ui,Arial,'Helvetica Neue',Helvetica,sans-serif;padding-top:4px;font-size:10px;content:'withWidth: ", width, "';opacity:0.75;display:block;}" + (process.env.NODE_ENV === "production" ? "" : ";label:withWidth;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oZWxwZXJzL2RlY29yYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtDYyIsImZpbGUiOiIuLi8uLi9zcmMvaGVscGVycy9kZWNvcmF0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuXG5leHBvcnQgY29uc3Qgd2l0aFBhZGRpbmcgPVxuICAoc3BhY2UgPSAnMTZweCcpID0+XG4gIChzdG9yeUZuOiAoLi4uYXJnczogYW55KSA9PiBhbnkpID0+IHtcbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICBtYXJnaW46ICR7c3BhY2V9O1xuICAgICAgICBgfVxuICAgICAgPlxuICAgICAgICB7c3RvcnlGbigpfVxuICAgICAgPC9kaXY+XG4gICAgKVxuICB9XG5cbmV4cG9ydCBjb25zdCB3aXRoQmFja2dyb3VuZCA9XG4gIChjb2xvciA9ICd0cmFuc3BhcmVudCcpID0+XG4gIChzdG9yeUZuOiAoLi4uYXJnczogYW55KSA9PiBhbnkpID0+IHtcbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke2NvbG9yfTtcbiAgICAgICAgYH1cbiAgICAgID5cbiAgICAgICAge3N0b3J5Rm4oKX1cbiAgICAgIDwvZGl2PlxuICAgIClcbiAgfVxuXG5leHBvcnQgY29uc3Qgd2l0aFdpZHRoID0gKHdpZHRoOiBzdHJpbmcpID0+IChzdG9yeUZuOiAoLi4uYXJnczogYW55KSA9PiBhbnkpID0+IHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgd2lkdGg6ICR7d2lkdGh9O1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZWVlO1xuICAgICAgICAmOjphZnRlciB7XG4gICAgICAgICAgZm9udC1mYW1pbHk6IFZlcmRhbmEsIHN5c3RlbS11aSwgQXJpYWwsICdIZWx2ZXRpY2EgTmV1ZScsIEhlbHZldGljYSwgc2Fucy1zZXJpZjtcbiAgICAgICAgICBwYWRkaW5nLXRvcDogNHB4O1xuICAgICAgICAgIGZvbnQtc2l6ZTogMTBweDtcbiAgICAgICAgICBjb250ZW50OiAnd2l0aFdpZHRoOiAke3dpZHRofSc7XG4gICAgICAgICAgb3BhY2l0eTogMC43NTtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgfVxuICAgICAgYH1cbiAgICA+XG4gICAgICB7c3RvcnlGbigpfVxuICAgIDwvZGl2PlxuICApXG59XG4iXX0= */")
|
|
24
|
-
}, storyFn());
|
|
25
|
-
};
|
|
26
|
-
};
|
package/index.d.ts
DELETED
package/index.js
DELETED
package/markdown/Markdown.d.ts
DELETED
package/markdown/Markdown.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import ReactMarkdown from 'react-markdown';
|
|
10
|
-
import renderers from 'react-markdown-github-renderers';
|
|
11
|
-
|
|
12
|
-
// the ListItem renderer from react-markdown-github-renderers does not render checkboxes so we create our own
|
|
13
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
-
var ListItemRenderer = function ListItemRenderer(props) {
|
|
15
|
-
var checkbox = null;
|
|
16
|
-
if (props.checked !== null) {
|
|
17
|
-
var checked = props.checked;
|
|
18
|
-
checkbox = /*#__PURE__*/React.createElement('input', {
|
|
19
|
-
type: 'checkbox',
|
|
20
|
-
checked: checked,
|
|
21
|
-
readOnly: true,
|
|
22
|
-
style: {
|
|
23
|
-
margin: '4px'
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/React.createElement('li', {
|
|
28
|
-
style: {
|
|
29
|
-
marginTop: 4,
|
|
30
|
-
lineHeight: 1.5
|
|
31
|
-
}
|
|
32
|
-
}, checkbox, props.children);
|
|
33
|
-
};
|
|
34
|
-
var TableRenderer = function TableRenderer(props) {
|
|
35
|
-
return /*#__PURE__*/React.createElement('table', {
|
|
36
|
-
className: 'markdown-table'
|
|
37
|
-
}, props.children);
|
|
38
|
-
};
|
|
39
|
-
var customRenderers = _objectSpread(_objectSpread({}, renderers), {}, {
|
|
40
|
-
listItem: ListItemRenderer,
|
|
41
|
-
table: TableRenderer
|
|
42
|
-
});
|
|
43
|
-
var Markdown = function Markdown(_ref) {
|
|
44
|
-
var children = _ref.children,
|
|
45
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
return ___EmotionJSX(ReactMarkdown, _extends({
|
|
47
|
-
escapeHtml: false,
|
|
48
|
-
source: children,
|
|
49
|
-
renderers: customRenderers
|
|
50
|
-
}, rest));
|
|
51
|
-
};
|
|
52
|
-
export default Markdown;
|
package/markdown/Md.d.ts
DELETED
package/markdown/Md.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Markdown from './Markdown';
|
|
3
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
4
|
-
export var Md = function Md(strings) {
|
|
5
|
-
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
6
|
-
values[_key - 1] = arguments[_key];
|
|
7
|
-
}
|
|
8
|
-
var source = strings.reduce(function (res, str, i) {
|
|
9
|
-
return "".concat(res).concat(str).concat(values[i] || '');
|
|
10
|
-
});
|
|
11
|
-
return ___EmotionJSX(Markdown, null, source);
|
|
12
|
-
};
|
|
13
|
-
export default Md;
|
package/markdown/index.d.ts
DELETED
package/markdown/index.js
DELETED
package/mdx/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.mdxLoaderRenderer = require('./mdxLoaderRenderer');
|
package/mdx/mdxLoaderRenderer.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// In order to use the css prop (without overwriting) on a component inside mdx
|
|
2
|
-
// stories we need to provide @mdx-js/loader with a custom renderer function.
|
|
3
|
-
// See https://github.com/mdx-js/mdx/tree/master/packages/loader
|
|
4
|
-
module.exports = "\nimport React from 'react'\nimport { jsx } from '@emotion/react'\nimport {mdx as _mdx } from '@mdx-js/react'\nconst mdx = (name, props, ...children) => {\n // Sometimes the mdxType prop can bleed into the DOM from components which \"spreads the rest props\"\n if(props) {\n // delete props.mdxType\n }\n return (typeof name === 'string' || typeof name === 'symbol') && !(props && 'css' in props) ? _mdx(name, props, ...children) : jsx(name, props, ...children)\n}\n";
|
package/types/global.d.js
DELETED
|
File without changes
|