@terraware/web-components 2.1.0 → 2.1.1
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/components/Pill/index.d.ts +11 -0
- package/components/Pill/index.d.ts.map +1 -0
- package/components/Pill/index.js +41 -0
- package/components/Pill/styles.scss +48 -0
- package/components/PillList/index.d.ts +14 -0
- package/components/PillList/index.d.ts.map +1 -0
- package/components/PillList/index.js +33 -0
- package/index.d.ts +4 -1
- package/index.d.ts.map +1 -1
- package/index.js +16 -0
- package/package.json +1 -1
- package/stories/PillList.stories.d.ts +9 -0
- package/stories/PillList.stories.d.ts.map +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './styles.scss';
|
|
2
|
+
type PillProps<IdType> = {
|
|
3
|
+
id: IdType;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
onRemove?: (id: IdType) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export default function Pill<IdType>({ id, label, value, onRemove, className }: PillProps<IdType>): JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Pill/index.tsx"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAC;AAEvB,KAAK,SAAS,CAAC,MAAM,IAAI;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAc9G"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Pill;
|
|
9
|
+
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
15
|
+
|
|
16
|
+
require("./styles.scss");
|
|
17
|
+
|
|
18
|
+
function Pill(_ref) {
|
|
19
|
+
var id = _ref.id,
|
|
20
|
+
label = _ref.label,
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
onRemove = _ref.onRemove,
|
|
23
|
+
className = _ref.className;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
+
className: "pill ".concat(className !== null && className !== void 0 ? className : '')
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
27
|
+
className: "label"
|
|
28
|
+
}, label, ":"), /*#__PURE__*/_react.default.createElement("p", {
|
|
29
|
+
className: "value"
|
|
30
|
+
}, value), onRemove ? /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
31
|
+
onClick: function onClick() {
|
|
32
|
+
return onRemove(id);
|
|
33
|
+
},
|
|
34
|
+
className: "iconContainer"
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
36
|
+
name: "close",
|
|
37
|
+
className: "icon"
|
|
38
|
+
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: "spacer"
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/terraware.scss';
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Inter';
|
|
5
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pill {
|
|
9
|
+
font-family: $tw-fnt-base-font-family;
|
|
10
|
+
background: $tw-clr-bg-tertiary;
|
|
11
|
+
padding: $tw-spc-base-xx-small $tw-spc-base-xx-small $tw-spc-base-xx-small 12px;
|
|
12
|
+
display: flex;
|
|
13
|
+
border-radius: 13px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
margin-right: $tw-spc-base-x-small;
|
|
16
|
+
margin-bottom: $tw-spc-base-x-small;
|
|
17
|
+
|
|
18
|
+
.label {
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
color: $tw-clr-txt;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.value {
|
|
26
|
+
padding-left: $tw-spc-base-xx-small;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
color: $tw-clr-txt;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.icon {
|
|
34
|
+
fill: $tw-clr-icn;
|
|
35
|
+
width: 12px;
|
|
36
|
+
height: 12px;
|
|
37
|
+
margin: 0 $tw-spc-base-xx-small;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.iconContainer {
|
|
41
|
+
padding: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.spacer {
|
|
45
|
+
width: $tw-spc-base-x-small;
|
|
46
|
+
height: 12px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type PillListItem<IdType> = {
|
|
2
|
+
id: IdType;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onRemove?: (id: IdType) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export type PillListProps<IdType> = {
|
|
9
|
+
data: PillListItem<IdType>[];
|
|
10
|
+
onRemove?: (id: IdType) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export default function PillList<IdType>(props: PillListProps<IdType>): JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PillList/index.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,CAAC,MAAM,IAAI;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI;IAClC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAiBlF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = PillList;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Pill = _interopRequireDefault(require("../Pill"));
|
|
13
|
+
|
|
14
|
+
var _material = require("@mui/material");
|
|
15
|
+
|
|
16
|
+
function PillList(props) {
|
|
17
|
+
var data = props.data,
|
|
18
|
+
onRemove = props.onRemove,
|
|
19
|
+
className = props.className;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexWrap: "wrap"
|
|
23
|
+
}, data.map(function (item, index) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_Pill.default, {
|
|
25
|
+
key: index,
|
|
26
|
+
id: item.id,
|
|
27
|
+
label: item.label,
|
|
28
|
+
value: item.value,
|
|
29
|
+
onRemove: item.onRemove || onRemove,
|
|
30
|
+
className: item.className || className
|
|
31
|
+
});
|
|
32
|
+
}));
|
|
33
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import NavFooter from './components/Navbar/NavFooter';
|
|
|
14
14
|
import NavItem from './components/Navbar/NavItem';
|
|
15
15
|
import NavSection from './components/Navbar/NavSection';
|
|
16
16
|
import Note from './components/Note';
|
|
17
|
+
import Pill from './components/Pill';
|
|
18
|
+
import PillList from './components/PillList';
|
|
17
19
|
import ProgressCircle from './components/ProgressCircle/ProgressCircle';
|
|
18
20
|
import RadioButton from './components/RadioButton';
|
|
19
21
|
import Select from './components/Select/Select';
|
|
@@ -28,9 +30,10 @@ import { EnhancedTableDetailsRow, RendererProps, TableColumnType } from './compo
|
|
|
28
30
|
import * as Svg from './components/svg';
|
|
29
31
|
import Message from './components/Message/Message';
|
|
30
32
|
import theme from './theme';
|
|
33
|
+
export type { PillListItem } from './components/PillList';
|
|
31
34
|
export type { IconName } from './components/Icon/icons/';
|
|
32
35
|
export type { Size } from './components/Size';
|
|
33
36
|
export type { DropdownItem } from './components/Dropdown';
|
|
34
37
|
export type { EnhancedTableDetailsRow, RendererProps, TableColumnType, TableRowType, SortOrder };
|
|
35
|
-
export { Autocomplete, Button, CellRenderer, CellDateRenderer, Checkbox, DatePicker, descendingComparator, DialogBox, Divisor, Dropdown, DropdownV1, ErrorBox, getComparator, icons, Icon, IconTooltip, Message, NavFooter, NavItem, NavSection, Navbar, Note, ProgressCircle, RadioButton, Select, SelectT, stableSort, SummaryBox, Svg, Textfield, TextTruncated, Table, theme, };
|
|
38
|
+
export { Autocomplete, Button, CellRenderer, CellDateRenderer, Checkbox, DatePicker, descendingComparator, DialogBox, Divisor, Dropdown, DropdownV1, ErrorBox, getComparator, icons, Icon, IconTooltip, Message, NavFooter, NavItem, NavSection, Navbar, Note, Pill, PillList, ProgressCircle, RadioButton, Select, SelectT, stableSort, SummaryBox, Svg, Textfield, TextTruncated, Table, theme, };
|
|
36
39
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,OAAO,MAAM,6BAA6B,CAAC;AAClD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,cAAc,MAAM,4C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,MAAM,yBAAyB,CAAC;AACrG,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAEjG,OAAO,EACL,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,GAAG,EACH,SAAS,EACT,aAAa,EACb,KAAK,EACL,KAAK,GACN,CAAC"}
|
package/index.js
CHANGED
|
@@ -107,6 +107,18 @@ Object.defineProperty(exports, "Note", {
|
|
|
107
107
|
return _Note.default;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
+
Object.defineProperty(exports, "Pill", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function get() {
|
|
113
|
+
return _Pill.default;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "PillList", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function get() {
|
|
119
|
+
return _PillList.default;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
110
122
|
Object.defineProperty(exports, "ProgressCircle", {
|
|
111
123
|
enumerable: true,
|
|
112
124
|
get: function get() {
|
|
@@ -231,6 +243,10 @@ var _NavSection = _interopRequireDefault(require("./components/Navbar/NavSection
|
|
|
231
243
|
|
|
232
244
|
var _Note = _interopRequireDefault(require("./components/Note"));
|
|
233
245
|
|
|
246
|
+
var _Pill = _interopRequireDefault(require("./components/Pill"));
|
|
247
|
+
|
|
248
|
+
var _PillList = _interopRequireDefault(require("./components/PillList"));
|
|
249
|
+
|
|
234
250
|
var _ProgressCircle = _interopRequireDefault(require("./components/ProgressCircle/ProgressCircle"));
|
|
235
251
|
|
|
236
252
|
var _RadioButton = _interopRequireDefault(require("./components/RadioButton"));
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import PillList, { PillListProps } from '../components/PillList';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof PillList;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: Story<PillListProps<number>>;
|
|
9
|
+
//# sourceMappingURL=PillList.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillList.stories.d.ts","sourceRoot":"","sources":["../../src/stories/PillList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;;;;AAEjE,wBAGE;AAMF,eAAO,MAAM,OAAO,8BAAoB,CAAC"}
|