@citygross/components 0.7.190 → 0.7.191

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.
@@ -5,5 +5,4 @@ export declare type TMaxHeightText = {
5
5
  readLessText?: string;
6
6
  maxHeight: number;
7
7
  };
8
- declare const MaxHeightText: ({ readMoreText, readLessText, maxHeight, children }: TMaxHeightText) => JSX.Element;
9
- export default MaxHeightText;
8
+ export declare function MaxHeightText({ readMoreText, readLessText, maxHeight, children }: TMaxHeightText): JSX.Element;
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { TMaxHeightText } from './MaxHeightText';
3
2
  import { Story } from '@storybook/react';
4
3
  declare const _default: {
5
- component: ({ readMoreText, readLessText, maxHeight, children }: TMaxHeightText) => JSX.Element;
4
+ component: any;
6
5
  title: string;
7
6
  };
8
7
  export default _default;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var styles = require('./styles.js');
7
+ var Link = require('../Links/Link.js');
8
+ var typography = require('@citygross/typography');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
+
14
+ function MaxHeightText(_a) {
15
+ var readMoreText = _a.readMoreText, readLessText = _a.readLessText, maxHeight = _a.maxHeight, children = _a.children;
16
+ var _b = React.useState(false), open = _b[0], setOpen = _b[1];
17
+ return (React__default["default"].createElement(styles.MaxHeightTextWrapper, null,
18
+ React__default["default"].createElement(styles.MaxHeightTextContainer, { maxHeight: open ? undefined : maxHeight },
19
+ children,
20
+ !open && React__default["default"].createElement(styles.MaxHeightTextFader, null)),
21
+ React__default["default"].createElement(Link.Link, { size: typography.TextTypes.TextSize.REGULAR, onClick: function () { return setOpen(!open); } }, open ? readLessText : readMoreText)));
22
+ }
23
+
24
+ exports.MaxHeightText = MaxHeightText;
25
+ //# sourceMappingURL=MaxHeightText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MaxHeightText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _tslib = require('../../../../_virtual/_tslib.js');
4
6
  var styled = require('styled-components');
5
7
 
@@ -7,8 +9,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
7
9
 
8
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
9
11
 
10
- styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
11
- styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"], ["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.maxHeight) ? "".concat(props === null || props === void 0 ? void 0 : props.maxHeight, "px") : 'auto'); });
12
- styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"], ["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.constants) === null || _b === void 0 ? void 0 : _b.maxHeightFaderHeight; }, function (props) { var _a, _b, _c, _d; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.transparent, ", ").concat((_d = (_c = props.theme) === null || _c === void 0 ? void 0 : _c.palette) === null || _d === void 0 ? void 0 : _d.lightest); });
12
+ var MaxHeightTextWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
13
+ var MaxHeightTextContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"], ["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.maxHeight) ? "".concat(props === null || props === void 0 ? void 0 : props.maxHeight, "px") : 'auto'); });
14
+ var MaxHeightTextFader = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"], ["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.constants) === null || _b === void 0 ? void 0 : _b.maxHeightFaderHeight; }, function (props) { var _a, _b, _c, _d; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.transparent, ", ").concat((_d = (_c = props.theme) === null || _c === void 0 ? void 0 : _c.palette) === null || _d === void 0 ? void 0 : _d.lightest); });
13
15
  var templateObject_1, templateObject_2, templateObject_3;
16
+
17
+ exports.MaxHeightTextContainer = MaxHeightTextContainer;
18
+ exports.MaxHeightTextFader = MaxHeightTextFader;
19
+ exports.MaxHeightTextWrapper = MaxHeightTextWrapper;
14
20
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -79,9 +79,7 @@ var MenuListItem = require('./components/MenuListItem/MenuListItem.js');
79
79
  var SlideInOutContainer = require('./components/SlideInOutContainer/SlideInOutContainer.js');
80
80
  var SearchSuggestionChip = require('./components/SearchSuggestionChip/SearchSuggestionChip.js');
81
81
  var ZipCodeInput = require('./components/ZipCodeInput/ZipCodeInput.js');
82
- require('react');
83
- require('./components/MaxHeightText/styles.js');
84
- require('@citygross/typography');
82
+ var MaxHeightText = require('./components/MaxHeightText/MaxHeightText.js');
85
83
 
86
84
 
87
85
 
@@ -193,4 +191,5 @@ exports.MenuListItem = MenuListItem.MenuListItem;
193
191
  exports.SlideInOutContainer = SlideInOutContainer.SlideInOutContainer;
194
192
  exports.SearchSuggestionChip = SearchSuggestionChip.SearchSuggestionChip;
195
193
  exports.ZipCodeInput = ZipCodeInput.ZipCodeInput;
194
+ exports.MaxHeightText = MaxHeightText.MaxHeightText;
196
195
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ import React, { useState } from 'react';
2
+ import { MaxHeightTextWrapper, MaxHeightTextContainer, MaxHeightTextFader } from './styles.js';
3
+ import { Link } from '../Links/Link.js';
4
+ import { TextTypes } from '@citygross/typography';
5
+
6
+ function MaxHeightText(_a) {
7
+ var readMoreText = _a.readMoreText, readLessText = _a.readLessText, maxHeight = _a.maxHeight, children = _a.children;
8
+ var _b = useState(false), open = _b[0], setOpen = _b[1];
9
+ return (React.createElement(MaxHeightTextWrapper, null,
10
+ React.createElement(MaxHeightTextContainer, { maxHeight: open ? undefined : maxHeight },
11
+ children,
12
+ !open && React.createElement(MaxHeightTextFader, null)),
13
+ React.createElement(Link, { size: TextTypes.TextSize.REGULAR, onClick: function () { return setOpen(!open); } }, open ? readLessText : readMoreText)));
14
+ }
15
+
16
+ export { MaxHeightText };
17
+ //# sourceMappingURL=MaxHeightText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MaxHeightText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,10 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
5
- styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"], ["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.maxHeight) ? "".concat(props === null || props === void 0 ? void 0 : props.maxHeight, "px") : 'auto'); });
6
- styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"], ["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.constants) === null || _b === void 0 ? void 0 : _b.maxHeightFaderHeight; }, function (props) { var _a, _b, _c, _d; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.transparent, ", ").concat((_d = (_c = props.theme) === null || _c === void 0 ? void 0 : _c.palette) === null || _d === void 0 ? void 0 : _d.lightest); });
4
+ var MaxHeightTextWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", "px;\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
5
+ var MaxHeightTextContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"], ["\n max-height: ", ";\n overflow: hidden;\n position: relative;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.maxHeight) ? "".concat(props === null || props === void 0 ? void 0 : props.maxHeight, "px") : 'auto'); });
6
+ var MaxHeightTextFader = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"], ["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", "px;\n background: linear-gradient(\n ", "\n );\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.constants) === null || _b === void 0 ? void 0 : _b.maxHeightFaderHeight; }, function (props) { var _a, _b, _c, _d; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.transparent, ", ").concat((_d = (_c = props.theme) === null || _c === void 0 ? void 0 : _c.palette) === null || _d === void 0 ? void 0 : _d.lightest); });
7
7
  var templateObject_1, templateObject_2, templateObject_3;
8
+
9
+ export { MaxHeightTextContainer, MaxHeightTextFader, MaxHeightTextWrapper };
8
10
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -75,7 +75,5 @@ export { MenuListItem } from './components/MenuListItem/MenuListItem.js';
75
75
  export { SlideInOutContainer } from './components/SlideInOutContainer/SlideInOutContainer.js';
76
76
  export { SearchSuggestionChip } from './components/SearchSuggestionChip/SearchSuggestionChip.js';
77
77
  export { ZipCodeInput } from './components/ZipCodeInput/ZipCodeInput.js';
78
- import 'react';
79
- import './components/MaxHeightText/styles.js';
80
- import '@citygross/typography';
78
+ export { MaxHeightText } from './components/MaxHeightText/MaxHeightText.js';
81
79
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.190",
3
+ "version": "0.7.191",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "07aaa0ba50be215f0deb3914e8f4def7cbb59c6f"
74
+ "gitHead": "b7bc8ef13d8532c09aa2995f9458893cbad1d9a3"
75
75
  }