@os-design/core 1.0.246 → 1.0.247
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/dist/cjs/ListItem/index.js +3 -2
- package/dist/cjs/ListItem/index.js.map +1 -1
- package/dist/esm/ListItem/index.js +2 -1
- package/dist/esm/ListItem/index.js.map +1 -1
- package/dist/types/ListItem/index.d.ts +1 -1
- package/dist/types/ListItem/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ListItem/index.tsx +8 -6
|
@@ -10,7 +10,7 @@ var _styles = require("@os-design/styles");
|
|
|
10
10
|
var _theming = require("@os-design/theming");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _ListItemActions = _interopRequireDefault(require("../ListItemActions"));
|
|
13
|
-
var _excluded = ["title", "description", "left", "right"];
|
|
13
|
+
var _excluded = ["title", "description", "left", "right", "children"];
|
|
14
14
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -50,10 +50,11 @@ var ListItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
50
50
|
description = _ref.description,
|
|
51
51
|
left = _ref.left,
|
|
52
52
|
right = _ref.right,
|
|
53
|
+
children = _ref.children,
|
|
53
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
54
55
|
return /*#__PURE__*/_react["default"].createElement(Container, _extends({}, rest, {
|
|
55
56
|
ref: ref
|
|
56
|
-
}), left && /*#__PURE__*/_react["default"].createElement(LeftAddon, null, left), /*#__PURE__*/_react["default"].createElement(Content, null, /*#__PURE__*/_react["default"].createElement(Title, null, title), description && /*#__PURE__*/_react["default"].createElement(Description, null, description)), right && /*#__PURE__*/_react["default"].createElement(RightAddon, null, right));
|
|
57
|
+
}), left && /*#__PURE__*/_react["default"].createElement(LeftAddon, null, left), children || /*#__PURE__*/_react["default"].createElement(Content, null, /*#__PURE__*/_react["default"].createElement(Title, null, title), description && /*#__PURE__*/_react["default"].createElement(Description, null, description)), right && /*#__PURE__*/_react["default"].createElement(RightAddon, null, right));
|
|
57
58
|
});
|
|
58
59
|
ListItem.displayName = 'ListItem';
|
|
59
60
|
var _default = exports["default"] = ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_styled","_interopRequireDefault","require","_styles","_theming","_react","_interopRequireWildcard","_ListItemActions","_excluded","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","Container","styled","ListItemActions","p","clr","theme","listItemColorBorder","horizontalPaddingStyles","Content","div","Title","colorText","ellipsisStyles","Description","listItemColorDescription","sizes","small","LeftAddon","listItemAddonPaddingHorizontal","RightAddon","ListItem","forwardRef","_ref","ref","title","description","left","right","rest","createElement","displayName","_default","exports"],"sources":["../../../src/ListItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ellipsisStyles, horizontalPaddingStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport React, { forwardRef } from 'react';\nimport ListItemActions, { ListItemActionsProps } from '../ListItemActions';\n\nexport interface ListItemProps extends ListItemActionsProps {\n /**\n * The title of the item.\n */\n title
|
|
1
|
+
{"version":3,"file":"index.js","names":["_styled","_interopRequireDefault","require","_styles","_theming","_react","_interopRequireWildcard","_ListItemActions","_excluded","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","Container","styled","ListItemActions","p","clr","theme","listItemColorBorder","horizontalPaddingStyles","Content","div","Title","colorText","ellipsisStyles","Description","listItemColorDescription","sizes","small","LeftAddon","listItemAddonPaddingHorizontal","RightAddon","ListItem","forwardRef","_ref","ref","title","description","left","right","children","rest","createElement","displayName","_default","exports"],"sources":["../../../src/ListItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ellipsisStyles, horizontalPaddingStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport React, { forwardRef } from 'react';\nimport ListItemActions, { ListItemActionsProps } from '../ListItemActions';\n\nexport interface ListItemProps extends ListItemActionsProps {\n /**\n * The title of the item.\n */\n title?: string;\n /**\n * The description of the item.\n * @default undefined\n */\n description?: string;\n /**\n * The component located on the left side.\n * For example, avatar, button, checkbox.\n * @default undefined\n */\n left?: React.ReactNode;\n /**\n * The component located on the right side.\n * For example, date.\n */\n right?: React.ReactNode;\n}\n\nconst Container = styled(ListItemActions)`\n box-sizing: border-box;\n min-height: 4em;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n\n &:not(:last-of-type) {\n border-bottom: 1px solid ${(p) => clr(p.theme.listItemColorBorder)};\n }\n\n ${horizontalPaddingStyles()};\n`;\n\nconst Content = styled.div`\n overflow: hidden;\n`;\n\nconst Title = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n font-weight: 500;\n ${ellipsisStyles};\n`;\n\nconst Description = styled.div`\n color: ${(p) => clr(p.theme.listItemColorDescription)};\n font-size: ${(p) => p.theme.sizes.small}em;\n ${ellipsisStyles};\n`;\n\nconst LeftAddon = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n padding-right: ${(p) => p.theme.listItemAddonPaddingHorizontal}em;\n`;\n\nconst RightAddon = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n margin-left: auto;\n padding-left: ${(p) => p.theme.listItemAddonPaddingHorizontal}em;\n`;\n\n/**\n * The base list item.\n */\nconst ListItem = forwardRef<HTMLDivElement, ListItemProps>(\n ({ title, description, left, right, children, ...rest }, ref) => (\n <Container {...rest} ref={ref}>\n {left && <LeftAddon>{left}</LeftAddon>}\n\n {children || (\n <Content>\n <Title>{title}</Title>\n {description && <Description>{description}</Description>}\n </Content>\n )}\n\n {right && <RightAddon>{right}</RightAddon>}\n </Container>\n )\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA2E,IAAAM,SAAA;AAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAAA,SAAAC,yBA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@@ -49,10 +49,11 @@ const ListItem = /*#__PURE__*/forwardRef(({
|
|
|
49
49
|
description,
|
|
50
50
|
left,
|
|
51
51
|
right,
|
|
52
|
+
children,
|
|
52
53
|
...rest
|
|
53
54
|
}, ref) => /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
|
|
54
55
|
ref: ref
|
|
55
|
-
}), left && /*#__PURE__*/React.createElement(LeftAddon, null, left), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(Title, null, title), description && /*#__PURE__*/React.createElement(Description, null, description)), right && /*#__PURE__*/React.createElement(RightAddon, null, right)));
|
|
56
|
+
}), left && /*#__PURE__*/React.createElement(LeftAddon, null, left), children || /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(Title, null, title), description && /*#__PURE__*/React.createElement(Description, null, description)), right && /*#__PURE__*/React.createElement(RightAddon, null, right)));
|
|
56
57
|
ListItem.displayName = 'ListItem';
|
|
57
58
|
export default ListItem;
|
|
58
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styled","ellipsisStyles","horizontalPaddingStyles","clr","React","forwardRef","ListItemActions","Container","p","theme","listItemColorBorder","Content","div","Title","colorText","Description","listItemColorDescription","sizes","small","LeftAddon","listItemAddonPaddingHorizontal","RightAddon","ListItem","title","description","left","right","rest","ref","createElement","_extends","displayName"],"sources":["../../../src/ListItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ellipsisStyles, horizontalPaddingStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport React, { forwardRef } from 'react';\nimport ListItemActions, { ListItemActionsProps } from '../ListItemActions';\n\nexport interface ListItemProps extends ListItemActionsProps {\n /**\n * The title of the item.\n */\n title
|
|
1
|
+
{"version":3,"file":"index.js","names":["styled","ellipsisStyles","horizontalPaddingStyles","clr","React","forwardRef","ListItemActions","Container","p","theme","listItemColorBorder","Content","div","Title","colorText","Description","listItemColorDescription","sizes","small","LeftAddon","listItemAddonPaddingHorizontal","RightAddon","ListItem","title","description","left","right","children","rest","ref","createElement","_extends","displayName"],"sources":["../../../src/ListItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ellipsisStyles, horizontalPaddingStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport React, { forwardRef } from 'react';\nimport ListItemActions, { ListItemActionsProps } from '../ListItemActions';\n\nexport interface ListItemProps extends ListItemActionsProps {\n /**\n * The title of the item.\n */\n title?: string;\n /**\n * The description of the item.\n * @default undefined\n */\n description?: string;\n /**\n * The component located on the left side.\n * For example, avatar, button, checkbox.\n * @default undefined\n */\n left?: React.ReactNode;\n /**\n * The component located on the right side.\n * For example, date.\n */\n right?: React.ReactNode;\n}\n\nconst Container = styled(ListItemActions)`\n box-sizing: border-box;\n min-height: 4em;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n\n &:not(:last-of-type) {\n border-bottom: 1px solid ${(p) => clr(p.theme.listItemColorBorder)};\n }\n\n ${horizontalPaddingStyles()};\n`;\n\nconst Content = styled.div`\n overflow: hidden;\n`;\n\nconst Title = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n font-weight: 500;\n ${ellipsisStyles};\n`;\n\nconst Description = styled.div`\n color: ${(p) => clr(p.theme.listItemColorDescription)};\n font-size: ${(p) => p.theme.sizes.small}em;\n ${ellipsisStyles};\n`;\n\nconst LeftAddon = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n padding-right: ${(p) => p.theme.listItemAddonPaddingHorizontal}em;\n`;\n\nconst RightAddon = styled.div`\n color: ${(p) => clr(p.theme.colorText)};\n margin-left: auto;\n padding-left: ${(p) => p.theme.listItemAddonPaddingHorizontal}em;\n`;\n\n/**\n * The base list item.\n */\nconst ListItem = forwardRef<HTMLDivElement, ListItemProps>(\n ({ title, description, left, right, children, ...rest }, ref) => (\n <Container {...rest} ref={ref}>\n {left && <LeftAddon>{left}</LeftAddon>}\n\n {children || (\n <Content>\n <Title>{title}</Title>\n {description && <Description>{description}</Description>}\n </Content>\n )}\n\n {right && <RightAddon>{right}</RightAddon>}\n </Container>\n )\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,cAAc,EAAEC,uBAAuB,QAAQ,mBAAmB;AAC3E,SAASC,GAAG,QAAQ,oBAAoB;AACxC,OAAOC,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,eAAe,MAAgC,oBAAoB;AAyB1E,MAAMC,SAAS,GAAGP,MAAM,CAACM,eAAe,CAAE;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAAgCE,CAAC,IAAKL,GAAG,CAACK,CAAC,CAACC,KAAK,CAACC,mBAAmB,CAAE;AACvE;AACA;AACA,IAAIR,uBAAuB,CAAC,CAAE;AAC9B,CAAC;AAED,MAAMS,OAAO,GAAGX,MAAM,CAACY,GAAI;AAC3B;AACA,CAAC;AAED,MAAMC,KAAK,GAAGb,MAAM,CAACY,GAAI;AACzB,WAAYJ,CAAC,IAAKL,GAAG,CAACK,CAAC,CAACC,KAAK,CAACK,SAAS,CAAE;AACzC;AACA,IAAIb,cAAe;AACnB,CAAC;AAED,MAAMc,WAAW,GAAGf,MAAM,CAACY,GAAI;AAC/B,WAAYJ,CAAC,IAAKL,GAAG,CAACK,CAAC,CAACC,KAAK,CAACO,wBAAwB,CAAE;AACxD,eAAgBR,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACQ,KAAK,CAACC,KAAM;AAC1C,IAAIjB,cAAe;AACnB,CAAC;AAED,MAAMkB,SAAS,GAAGnB,MAAM,CAACY,GAAI;AAC7B,WAAYJ,CAAC,IAAKL,GAAG,CAACK,CAAC,CAACC,KAAK,CAACK,SAAS,CAAE;AACzC,mBAAoBN,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACW,8BAA+B;AACjE,CAAC;AAED,MAAMC,UAAU,GAAGrB,MAAM,CAACY,GAAI;AAC9B,WAAYJ,CAAC,IAAKL,GAAG,CAACK,CAAC,CAACC,KAAK,CAACK,SAAS,CAAE;AACzC;AACA,kBAAmBN,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACW,8BAA+B;AAChE,CAAC;;AAED;AACA;AACA;AACA,MAAME,QAAQ,gBAAGjB,UAAU,CACzB,CAAC;EAAEkB,KAAK;EAAEC,WAAW;EAAEC,IAAI;EAAEC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EAAEC,GAAG,kBAC1DzB,KAAA,CAAA0B,aAAA,CAACvB,SAAS,EAAAwB,QAAA,KAAKH,IAAI;EAAEC,GAAG,EAAEA;AAAI,IAC3BJ,IAAI,iBAAIrB,KAAA,CAAA0B,aAAA,CAACX,SAAS,QAAEM,IAAgB,CAAC,EAErCE,QAAQ,iBACPvB,KAAA,CAAA0B,aAAA,CAACnB,OAAO,qBACNP,KAAA,CAAA0B,aAAA,CAACjB,KAAK,QAAEU,KAAa,CAAC,EACrBC,WAAW,iBAAIpB,KAAA,CAAA0B,aAAA,CAACf,WAAW,QAAES,WAAyB,CAChD,CACV,EAEAE,KAAK,iBAAItB,KAAA,CAAA0B,aAAA,CAACT,UAAU,QAAEK,KAAkB,CAChC,CAEf,CAAC;AAEDJ,QAAQ,CAACU,WAAW,GAAG,UAAU;AAEjC,eAAeV,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ListItem/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IAIzD,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ListItem/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IAIzD,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAKvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AA+CD,QAAA,MAAM,QAAQ,sFAeb,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.247",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"react": ">=18",
|
|
60
60
|
"react-dom": ">=18"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "95db1ded272037a29f4fb69dd902c0cdcdd36a4c"
|
|
63
63
|
}
|
package/src/ListItem/index.tsx
CHANGED
|
@@ -8,7 +8,7 @@ export interface ListItemProps extends ListItemActionsProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* The title of the item.
|
|
10
10
|
*/
|
|
11
|
-
title
|
|
11
|
+
title?: string;
|
|
12
12
|
/**
|
|
13
13
|
* The description of the item.
|
|
14
14
|
* @default undefined
|
|
@@ -73,14 +73,16 @@ const RightAddon = styled.div`
|
|
|
73
73
|
* The base list item.
|
|
74
74
|
*/
|
|
75
75
|
const ListItem = forwardRef<HTMLDivElement, ListItemProps>(
|
|
76
|
-
({ title, description, left, right, ...rest }, ref) => (
|
|
76
|
+
({ title, description, left, right, children, ...rest }, ref) => (
|
|
77
77
|
<Container {...rest} ref={ref}>
|
|
78
78
|
{left && <LeftAddon>{left}</LeftAddon>}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
{children || (
|
|
81
|
+
<Content>
|
|
82
|
+
<Title>{title}</Title>
|
|
83
|
+
{description && <Description>{description}</Description>}
|
|
84
|
+
</Content>
|
|
85
|
+
)}
|
|
84
86
|
|
|
85
87
|
{right && <RightAddon>{right}</RightAddon>}
|
|
86
88
|
</Container>
|