@paubox/ui 0.8.8 → 0.8.9

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.
Files changed (2) hide show
  1. package/index.esm.js +63 -104
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { css } from '@emotion/react';
3
2
  import styled from '@emotion/styled';
3
+ import { css } from '@emotion/react';
4
4
  import * as React from 'react';
5
5
  import React__default, { useState, useRef, forwardRef, useLayoutEffect, useEffect, createElement, cloneElement, Component, createRef, useCallback, useMemo } from 'react';
6
6
  import * as ReactDOM from 'react-dom';
@@ -1663,7 +1663,7 @@ function _templateObject5$3() {
1663
1663
  };
1664
1664
  return data;
1665
1665
  }
1666
- function _templateObject6$2() {
1666
+ function _templateObject6$1() {
1667
1667
  var data = _tagged_template_literal$o([
1668
1668
  "\n ",
1669
1669
  "\n font-size: ",
@@ -1671,12 +1671,12 @@ function _templateObject6$2() {
1671
1671
  "rem;\n letter-spacing: ",
1672
1672
  "px;\n font-weight: 600;\n"
1673
1673
  ]);
1674
- _templateObject6$2 = function _templateObject() {
1674
+ _templateObject6$1 = function _templateObject() {
1675
1675
  return data;
1676
1676
  };
1677
1677
  return data;
1678
1678
  }
1679
- function _templateObject7$1() {
1679
+ function _templateObject7() {
1680
1680
  var data = _tagged_template_literal$o([
1681
1681
  "\n ",
1682
1682
  "\n font-size: ",
@@ -1684,12 +1684,12 @@ function _templateObject7$1() {
1684
1684
  "rem;\n letter-spacing: ",
1685
1685
  "px;\n font-weight: 400;\n"
1686
1686
  ]);
1687
- _templateObject7$1 = function _templateObject() {
1687
+ _templateObject7 = function _templateObject() {
1688
1688
  return data;
1689
1689
  };
1690
1690
  return data;
1691
1691
  }
1692
- function _templateObject8$1() {
1692
+ function _templateObject8() {
1693
1693
  var data = _tagged_template_literal$o([
1694
1694
  "\n ",
1695
1695
  "\n font-size: ",
@@ -1697,12 +1697,12 @@ function _templateObject8$1() {
1697
1697
  "rem;\n letter-spacing: ",
1698
1698
  "px;\n font-weight: 600;\n"
1699
1699
  ]);
1700
- _templateObject8$1 = function _templateObject() {
1700
+ _templateObject8 = function _templateObject() {
1701
1701
  return data;
1702
1702
  };
1703
1703
  return data;
1704
1704
  }
1705
- function _templateObject9$1() {
1705
+ function _templateObject9() {
1706
1706
  var data = _tagged_template_literal$o([
1707
1707
  "\n ",
1708
1708
  "\n font-size: ",
@@ -1710,12 +1710,12 @@ function _templateObject9$1() {
1710
1710
  "rem;\n letter-spacing: ",
1711
1711
  "px;\n font-weight: 400;\n"
1712
1712
  ]);
1713
- _templateObject9$1 = function _templateObject() {
1713
+ _templateObject9 = function _templateObject() {
1714
1714
  return data;
1715
1715
  };
1716
1716
  return data;
1717
1717
  }
1718
- function _templateObject10$1() {
1718
+ function _templateObject10() {
1719
1719
  var data = _tagged_template_literal$o([
1720
1720
  "\n ",
1721
1721
  "\n font-size: ",
@@ -1723,7 +1723,7 @@ function _templateObject10$1() {
1723
1723
  "rem;\n letter-spacing: ",
1724
1724
  "px;\n font-weight: 600;\n"
1725
1725
  ]);
1726
- _templateObject10$1 = function _templateObject() {
1726
+ _templateObject10 = function _templateObject() {
1727
1727
  return data;
1728
1728
  };
1729
1729
  return data;
@@ -1930,12 +1930,12 @@ var $headline100Semibold = css(_templateObject2$a(), commonStyles, headline100Fo
1930
1930
  var $headline200Regular = css(_templateObject3$7(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
1931
1931
  var $headline200Semibold = css(_templateObject4$5(), commonStyles, headline200FontSize / BASE_FONT_SIZE, headline200LineHeight / BASE_FONT_SIZE, headline200LetterSpacing);
1932
1932
  var $headline300Regular = css(_templateObject5$3(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1933
- var $headline300Semibold = css(_templateObject6$2(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1933
+ var $headline300Semibold = css(_templateObject6$1(), commonStyles, headline300FontSize / BASE_FONT_SIZE, headline300LineHeight / BASE_FONT_SIZE, headline300LetterSpacing);
1934
1934
  // PARAGRAPH
1935
- var $paragraph100Regular = css(_templateObject7$1(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
1936
- var $paragraph100Semibold = css(_templateObject8$1(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
1937
- var $paragraph200Regular = css(_templateObject9$1(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
1938
- var $paragraph200Semibold = css(_templateObject10$1(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
1935
+ var $paragraph100Regular = css(_templateObject7(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
1936
+ var $paragraph100Semibold = css(_templateObject8(), commonStyles, paragraph100FontSize / BASE_FONT_SIZE, paragraph100LineHeight / BASE_FONT_SIZE, paragraph100LetterSpacing);
1937
+ var $paragraph200Regular = css(_templateObject9(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
1938
+ var $paragraph200Semibold = css(_templateObject10(), commonStyles, paragraph200FontSize / BASE_FONT_SIZE, paragraph200LineHeight / BASE_FONT_SIZE, paragraph200LetterSpacing);
1939
1939
  var $paragraph300Regular = css(_templateObject11(), commonStyles, paragraph300FontSize / BASE_FONT_SIZE, paragraph300LineHeight / BASE_FONT_SIZE, paragraph300LetterSpacing);
1940
1940
  var $paragraph300Medium = css(_templateObject12(), commonStyles, paragraph300FontSize / BASE_FONT_SIZE, paragraph300LineHeight / BASE_FONT_SIZE, paragraph300LetterSpacing);
1941
1941
  var $paragraph300Semibold = css(_templateObject13(), commonStyles, paragraph300FontSize / BASE_FONT_SIZE, paragraph300LineHeight / BASE_FONT_SIZE, paragraph300LetterSpacing);
@@ -2041,9 +2041,10 @@ function _unsupported_iterable_to_array$i(o, minLen) {
2041
2041
  }
2042
2042
  function _templateObject$n() {
2043
2043
  var data = _tagged_template_literal$n([
2044
- "\n padding: ",
2045
- ";\n margin: 10px;\n border-radius: 5px;\n color: ",
2046
- ";\n display: flex;\n align-items: center;\n flex-direction: row;\n gap: 0.5rem;\n "
2044
+ "\n padding: ",
2045
+ ";\n margin: 10px;\n border-radius: 5px;\n color: ",
2046
+ ";\n display: flex;\n align-items: center;\n flex-direction: row;\n gap: 0.5rem;\n background-color: ",
2047
+ ";\n"
2047
2048
  ]);
2048
2049
  _templateObject$n = function _templateObject() {
2049
2050
  return data;
@@ -2052,8 +2053,8 @@ function _templateObject$n() {
2052
2053
  }
2053
2054
  function _templateObject1$c() {
2054
2055
  var data = _tagged_template_literal$n([
2055
- "\n ",
2056
- "\n margin: 0;\n "
2056
+ "\n ",
2057
+ ";\n margin: 0;\n"
2057
2058
  ]);
2058
2059
  _templateObject1$c = function _templateObject() {
2059
2060
  return data;
@@ -2062,8 +2063,8 @@ function _templateObject1$c() {
2062
2063
  }
2063
2064
  function _templateObject2$9() {
2064
2065
  var data = _tagged_template_literal$n([
2065
- "\n ",
2066
- "\n margin: 0;\n "
2066
+ "\n ",
2067
+ ";\n margin: 0;\n"
2067
2068
  ]);
2068
2069
  _templateObject2$9 = function _templateObject() {
2069
2070
  return data;
@@ -2072,8 +2073,8 @@ function _templateObject2$9() {
2072
2073
  }
2073
2074
  function _templateObject3$6() {
2074
2075
  var data = _tagged_template_literal$n([
2075
- "\n background-color: ",
2076
- ";\n "
2076
+ "\n font-size: 1.5rem;\n color: ",
2077
+ ";\n margin-bottom: auto;\n flex-shrink: 0;\n"
2077
2078
  ]);
2078
2079
  _templateObject3$6 = function _templateObject() {
2079
2080
  return data;
@@ -2082,8 +2083,7 @@ function _templateObject3$6() {
2082
2083
  }
2083
2084
  function _templateObject4$4() {
2084
2085
  var data = _tagged_template_literal$n([
2085
- "\n background-color: ",
2086
- ";\n "
2086
+ "\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n"
2087
2087
  ]);
2088
2088
  _templateObject4$4 = function _templateObject() {
2089
2089
  return data;
@@ -2092,65 +2092,36 @@ function _templateObject4$4() {
2092
2092
  }
2093
2093
  function _templateObject5$2() {
2094
2094
  var data = _tagged_template_literal$n([
2095
- "\n background-color: ",
2096
- ";\n "
2095
+ "\n background-color: transparent;\n border: none;\n color: ",
2096
+ ";\n cursor: pointer;\n padding: 0.25rem;\n font-size: 0.75rem;\n margin-left: ",
2097
+ ";\n"
2097
2098
  ]);
2098
2099
  _templateObject5$2 = function _templateObject() {
2099
2100
  return data;
2100
2101
  };
2101
2102
  return data;
2102
2103
  }
2103
- function _templateObject6$1() {
2104
- var data = _tagged_template_literal$n([
2105
- "\n background-color: ",
2106
- ";\n "
2107
- ]);
2108
- _templateObject6$1 = function _templateObject() {
2109
- return data;
2110
- };
2111
- return data;
2112
- }
2113
- function _templateObject7() {
2114
- var data = _tagged_template_literal$n([
2115
- "\n font-size: 1.5rem;\n color: ",
2116
- ";\n margin-bottom: auto;\n flex-shrink: 0;\n "
2117
- ]);
2118
- _templateObject7 = function _templateObject() {
2119
- return data;
2120
- };
2121
- return data;
2122
- }
2123
- function _templateObject8() {
2124
- var data = _tagged_template_literal$n([
2125
- "\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n "
2126
- ]);
2127
- _templateObject8 = function _templateObject() {
2128
- return data;
2129
- };
2130
- return data;
2131
- }
2132
- function _templateObject9() {
2133
- var data = _tagged_template_literal$n([
2134
- "\n background-color: transparent;\n border: none;\n color: ",
2135
- ";\n cursor: pointer;\n padding: 0.25rem;\n font-size: 0.75;\n margin-left: ",
2136
- ";\n "
2137
- ]);
2138
- _templateObject9 = function _templateObject() {
2139
- return data;
2140
- };
2141
- return data;
2142
- }
2143
- function _templateObject10() {
2144
- var data = _tagged_template_literal$n([
2145
- "\n ",
2146
- "\n ",
2147
- "\n "
2148
- ]);
2149
- _templateObject10 = function _templateObject() {
2150
- return data;
2151
- };
2152
- return data;
2153
- }
2104
+ var AlertContainer = styled.div(_templateObject$n(), function(param) {
2105
+ var size = param.size;
2106
+ return size === 'large' ? '1rem' : '0.5rem 0.625rem';
2107
+ }, neutral900, function(param) {
2108
+ var type = param.type;
2109
+ return type === 'info' ? primary100 : type === 'warning' ? warning100 : type === 'error' ? danger100 : success100;
2110
+ });
2111
+ var Title = styled.h1(_templateObject1$c(), function(param) {
2112
+ var size = param.size;
2113
+ return size === 'large' ? $paragraph100Semibold : $paragraph200Regular;
2114
+ });
2115
+ var Text = styled.p(_templateObject2$9(), $paragraph200Regular);
2116
+ var StyledIcon = styled.div(_templateObject3$6(), function(param) {
2117
+ var type = param.type;
2118
+ return type === 'info' ? primary700 : type === 'error' ? danger700 : type === 'success' ? success700 : warning700;
2119
+ });
2120
+ var TextWrapper = styled.div(_templateObject4$4());
2121
+ var TruncaterButton = styled.button(_templateObject5$2(), primary700, function(param) {
2122
+ var isExpanded = param.isExpanded;
2123
+ return !isExpanded ? '0' : '0.25rem';
2124
+ });
2154
2125
  var AlertBar = function(props) {
2155
2126
  var title = props.title, _props_text = props.text, text = _props_text === void 0 ? '' : _props_text, _props_size = props.size, size = _props_size === void 0 ? 'small' : _props_size, _props_type = props.type, type = _props_type === void 0 ? 'info' : _props_type;
2156
2127
  var _useState = _sliced_to_array$e(useState(false), 2), isExpanded = _useState[0], setIsExpanded = _useState[1];
@@ -2158,18 +2129,6 @@ var AlertBar = function(props) {
2158
2129
  var isTooLong = text.length > maxLength;
2159
2130
  var displayText = isExpanded || !isTooLong ? text : "".concat(text.slice(0, maxLength), "...");
2160
2131
  var textRef = useRef(null);
2161
- var alertBaseStyles = css(_templateObject$n(), size === 'large' ? '1rem' : '0.5rem 0.625rem ', neutral900);
2162
- var titleStyles = css(_templateObject1$c(), size === 'large' ? $paragraph100Semibold : $paragraph200Regular);
2163
- var textStyles = css(_templateObject2$9(), $paragraph200Regular);
2164
- var alertStyles = {
2165
- info: css(_templateObject3$6(), primary100),
2166
- warning: css(_templateObject4$4(), warning100),
2167
- error: css(_templateObject5$2(), danger100),
2168
- success: css(_templateObject6$1(), success100)
2169
- };
2170
- var iconStyles = css(_templateObject7(), type === 'info' ? "".concat(primary700) : type === 'error' ? "".concat(danger700) : type === 'success' ? "".concat(success700) : "".concat(warning700));
2171
- var textWrapperStyles = css(_templateObject8());
2172
- var truncaterButtonStyles = css(_templateObject9(), primary700, !isExpanded ? '0' : '0.25rem');
2173
2132
  var icon = {
2174
2133
  info: Info,
2175
2134
  warning: Warning,
@@ -2177,26 +2136,26 @@ var AlertBar = function(props) {
2177
2136
  success: Success
2178
2137
  };
2179
2138
  var Icon = icon[type];
2180
- return /*#__PURE__*/ jsxs("div", {
2181
- css: css(_templateObject10(), alertBaseStyles, alertStyles[type]),
2139
+ return /*#__PURE__*/ jsxs(AlertContainer, {
2140
+ type: type,
2141
+ size: size,
2182
2142
  children: [
2183
- /*#__PURE__*/ jsx(Icon, {
2184
- css: iconStyles
2143
+ /*#__PURE__*/ jsx(StyledIcon, {
2144
+ type: type,
2145
+ children: /*#__PURE__*/ jsx(Icon, {})
2185
2146
  }),
2186
- /*#__PURE__*/ jsxs("div", {
2187
- css: textWrapperStyles,
2147
+ /*#__PURE__*/ jsxs(TextWrapper, {
2188
2148
  children: [
2189
- /*#__PURE__*/ jsx("h1", {
2190
- css: titleStyles,
2149
+ /*#__PURE__*/ jsx(Title, {
2150
+ size: size,
2191
2151
  children: title
2192
2152
  }),
2193
- text && /*#__PURE__*/ jsxs("p", {
2153
+ text && /*#__PURE__*/ jsxs(Text, {
2194
2154
  ref: textRef,
2195
- css: textStyles,
2196
2155
  children: [
2197
2156
  displayText,
2198
- isTooLong && /*#__PURE__*/ jsx("button", {
2199
- css: truncaterButtonStyles,
2157
+ isTooLong && /*#__PURE__*/ jsx(TruncaterButton, {
2158
+ isExpanded: isExpanded,
2200
2159
  type: "button",
2201
2160
  onClick: function() {
2202
2161
  return setIsExpanded(!isExpanded);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@paubox/ui",
3
3
  "author": "Paubox, Inc.",
4
4
  "description": "Paubox Component Library",
5
- "version": "0.8.8",
5
+ "version": "0.8.9",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {