pallote-react 0.15.11 → 0.15.13
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 +61 -16
- 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,15 @@ const Checkbox = ({
|
|
|
1717
1721
|
checked,
|
|
1718
1722
|
disabled,
|
|
1719
1723
|
optional,
|
|
1724
|
+
dense,
|
|
1725
|
+
onChange,
|
|
1720
1726
|
className,
|
|
1721
1727
|
...props
|
|
1722
1728
|
}) => {
|
|
1723
1729
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1724
1730
|
className: classnames(['checkbox', {
|
|
1725
|
-
'checkbox-disabled': disabled
|
|
1731
|
+
'checkbox-disabled': disabled,
|
|
1732
|
+
'checkbox-dense': dense
|
|
1726
1733
|
}, className])
|
|
1727
1734
|
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
1728
1735
|
className: classnames('checkbox_control'),
|
|
@@ -1733,7 +1740,8 @@ const Checkbox = ({
|
|
|
1733
1740
|
checked: checked,
|
|
1734
1741
|
"aria-checked": checked,
|
|
1735
1742
|
disabled: disabled,
|
|
1736
|
-
required: !(disabled || optional)
|
|
1743
|
+
required: !(disabled || optional),
|
|
1744
|
+
onChange: onChange
|
|
1737
1745
|
}, props)), /*#__PURE__*/React__default.createElement("label", {
|
|
1738
1746
|
className: classnames('checkbox_label'),
|
|
1739
1747
|
htmlFor: id
|
|
@@ -1746,6 +1754,7 @@ Checkbox.propTypes = {
|
|
|
1746
1754
|
checked: PropTypes.bool,
|
|
1747
1755
|
disabled: PropTypes.bool,
|
|
1748
1756
|
optional: PropTypes.bool,
|
|
1757
|
+
dense: PropTypes.bool,
|
|
1749
1758
|
className: PropTypes.node
|
|
1750
1759
|
};
|
|
1751
1760
|
|
|
@@ -1754,11 +1763,14 @@ const InputLabel = ({
|
|
|
1754
1763
|
htmlFor,
|
|
1755
1764
|
label = 'Input label',
|
|
1756
1765
|
hint,
|
|
1757
|
-
error
|
|
1766
|
+
error,
|
|
1767
|
+
hideLabel = false
|
|
1758
1768
|
}) => {
|
|
1759
1769
|
const LabelTag = isLegend ? 'legend' : 'label';
|
|
1760
1770
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label && /*#__PURE__*/React__default.createElement(LabelTag, _extends({
|
|
1761
|
-
className: 'input_label'
|
|
1771
|
+
className: classnames('input_label', {
|
|
1772
|
+
'sr-only': hideLabel
|
|
1773
|
+
})
|
|
1762
1774
|
}, !isLegend && {
|
|
1763
1775
|
htmlFor
|
|
1764
1776
|
}), label), hint && /*#__PURE__*/React__default.createElement("p", {
|
|
@@ -1778,7 +1790,8 @@ InputLabel.propTypes = {
|
|
|
1778
1790
|
},
|
|
1779
1791
|
label: PropTypes.string.isRequired,
|
|
1780
1792
|
hint: PropTypes.string,
|
|
1781
|
-
error: PropTypes.string
|
|
1793
|
+
error: PropTypes.string,
|
|
1794
|
+
hideLabel: PropTypes.bool
|
|
1782
1795
|
};
|
|
1783
1796
|
|
|
1784
1797
|
const Checkboxes = ({
|
|
@@ -1789,7 +1802,9 @@ const Checkboxes = ({
|
|
|
1789
1802
|
error,
|
|
1790
1803
|
disabled,
|
|
1791
1804
|
optional,
|
|
1805
|
+
dense,
|
|
1792
1806
|
hint,
|
|
1807
|
+
hideLabel,
|
|
1793
1808
|
children,
|
|
1794
1809
|
className
|
|
1795
1810
|
}) => {
|
|
@@ -1797,7 +1812,8 @@ const Checkboxes = ({
|
|
|
1797
1812
|
className: classnames(['input', {
|
|
1798
1813
|
'js-error': error,
|
|
1799
1814
|
'input-disabled': disabled,
|
|
1800
|
-
'input-optional': optional
|
|
1815
|
+
'input-optional': optional,
|
|
1816
|
+
'input-dense': dense
|
|
1801
1817
|
}, className])
|
|
1802
1818
|
}, hint || error ? {
|
|
1803
1819
|
'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
|
|
@@ -1805,7 +1821,8 @@ const Checkboxes = ({
|
|
|
1805
1821
|
isLegend: true,
|
|
1806
1822
|
label: label,
|
|
1807
1823
|
hint: hint,
|
|
1808
|
-
error: error
|
|
1824
|
+
error: error,
|
|
1825
|
+
hideLabel: hideLabel
|
|
1809
1826
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1810
1827
|
className: classnames(['input_control', 'radios', {
|
|
1811
1828
|
[`radios-${direction}`]: direction
|
|
@@ -1824,7 +1841,9 @@ Checkboxes.propTypes = {
|
|
|
1824
1841
|
error: PropTypes.bool,
|
|
1825
1842
|
disabled: PropTypes.bool,
|
|
1826
1843
|
optional: PropTypes.bool,
|
|
1844
|
+
dense: PropTypes.bool,
|
|
1827
1845
|
hint: PropTypes.string,
|
|
1846
|
+
hideLabel: PropTypes.bool,
|
|
1828
1847
|
children: PropTypes.node.isRequired,
|
|
1829
1848
|
className: PropTypes.node
|
|
1830
1849
|
};
|
|
@@ -1931,7 +1950,9 @@ const Input = ({
|
|
|
1931
1950
|
error,
|
|
1932
1951
|
disabled,
|
|
1933
1952
|
optional,
|
|
1953
|
+
dense,
|
|
1934
1954
|
hint,
|
|
1955
|
+
hideLabel,
|
|
1935
1956
|
className,
|
|
1936
1957
|
...props
|
|
1937
1958
|
}) => {
|
|
@@ -1947,13 +1968,15 @@ const Input = ({
|
|
|
1947
1968
|
'js-error': error,
|
|
1948
1969
|
'input-disabled': disabled,
|
|
1949
1970
|
'input-optional': optional,
|
|
1971
|
+
'input-dense': dense,
|
|
1950
1972
|
'input-withIcon': icon
|
|
1951
1973
|
}, className])
|
|
1952
1974
|
}, /*#__PURE__*/React__default.createElement(InputLabel, {
|
|
1953
1975
|
htmlFor: id,
|
|
1954
1976
|
label: label,
|
|
1955
1977
|
hint: hint,
|
|
1956
|
-
error: error
|
|
1978
|
+
error: error,
|
|
1979
|
+
hideLabel: hideLabel
|
|
1957
1980
|
}), customIcon && /*#__PURE__*/React__default.createElement("div", {
|
|
1958
1981
|
className: 'input_icon'
|
|
1959
1982
|
}, customIcon), /*#__PURE__*/React__default.createElement("input", _extends({
|
|
@@ -1981,7 +2004,9 @@ Input.propTypes = {
|
|
|
1981
2004
|
error: PropTypes.bool,
|
|
1982
2005
|
disabled: PropTypes.bool,
|
|
1983
2006
|
optional: PropTypes.bool,
|
|
2007
|
+
dense: PropTypes.bool,
|
|
1984
2008
|
hint: PropTypes.string,
|
|
2009
|
+
hideLabel: PropTypes.bool,
|
|
1985
2010
|
className: PropTypes.node
|
|
1986
2011
|
};
|
|
1987
2012
|
|
|
@@ -2274,12 +2299,15 @@ const Radio = ({
|
|
|
2274
2299
|
checked,
|
|
2275
2300
|
disabled,
|
|
2276
2301
|
optional,
|
|
2302
|
+
dense,
|
|
2303
|
+
onChange,
|
|
2277
2304
|
className,
|
|
2278
2305
|
...props
|
|
2279
2306
|
}) => {
|
|
2280
2307
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2281
2308
|
className: classnames(['radio', {
|
|
2282
|
-
'radio-disabled': disabled
|
|
2309
|
+
'radio-disabled': disabled,
|
|
2310
|
+
'radio-dense': dense
|
|
2283
2311
|
}, className])
|
|
2284
2312
|
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
2285
2313
|
className: classnames('radio_control'),
|
|
@@ -2290,7 +2318,8 @@ const Radio = ({
|
|
|
2290
2318
|
checked: checked,
|
|
2291
2319
|
"aria-checked": checked,
|
|
2292
2320
|
disabled: disabled,
|
|
2293
|
-
required: !(disabled || optional)
|
|
2321
|
+
required: !(disabled || optional),
|
|
2322
|
+
onChange: onChange
|
|
2294
2323
|
}, props)), /*#__PURE__*/React__default.createElement("label", {
|
|
2295
2324
|
className: classnames('radio_label'),
|
|
2296
2325
|
htmlFor: id
|
|
@@ -2304,6 +2333,7 @@ Radio.propTypes = {
|
|
|
2304
2333
|
checked: PropTypes.bool,
|
|
2305
2334
|
disabled: PropTypes.bool,
|
|
2306
2335
|
optional: PropTypes.bool,
|
|
2336
|
+
dense: PropTypes.bool,
|
|
2307
2337
|
className: PropTypes.node
|
|
2308
2338
|
};
|
|
2309
2339
|
|
|
@@ -2315,7 +2345,9 @@ const RadioButtons = ({
|
|
|
2315
2345
|
error,
|
|
2316
2346
|
disabled,
|
|
2317
2347
|
optional,
|
|
2348
|
+
dense,
|
|
2318
2349
|
hint,
|
|
2350
|
+
hideLabel,
|
|
2319
2351
|
children,
|
|
2320
2352
|
className
|
|
2321
2353
|
}) => {
|
|
@@ -2323,7 +2355,8 @@ const RadioButtons = ({
|
|
|
2323
2355
|
className: classnames(['input', {
|
|
2324
2356
|
'js-error': error,
|
|
2325
2357
|
'input-disabled': disabled,
|
|
2326
|
-
'input-optional': optional
|
|
2358
|
+
'input-optional': optional,
|
|
2359
|
+
'input-dense': dense
|
|
2327
2360
|
}, className])
|
|
2328
2361
|
}, hint || error ? {
|
|
2329
2362
|
'aria-describedby': [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(' ')
|
|
@@ -2331,7 +2364,8 @@ const RadioButtons = ({
|
|
|
2331
2364
|
isLegend: true,
|
|
2332
2365
|
label: label,
|
|
2333
2366
|
hint: hint,
|
|
2334
|
-
error: error
|
|
2367
|
+
error: error,
|
|
2368
|
+
hideLabel: hideLabel
|
|
2335
2369
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
2336
2370
|
className: classnames(['input_control', 'radios', {
|
|
2337
2371
|
[`radios-${direction}`]: direction
|
|
@@ -2350,7 +2384,9 @@ RadioButtons.propTypes = {
|
|
|
2350
2384
|
error: PropTypes.bool,
|
|
2351
2385
|
disabled: PropTypes.bool,
|
|
2352
2386
|
optional: PropTypes.bool,
|
|
2387
|
+
dense: PropTypes.bool,
|
|
2353
2388
|
hint: PropTypes.string,
|
|
2389
|
+
hideLabel: PropTypes.bool,
|
|
2354
2390
|
children: PropTypes.node.isRequired,
|
|
2355
2391
|
className: PropTypes.node
|
|
2356
2392
|
};
|
|
@@ -2383,6 +2419,7 @@ const Select = ({
|
|
|
2383
2419
|
optional,
|
|
2384
2420
|
dense,
|
|
2385
2421
|
hint,
|
|
2422
|
+
hideLabel,
|
|
2386
2423
|
children,
|
|
2387
2424
|
className,
|
|
2388
2425
|
...props
|
|
@@ -2405,7 +2442,8 @@ const Select = ({
|
|
|
2405
2442
|
htmlFor: id,
|
|
2406
2443
|
label: label,
|
|
2407
2444
|
hint: hint,
|
|
2408
|
-
error: error
|
|
2445
|
+
error: error,
|
|
2446
|
+
hideLabel: hideLabel
|
|
2409
2447
|
}), /*#__PURE__*/React__default.createElement("select", _extends({
|
|
2410
2448
|
ref: inputRef,
|
|
2411
2449
|
className: 'input_control',
|
|
@@ -2428,6 +2466,7 @@ Select.propTypes = {
|
|
|
2428
2466
|
optional: PropTypes.bool,
|
|
2429
2467
|
dense: PropTypes.bool,
|
|
2430
2468
|
hint: PropTypes.string,
|
|
2469
|
+
hideLabel: PropTypes.bool,
|
|
2431
2470
|
children: PropTypes.any.isRequired,
|
|
2432
2471
|
className: PropTypes.node
|
|
2433
2472
|
};
|
|
@@ -3023,7 +3062,9 @@ const Textarea = ({
|
|
|
3023
3062
|
error,
|
|
3024
3063
|
disabled,
|
|
3025
3064
|
optional,
|
|
3065
|
+
dense,
|
|
3026
3066
|
hint,
|
|
3067
|
+
hideLabel,
|
|
3027
3068
|
className,
|
|
3028
3069
|
...props
|
|
3029
3070
|
}) => {
|
|
@@ -3037,13 +3078,15 @@ const Textarea = ({
|
|
|
3037
3078
|
className: classnames(['input', {
|
|
3038
3079
|
'js-error': error,
|
|
3039
3080
|
'input-disabled': disabled,
|
|
3040
|
-
'input-optional': optional
|
|
3081
|
+
'input-optional': optional,
|
|
3082
|
+
'input-dense': dense
|
|
3041
3083
|
}, className])
|
|
3042
3084
|
}, /*#__PURE__*/React__default.createElement(InputLabel, {
|
|
3043
3085
|
htmlFor: id,
|
|
3044
3086
|
label: label,
|
|
3045
3087
|
hint: hint,
|
|
3046
|
-
error: error
|
|
3088
|
+
error: error,
|
|
3089
|
+
hideLabel: hideLabel
|
|
3047
3090
|
}), /*#__PURE__*/React__default.createElement("textarea", _extends({
|
|
3048
3091
|
ref: inputRef,
|
|
3049
3092
|
className: 'input_control',
|
|
@@ -3067,7 +3110,9 @@ Textarea.propTypes = {
|
|
|
3067
3110
|
error: PropTypes.bool,
|
|
3068
3111
|
disabled: PropTypes.bool,
|
|
3069
3112
|
optional: PropTypes.bool,
|
|
3113
|
+
dense: PropTypes.bool,
|
|
3070
3114
|
hint: PropTypes.string,
|
|
3115
|
+
hideLabel: PropTypes.bool,
|
|
3071
3116
|
className: PropTypes.node
|
|
3072
3117
|
};
|
|
3073
3118
|
|
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.13",
|
|
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.12"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@chromatic-com/storybook": "^3.2.4",
|