@plurid/plurid-ui-components-react 0.0.0-4 → 0.0.0-8
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/distribution/components/universal/index.d.ts +2 -0
- package/distribution/components/universal/inputs/EntityPill/index.d.ts +11 -0
- package/distribution/components/universal/inputs/EntityPill/styled.d.ts +5 -0
- package/distribution/components/universal/inputs/EntityPillGroup/index.d.ts +13 -0
- package/distribution/components/universal/inputs/EntityPillGroup/styled.d.ts +5 -0
- package/distribution/components/universal/inputs/InputDescriptor/index.d.ts +3 -1
- package/distribution/components/universal/inputs/InputSwitch/index.d.ts +4 -1
- package/distribution/components/universal/inputs/index.d.ts +2 -0
- package/distribution/components/universal/varia/CopyableLine/index.d.ts +2 -0
- package/distribution/data/interfaces/index.d.ts +4 -0
- package/distribution/index.es.js +72 -7
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +71 -6
- package/distribution/index.js.map +1 -1
- package/package.json +30 -30
package/distribution/index.js
CHANGED
|
@@ -1470,9 +1470,65 @@ const Dropdown = properties => {
|
|
|
1470
1470
|
})))));
|
|
1471
1471
|
};
|
|
1472
1472
|
|
|
1473
|
+
const StyledEntityPill = styled__default["default"].div`
|
|
1474
|
+
background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
|
|
1475
|
+
box-shadow: ${({theme: theme}) => theme.boxShadowUmbra};
|
|
1476
|
+
|
|
1477
|
+
padding: 0.5rem 1rem;
|
|
1478
|
+
margin: 0.5rem;
|
|
1479
|
+
border-radius: 20px;
|
|
1480
|
+
|
|
1481
|
+
display: flex;
|
|
1482
|
+
align-items: center;
|
|
1483
|
+
`;
|
|
1484
|
+
|
|
1485
|
+
const EntityPill = properties => {
|
|
1486
|
+
const {id: id, remove: remove, text: text, theme: theme, style: style} = properties;
|
|
1487
|
+
const textValue = text || id;
|
|
1488
|
+
return React__default["default"].createElement(StyledEntityPill, {
|
|
1489
|
+
theme: theme || themes.plurid,
|
|
1490
|
+
style: Object.assign({}, style)
|
|
1491
|
+
}, React__default["default"].createElement("div", {
|
|
1492
|
+
style: {
|
|
1493
|
+
marginRight: "0.5rem"
|
|
1494
|
+
}
|
|
1495
|
+
}, textValue), React__default["default"].createElement(pluridIconsReact.PluridIconDelete, {
|
|
1496
|
+
theme: theme,
|
|
1497
|
+
atClick: () => remove(id)
|
|
1498
|
+
}));
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1501
|
+
const StyledEntityPillGroup = styled__default["default"].div`
|
|
1502
|
+
display: flex;
|
|
1503
|
+
flex-flow: wrap;
|
|
1504
|
+
margin: 0 auto;
|
|
1505
|
+
justify-content: center;
|
|
1506
|
+
`;
|
|
1507
|
+
|
|
1508
|
+
const EntityPillGroup = properties => {
|
|
1509
|
+
const {entities: entities, remove: remove, keyFix: keyFix, theme: theme, style: style, pillStyle: pillStyle} = properties;
|
|
1510
|
+
return React__default["default"].createElement(StyledEntityPillGroup, {
|
|
1511
|
+
theme: theme,
|
|
1512
|
+
style: Object.assign({}, style)
|
|
1513
|
+
}, entities.map((entity => {
|
|
1514
|
+
const stringEntity = typeof entity === "string";
|
|
1515
|
+
const id = stringEntity ? entity : entity.id;
|
|
1516
|
+
const text = stringEntity ? undefined : entity.text;
|
|
1517
|
+
return React__default["default"].createElement(EntityPill, {
|
|
1518
|
+
key: `entity-pill-${id}${keyFix || ""}`,
|
|
1519
|
+
id: id,
|
|
1520
|
+
text: text,
|
|
1521
|
+
remove: remove,
|
|
1522
|
+
theme: theme || themes.plurid,
|
|
1523
|
+
style: pillStyle
|
|
1524
|
+
});
|
|
1525
|
+
})));
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1473
1528
|
const StyledInputDescriptor = styled__default["default"].div`
|
|
1474
1529
|
text-align: left;
|
|
1475
1530
|
font-size: 0.9rem;
|
|
1531
|
+
line-height: 1;
|
|
1476
1532
|
min-height: 1.1rem;
|
|
1477
1533
|
margin-top: 1.3rem;
|
|
1478
1534
|
margin-bottom: 0.4rem;
|
|
@@ -1483,9 +1539,12 @@ const StyledInputDescriptor = styled__default["default"].div`
|
|
|
1483
1539
|
`;
|
|
1484
1540
|
|
|
1485
1541
|
const InputDescriptor = properties => {
|
|
1486
|
-
const {name: name, show: show, theme:
|
|
1542
|
+
const {name: name, show: show, theme: themeProperty, style: style, className: className} = properties;
|
|
1543
|
+
const theme = themeProperty || themes.plurid;
|
|
1487
1544
|
return React__default["default"].createElement(StyledInputDescriptor, {
|
|
1488
|
-
theme: theme
|
|
1545
|
+
theme: theme,
|
|
1546
|
+
className: className,
|
|
1547
|
+
style: Object.assign({}, style)
|
|
1489
1548
|
}, show && React__default["default"].createElement(React__default["default"].Fragment, null, name));
|
|
1490
1549
|
};
|
|
1491
1550
|
|
|
@@ -1695,9 +1754,12 @@ const StyledInputSwitch = styled__default["default"].div`
|
|
|
1695
1754
|
`;
|
|
1696
1755
|
|
|
1697
1756
|
const InputSwitch = properties => {
|
|
1698
|
-
const {name: name, checked: checked, atChange: atChange, theme:
|
|
1757
|
+
const {name: name, checked: checked, atChange: atChange, theme: themeProperty, compact: compact, style: style, className: className} = properties;
|
|
1758
|
+
const theme = themeProperty || themes.plurid;
|
|
1699
1759
|
return React__default["default"].createElement(StyledInputSwitch, {
|
|
1700
|
-
compact: compact
|
|
1760
|
+
compact: compact,
|
|
1761
|
+
style: Object.assign({}, style),
|
|
1762
|
+
className: className
|
|
1701
1763
|
}, React__default["default"].createElement(FormLeftRight, null, React__default["default"].createElement("div", {
|
|
1702
1764
|
style: {
|
|
1703
1765
|
marginLeft: "0.9rem"
|
|
@@ -2045,6 +2107,8 @@ const Slider = properties => {
|
|
|
2045
2107
|
|
|
2046
2108
|
const inputs = {
|
|
2047
2109
|
Dropdown: Dropdown,
|
|
2110
|
+
EntityPill: EntityPill,
|
|
2111
|
+
EntityPillGroup: EntityPillGroup,
|
|
2048
2112
|
InputBox: InputBox,
|
|
2049
2113
|
InputDescriptor: InputDescriptor,
|
|
2050
2114
|
InputLine: InputLine,
|
|
@@ -2389,7 +2453,7 @@ const StyledData = styled__default["default"].div`
|
|
|
2389
2453
|
`;
|
|
2390
2454
|
|
|
2391
2455
|
const CopyableLine = properties => {
|
|
2392
|
-
const {data: data, viewData: viewData, copyMessage: copyMessage, copyMessageTime: copyMessageTime, style: style, className: className} = properties;
|
|
2456
|
+
const {data: data, theme: theme, viewData: viewData, copyMessage: copyMessage, copyMessageTime: copyMessageTime, style: style, className: className} = properties;
|
|
2393
2457
|
const viewDataText = viewData || data;
|
|
2394
2458
|
const copyMessageText = copyMessage !== null && copyMessage !== void 0 ? copyMessage : "copied";
|
|
2395
2459
|
const copyMessageTimeValue = copyMessageTime || 2e3;
|
|
@@ -2401,7 +2465,8 @@ const CopyableLine = properties => {
|
|
|
2401
2465
|
atClick: () => {
|
|
2402
2466
|
pluridFunctions.clipboard.copy(data);
|
|
2403
2467
|
setShowCopyMessage(true);
|
|
2404
|
-
}
|
|
2468
|
+
},
|
|
2469
|
+
theme: theme
|
|
2405
2470
|
}), React__default["default"].createElement(StyledData, null, showCopyMessage ? React__default["default"].createElement(React__default["default"].Fragment, null, copyMessageText) : React__default["default"].createElement(React__default["default"].Fragment, null, viewDataText)));
|
|
2406
2471
|
};
|
|
2407
2472
|
|