@pingux/astro 2.20.0-alpha.5 → 2.20.0-alpha.7
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/lib/cjs/recipes/CountryPicker.stories.js +11 -2
- package/lib/cjs/recipes/InlineEditing.stories.js +12 -2
- package/lib/cjs/utils/designUtils/figmaLinks.js +6 -0
- package/lib/recipes/CountryPicker.stories.js +10 -1
- package/lib/recipes/InlineEditing.stories.js +10 -1
- package/lib/utils/designUtils/figmaLinks.js +6 -0
- package/package.json +1 -1
@@ -14,12 +14,15 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
16
16
|
var _countriesList = require("countries-list");
|
17
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
17
18
|
var _index = require("../index");
|
19
|
+
var _figmaLinks = require("../utils/designUtils/figmaLinks");
|
18
20
|
var _react2 = require("@emotion/react");
|
19
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
23
|
var _default = {
|
22
|
-
title: 'Recipes/Country Picker'
|
24
|
+
title: 'Recipes/Country Picker',
|
25
|
+
decorators: [_storybookAddonDesigns.withDesign]
|
23
26
|
};
|
24
27
|
exports["default"] = _default;
|
25
28
|
var validatePhoneNumber = function validatePhoneNumber(str) {
|
@@ -132,4 +135,10 @@ var Default = function Default() {
|
|
132
135
|
value: phoneNumber
|
133
136
|
})));
|
134
137
|
};
|
135
|
-
exports.Default = Default;
|
138
|
+
exports.Default = Default;
|
139
|
+
Default.parameters = {
|
140
|
+
design: {
|
141
|
+
type: 'figma',
|
142
|
+
url: _figmaLinks.FIGMA_LINKS.countryPicker["default"]
|
143
|
+
}
|
144
|
+
};
|
@@ -20,14 +20,17 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
21
21
|
var _CheckIcon = _interopRequireDefault(require("@pingux/mdi-react/CheckIcon"));
|
22
22
|
var _CloseIcon = _interopRequireDefault(require("@pingux/mdi-react/CloseIcon"));
|
23
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
23
24
|
var _index = require("../index");
|
25
|
+
var _figmaLinks = require("../utils/designUtils/figmaLinks");
|
24
26
|
var _react2 = require("@emotion/react");
|
25
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
26
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
29
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
28
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
29
31
|
var _default = {
|
30
|
-
title: 'Recipes/Inline Editing'
|
32
|
+
title: 'Recipes/Inline Editing',
|
33
|
+
decorators: [_storybookAddonDesigns.withDesign]
|
31
34
|
};
|
32
35
|
exports["default"] = _default;
|
33
36
|
var EditableAreaContext = /*#__PURE__*/(0, _react.createContext)();
|
@@ -97,12 +100,19 @@ var Default = function Default() {
|
|
97
100
|
controlProps: controlProps
|
98
101
|
}));
|
99
102
|
};
|
103
|
+
exports.Default = Default;
|
104
|
+
Default.parameters = {
|
105
|
+
design: {
|
106
|
+
type: 'figma',
|
107
|
+
url: _figmaLinks.FIGMA_LINKS.inlineEditing["default"]
|
108
|
+
}
|
109
|
+
};
|
100
110
|
|
101
111
|
/**
|
102
112
|
* Editable
|
103
113
|
* Wrapper component that provides context value for all editable components
|
104
114
|
*/
|
105
|
-
|
115
|
+
|
106
116
|
var Editable = function Editable(props) {
|
107
117
|
var value = props.value,
|
108
118
|
isEditing = props.isEditing;
|
@@ -50,6 +50,9 @@ var FIGMA_LINKS = {
|
|
50
50
|
copyText: {
|
51
51
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
52
52
|
},
|
53
|
+
countryPicker: {
|
54
|
+
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
55
|
+
},
|
53
56
|
helpHint: {
|
54
57
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A4534&t=We3h7LaaFJQnxdSy-1',
|
55
58
|
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=28958%3A40081&mode=design&t=WmSYPx1hR8kxFiXf-1'
|
@@ -63,6 +66,9 @@ var FIGMA_LINKS = {
|
|
63
66
|
iconButton: {
|
64
67
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A2520&t=We3h7LaaFJQnxdSy-1'
|
65
68
|
},
|
69
|
+
inlineEditing: {
|
70
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=5244-14864&mode=design&t=1pPbrQvGkdMYBNqk-0'
|
71
|
+
},
|
66
72
|
link: {
|
67
73
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=8708-29543&t=8Wwd3tIBh3GEjCJB-0'
|
68
74
|
},
|
@@ -3,10 +3,13 @@ import _Object$entries from "@babel/runtime-corejs3/core-js-stable/object/entrie
|
|
3
3
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
4
4
|
import React, { useState } from 'react';
|
5
5
|
import { countries as countriesObj } from 'countries-list';
|
6
|
+
import { withDesign } from 'storybook-addon-designs';
|
6
7
|
import { Box, ComboBoxField, Input, Item } from '../index';
|
8
|
+
import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks';
|
7
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
10
|
export default {
|
9
|
-
title: 'Recipes/Country Picker'
|
11
|
+
title: 'Recipes/Country Picker',
|
12
|
+
decorators: [withDesign]
|
10
13
|
};
|
11
14
|
var validatePhoneNumber = function validatePhoneNumber(str) {
|
12
15
|
var reg = /^$|^[\d\-(\d)\s.]+$|^\+/g;
|
@@ -117,4 +120,10 @@ export var Default = function Default() {
|
|
117
120
|
onChange: onPhoneNumberValueChange,
|
118
121
|
value: phoneNumber
|
119
122
|
})));
|
123
|
+
};
|
124
|
+
Default.parameters = {
|
125
|
+
design: {
|
126
|
+
type: 'figma',
|
127
|
+
url: FIGMA_LINKS.countryPicker["default"]
|
128
|
+
}
|
120
129
|
};
|
@@ -13,10 +13,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
import React, { createContext, useContext, useEffect, useRef, useState } from 'react';
|
14
14
|
import CheckIcon from '@pingux/mdi-react/CheckIcon';
|
15
15
|
import CloseIcon from '@pingux/mdi-react/CloseIcon';
|
16
|
+
import { withDesign } from 'storybook-addon-designs';
|
16
17
|
import { Box, Icon, IconButton, TextAreaField } from '../index';
|
18
|
+
import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks';
|
17
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
18
20
|
export default {
|
19
|
-
title: 'Recipes/Inline Editing'
|
21
|
+
title: 'Recipes/Inline Editing',
|
22
|
+
decorators: [withDesign]
|
20
23
|
};
|
21
24
|
var EditableAreaContext = /*#__PURE__*/createContext();
|
22
25
|
var EditableAreaProvider = EditableAreaContext.Provider;
|
@@ -85,6 +88,12 @@ export var Default = function Default() {
|
|
85
88
|
controlProps: controlProps
|
86
89
|
}));
|
87
90
|
};
|
91
|
+
Default.parameters = {
|
92
|
+
design: {
|
93
|
+
type: 'figma',
|
94
|
+
url: FIGMA_LINKS.inlineEditing["default"]
|
95
|
+
}
|
96
|
+
};
|
88
97
|
|
89
98
|
/**
|
90
99
|
* Editable
|
@@ -43,6 +43,9 @@ export var FIGMA_LINKS = {
|
|
43
43
|
copyText: {
|
44
44
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=218-1442&t=8Wwd3tIBh3GEjCJB-0'
|
45
45
|
},
|
46
|
+
countryPicker: {
|
47
|
+
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
48
|
+
},
|
46
49
|
helpHint: {
|
47
50
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A4534&t=We3h7LaaFJQnxdSy-1',
|
48
51
|
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=28958%3A40081&mode=design&t=WmSYPx1hR8kxFiXf-1'
|
@@ -56,6 +59,9 @@ export var FIGMA_LINKS = {
|
|
56
59
|
iconButton: {
|
57
60
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=0%3A2520&t=We3h7LaaFJQnxdSy-1'
|
58
61
|
},
|
62
|
+
inlineEditing: {
|
63
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=5244-14864&mode=design&t=1pPbrQvGkdMYBNqk-0'
|
64
|
+
},
|
59
65
|
link: {
|
60
66
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=8708-29543&t=8Wwd3tIBh3GEjCJB-0'
|
61
67
|
},
|