@xqmsg/ui-core 0.14.3 → 0.14.5
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/components/input/StackedCheckbox/StackedCheckbox.d.ts +10 -0
- package/dist/theme/provider/index.d.ts +1 -1
- package/dist/ui-core.cjs.development.js +22 -20
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +22 -20
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +6 -0
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +27 -0
- package/src/components/input/StackedSelect/StackedSelect.tsx +1 -0
- package/src/components/input/StackedSwitch/index.tsx +2 -0
- package/src/components/input/index.tsx +5 -3
- package/src/components/table/index.tsx +2 -7
- package/src/theme/provider/index.tsx +1 -1
- package/dist/components/input/StackedCheckbox/StackedCheckboxGroup.d.ts +0 -10
- package/src/components/input/StackedCheckbox/StackedCheckboxGroup.tsx +0 -29
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectFieldProps } from '../InputTypes';
|
|
3
|
+
export interface StackedCheckboxProps extends SelectFieldProps {
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
8
|
+
*/
|
|
9
|
+
declare const StackedCheckbox: React.ForwardRefExoticComponent<StackedCheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default StackedCheckbox;
|
|
@@ -11,6 +11,7 @@ var reactHookForm = require('react-hook-form');
|
|
|
11
11
|
var lodash = require('lodash');
|
|
12
12
|
var icons = require('@chakra-ui/icons');
|
|
13
13
|
var hi = require('react-icons/hi');
|
|
14
|
+
var provider = require('@chakra-ui/provider');
|
|
14
15
|
var themeTools = require('@chakra-ui/theme-tools');
|
|
15
16
|
var system = require('@chakra-ui/system');
|
|
16
17
|
|
|
@@ -408,18 +409,15 @@ function Form(_ref) {
|
|
|
408
409
|
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
409
410
|
*/
|
|
410
411
|
|
|
411
|
-
var
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
value: option.value
|
|
421
|
-
}, option.label));
|
|
422
|
-
}));
|
|
412
|
+
var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
413
|
+
var value = _ref2.value,
|
|
414
|
+
label = _ref2.label,
|
|
415
|
+
defaultValue = _ref2.defaultValue;
|
|
416
|
+
return /*#__PURE__*/React__default.createElement(react.Checkbox, {
|
|
417
|
+
ref: _ref,
|
|
418
|
+
value: String(value),
|
|
419
|
+
defaultChecked: Boolean(defaultValue)
|
|
420
|
+
}, label);
|
|
423
421
|
});
|
|
424
422
|
|
|
425
423
|
function _extends() {
|
|
@@ -628,7 +626,8 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
628
626
|
color: "transparent",
|
|
629
627
|
fontSize: "13px",
|
|
630
628
|
textShadow: "0 0 0 " + colors.label.primary.light,
|
|
631
|
-
value: selectedOption
|
|
629
|
+
value: selectedOption,
|
|
630
|
+
autoComplete: "off"
|
|
632
631
|
})), /*#__PURE__*/React__default.createElement(react.InputRightElement, {
|
|
633
632
|
cursor: "pointer",
|
|
634
633
|
onClick: function onClick() {
|
|
@@ -1105,6 +1104,7 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1105
1104
|
var isRequired = _ref2.isRequired,
|
|
1106
1105
|
_onChange = _ref2.onChange,
|
|
1107
1106
|
value = _ref2.value;
|
|
1107
|
+
if (value === null) return null;
|
|
1108
1108
|
return /*#__PURE__*/React__default.createElement(react.Switch, {
|
|
1109
1109
|
size: "lg",
|
|
1110
1110
|
ref: _ref,
|
|
@@ -1223,17 +1223,18 @@ function Input(_ref) {
|
|
|
1223
1223
|
});
|
|
1224
1224
|
|
|
1225
1225
|
case 'checkbox':
|
|
1226
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1226
|
+
return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
|
|
1227
1227
|
className: "input-" + inputType + " " + (className != null ? className : ''),
|
|
1228
1228
|
name: name,
|
|
1229
1229
|
id: name,
|
|
1230
1230
|
isInvalid: isInvalid,
|
|
1231
|
-
options: options,
|
|
1232
1231
|
onChange: onChange,
|
|
1233
1232
|
onBlur: onBlur,
|
|
1234
1233
|
ref: ref,
|
|
1235
1234
|
disabled: disabled,
|
|
1236
|
-
value: value
|
|
1235
|
+
value: value,
|
|
1236
|
+
defaultValue: defaultValue,
|
|
1237
|
+
label: label
|
|
1237
1238
|
});
|
|
1238
1239
|
|
|
1239
1240
|
case 'multi-select':
|
|
@@ -1284,7 +1285,8 @@ function Input(_ref) {
|
|
|
1284
1285
|
onChange: onChange,
|
|
1285
1286
|
onBlur: onBlur,
|
|
1286
1287
|
ref: ref,
|
|
1287
|
-
value: value
|
|
1288
|
+
value: value,
|
|
1289
|
+
defaultValue: defaultValue
|
|
1288
1290
|
});
|
|
1289
1291
|
|
|
1290
1292
|
default:
|
|
@@ -1607,10 +1609,10 @@ function Table(_ref) {
|
|
|
1607
1609
|
border: "none",
|
|
1608
1610
|
overflowX: "auto",
|
|
1609
1611
|
bg: "white",
|
|
1610
|
-
width: "
|
|
1612
|
+
width: "100%"
|
|
1611
1613
|
}, /*#__PURE__*/React__default.createElement(react.Table, {
|
|
1612
1614
|
variant: "unstyled",
|
|
1613
|
-
width: "
|
|
1615
|
+
width: "100%",
|
|
1614
1616
|
style: {
|
|
1615
1617
|
borderCollapse: 'separate',
|
|
1616
1618
|
borderSpacing: '0px'
|
|
@@ -2867,7 +2869,7 @@ var customXQChakraTheme = /*#__PURE__*/react.extendTheme( /*#__PURE__*/_extends(
|
|
|
2867
2869
|
var XQThemeProvider = function XQThemeProvider(_ref) {
|
|
2868
2870
|
var children = _ref.children,
|
|
2869
2871
|
cssVarsRoot = _ref.cssVarsRoot;
|
|
2870
|
-
return /*#__PURE__*/React__default.createElement(
|
|
2872
|
+
return /*#__PURE__*/React__default.createElement(provider.ChakraProvider, {
|
|
2871
2873
|
theme: customXQChakraTheme,
|
|
2872
2874
|
resetCSS: true,
|
|
2873
2875
|
cssVarsRoot: cssVarsRoot
|