@pingux/astro 2.17.0-alpha.0 → 2.17.0-alpha.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/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +17 -6
- package/lib/cjs/types/item.d.ts +29 -0
- package/lib/cjs/types/item.js +6 -0
- package/lib/types/index.js +1 -0
- package/lib/types/item.js +1 -0
- package/package.json +2 -1
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +0 -133
- package/lib/recipes/RadioButtonsWithLinks.stories.js +0 -118
package/lib/cjs/types/index.d.ts
CHANGED
package/lib/cjs/types/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
|
4
4
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
5
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
6
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
@@ -29,8 +29,19 @@ _forEachInstanceProperty(_context2 = _Object$keys(_icon)).call(_context2, functi
|
|
29
29
|
}
|
30
30
|
});
|
31
31
|
});
|
32
|
+
var _item = require("./item");
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_item)).call(_context3, function (key) {
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
35
|
+
if (key in exports && exports[key] === _item[key]) return;
|
36
|
+
_Object$defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _item[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
32
43
|
var _loader = require("./loader");
|
33
|
-
_forEachInstanceProperty(
|
44
|
+
_forEachInstanceProperty(_context4 = _Object$keys(_loader)).call(_context4, function (key) {
|
34
45
|
if (key === "default" || key === "__esModule") return;
|
35
46
|
if (key in exports && exports[key] === _loader[key]) return;
|
36
47
|
_Object$defineProperty(exports, key, {
|
@@ -41,7 +52,7 @@ _forEachInstanceProperty(_context3 = _Object$keys(_loader)).call(_context3, func
|
|
41
52
|
});
|
42
53
|
});
|
43
54
|
var _popoverContainer = require("./popoverContainer");
|
44
|
-
_forEachInstanceProperty(
|
55
|
+
_forEachInstanceProperty(_context5 = _Object$keys(_popoverContainer)).call(_context5, function (key) {
|
45
56
|
if (key === "default" || key === "__esModule") return;
|
46
57
|
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
47
58
|
_Object$defineProperty(exports, key, {
|
@@ -52,7 +63,7 @@ _forEachInstanceProperty(_context4 = _Object$keys(_popoverContainer)).call(_cont
|
|
52
63
|
});
|
53
64
|
});
|
54
65
|
var _shared = require("./shared");
|
55
|
-
_forEachInstanceProperty(
|
66
|
+
_forEachInstanceProperty(_context6 = _Object$keys(_shared)).call(_context6, function (key) {
|
56
67
|
if (key === "default" || key === "__esModule") return;
|
57
68
|
if (key in exports && exports[key] === _shared[key]) return;
|
58
69
|
_Object$defineProperty(exports, key, {
|
@@ -63,7 +74,7 @@ _forEachInstanceProperty(_context5 = _Object$keys(_shared)).call(_context5, func
|
|
63
74
|
});
|
64
75
|
});
|
65
76
|
var _tableCell = require("./tableCell");
|
66
|
-
_forEachInstanceProperty(
|
77
|
+
_forEachInstanceProperty(_context7 = _Object$keys(_tableCell)).call(_context7, function (key) {
|
67
78
|
if (key === "default" || key === "__esModule") return;
|
68
79
|
if (key in exports && exports[key] === _tableCell[key]) return;
|
69
80
|
_Object$defineProperty(exports, key, {
|
@@ -74,7 +85,7 @@ _forEachInstanceProperty(_context6 = _Object$keys(_tableCell)).call(_context6, f
|
|
74
85
|
});
|
75
86
|
});
|
76
87
|
var _text = require("./text");
|
77
|
-
_forEachInstanceProperty(
|
88
|
+
_forEachInstanceProperty(_context8 = _Object$keys(_text)).call(_context8, function (key) {
|
78
89
|
if (key === "default" || key === "__esModule") return;
|
79
90
|
if (key in exports && exports[key] === _text[key]) return;
|
80
91
|
_Object$defineProperty(exports, key, {
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { CSSProperties, ElementType } from 'react';
|
2
|
+
import type { ItemProps } from '@react-types/shared';
|
3
|
+
import { DOMAttributes, StyleProps } from './shared';
|
4
|
+
export interface StylingProps extends DOMAttributes, StyleProps {
|
5
|
+
style?: CSSProperties | string;
|
6
|
+
}
|
7
|
+
declare module '@react-types/shared' {
|
8
|
+
interface ItemProps<T> extends StyleProps, DOMAttributes {
|
9
|
+
/** The rendered label for the item. */
|
10
|
+
label?: string;
|
11
|
+
/** Props for the accordion item content element. */
|
12
|
+
regionProps?: StylingProps;
|
13
|
+
/** Props for the accordion item content element. */
|
14
|
+
containerProps?: StylingProps;
|
15
|
+
/** Whether the item has a separator */
|
16
|
+
isSeparator?: boolean;
|
17
|
+
/** Whether the item is pressed */
|
18
|
+
isPressed?: boolean;
|
19
|
+
/** The HTML element type that will be used to render the item. */
|
20
|
+
elementType?: string | ElementType;
|
21
|
+
/** Indicates the status of item */
|
22
|
+
status?: 'default' | 'error' | 'success' | 'warning';
|
23
|
+
/** A URL to link to if elementType="a". */
|
24
|
+
href?: string;
|
25
|
+
/** Inline styling prop for item */
|
26
|
+
sx?: StylingProps;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
export default ItemProps;
|
package/lib/types/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "2.17.0-alpha.
|
3
|
+
"version": "2.17.0-alpha.2",
|
4
4
|
"description": "React component library for Ping Identity's design system",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -75,6 +75,7 @@
|
|
75
75
|
"@react-stately/list": "~3.4.1",
|
76
76
|
"@react-stately/table": "~3.3.0",
|
77
77
|
"@react-stately/virtualizer": "^3.2.1",
|
78
|
+
"@react-types/shared": "^3.20.0",
|
78
79
|
"@storybook/addon-actions": "^7.1.0",
|
79
80
|
"@storybook/api": "^7.1.0",
|
80
81
|
"@storybook/components": "^7.1.0",
|
@@ -1,133 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
5
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
7
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
8
|
-
_Object$defineProperty(exports, "__esModule", {
|
9
|
-
value: true
|
10
|
-
});
|
11
|
-
exports["default"] = exports.Default = void 0;
|
12
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
13
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
15
|
-
var _CloseIcon = _interopRequireDefault(require("@pingux/mdi-react/CloseIcon"));
|
16
|
-
var _index = require("../index");
|
17
|
-
var _react2 = require("@emotion/react");
|
18
|
-
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); }
|
19
|
-
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; }
|
20
|
-
var _default = {
|
21
|
-
title: 'Recipes/Radio Buttons with Links'
|
22
|
-
};
|
23
|
-
exports["default"] = _default;
|
24
|
-
var Default = function Default() {
|
25
|
-
var roles = [{
|
26
|
-
name: 'Client Application Developer'
|
27
|
-
}, {
|
28
|
-
name: 'Environment Admin',
|
29
|
-
isDisabled: true
|
30
|
-
}, {
|
31
|
-
name: 'Identity Data Admin',
|
32
|
-
isDisabled: true
|
33
|
-
}, {
|
34
|
-
name: 'Organization Admin'
|
35
|
-
}];
|
36
|
-
var titleSx = {
|
37
|
-
fontSize: 'md',
|
38
|
-
color: 'neutral.20',
|
39
|
-
fontWeight: 2
|
40
|
-
};
|
41
|
-
var subtitleSx = {
|
42
|
-
fontSize: 'md',
|
43
|
-
color: 'neutral.10'
|
44
|
-
};
|
45
|
-
var RadioFieldWithButton = function RadioFieldWithButton(_ref) {
|
46
|
-
var fieldName = _ref.fieldName,
|
47
|
-
isDisabled = _ref.isDisabled;
|
48
|
-
var _useState = (0, _react.useState)(false),
|
49
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
50
|
-
isOpen = _useState2[0],
|
51
|
-
setIsOpen = _useState2[1];
|
52
|
-
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Box, {
|
53
|
-
isRow: true,
|
54
|
-
alignItems: "center"
|
55
|
-
}, (0, _react2.jsx)(_index.RadioField, {
|
56
|
-
value: fieldName,
|
57
|
-
label: fieldName,
|
58
|
-
isDisabled: isDisabled
|
59
|
-
}), (0, _react2.jsx)(_index.Button, {
|
60
|
-
variant: "link",
|
61
|
-
mb: "xs",
|
62
|
-
ml: "md",
|
63
|
-
onPress: function onPress() {
|
64
|
-
return setIsOpen(function (prev) {
|
65
|
-
return !prev;
|
66
|
-
});
|
67
|
-
},
|
68
|
-
isDisabled: isDisabled
|
69
|
-
}, "".concat(isOpen ? 'Hide' : 'Show', " Permissions"))), isOpen && (0, _react2.jsx)(PermissionsList, {
|
70
|
-
onPress: function onPress() {
|
71
|
-
return setIsOpen(false);
|
72
|
-
}
|
73
|
-
}));
|
74
|
-
};
|
75
|
-
var PermissionsList = function PermissionsList(_ref2) {
|
76
|
-
var onPress = _ref2.onPress;
|
77
|
-
return (0, _react2.jsx)(_index.Box, {
|
78
|
-
p: "md",
|
79
|
-
bg: "neutral.95"
|
80
|
-
}, (0, _react2.jsx)(_index.Box, {
|
81
|
-
isRow: true,
|
82
|
-
justifyContent: "space-between",
|
83
|
-
mb: "sm"
|
84
|
-
}, (0, _react2.jsx)(_index.Text, {
|
85
|
-
sx: {
|
86
|
-
fontWeight: 2
|
87
|
-
}
|
88
|
-
}, "Permissions"), (0, _react2.jsx)(_index.IconButton, {
|
89
|
-
onPress: onPress,
|
90
|
-
"aria-label": "close"
|
91
|
-
}, (0, _react2.jsx)(_index.Icon, {
|
92
|
-
icon: _CloseIcon["default"],
|
93
|
-
size: "sm",
|
94
|
-
title: {
|
95
|
-
name: 'Close Icon'
|
96
|
-
}
|
97
|
-
}))), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, {
|
98
|
-
sx: titleSx,
|
99
|
-
mb: "xs"
|
100
|
-
}, "Resource"), (0, _react2.jsx)(_index.Text, {
|
101
|
-
sx: subtitleSx,
|
102
|
-
mb: "sm"
|
103
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
|
104
|
-
sx: titleSx,
|
105
|
-
mb: "xs"
|
106
|
-
}, "Push Credentials"), (0, _react2.jsx)(_index.Text, {
|
107
|
-
sx: subtitleSx,
|
108
|
-
mb: "sm"
|
109
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"), (0, _react2.jsx)(_index.Text, {
|
110
|
-
sx: titleSx,
|
111
|
-
mb: "xs"
|
112
|
-
}, "Organization"), (0, _react2.jsx)(_index.Text, {
|
113
|
-
sx: subtitleSx,
|
114
|
-
mb: "sm"
|
115
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"), (0, _react2.jsx)(_index.Text, {
|
116
|
-
sx: titleSx,
|
117
|
-
mb: "xs"
|
118
|
-
}, "Image"), (0, _react2.jsx)(_index.Text, {
|
119
|
-
sx: subtitleSx,
|
120
|
-
mb: "sm"
|
121
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod")));
|
122
|
-
};
|
123
|
-
return (0, _react2.jsx)(_index.RadioGroupField, null, (0, _map["default"])(roles).call(roles, function (_ref3) {
|
124
|
-
var name = _ref3.name,
|
125
|
-
isDisabled = _ref3.isDisabled;
|
126
|
-
return (0, _react2.jsx)(RadioFieldWithButton, {
|
127
|
-
fieldName: name,
|
128
|
-
isDisabled: isDisabled,
|
129
|
-
key: name
|
130
|
-
});
|
131
|
-
}));
|
132
|
-
};
|
133
|
-
exports.Default = Default;
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
3
|
-
import React, { useState } from 'react';
|
4
|
-
import CloseIcon from '@pingux/mdi-react/CloseIcon';
|
5
|
-
import { Box, Button, Icon, IconButton, RadioField, RadioGroupField, Text } from '../index';
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
-
export default {
|
8
|
-
title: 'Recipes/Radio Buttons with Links'
|
9
|
-
};
|
10
|
-
export var Default = function Default() {
|
11
|
-
var roles = [{
|
12
|
-
name: 'Client Application Developer'
|
13
|
-
}, {
|
14
|
-
name: 'Environment Admin',
|
15
|
-
isDisabled: true
|
16
|
-
}, {
|
17
|
-
name: 'Identity Data Admin',
|
18
|
-
isDisabled: true
|
19
|
-
}, {
|
20
|
-
name: 'Organization Admin'
|
21
|
-
}];
|
22
|
-
var titleSx = {
|
23
|
-
fontSize: 'md',
|
24
|
-
color: 'neutral.20',
|
25
|
-
fontWeight: 2
|
26
|
-
};
|
27
|
-
var subtitleSx = {
|
28
|
-
fontSize: 'md',
|
29
|
-
color: 'neutral.10'
|
30
|
-
};
|
31
|
-
var RadioFieldWithButton = function RadioFieldWithButton(_ref) {
|
32
|
-
var fieldName = _ref.fieldName,
|
33
|
-
isDisabled = _ref.isDisabled;
|
34
|
-
var _useState = useState(false),
|
35
|
-
_useState2 = _slicedToArray(_useState, 2),
|
36
|
-
isOpen = _useState2[0],
|
37
|
-
setIsOpen = _useState2[1];
|
38
|
-
return ___EmotionJSX(Box, null, ___EmotionJSX(Box, {
|
39
|
-
isRow: true,
|
40
|
-
alignItems: "center"
|
41
|
-
}, ___EmotionJSX(RadioField, {
|
42
|
-
value: fieldName,
|
43
|
-
label: fieldName,
|
44
|
-
isDisabled: isDisabled
|
45
|
-
}), ___EmotionJSX(Button, {
|
46
|
-
variant: "link",
|
47
|
-
mb: "xs",
|
48
|
-
ml: "md",
|
49
|
-
onPress: function onPress() {
|
50
|
-
return setIsOpen(function (prev) {
|
51
|
-
return !prev;
|
52
|
-
});
|
53
|
-
},
|
54
|
-
isDisabled: isDisabled
|
55
|
-
}, "".concat(isOpen ? 'Hide' : 'Show', " Permissions"))), isOpen && ___EmotionJSX(PermissionsList, {
|
56
|
-
onPress: function onPress() {
|
57
|
-
return setIsOpen(false);
|
58
|
-
}
|
59
|
-
}));
|
60
|
-
};
|
61
|
-
var PermissionsList = function PermissionsList(_ref2) {
|
62
|
-
var onPress = _ref2.onPress;
|
63
|
-
return ___EmotionJSX(Box, {
|
64
|
-
p: "md",
|
65
|
-
bg: "neutral.95"
|
66
|
-
}, ___EmotionJSX(Box, {
|
67
|
-
isRow: true,
|
68
|
-
justifyContent: "space-between",
|
69
|
-
mb: "sm"
|
70
|
-
}, ___EmotionJSX(Text, {
|
71
|
-
sx: {
|
72
|
-
fontWeight: 2
|
73
|
-
}
|
74
|
-
}, "Permissions"), ___EmotionJSX(IconButton, {
|
75
|
-
onPress: onPress,
|
76
|
-
"aria-label": "close"
|
77
|
-
}, ___EmotionJSX(Icon, {
|
78
|
-
icon: CloseIcon,
|
79
|
-
size: "sm",
|
80
|
-
title: {
|
81
|
-
name: 'Close Icon'
|
82
|
-
}
|
83
|
-
}))), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
84
|
-
sx: titleSx,
|
85
|
-
mb: "xs"
|
86
|
-
}, "Resource"), ___EmotionJSX(Text, {
|
87
|
-
sx: subtitleSx,
|
88
|
-
mb: "sm"
|
89
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
|
90
|
-
sx: titleSx,
|
91
|
-
mb: "xs"
|
92
|
-
}, "Push Credentials"), ___EmotionJSX(Text, {
|
93
|
-
sx: subtitleSx,
|
94
|
-
mb: "sm"
|
95
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"), ___EmotionJSX(Text, {
|
96
|
-
sx: titleSx,
|
97
|
-
mb: "xs"
|
98
|
-
}, "Organization"), ___EmotionJSX(Text, {
|
99
|
-
sx: subtitleSx,
|
100
|
-
mb: "sm"
|
101
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"), ___EmotionJSX(Text, {
|
102
|
-
sx: titleSx,
|
103
|
-
mb: "xs"
|
104
|
-
}, "Image"), ___EmotionJSX(Text, {
|
105
|
-
sx: subtitleSx,
|
106
|
-
mb: "sm"
|
107
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod")));
|
108
|
-
};
|
109
|
-
return ___EmotionJSX(RadioGroupField, null, _mapInstanceProperty(roles).call(roles, function (_ref3) {
|
110
|
-
var name = _ref3.name,
|
111
|
-
isDisabled = _ref3.isDisabled;
|
112
|
-
return ___EmotionJSX(RadioFieldWithButton, {
|
113
|
-
fieldName: name,
|
114
|
-
isDisabled: isDisabled,
|
115
|
-
key: name
|
116
|
-
});
|
117
|
-
}));
|
118
|
-
};
|