@pingux/astro 2.150.0-alpha.1 → 2.150.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/components/Box/Box.js +5 -3
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +4 -2
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +144 -5
- package/lib/cjs/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.d.ts +11 -0
- package/lib/cjs/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.js +197 -0
- package/lib/cjs/styles/themes/next-gen/variants/box.d.ts +61 -0
- package/lib/cjs/styles/themes/next-gen/variants/box.js +58 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +106 -5
- package/lib/cjs/styles/themes/next-gen/variants/button.js +40 -4
- package/lib/cjs/styles/themes/next-gen/variants/input.js +21 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +38 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +2 -16
- package/lib/cjs/types/iconButtonToggle.d.ts +2 -0
- package/lib/components/Box/Box.js +5 -3
- package/lib/components/IconButtonToggle/IconButtonToggle.js +4 -2
- package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.js +178 -0
- package/lib/styles/themes/next-gen/variants/box.js +49 -0
- package/lib/styles/themes/next-gen/variants/button.js +40 -4
- package/lib/styles/themes/next-gen/variants/input.js +21 -0
- package/lib/styles/themes/next-gen/variants/variants.js +2 -16
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ var _styledSystem = require("styled-system");
|
|
|
26
26
|
var _themeUi = require("theme-ui");
|
|
27
27
|
var _hooks = require("../../hooks");
|
|
28
28
|
var _react2 = require("@emotion/react");
|
|
29
|
-
var _excluded = ["as", "flexDirection", "gap", "isRow", "isDisabled", "className", "fontSize", "sx"];
|
|
29
|
+
var _excluded = ["as", "flexDirection", "gap", "isRow", "isDisabled", "className", "fontSize", "sx", "variant"];
|
|
30
30
|
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); }
|
|
31
31
|
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; }
|
|
32
32
|
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; }
|
|
@@ -36,7 +36,7 @@ var ExtendedBox = /*#__PURE__*/(0, _base["default"])(_themeUi.Box, process.env.N
|
|
|
36
36
|
} : {
|
|
37
37
|
target: "ejf9h0h0",
|
|
38
38
|
label: "ExtendedBox"
|
|
39
|
-
})(_styledSystem.layout, _styledSystem.flexbox, _styledSystem.typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
39
|
+
})(_styledSystem.layout, _styledSystem.flexbox, _styledSystem.typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0JveC9Cb3gudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNvQiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9Cb3gvQm94LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmLCB1c2VNZW1vIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgdG9OdW1iZXIgfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHsgZmxleGJveCwgbGF5b3V0LCB0eXBvZ3JhcGh5IH0gZnJvbSAnc3R5bGVkLXN5c3RlbSc7XG5pbXBvcnQgeyBCb3ggYXMgVGhlbWVVSUJveCB9IGZyb20gJ3RoZW1lLXVpJztcblxuaW1wb3J0IHsgdXNlUHJvcFdhcm5pbmcsIHVzZVN0YXR1c0NsYXNzZXMgfSBmcm9tICcuLi8uLi9ob29rcyc7XG5pbXBvcnQgeyBCb3hQcm9wcyB9IGZyb20gJy4uLy4uL3R5cGVzJztcblxuY29uc3QgRXh0ZW5kZWRCb3ggPSBzdHlsZWQoVGhlbWVVSUJveCkoXG4gIGxheW91dCxcbiAgZmxleGJveCxcbiAgdHlwb2dyYXBoeSxcbik7XG5cbmNvbnN0IEJveCA9IGZvcndhcmRSZWY8SFRNTEVsZW1lbnQsIEJveFByb3BzPigocHJvcHMsIHJlZikgPT4ge1xuICBjb25zdCB7XG4gICAgYXMgPSAnZGl2JyxcbiAgICBmbGV4RGlyZWN0aW9uLFxuICAgIGdhcCxcbiAgICBpc1JvdyA9IGZhbHNlLFxuICAgIGlzRGlzYWJsZWQgPSBmYWxzZSxcbiAgICBjbGFzc05hbWUsXG4gICAgZm9udFNpemUsXG4gICAgc3gsXG4gICAgdmFyaWFudCA9ICdib3guYmFzZScsXG4gICAgLi4ub3RoZXJzXG4gIH0gPSBwcm9wcztcbiAgY29uc3QgZmQgPSBmbGV4RGlyZWN0aW9uIHx8IGlzUm93ID8gJ3JvdycgOiAnY29sdW1uJztcbiAgY29uc3QgY3VzdG9tID0geyAuLi5zeCB9O1xuXG4gIGNvbnN0IHsgY2xhc3NOYW1lcyB9ID0gdXNlU3RhdHVzQ2xhc3NlcyhjbGFzc05hbWUsIHsgaXNEaXNhYmxlZCB9KTtcbiAgdXNlUHJvcFdhcm5pbmcocHJvcHMsICdkaXNhYmxlZCcsICdpc0Rpc2FibGVkJyk7XG5cbiAgaWYgKGdhcCkge1xuICAgIGN1c3RvbVsnJiA+ICogKyAqOm5vdCg6Zmlyc3Qtb2YtdHlwZTpub3Qoc3R5bGUpOm5vdCg6Zmlyc3Qtb2YtdHlwZSB+ICopKSddID0ge1xuICAgICAgW2ZkID09PSAncm93JyA/ICdtYXJnaW5MZWZ0JyA6ICdtYXJnaW5Ub3AnXTogZ2FwLFxuICAgIH07XG4gIH1cblxuICBjb25zdCBjdXN0b21Gb250U2l6ZSA9IHVzZU1lbW8oKCkgPT4ge1xuICAgIGNvbnN0IG51bWVyaWNhbEZvbnRTaXplID0gdG9OdW1iZXIoZm9udFNpemUpO1xuICAgIGlmIChOdW1iZXIuaXNOYU4obnVtZXJpY2FsRm9udFNpemUpKSB7XG4gICAgICByZXR1cm4gZm9udFNpemU7XG4gICAgfVxuICAgIHJldHVybiBudW1lcmljYWxGb250U2l6ZTtcbiAgfSwgW2ZvbnRTaXplXSk7XG5cbiAgcmV0dXJuIChcbiAgICA8RXh0ZW5kZWRCb3hcbiAgICAgIGNsYXNzTmFtZT17Y2xhc3NOYW1lc31cbiAgICAgIHJlZj17cmVmfVxuICAgICAgZGlzcGxheT1cImZsZXhcIlxuICAgICAgZmxleERpcmVjdGlvbj17ZmR9XG4gICAgICB2YXJpYW50PXt2YXJpYW50fVxuICAgICAgZm9udFNpemU9e2N1c3RvbUZvbnRTaXplfVxuICAgICAgYXM9e2FzfVxuICAgICAgey4uLm90aGVyc31cbiAgICAgIHN4PXtjdXN0b219XG4gICAgLz5cbiAgKTtcbn0pO1xuXG5Cb3guZGlzcGxheU5hbWUgPSAnQm94JztcblxuZXhwb3J0IGRlZmF1bHQgQm94O1xuIl19 */");
|
|
40
40
|
var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
41
41
|
var _props$as = props.as,
|
|
42
42
|
as = _props$as === void 0 ? 'div' : _props$as,
|
|
@@ -49,6 +49,8 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
49
49
|
className = props.className,
|
|
50
50
|
fontSize = props.fontSize,
|
|
51
51
|
sx = props.sx,
|
|
52
|
+
_props$variant = props.variant,
|
|
53
|
+
variant = _props$variant === void 0 ? 'box.base' : _props$variant,
|
|
52
54
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
53
55
|
var fd = flexDirection || isRow ? 'row' : 'column';
|
|
54
56
|
var custom = _objectSpread({}, sx);
|
|
@@ -72,7 +74,7 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
72
74
|
ref: ref,
|
|
73
75
|
display: "flex",
|
|
74
76
|
flexDirection: fd,
|
|
75
|
-
variant:
|
|
77
|
+
variant: variant,
|
|
76
78
|
fontSize: customFontSize,
|
|
77
79
|
as: as
|
|
78
80
|
}, others, {
|
|
@@ -24,7 +24,8 @@ var IconButtonToggle = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
24
24
|
iconProps = props.iconProps,
|
|
25
25
|
isToggled = props.isToggled,
|
|
26
26
|
onToggle = props.onToggle,
|
|
27
|
-
title = props.title
|
|
27
|
+
title = props.title,
|
|
28
|
+
variant = props.variant;
|
|
28
29
|
var conditionalRenderProps = {
|
|
29
30
|
ComponentToRenderIfTrue: toggledIcon,
|
|
30
31
|
ComponentToRenderIfFalse: defaultIcon,
|
|
@@ -37,7 +38,8 @@ var IconButtonToggle = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
37
38
|
return (0, _react2.jsx)(_IconButton["default"], (0, _extends2["default"])({
|
|
38
39
|
onPress: handleConditionChange,
|
|
39
40
|
ref: ref,
|
|
40
|
-
title: title
|
|
41
|
+
title: title,
|
|
42
|
+
variant: variant
|
|
41
43
|
}, buttonProps), (0, _react2.jsx)(_Icon["default"], (0, _extends2["default"])({
|
|
42
44
|
icon: RenderedComponent
|
|
43
45
|
}, iconProps)));
|
|
@@ -28,7 +28,7 @@ var astroBlacklistStory = {
|
|
|
28
28
|
Loader: ['Circular', 'Custom Circular']
|
|
29
29
|
};
|
|
30
30
|
exports.astroBlacklistStory = astroBlacklistStory;
|
|
31
|
-
var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer'];
|
|
31
|
+
var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer', 'Onyx Input Patterns'];
|
|
32
32
|
exports.nextGenOnlyComponents = nextGenOnlyComponents;
|
|
33
33
|
var _default = nextGenConvertedComponents;
|
|
34
34
|
exports["default"] = _default;
|
|
@@ -431,8 +431,20 @@ declare const _default: {
|
|
|
431
431
|
backgroundColor: string;
|
|
432
432
|
borderColor: string;
|
|
433
433
|
color: string;
|
|
434
|
+
'&.is-focused': {
|
|
435
|
+
outlineColor: string;
|
|
436
|
+
backgroundColor: string;
|
|
437
|
+
outline: string;
|
|
438
|
+
outlineOffset: string;
|
|
439
|
+
};
|
|
440
|
+
'&.is-pressed': {
|
|
441
|
+
backgroundColor: string;
|
|
442
|
+
color: string;
|
|
443
|
+
};
|
|
434
444
|
'&.is-hovered': {
|
|
435
445
|
boxShadow: string;
|
|
446
|
+
backgroundColor: string;
|
|
447
|
+
color: string;
|
|
436
448
|
};
|
|
437
449
|
alignItems: string;
|
|
438
450
|
justifyContent: string;
|
|
@@ -456,11 +468,6 @@ declare const _default: {
|
|
|
456
468
|
'&.is-disabled': {
|
|
457
469
|
opacity: number;
|
|
458
470
|
};
|
|
459
|
-
'&.is-focused': {
|
|
460
|
-
outline: string;
|
|
461
|
-
outlineColor: string;
|
|
462
|
-
outlineOffset: string;
|
|
463
|
-
};
|
|
464
471
|
transition: string;
|
|
465
472
|
};
|
|
466
473
|
inverse: {
|
|
@@ -1476,6 +1483,47 @@ declare const _default: {
|
|
|
1476
1483
|
outlineOffset: string;
|
|
1477
1484
|
};
|
|
1478
1485
|
};
|
|
1486
|
+
passwordVisibilityIcon: {
|
|
1487
|
+
right: number;
|
|
1488
|
+
padding: string;
|
|
1489
|
+
border: string;
|
|
1490
|
+
'&:hover, &.is-pressed': {
|
|
1491
|
+
background: string;
|
|
1492
|
+
boxShadow: string;
|
|
1493
|
+
};
|
|
1494
|
+
'&.is-focused': {
|
|
1495
|
+
outline: string;
|
|
1496
|
+
outlineOffset: string;
|
|
1497
|
+
outlineColor: string;
|
|
1498
|
+
};
|
|
1499
|
+
position: string;
|
|
1500
|
+
top: string;
|
|
1501
|
+
transform: string;
|
|
1502
|
+
height: string;
|
|
1503
|
+
width: string;
|
|
1504
|
+
justifyContent: string;
|
|
1505
|
+
path: {
|
|
1506
|
+
fill: string;
|
|
1507
|
+
};
|
|
1508
|
+
'&.is-hovered': {
|
|
1509
|
+
backgroundColor: string;
|
|
1510
|
+
path: {
|
|
1511
|
+
fill: string;
|
|
1512
|
+
};
|
|
1513
|
+
};
|
|
1514
|
+
'&.is-pressed': {
|
|
1515
|
+
backgroundColor: string;
|
|
1516
|
+
path: {
|
|
1517
|
+
fill: string;
|
|
1518
|
+
};
|
|
1519
|
+
};
|
|
1520
|
+
p: string;
|
|
1521
|
+
transition: string;
|
|
1522
|
+
outline: string;
|
|
1523
|
+
borderRadius: string;
|
|
1524
|
+
cursor: string;
|
|
1525
|
+
boxShadow: string;
|
|
1526
|
+
};
|
|
1479
1527
|
};
|
|
1480
1528
|
modalCloseButton: {
|
|
1481
1529
|
position: string;
|
|
@@ -1575,6 +1623,59 @@ declare const _default: {
|
|
|
1575
1623
|
outline: string;
|
|
1576
1624
|
};
|
|
1577
1625
|
};
|
|
1626
|
+
ButtonInputGroupContentRight: {
|
|
1627
|
+
right: number;
|
|
1628
|
+
padding: string;
|
|
1629
|
+
borderRadius: string;
|
|
1630
|
+
borderWidth: string;
|
|
1631
|
+
borderLeftWidth: string;
|
|
1632
|
+
borderRightWidth: string;
|
|
1633
|
+
borderLeftColor: string;
|
|
1634
|
+
position: string;
|
|
1635
|
+
top: string;
|
|
1636
|
+
transform: string;
|
|
1637
|
+
height: string;
|
|
1638
|
+
width: string;
|
|
1639
|
+
justifyContent: string;
|
|
1640
|
+
backgroundColor: string;
|
|
1641
|
+
borderColor: string;
|
|
1642
|
+
color: string;
|
|
1643
|
+
'&.is-focused': {
|
|
1644
|
+
outlineColor: string;
|
|
1645
|
+
backgroundColor: string;
|
|
1646
|
+
outline: string;
|
|
1647
|
+
outlineOffset: string;
|
|
1648
|
+
};
|
|
1649
|
+
'&.is-pressed': {
|
|
1650
|
+
backgroundColor: string;
|
|
1651
|
+
color: string;
|
|
1652
|
+
};
|
|
1653
|
+
'&.is-hovered': {
|
|
1654
|
+
boxShadow: string;
|
|
1655
|
+
backgroundColor: string;
|
|
1656
|
+
color: string;
|
|
1657
|
+
};
|
|
1658
|
+
alignItems: string;
|
|
1659
|
+
flexShrink: number;
|
|
1660
|
+
minWidth: string;
|
|
1661
|
+
cursor: string;
|
|
1662
|
+
display: string;
|
|
1663
|
+
maxWidth: string;
|
|
1664
|
+
fontFamily: string;
|
|
1665
|
+
fontSize: string;
|
|
1666
|
+
fontWeight: number;
|
|
1667
|
+
textAlign: string;
|
|
1668
|
+
verticalAlign: string;
|
|
1669
|
+
lineHeight: number;
|
|
1670
|
+
border: string;
|
|
1671
|
+
px: string;
|
|
1672
|
+
py: string;
|
|
1673
|
+
maxHeight: string;
|
|
1674
|
+
'&.is-disabled': {
|
|
1675
|
+
opacity: number;
|
|
1676
|
+
};
|
|
1677
|
+
transition: string;
|
|
1678
|
+
};
|
|
1578
1679
|
};
|
|
1579
1680
|
forms: {
|
|
1580
1681
|
input: import("theme-ui").ThemeUICSSObject;
|
|
@@ -3562,6 +3663,44 @@ declare const _default: {
|
|
|
3562
3663
|
boxShadow: string;
|
|
3563
3664
|
};
|
|
3564
3665
|
};
|
|
3666
|
+
inputDropDownContentLeft: {
|
|
3667
|
+
left: number;
|
|
3668
|
+
position: string;
|
|
3669
|
+
top: string;
|
|
3670
|
+
transform: string;
|
|
3671
|
+
height: string;
|
|
3672
|
+
width: string;
|
|
3673
|
+
justifyContent: string;
|
|
3674
|
+
};
|
|
3675
|
+
inputGroupContentLeft: {
|
|
3676
|
+
left: number;
|
|
3677
|
+
borderRight: string;
|
|
3678
|
+
position: string;
|
|
3679
|
+
top: string;
|
|
3680
|
+
transform: string;
|
|
3681
|
+
height: string;
|
|
3682
|
+
width: string;
|
|
3683
|
+
justifyContent: string;
|
|
3684
|
+
};
|
|
3685
|
+
inputDropDownContentRight: {
|
|
3686
|
+
right: number;
|
|
3687
|
+
position: string;
|
|
3688
|
+
top: string;
|
|
3689
|
+
transform: string;
|
|
3690
|
+
height: string;
|
|
3691
|
+
width: string;
|
|
3692
|
+
justifyContent: string;
|
|
3693
|
+
};
|
|
3694
|
+
inputGroupContentRight: {
|
|
3695
|
+
right: number;
|
|
3696
|
+
borderLeft: string;
|
|
3697
|
+
position: string;
|
|
3698
|
+
top: string;
|
|
3699
|
+
transform: string;
|
|
3700
|
+
height: string;
|
|
3701
|
+
width: string;
|
|
3702
|
+
justifyContent: string;
|
|
3703
|
+
};
|
|
3565
3704
|
};
|
|
3566
3705
|
buttonBar: {
|
|
3567
3706
|
container: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("../../../..").TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Default: () => React.JSX.Element;
|
|
8
|
+
export declare const PasswordInput: () => React.JSX.Element;
|
|
9
|
+
export declare const InputGroup: () => React.JSX.Element;
|
|
10
|
+
export declare const ButtonInputGroup: () => React.JSX.Element;
|
|
11
|
+
export declare const DropdownInputGroup: () => React.JSX.Element;
|
|
@@ -0,0 +1,197 @@
|
|
|
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.PasswordInput = exports.InputGroup = exports.DropdownInputGroup = exports.Default = exports.ButtonInputGroup = void 0;
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _EyeOffOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/EyeOffOutlineIcon"));
|
|
15
|
+
var _EyeOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/EyeOutlineIcon"));
|
|
16
|
+
var _ = require("../../../..");
|
|
17
|
+
var _TextField = _interopRequireDefault(require("../../../../components/TextField"));
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
|
+
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
|
+
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
|
+
var _default = {
|
|
22
|
+
title: 'Form/Onyx Input Patterns',
|
|
23
|
+
component: _TextField["default"]
|
|
24
|
+
};
|
|
25
|
+
exports["default"] = _default;
|
|
26
|
+
var items = [{
|
|
27
|
+
name: 'Aardvark',
|
|
28
|
+
id: '1'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'Kangaroo',
|
|
31
|
+
id: '2'
|
|
32
|
+
}, {
|
|
33
|
+
name: 'Snake',
|
|
34
|
+
id: '3'
|
|
35
|
+
}];
|
|
36
|
+
var Default = function Default() {
|
|
37
|
+
return (0, _react2.jsx)(_TextField["default"], {
|
|
38
|
+
label: "Label",
|
|
39
|
+
helperText: "Help text for this field."
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.Default = Default;
|
|
43
|
+
var PasswordInput = function PasswordInput() {
|
|
44
|
+
var _useState = (0, _react.useState)(false),
|
|
45
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
46
|
+
isVisible = _useState2[0],
|
|
47
|
+
setIsVisible = _useState2[1];
|
|
48
|
+
var handleVisible = function handleVisible() {
|
|
49
|
+
setIsVisible(!isVisible);
|
|
50
|
+
};
|
|
51
|
+
return (0, _react2.jsx)(_TextField["default"], {
|
|
52
|
+
label: "Password",
|
|
53
|
+
type: "password",
|
|
54
|
+
containerProps: {
|
|
55
|
+
sx: {
|
|
56
|
+
'& input': {
|
|
57
|
+
paddingRight: '60px'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
slots: {
|
|
62
|
+
inContainer: (0, _react2.jsx)(_.IconButtonToggle, {
|
|
63
|
+
toggledIcon: _EyeOutlineIcon["default"],
|
|
64
|
+
defaultIcon: _EyeOffOutlineIcon["default"],
|
|
65
|
+
onToggle: handleVisible,
|
|
66
|
+
isToggled: isVisible,
|
|
67
|
+
variant: "passwordVisibilityIcon",
|
|
68
|
+
buttonProps: {
|
|
69
|
+
'aria-label': 'eye icon'
|
|
70
|
+
},
|
|
71
|
+
iconProps: {
|
|
72
|
+
size: 'xs'
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
exports.PasswordInput = PasswordInput;
|
|
79
|
+
var InputGroup = function InputGroup() {
|
|
80
|
+
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_TextField["default"], {
|
|
81
|
+
label: "Label",
|
|
82
|
+
helperText: "Help text for this field.",
|
|
83
|
+
containerProps: {
|
|
84
|
+
sx: {
|
|
85
|
+
'& input': {
|
|
86
|
+
paddingLeft: '70px'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
slots: {
|
|
91
|
+
beforeInput: (0, _react2.jsx)(_.Box, {
|
|
92
|
+
variant: "box.inputGroupContentLeft",
|
|
93
|
+
p: "12px 20px"
|
|
94
|
+
}, (0, _react2.jsx)(_.Text, null, "@"))
|
|
95
|
+
}
|
|
96
|
+
}), (0, _react2.jsx)(_TextField["default"], {
|
|
97
|
+
label: "Label",
|
|
98
|
+
mt: "xl",
|
|
99
|
+
helperText: "Help text for this field.",
|
|
100
|
+
containerProps: {
|
|
101
|
+
sx: {
|
|
102
|
+
'& input': {
|
|
103
|
+
paddingRight: '160px'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
slots: {
|
|
108
|
+
inContainer: (0, _react2.jsx)(_.Box, {
|
|
109
|
+
variant: "box.inputGroupContentRight",
|
|
110
|
+
p: "12px 20px"
|
|
111
|
+
}, (0, _react2.jsx)(_.Text, null, "@example.com"))
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
};
|
|
115
|
+
exports.InputGroup = InputGroup;
|
|
116
|
+
var ButtonInputGroup = function ButtonInputGroup() {
|
|
117
|
+
return (0, _react2.jsx)(_TextField["default"], {
|
|
118
|
+
label: "Label",
|
|
119
|
+
containerProps: {
|
|
120
|
+
sx: {
|
|
121
|
+
'& input': {
|
|
122
|
+
paddingRight: '100px'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
slots: {
|
|
127
|
+
inContainer: (0, _react2.jsx)(_.Button, {
|
|
128
|
+
variant: "ButtonInputGroupContentRight"
|
|
129
|
+
}, "Button")
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
exports.ButtonInputGroup = ButtonInputGroup;
|
|
134
|
+
var DropdownInputGroup = function DropdownInputGroup() {
|
|
135
|
+
var _useState3 = (0, _react.useState)(items[0].name),
|
|
136
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
137
|
+
selectedKey = _useState4[0],
|
|
138
|
+
setSelectedKey = _useState4[1];
|
|
139
|
+
var handleSelectionChange = function handleSelectionChange(key) {
|
|
140
|
+
return setSelectedKey(key);
|
|
141
|
+
};
|
|
142
|
+
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_TextField["default"], {
|
|
143
|
+
label: "Label",
|
|
144
|
+
containerProps: {
|
|
145
|
+
sx: {
|
|
146
|
+
'& > .field-control-wrapper > input': {
|
|
147
|
+
paddingRight: '160px'
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
slots: {
|
|
152
|
+
inContainer: (0, _react2.jsx)(_.Box, {
|
|
153
|
+
variant: "box.inputDropDownContentRight",
|
|
154
|
+
width: "150px",
|
|
155
|
+
mt: "-2px"
|
|
156
|
+
}, (0, _react2.jsx)(_.SelectField, {
|
|
157
|
+
items: items,
|
|
158
|
+
selectedKey: selectedKey,
|
|
159
|
+
onSelectionChange: handleSelectionChange,
|
|
160
|
+
variant: "forms.input.dropDownContentRight"
|
|
161
|
+
}, function (item) {
|
|
162
|
+
return (0, _react2.jsx)(_.Item, {
|
|
163
|
+
key: item.name,
|
|
164
|
+
"data-id": item.name
|
|
165
|
+
}, item.name);
|
|
166
|
+
}))
|
|
167
|
+
}
|
|
168
|
+
}), (0, _react2.jsx)(_TextField["default"], {
|
|
169
|
+
label: "Label",
|
|
170
|
+
mt: "xl",
|
|
171
|
+
containerProps: {
|
|
172
|
+
sx: {
|
|
173
|
+
'& > .field-control-wrapper > input': {
|
|
174
|
+
paddingLeft: '160px'
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
slots: {
|
|
179
|
+
beforeInput: (0, _react2.jsx)(_.Box, {
|
|
180
|
+
variant: "box.inputDropDownContentLeft",
|
|
181
|
+
width: "150px",
|
|
182
|
+
mt: "-2px"
|
|
183
|
+
}, (0, _react2.jsx)(_.SelectField, {
|
|
184
|
+
items: items,
|
|
185
|
+
selectedKey: selectedKey,
|
|
186
|
+
onSelectionChange: handleSelectionChange,
|
|
187
|
+
variant: "forms.input.dropDownContentLeft"
|
|
188
|
+
}, function (item) {
|
|
189
|
+
return (0, _react2.jsx)(_.Item, {
|
|
190
|
+
key: item.name,
|
|
191
|
+
"data-id": item.name
|
|
192
|
+
}, item.name);
|
|
193
|
+
}))
|
|
194
|
+
}
|
|
195
|
+
}));
|
|
196
|
+
};
|
|
197
|
+
exports.DropdownInputGroup = DropdownInputGroup;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare const commonContentProps: {
|
|
2
|
+
position: string;
|
|
3
|
+
top: string;
|
|
4
|
+
transform: string;
|
|
5
|
+
height: string;
|
|
6
|
+
width: string;
|
|
7
|
+
justifyContent: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const box: {
|
|
10
|
+
indeterminateCheckboxIcon: {
|
|
11
|
+
height: string;
|
|
12
|
+
width: string;
|
|
13
|
+
'&.is-disabled': {
|
|
14
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
|
15
|
+
fill: string;
|
|
16
|
+
stroke: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
'&.is-focused': {
|
|
20
|
+
boxShadow: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
inputDropDownContentLeft: {
|
|
24
|
+
left: number;
|
|
25
|
+
position: string;
|
|
26
|
+
top: string;
|
|
27
|
+
transform: string;
|
|
28
|
+
height: string;
|
|
29
|
+
width: string;
|
|
30
|
+
justifyContent: string;
|
|
31
|
+
};
|
|
32
|
+
inputGroupContentLeft: {
|
|
33
|
+
left: number;
|
|
34
|
+
borderRight: string;
|
|
35
|
+
position: string;
|
|
36
|
+
top: string;
|
|
37
|
+
transform: string;
|
|
38
|
+
height: string;
|
|
39
|
+
width: string;
|
|
40
|
+
justifyContent: string;
|
|
41
|
+
};
|
|
42
|
+
inputDropDownContentRight: {
|
|
43
|
+
right: number;
|
|
44
|
+
position: string;
|
|
45
|
+
top: string;
|
|
46
|
+
transform: string;
|
|
47
|
+
height: string;
|
|
48
|
+
width: string;
|
|
49
|
+
justifyContent: string;
|
|
50
|
+
};
|
|
51
|
+
inputGroupContentRight: {
|
|
52
|
+
right: number;
|
|
53
|
+
borderLeft: string;
|
|
54
|
+
position: string;
|
|
55
|
+
top: string;
|
|
56
|
+
transform: string;
|
|
57
|
+
height: string;
|
|
58
|
+
width: string;
|
|
59
|
+
justifyContent: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
5
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
8
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
9
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
10
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
11
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
12
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
exports.commonContentProps = exports.box = void 0;
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
17
|
+
var _colors = _interopRequireDefault(require("../colors/colors"));
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
var commonContentProps = {
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
top: '50%',
|
|
23
|
+
transform: 'translateY(-50%)',
|
|
24
|
+
height: '100%',
|
|
25
|
+
width: 'max-content',
|
|
26
|
+
justifyContent: 'center'
|
|
27
|
+
};
|
|
28
|
+
exports.commonContentProps = commonContentProps;
|
|
29
|
+
var box = {
|
|
30
|
+
indeterminateCheckboxIcon: {
|
|
31
|
+
height: '19.25px',
|
|
32
|
+
width: '19.25px',
|
|
33
|
+
'&.is-disabled': {
|
|
34
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
|
35
|
+
fill: 'gray-500',
|
|
36
|
+
stroke: 'gray-500'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
'&.is-focused': {
|
|
40
|
+
boxShadow: "inset 0px 0px 0px 1px ".concat(_colors["default"].focus)
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
inputDropDownContentLeft: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
44
|
+
left: 0
|
|
45
|
+
}),
|
|
46
|
+
inputGroupContentLeft: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
47
|
+
left: 0,
|
|
48
|
+
borderRight: "1px solid ".concat(_colors["default"]['gray-500'])
|
|
49
|
+
}),
|
|
50
|
+
inputDropDownContentRight: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
51
|
+
right: 0
|
|
52
|
+
}),
|
|
53
|
+
inputGroupContentRight: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
54
|
+
right: 0,
|
|
55
|
+
borderLeft: "1px solid ".concat(_colors["default"]['gray-500'])
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
exports.box = box;
|