@plurid/plurid-ui-components-react 0.0.0-4 → 0.0.0-5

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.
@@ -1470,6 +1470,61 @@ 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;
@@ -2045,6 +2100,8 @@ const Slider = properties => {
2045
2100
 
2046
2101
  const inputs = {
2047
2102
  Dropdown: Dropdown,
2103
+ EntityPill: EntityPill,
2104
+ EntityPillGroup: EntityPillGroup,
2048
2105
  InputBox: InputBox,
2049
2106
  InputDescriptor: InputDescriptor,
2050
2107
  InputLine: InputLine,