pallote-react 0.15.10 → 0.15.12

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/index.js CHANGED
@@ -1517,6 +1517,7 @@ const Button = /*#__PURE__*/React__default.forwardRef(({
1517
1517
  iconRight,
1518
1518
  className,
1519
1519
  children = 'button',
1520
+ type = 'button',
1520
1521
  ...props
1521
1522
  }, ref) => {
1522
1523
  const Component = component || 'button';
@@ -1537,7 +1538,9 @@ const Button = /*#__PURE__*/React__default.forwardRef(({
1537
1538
  }, className]),
1538
1539
  ref: ref,
1539
1540
  disabled: Component === 'button' ? disabled : undefined
1540
- }, props), content);
1541
+ }, Component === 'button' ? {
1542
+ type
1543
+ } : {}, props), content);
1541
1544
  });
1542
1545
  Button.displayName = 'Button';
1543
1546
  Button.propTypes = {
@@ -1551,6 +1554,7 @@ Button.propTypes = {
1551
1554
  iconLeft: PropTypes.node,
1552
1555
  iconRight: PropTypes.node,
1553
1556
  className: PropTypes.node,
1557
+ type: PropTypes.oneOf(['button', 'submit', 'reset']),
1554
1558
  children: PropTypes.node.isRequired
1555
1559
  };
1556
1560
 
@@ -1717,12 +1721,14 @@ const Checkbox = ({
1717
1721
  checked,
1718
1722
  disabled,
1719
1723
  optional,
1724
+ dense,
1720
1725
  className,
1721
1726
  ...props
1722
1727
  }) => {
1723
1728
  return /*#__PURE__*/React__default.createElement("div", {
1724
1729
  className: classnames(['checkbox', {
1725
- 'checkbox-disabled': disabled
1730
+ 'checkbox-disabled': disabled,
1731
+ 'checkbox-dense': dense
1726
1732
  }, className])
1727
1733
  }, /*#__PURE__*/React__default.createElement("input", _extends({
1728
1734
  className: classnames('checkbox_control'),
@@ -1746,6 +1752,7 @@ Checkbox.propTypes = {
1746
1752
  checked: PropTypes.bool,
1747
1753
  disabled: PropTypes.bool,
1748
1754
  optional: PropTypes.bool,
1755
+ dense: PropTypes.bool,
1749
1756
  className: PropTypes.node
1750
1757
  };
1751
1758
 
@@ -1754,11 +1761,14 @@ const InputLabel = ({
1754
1761
  htmlFor,
1755
1762
  label = 'Input label',
1756
1763
  hint,
1757
- error
1764
+ error,
1765
+ hideLabel = false
1758
1766
  }) => {
1759
1767
  const LabelTag = isLegend ? 'legend' : 'label';
1760
1768
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label && /*#__PURE__*/React__default.createElement(LabelTag, _extends({
1761
- className: 'input_label'
1769
+ className: classnames('input_label', {
1770
+ 'sr-only': hideLabel
1771
+ })
1762
1772
  }, !isLegend && {
1763
1773
  htmlFor
1764
1774
  }), label), hint && /*#__PURE__*/React__default.createElement("p", {
@@ -1778,7 +1788,8 @@ InputLabel.propTypes = {
1778
1788
  },
1779
1789
  label: PropTypes.string.isRequired,
1780
1790
  hint: PropTypes.string,
1781
- error: PropTypes.string
1791
+ error: PropTypes.string,
1792
+ hideLabel: PropTypes.bool
1782
1793
  };
1783
1794
 
1784
1795
  const Checkboxes = ({
@@ -1789,7 +1800,9 @@ const Checkboxes = ({
1789
1800
  error,
1790
1801
  disabled,
1791
1802
  optional,
1803
+ dense,
1792
1804
  hint,
1805
+ hideLabel,
1793
1806
  children,
1794
1807
  className
1795
1808
  }) => {
@@ -1797,21 +1810,23 @@ const Checkboxes = ({
1797
1810
  className: classnames(['input', {
1798
1811
  'js-error': error,
1799
1812
  'input-disabled': disabled,
1800
- 'input-optional': optional
1801
- }, className]),
1802
- onChange: onChange
1813
+ 'input-optional': optional,
1814
+ 'input-dense': dense
1815
+ }, className])
1803
1816
  }, hint || error ? {
1804
1817
  'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
1805
1818
  } : null), /*#__PURE__*/React__default.createElement(InputLabel, {
1806
1819
  isLegend: true,
1807
1820
  label: label,
1808
1821
  hint: hint,
1809
- error: error
1822
+ error: error,
1823
+ hideLabel: hideLabel
1810
1824
  }), /*#__PURE__*/React__default.createElement("div", {
1811
1825
  className: classnames(['input_control', 'radios', {
1812
1826
  [`radios-${direction}`]: direction
1813
1827
  }])
1814
1828
  }, React__default.Children.map(children, child => /*#__PURE__*/React__default.isValidElement(child) ? /*#__PURE__*/React__default.cloneElement(child, {
1829
+ onChange,
1815
1830
  optional,
1816
1831
  disabled
1817
1832
  }) : child)));
@@ -1824,7 +1839,9 @@ Checkboxes.propTypes = {
1824
1839
  error: PropTypes.bool,
1825
1840
  disabled: PropTypes.bool,
1826
1841
  optional: PropTypes.bool,
1842
+ dense: PropTypes.bool,
1827
1843
  hint: PropTypes.string,
1844
+ hideLabel: PropTypes.bool,
1828
1845
  children: PropTypes.node.isRequired,
1829
1846
  className: PropTypes.node
1830
1847
  };
@@ -1931,7 +1948,9 @@ const Input = ({
1931
1948
  error,
1932
1949
  disabled,
1933
1950
  optional,
1951
+ dense,
1934
1952
  hint,
1953
+ hideLabel,
1935
1954
  className,
1936
1955
  ...props
1937
1956
  }) => {
@@ -1947,14 +1966,15 @@ const Input = ({
1947
1966
  'js-error': error,
1948
1967
  'input-disabled': disabled,
1949
1968
  'input-optional': optional,
1969
+ 'input-dense': dense,
1950
1970
  'input-withIcon': icon
1951
- }, className]),
1952
- onChange: onChange
1971
+ }, className])
1953
1972
  }, /*#__PURE__*/React__default.createElement(InputLabel, {
1954
1973
  htmlFor: id,
1955
1974
  label: label,
1956
1975
  hint: hint,
1957
- error: error
1976
+ error: error,
1977
+ hideLabel: hideLabel
1958
1978
  }), customIcon && /*#__PURE__*/React__default.createElement("div", {
1959
1979
  className: 'input_icon'
1960
1980
  }, customIcon), /*#__PURE__*/React__default.createElement("input", _extends({
@@ -1965,7 +1985,8 @@ const Input = ({
1965
1985
  id: id,
1966
1986
  placeholder: placeholder,
1967
1987
  disabled: disabled,
1968
- required: !(disabled || optional)
1988
+ required: !(disabled || optional),
1989
+ onChange: onChange
1969
1990
  }, hint || error ? {
1970
1991
  'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
1971
1992
  } : null, props)));
@@ -1981,7 +2002,9 @@ Input.propTypes = {
1981
2002
  error: PropTypes.bool,
1982
2003
  disabled: PropTypes.bool,
1983
2004
  optional: PropTypes.bool,
2005
+ dense: PropTypes.bool,
1984
2006
  hint: PropTypes.string,
2007
+ hideLabel: PropTypes.bool,
1985
2008
  className: PropTypes.node
1986
2009
  };
1987
2010
 
@@ -2274,12 +2297,14 @@ const Radio = ({
2274
2297
  checked,
2275
2298
  disabled,
2276
2299
  optional,
2300
+ dense,
2277
2301
  className,
2278
2302
  ...props
2279
2303
  }) => {
2280
2304
  return /*#__PURE__*/React__default.createElement("div", {
2281
2305
  className: classnames(['radio', {
2282
- 'radio-disabled': disabled
2306
+ 'radio-disabled': disabled,
2307
+ 'radio-dense': dense
2283
2308
  }, className])
2284
2309
  }, /*#__PURE__*/React__default.createElement("input", _extends({
2285
2310
  className: classnames('radio_control'),
@@ -2304,6 +2329,7 @@ Radio.propTypes = {
2304
2329
  checked: PropTypes.bool,
2305
2330
  disabled: PropTypes.bool,
2306
2331
  optional: PropTypes.bool,
2332
+ dense: PropTypes.bool,
2307
2333
  className: PropTypes.node
2308
2334
  };
2309
2335
 
@@ -2315,7 +2341,9 @@ const RadioButtons = ({
2315
2341
  error,
2316
2342
  disabled,
2317
2343
  optional,
2344
+ dense,
2318
2345
  hint,
2346
+ hideLabel,
2319
2347
  children,
2320
2348
  className
2321
2349
  }) => {
@@ -2323,21 +2351,23 @@ const RadioButtons = ({
2323
2351
  className: classnames(['input', {
2324
2352
  'js-error': error,
2325
2353
  'input-disabled': disabled,
2326
- 'input-optional': optional
2327
- }, className]),
2328
- onChange: onChange
2354
+ 'input-optional': optional,
2355
+ 'input-dense': dense
2356
+ }, className])
2329
2357
  }, hint || error ? {
2330
2358
  'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
2331
2359
  } : null), /*#__PURE__*/React__default.createElement(InputLabel, {
2332
2360
  isLegend: true,
2333
2361
  label: label,
2334
2362
  hint: hint,
2335
- error: error
2363
+ error: error,
2364
+ hideLabel: hideLabel
2336
2365
  }), /*#__PURE__*/React__default.createElement("div", {
2337
2366
  className: classnames(['input_control', 'radios', {
2338
2367
  [`radios-${direction}`]: direction
2339
2368
  }])
2340
2369
  }, React__default.Children.map(children, child => /*#__PURE__*/React__default.isValidElement(child) ? /*#__PURE__*/React__default.cloneElement(child, {
2370
+ onChange,
2341
2371
  optional,
2342
2372
  disabled
2343
2373
  }) : child)));
@@ -2350,7 +2380,9 @@ RadioButtons.propTypes = {
2350
2380
  error: PropTypes.bool,
2351
2381
  disabled: PropTypes.bool,
2352
2382
  optional: PropTypes.bool,
2383
+ dense: PropTypes.bool,
2353
2384
  hint: PropTypes.string,
2385
+ hideLabel: PropTypes.bool,
2354
2386
  children: PropTypes.node.isRequired,
2355
2387
  className: PropTypes.node
2356
2388
  };
@@ -2383,6 +2415,7 @@ const Select = ({
2383
2415
  optional,
2384
2416
  dense,
2385
2417
  hint,
2418
+ hideLabel,
2386
2419
  children,
2387
2420
  className,
2388
2421
  ...props
@@ -2400,20 +2433,21 @@ const Select = ({
2400
2433
  'input-disabled': disabled,
2401
2434
  'input-optional': optional,
2402
2435
  'input-dense': dense
2403
- }, className]),
2404
- onChange: onChange
2436
+ }, className])
2405
2437
  }, /*#__PURE__*/React__default.createElement(InputLabel, {
2406
2438
  htmlFor: id,
2407
2439
  label: label,
2408
2440
  hint: hint,
2409
- error: error
2441
+ error: error,
2442
+ hideLabel: hideLabel
2410
2443
  }), /*#__PURE__*/React__default.createElement("select", _extends({
2411
2444
  ref: inputRef,
2412
2445
  className: 'input_control',
2413
2446
  name: id,
2414
2447
  id: id,
2415
2448
  disabled: disabled,
2416
- required: !(disabled || optional)
2449
+ required: !(disabled || optional),
2450
+ onChange: onChange
2417
2451
  }, hint || error ? {
2418
2452
  'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
2419
2453
  } : null, props), children));
@@ -2428,6 +2462,7 @@ Select.propTypes = {
2428
2462
  optional: PropTypes.bool,
2429
2463
  dense: PropTypes.bool,
2430
2464
  hint: PropTypes.string,
2465
+ hideLabel: PropTypes.bool,
2431
2466
  children: PropTypes.any.isRequired,
2432
2467
  className: PropTypes.node
2433
2468
  };
@@ -3023,7 +3058,9 @@ const Textarea = ({
3023
3058
  error,
3024
3059
  disabled,
3025
3060
  optional,
3061
+ dense,
3026
3062
  hint,
3063
+ hideLabel,
3027
3064
  className,
3028
3065
  ...props
3029
3066
  }) => {
@@ -3037,14 +3074,15 @@ const Textarea = ({
3037
3074
  className: classnames(['input', {
3038
3075
  'js-error': error,
3039
3076
  'input-disabled': disabled,
3040
- 'input-optional': optional
3041
- }, className]),
3042
- onChange: onChange
3077
+ 'input-optional': optional,
3078
+ 'input-dense': dense
3079
+ }, className])
3043
3080
  }, /*#__PURE__*/React__default.createElement(InputLabel, {
3044
3081
  htmlFor: id,
3045
3082
  label: label,
3046
3083
  hint: hint,
3047
- error: error
3084
+ error: error,
3085
+ hideLabel: hideLabel
3048
3086
  }), /*#__PURE__*/React__default.createElement("textarea", _extends({
3049
3087
  ref: inputRef,
3050
3088
  className: 'input_control',
@@ -3053,7 +3091,8 @@ const Textarea = ({
3053
3091
  placeholder: placeholder,
3054
3092
  disabled: disabled,
3055
3093
  required: !(disabled || optional),
3056
- rows: 4
3094
+ rows: 4,
3095
+ onChange: onChange
3057
3096
  }, hint || error ? {
3058
3097
  'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
3059
3098
  } : null, props)));
@@ -3067,7 +3106,9 @@ Textarea.propTypes = {
3067
3106
  error: PropTypes.bool,
3068
3107
  disabled: PropTypes.bool,
3069
3108
  optional: PropTypes.bool,
3109
+ dense: PropTypes.bool,
3070
3110
  hint: PropTypes.string,
3111
+ hideLabel: PropTypes.bool,
3071
3112
  className: PropTypes.node
3072
3113
  };
3073
3114
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pallote-react",
3
- "version": "0.15.10",
3
+ "version": "0.15.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "styles": "dist/index.css",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pallote-react",
3
- "version": "0.15.10",
3
+ "version": "0.15.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "styles": "dist/index.css",
@@ -23,7 +23,7 @@
23
23
  "classnames": "^2.5.1",
24
24
  "react-syntax-highlighter": "^15.6.1",
25
25
  "sass": "^1.71.1",
26
- "pallote-css": "^0.9.10"
26
+ "pallote-css": "^0.9.11"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@chromatic-com/storybook": "^3.2.4",