pallote-react 0.15.11 → 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 +55 -14
- package/dist/package.json +1 -1
- package/package.json +2 -2
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
|
-
},
|
|
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,7 +1810,8 @@ const Checkboxes = ({
|
|
|
1797
1810
|
className: classnames(['input', {
|
|
1798
1811
|
'js-error': error,
|
|
1799
1812
|
'input-disabled': disabled,
|
|
1800
|
-
'input-optional': optional
|
|
1813
|
+
'input-optional': optional,
|
|
1814
|
+
'input-dense': dense
|
|
1801
1815
|
}, className])
|
|
1802
1816
|
}, hint || error ? {
|
|
1803
1817
|
'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
|
|
@@ -1805,7 +1819,8 @@ const Checkboxes = ({
|
|
|
1805
1819
|
isLegend: true,
|
|
1806
1820
|
label: label,
|
|
1807
1821
|
hint: hint,
|
|
1808
|
-
error: error
|
|
1822
|
+
error: error,
|
|
1823
|
+
hideLabel: hideLabel
|
|
1809
1824
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1810
1825
|
className: classnames(['input_control', 'radios', {
|
|
1811
1826
|
[`radios-${direction}`]: direction
|
|
@@ -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,13 +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
1971
|
}, className])
|
|
1952
1972
|
}, /*#__PURE__*/React__default.createElement(InputLabel, {
|
|
1953
1973
|
htmlFor: id,
|
|
1954
1974
|
label: label,
|
|
1955
1975
|
hint: hint,
|
|
1956
|
-
error: error
|
|
1976
|
+
error: error,
|
|
1977
|
+
hideLabel: hideLabel
|
|
1957
1978
|
}), customIcon && /*#__PURE__*/React__default.createElement("div", {
|
|
1958
1979
|
className: 'input_icon'
|
|
1959
1980
|
}, customIcon), /*#__PURE__*/React__default.createElement("input", _extends({
|
|
@@ -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,7 +2351,8 @@ const RadioButtons = ({
|
|
|
2323
2351
|
className: classnames(['input', {
|
|
2324
2352
|
'js-error': error,
|
|
2325
2353
|
'input-disabled': disabled,
|
|
2326
|
-
'input-optional': optional
|
|
2354
|
+
'input-optional': optional,
|
|
2355
|
+
'input-dense': dense
|
|
2327
2356
|
}, className])
|
|
2328
2357
|
}, hint || error ? {
|
|
2329
2358
|
'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
|
|
@@ -2331,7 +2360,8 @@ const RadioButtons = ({
|
|
|
2331
2360
|
isLegend: true,
|
|
2332
2361
|
label: label,
|
|
2333
2362
|
hint: hint,
|
|
2334
|
-
error: error
|
|
2363
|
+
error: error,
|
|
2364
|
+
hideLabel: hideLabel
|
|
2335
2365
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
2336
2366
|
className: classnames(['input_control', 'radios', {
|
|
2337
2367
|
[`radios-${direction}`]: direction
|
|
@@ -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
|
|
@@ -2405,7 +2438,8 @@ const Select = ({
|
|
|
2405
2438
|
htmlFor: id,
|
|
2406
2439
|
label: label,
|
|
2407
2440
|
hint: hint,
|
|
2408
|
-
error: error
|
|
2441
|
+
error: error,
|
|
2442
|
+
hideLabel: hideLabel
|
|
2409
2443
|
}), /*#__PURE__*/React__default.createElement("select", _extends({
|
|
2410
2444
|
ref: inputRef,
|
|
2411
2445
|
className: 'input_control',
|
|
@@ -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,13 +3074,15 @@ const Textarea = ({
|
|
|
3037
3074
|
className: classnames(['input', {
|
|
3038
3075
|
'js-error': error,
|
|
3039
3076
|
'input-disabled': disabled,
|
|
3040
|
-
'input-optional': optional
|
|
3077
|
+
'input-optional': optional,
|
|
3078
|
+
'input-dense': dense
|
|
3041
3079
|
}, className])
|
|
3042
3080
|
}, /*#__PURE__*/React__default.createElement(InputLabel, {
|
|
3043
3081
|
htmlFor: id,
|
|
3044
3082
|
label: label,
|
|
3045
3083
|
hint: hint,
|
|
3046
|
-
error: error
|
|
3084
|
+
error: error,
|
|
3085
|
+
hideLabel: hideLabel
|
|
3047
3086
|
}), /*#__PURE__*/React__default.createElement("textarea", _extends({
|
|
3048
3087
|
ref: inputRef,
|
|
3049
3088
|
className: 'input_control',
|
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pallote-react",
|
|
3
|
-
"version": "0.15.
|
|
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.
|
|
26
|
+
"pallote-css": "^0.9.11"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@chromatic-com/storybook": "^3.2.4",
|