@dreamcommerce/aurora 2.4.0-1 → 2.4.0-10
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/build/cjs/packages/aurora/src/components/color_picker/components/label.js +0 -1
- package/build/cjs/packages/aurora/src/components/color_picker/components/label.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/components/input.js +2 -1
- package/build/cjs/packages/aurora/src/components/controls/components/input.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/components/label.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/css_classes.js +1 -5
- package/build/cjs/packages/aurora/src/components/controls/css_classes.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_cell_selector/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_checkbox/index.js +5 -9
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_checkbox/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_checkbox_switch/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_color_picker/index.js +2 -3
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_color_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_date_picker/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_file_picker/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_input/index.js +2 -3
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_input/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_multi_select/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_radio/index.js +4 -5
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_radio/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_radio_group/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_range/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_textarea/index.js +2 -3
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_textarea/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/controls/index.js +2 -4
- package/build/cjs/packages/aurora/src/components/controls/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/heading/index.js +4 -5
- package/build/cjs/packages/aurora/src/components/heading/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/label/css_classes.js +3 -1
- package/build/cjs/packages/aurora/src/components/label/css_classes.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/label/index.js +5 -2
- package/build/cjs/packages/aurora/src/components/label/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/stack/index.js +3 -3
- package/build/cjs/packages/aurora/src/components/stack/stack_constants.js +6 -1
- package/build/cjs/packages/aurora/src/components/stack/stack_constants.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/typography/index.js +24 -0
- package/build/cjs/packages/aurora/src/components/{controls/components/helper.js.map → typography/index.js.map} +1 -1
- package/build/cjs/packages/aurora/src/components/typography/typography_constants.js +58 -0
- package/build/cjs/packages/aurora/src/components/typography/typography_constants.js.map +1 -0
- package/build/cjs/packages/aurora/src/css/color_picker/main.module.less.js +1 -1
- package/build/cjs/packages/aurora/src/css/controls/main.module.less.js +1 -1
- package/build/cjs/packages/aurora/src/css/heading/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/css/hint/main.module.less.js +1 -1
- package/build/cjs/packages/aurora/src/css/label/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/css/stack/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/css/typography/main.module.less.js +12 -0
- package/build/cjs/packages/aurora/src/index.js +45 -43
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/color_picker/components/label.js +0 -1
- package/build/esm/packages/aurora/src/components/color_picker/components/label.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/components/input.js +2 -1
- package/build/esm/packages/aurora/src/components/controls/components/input.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/components/label.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/css_classes.d.ts +0 -2
- package/build/esm/packages/aurora/src/components/controls/css_classes.js +2 -4
- package/build/esm/packages/aurora/src/components/controls/css_classes.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_cell_selector/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_checkbox/index.js +2 -6
- package/build/esm/packages/aurora/src/components/controls/hoc/control_checkbox/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_checkbox_switch/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_color_picker/index.js +2 -3
- package/build/esm/packages/aurora/src/components/controls/hoc/control_color_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_date_picker/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_file_picker/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_input/index.js +2 -3
- package/build/esm/packages/aurora/src/components/controls/hoc/control_input/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_multi_select/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_radio/index.js +4 -5
- package/build/esm/packages/aurora/src/components/controls/hoc/control_radio/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_radio_group/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_range/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_textarea/index.js +2 -3
- package/build/esm/packages/aurora/src/components/controls/hoc/control_textarea/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/index.js +2 -4
- package/build/esm/packages/aurora/src/components/controls/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/types.d.ts +13 -11
- package/build/esm/packages/aurora/src/components/date_picker/types.d.ts +2 -1
- package/build/esm/packages/aurora/src/components/date_picker/types.js.map +1 -1
- package/build/esm/packages/aurora/src/components/heading/index.js +4 -5
- package/build/esm/packages/aurora/src/components/heading/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/label/css_classes.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/label/css_classes.js +3 -2
- package/build/esm/packages/aurora/src/components/label/css_classes.js.map +1 -1
- package/build/esm/packages/aurora/src/components/label/index.js +6 -3
- package/build/esm/packages/aurora/src/components/label/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/label/types.d.ts +2 -1
- package/build/esm/packages/aurora/src/components/label/types.js.map +1 -1
- package/build/esm/packages/aurora/src/components/stack/index.js +4 -4
- package/build/esm/packages/aurora/src/components/stack/stack_constants.d.ts +5 -1
- package/build/esm/packages/aurora/src/components/stack/stack_constants.js +6 -2
- package/build/esm/packages/aurora/src/components/stack/stack_constants.js.map +1 -1
- package/build/esm/packages/aurora/src/components/stack/stack_types.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/typography/index.d.ts +4 -0
- package/build/esm/packages/aurora/src/components/typography/index.js +15 -0
- package/build/esm/packages/aurora/src/components/{controls/components/helper.js.map → typography/index.js.map} +1 -1
- package/build/esm/packages/aurora/src/components/typography/typography_constants.d.ts +44 -0
- package/build/esm/packages/aurora/src/components/typography/typography_constants.js +48 -0
- package/build/esm/packages/aurora/src/components/typography/typography_constants.js.map +1 -0
- package/build/esm/packages/aurora/src/components/typography/typography_types.d.ts +13 -0
- package/build/esm/packages/aurora/src/components/typography/typography_types.js +3 -0
- package/build/esm/packages/aurora/src/components/typography/typography_types.js.map +1 -0
- package/build/esm/packages/aurora/src/css/color_picker/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/css/controls/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/css/heading/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/css/hint/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/css/label/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/css/stack/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/css/typography/main.module.less.js +8 -0
- package/build/esm/packages/aurora/src/index.d.ts +2 -1
- package/build/esm/packages/aurora/src/index.js +3 -2
- package/build/esm/packages/aurora/src/index.js.map +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/aurora/src/components/controls/components/helper.js +0 -23
- package/build/cjs/packages/aurora/src/css/helper/main.module.less.js +0 -12
- package/build/esm/packages/aurora/src/components/controls/components/helper.d.ts +0 -4
- package/build/esm/packages/aurora/src/components/controls/components/helper.js +0 -14
- package/build/esm/packages/aurora/src/css/helper/main.module.less.js +0 -8
- /package/build/cjs/packages/aurora/src/css/{helper → typography}/main.module.less.js.map +0 -0
- /package/build/esm/packages/aurora/src/css/{helper → typography}/main.module.less.js.map +0 -0
|
@@ -20,16 +20,15 @@ import Dropdown from '../../../dropdown/index.js';
|
|
|
20
20
|
* />
|
|
21
21
|
* )
|
|
22
22
|
*/
|
|
23
|
-
const ControlColorPicker = ({ initialColor = '#FFFFFF', name, isRequired, label, id, onChange, hideChooseCancelButtons, errors, hint,
|
|
23
|
+
const ControlColorPicker = ({ initialColor = '#FFFFFF', name, isRequired, label, id, onChange, hideChooseCancelButtons, errors, hint, hintOptions = { isFixed: true }, labelAdditionalInfo }) => {
|
|
24
24
|
const colorPickerContext = useColorPicker({ initialColorHex: initialColor, onChange });
|
|
25
25
|
return (React.createElement(ColorPickerContext.Provider, { value: colorPickerContext },
|
|
26
26
|
React.createElement(Dropdown, null,
|
|
27
27
|
React.createElement(Dropdown.CustomLabel, null,
|
|
28
28
|
React.createElement(Control, { errors: errors, name: name, id: id },
|
|
29
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
29
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
30
30
|
label,
|
|
31
31
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
32
|
-
helper && React.createElement(Control.Helper, { hasError: !!(errors === null || errors === void 0 ? void 0 : errors.length) }, helper),
|
|
33
32
|
React.createElement(Control.Content, null,
|
|
34
33
|
React.createElement(Control.Element, null,
|
|
35
34
|
React.createElement(ColorPickerLabel, { name: name || '', isRequired: isRequired, id: id, label: label }))),
|
package/build/esm/packages/aurora/src/components/controls/hoc/control_color_picker/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -25,7 +25,7 @@ const DatepickerViews = {
|
|
|
25
25
|
* />
|
|
26
26
|
* )
|
|
27
27
|
*/
|
|
28
|
-
const ControlDatepicker = ({ onChange, label, name, isRequired, id = 'datepicker-id', type = 'single', defaultDate, defaultRange, maxDate, minDate, maxRange, minRange, className, showDefaultRanges = true, showButtons = true, errors, hint }) => {
|
|
28
|
+
const ControlDatepicker = ({ onChange, label, name, isRequired, id = 'datepicker-id', type = 'single', defaultDate, defaultRange, maxDate, minDate, maxRange, minRange, className, showDefaultRanges = true, showButtons = true, errors, hint, labelAdditionalInfo }) => {
|
|
29
29
|
const valueController = useValueController({
|
|
30
30
|
type,
|
|
31
31
|
defaultDate,
|
|
@@ -44,7 +44,7 @@ const ControlDatepicker = ({ onChange, label, name, isRequired, id = 'datepicker
|
|
|
44
44
|
return (React.createElement(DatepickerContext.Provider, { value: valueController },
|
|
45
45
|
React.createElement(Dropdown.CustomLabel, null,
|
|
46
46
|
React.createElement(Control, { errors: errors, name: name, id: id },
|
|
47
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
47
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
48
48
|
label,
|
|
49
49
|
hint && React.createElement(Hint, { fixed: true, spacingLeft: true, hint: hint }))),
|
|
50
50
|
React.createElement(Control.Content, null,
|
|
@@ -3,9 +3,9 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import FilePicker from '../../../file_picker/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlFilePicker = ({ label, isRequired, id, name, onChange, allowedExtensions, initialFile, className, errors, hint, hintOptions = { isFixed: true } }) => {
|
|
6
|
+
const ControlFilePicker = ({ label, isRequired, id, name, onChange, allowedExtensions, initialFile, className, errors, hint, hintOptions = { isFixed: true }, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
8
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
10
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
11
11
|
React.createElement(Control.Content, null,
|
|
@@ -17,12 +17,11 @@ import Hint from '../../../hint/index.js';
|
|
|
17
17
|
* />
|
|
18
18
|
* )
|
|
19
19
|
*/
|
|
20
|
-
const ControlInput = ({ label, isRequired, id, name, value, placeholder, prefix, postfix, disabled, onChange, onKeyPress, onKeyUp, hint, hintOptions = { isFixed: true }, errors,
|
|
20
|
+
const ControlInput = ({ label, isRequired, id, name, value, placeholder, prefix, postfix, disabled, onChange, onKeyPress, onKeyUp, hint, hintOptions = { isFixed: true }, errors, labelAdditionalInfo, additionalInfo, ...props }) => {
|
|
21
21
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
22
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
22
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
23
23
|
label,
|
|
24
24
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
25
|
-
helper && React.createElement(Control.Helper, { hasError: !!(errors === null || errors === void 0 ? void 0 : errors.length) }, helper),
|
|
26
25
|
React.createElement(Control.Content, null,
|
|
27
26
|
React.createElement(Control.Element, { prefix: prefix, postfix: postfix },
|
|
28
27
|
React.createElement(Control.Input, { id: id, name: name, value: value, placeholder: placeholder, disabled: disabled, onChange: onChange, onKeyPress: onKeyPress, onKeyUp: onKeyUp, ...props }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,9 +3,9 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import Multiple from '../../../dropdown/hoc/multiselect/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlMultiSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint, hintOptions = { isFixed: true }, hasCloseIcon }) => {
|
|
6
|
+
const ControlMultiSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint, hintOptions = { isFixed: true }, hasCloseIcon, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
8
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
10
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
11
11
|
React.createElement(Control.Content, null,
|
|
@@ -16,16 +16,15 @@ import Hint from '../../../hint/index.js';
|
|
|
16
16
|
* />
|
|
17
17
|
* )
|
|
18
18
|
*/
|
|
19
|
-
const ControlRadio = ({ id, label, hint, hintOptions = { isFixed: true }, name, value, defaultChecked, checked, disabled, onClick, errors,
|
|
19
|
+
const ControlRadio = ({ id, label, hint, hintOptions = { isFixed: true }, name, value, defaultChecked, checked, disabled, onClick, errors, labelAdditionalInfo }) => {
|
|
20
20
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
21
21
|
React.createElement(Control.Content, null,
|
|
22
|
-
React.createElement(Control.Element, { type: "radio", verticalPosition:
|
|
22
|
+
React.createElement(Control.Element, { type: "radio", verticalPosition: labelAdditionalInfo ? VERTICAL_POSITION.top : undefined },
|
|
23
23
|
React.createElement(Control.Radio, { id: id, name: name, value: value, defaultChecked: defaultChecked, checked: checked, disabled: disabled, onClick: onClick }),
|
|
24
|
-
React.createElement(Label, { htmlFor: id },
|
|
24
|
+
React.createElement(Label, { additionalInfo: labelAdditionalInfo, htmlFor: id },
|
|
25
25
|
label,
|
|
26
26
|
" ",
|
|
27
|
-
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, hint: hint, spacingLeft: true }),
|
|
28
|
-
additionalInfo && React.createElement(Control.AdditionalInfo, null, additionalInfo)))),
|
|
27
|
+
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, hint: hint, spacingLeft: true })))),
|
|
29
28
|
React.createElement(Control.Errors, null)));
|
|
30
29
|
};
|
|
31
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,9 +3,9 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import ControlRadio from '../control_radio/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlRadioGroup = ({ id, name, onClick, checkedValue, defaultCheckedValue, label, hint, hintOptions = { isFixed: true }, options, errors, isRequired }) => {
|
|
6
|
+
const ControlRadioGroup = ({ id, name, onClick, checkedValue, defaultCheckedValue, label, hint, hintOptions = { isFixed: true }, options, errors, isRequired, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
8
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
10
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
11
11
|
options.map(({ value, label, hint, disabled }) => (React.createElement(ControlRadio, { key: `RadioGroup${id}-RadioElement-${value}`, label: label, id: `RadioGroup${id}-Radio-${value}`, value: value, hint: hint, disabled: disabled, name: name, defaultChecked: defaultCheckedValue ? defaultCheckedValue === value : undefined, checked: checkedValue ? checkedValue === value : undefined, onClick: onClick }))),
|
|
@@ -3,9 +3,9 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import Range from '../../../range/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlRange = ({ label, hint, hintOptions = { isFixed: true }, isRequired, id, name, isDisabled, onChange, initialValue, step, max, min, errors }) => {
|
|
6
|
+
const ControlRange = ({ label, hint, hintOptions = { isFixed: true }, isRequired, id, name, isDisabled, onChange, initialValue, step, max, min, errors, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
8
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
10
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
11
11
|
React.createElement(Control.Content, null,
|
|
@@ -18,9 +18,9 @@ import Select from '../../../dropdown/hoc/select/index.js';
|
|
|
18
18
|
* />
|
|
19
19
|
* )
|
|
20
20
|
*/
|
|
21
|
-
const ControlSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint, hintOptions = { isFixed: true }, placeholder, additionalInfo, onScroll, innerAdditionalContent, hasCloseIcon }) => {
|
|
21
|
+
const ControlSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint, hintOptions = { isFixed: true }, placeholder, additionalInfo, onScroll, innerAdditionalContent, hasCloseIcon, labelAdditionalInfo }) => {
|
|
22
22
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
23
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
23
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
24
24
|
label,
|
|
25
25
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
26
26
|
React.createElement(Control.Content, null,
|
package/build/esm/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import TagsSelector from '../../../tags_selector/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlTagsSelector = ({ id, name, label, isRequired, placeholder, minTagLength, withList, defaultTags, defaultListTags, onChange, onListItemClick, errors, hint, hintOptions = { isFixed: true } }) => {
|
|
6
|
+
const ControlTagsSelector = ({ id, name, label, isRequired, placeholder, minTagLength, withList, defaultTags, defaultListTags, onChange, onListItemClick, errors, hint, hintOptions = { isFixed: true }, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
8
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
10
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
11
11
|
React.createElement(Control.Content, null,
|
|
@@ -17,12 +17,11 @@ import Hint from '../../../hint/index.js';
|
|
|
17
17
|
* />
|
|
18
18
|
* )
|
|
19
19
|
*/
|
|
20
|
-
const ControlTextarea = React.forwardRef(({ label, isRequired, id, name, value, defaultValue, placeholder, disabled, readOnly, onChange, onFocus, onBlur, onKeyPress, errors, hint, hintOptions = { isFixed: true },
|
|
20
|
+
const ControlTextarea = React.forwardRef(({ label, isRequired, id, name, value, defaultValue, placeholder, disabled, readOnly, onChange, onFocus, onBlur, onKeyPress, errors, hint, hintOptions = { isFixed: true }, labelAdditionalInfo }, ref) => {
|
|
21
21
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
22
|
-
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired },
|
|
22
|
+
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
23
23
|
label,
|
|
24
24
|
hint && React.createElement(Hint, { fixed: hintOptions.isFixed, spacingLeft: true, hint: hint }))),
|
|
25
|
-
helper && React.createElement(Control.Helper, { hasError: !!(errors === null || errors === void 0 ? void 0 : errors.length) }, helper),
|
|
26
25
|
React.createElement(Control.Content, null,
|
|
27
26
|
React.createElement(Control.Element, null,
|
|
28
27
|
React.createElement(Control.Textarea, { id: id, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, readOnly: readOnly, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyPress: onKeyPress, ref: ref }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { cssControls, cssControlsError } from './css_classes.js';
|
|
3
3
|
import { ControlContext } from './context.js';
|
|
4
|
-
import Input from './components/input.js';
|
|
5
4
|
import cssStyles from '../../css/controls/main.module.less.js';
|
|
5
|
+
import Input from './components/input.js';
|
|
6
6
|
import { AdditionalInfo } from './components/additional_info.js';
|
|
7
7
|
import Checkbox from './components/checkbox.js';
|
|
8
8
|
import CheckboxSwitch from './components/checkbox_switch.js';
|
|
@@ -10,7 +10,6 @@ import Content from './components/content.js';
|
|
|
10
10
|
import ControlLabel from './components/label.js';
|
|
11
11
|
import Element from './components/element.js';
|
|
12
12
|
import Errors from './components/errors.js';
|
|
13
|
-
import Helper from './components/helper.js';
|
|
14
13
|
import Radio from './components/radio.js';
|
|
15
14
|
import Textarea from './components/textarea.js';
|
|
16
15
|
|
|
@@ -27,8 +26,7 @@ Control.Content = Content;
|
|
|
27
26
|
Control.Element = Element;
|
|
28
27
|
Control.Textarea = Textarea;
|
|
29
28
|
Control.Errors = Errors;
|
|
30
|
-
Control.AdditionalInfo = AdditionalInfo;
|
|
31
|
-
Control.Helper = Helper;
|
|
29
|
+
Control.AdditionalInfo = AdditionalInfo;
|
|
32
30
|
|
|
33
31
|
export default Control;
|
|
34
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -22,7 +22,6 @@ export interface IControlComposition {
|
|
|
22
22
|
Textarea: React.FC<ITextareaProps>;
|
|
23
23
|
Errors: React.FC;
|
|
24
24
|
AdditionalInfo: React.FC;
|
|
25
|
-
Helper: React.FC<IControlHelperProps>;
|
|
26
25
|
}
|
|
27
26
|
export interface IControlProps {
|
|
28
27
|
children: ReactNode;
|
|
@@ -54,6 +53,7 @@ export interface IControlTagsSelectorProps extends IControlCommonProps {
|
|
|
54
53
|
id?: string;
|
|
55
54
|
name?: string;
|
|
56
55
|
label?: string;
|
|
56
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
57
57
|
isRequired?: boolean;
|
|
58
58
|
placeholder?: string;
|
|
59
59
|
minTagLength?: number;
|
|
@@ -92,6 +92,7 @@ export interface IControlLabelProps {
|
|
|
92
92
|
id?: string;
|
|
93
93
|
isRequired?: boolean;
|
|
94
94
|
children: any;
|
|
95
|
+
additionalInfo?: string | ReactNode;
|
|
95
96
|
}
|
|
96
97
|
export interface ICheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
97
98
|
id?: string;
|
|
@@ -103,14 +104,11 @@ export interface IControlInputProps extends IInputProps, IControlCommonProps {
|
|
|
103
104
|
postfix?: string;
|
|
104
105
|
label?: string;
|
|
105
106
|
isRequired?: boolean;
|
|
106
|
-
|
|
107
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
107
108
|
}
|
|
108
109
|
export interface IControlCheckboxProps extends ICheckboxProps, IControlCommonProps {
|
|
109
110
|
label: string;
|
|
110
|
-
|
|
111
|
-
hintTopOptions?: TControlHintOptions;
|
|
112
|
-
labelTop?: string;
|
|
113
|
-
hintTop?: string;
|
|
111
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
114
112
|
}
|
|
115
113
|
export interface IRadioProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
116
114
|
id: string;
|
|
@@ -118,6 +116,7 @@ export interface IRadioProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
118
116
|
}
|
|
119
117
|
export interface IControlRadioProps extends IRadioProps, IControlCommonProps {
|
|
120
118
|
label: string;
|
|
119
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
121
120
|
}
|
|
122
121
|
export interface IControlRadioGroupOption {
|
|
123
122
|
value: string;
|
|
@@ -133,6 +132,7 @@ export interface IControlRadioGroup extends IControlCommonProps {
|
|
|
133
132
|
id: string;
|
|
134
133
|
name: string;
|
|
135
134
|
label: string;
|
|
135
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
136
136
|
}
|
|
137
137
|
export interface IControlColorPickerProps extends IColorPickerProps, IControlCommonProps {
|
|
138
138
|
id: string;
|
|
@@ -140,33 +140,37 @@ export interface IControlColorPickerProps extends IColorPickerProps, IControlCom
|
|
|
140
140
|
label?: string;
|
|
141
141
|
isRequired?: boolean;
|
|
142
142
|
hideChooseCancelButtons?: boolean;
|
|
143
|
-
|
|
143
|
+
labelAdditionalInfo?: string | React.ReactNode;
|
|
144
144
|
}
|
|
145
145
|
export interface IControlTextareaProps extends ITextareaProps, IControlCommonProps {
|
|
146
146
|
label?: string;
|
|
147
147
|
isRequired?: boolean;
|
|
148
|
-
|
|
148
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
149
149
|
}
|
|
150
150
|
export interface IControlSelectProps extends ISelectProps, IControlCommonProps {
|
|
151
151
|
id?: string;
|
|
152
152
|
label?: string;
|
|
153
153
|
isRequired?: boolean;
|
|
154
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
154
155
|
}
|
|
155
156
|
export interface IControlMultiSelectProps extends IMultiSelectProps, IControlCommonProps {
|
|
156
157
|
id?: string;
|
|
157
158
|
label?: string;
|
|
158
159
|
isRequired?: boolean;
|
|
160
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
159
161
|
}
|
|
160
162
|
export interface IControlRange extends IRange, IControlCommonProps {
|
|
161
163
|
id?: string;
|
|
162
164
|
label?: string;
|
|
163
165
|
isRequired?: boolean;
|
|
164
166
|
name?: string;
|
|
167
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
165
168
|
}
|
|
166
169
|
export interface IControlFilePicker extends IFilePicker, IControlCommonProps {
|
|
167
170
|
label?: string;
|
|
168
171
|
isRequired?: boolean;
|
|
169
172
|
name?: string;
|
|
173
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
170
174
|
}
|
|
171
175
|
export interface ICellSelector {
|
|
172
176
|
rows?: number;
|
|
@@ -181,8 +185,6 @@ export interface IControlCellSelector extends ICellSelector, IControlCommonProps
|
|
|
181
185
|
label?: string;
|
|
182
186
|
id?: string;
|
|
183
187
|
isRequired?: boolean;
|
|
184
|
-
|
|
185
|
-
export interface IControlHelperProps {
|
|
186
|
-
hasError?: boolean;
|
|
188
|
+
labelAdditionalInfo?: string | ReactNode;
|
|
187
189
|
}
|
|
188
190
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { TControlErrors } from "../controls/types";
|
|
3
3
|
export interface IMonthYear {
|
|
4
4
|
month: number;
|
|
@@ -70,6 +70,7 @@ export interface IDatepickerProps {
|
|
|
70
70
|
showButtons?: boolean;
|
|
71
71
|
hint?: string;
|
|
72
72
|
errors?: TControlErrors;
|
|
73
|
+
labelAdditionalInfo?: string | React.ReactNode;
|
|
73
74
|
}
|
|
74
75
|
export interface IDatepickerLabelProps {
|
|
75
76
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/date_picker/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/date_picker/types.ts"],"names":[],"mappings":"AAAA,OAAgD,OAAO,CAAC;AACxD,OAA+B,kCAAkC,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import cssClasses from '../../css/heading/main.module.less.js';
|
|
4
|
+
import { Typography } from '../typography/index.js';
|
|
4
5
|
|
|
5
6
|
const Heading = ({ as = 'h1', isSubheading, withHeadline, children }) => {
|
|
6
|
-
const classes = classnames(
|
|
7
|
+
const classes = classnames(withHeadline && cssClasses.head_line);
|
|
7
8
|
if (!isSubheading) {
|
|
8
|
-
return React.createElement(
|
|
9
|
-
className: classes
|
|
10
|
-
}, children);
|
|
9
|
+
return (React.createElement(Typography, { as: as, cssClasses: classes }, children));
|
|
11
10
|
}
|
|
12
|
-
return React.createElement("span",
|
|
11
|
+
return (React.createElement(Typography, { as: "span", variant: as }, children));
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
export default Heading;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const cssLabel = 'label';
|
|
2
2
|
const cssLabelRequired = `${cssLabel}_required`;
|
|
3
|
-
const cssLabelError = `${cssLabel}_error`;
|
|
3
|
+
const cssLabelError = `${cssLabel}_error`;
|
|
4
|
+
const cssLabelAdditionalInfo = `${cssLabel}__additional-info`;
|
|
4
5
|
|
|
5
|
-
export { cssLabel, cssLabelError, cssLabelRequired };
|
|
6
|
+
export { cssLabel, cssLabelAdditionalInfo, cssLabelError, cssLabelRequired };
|
|
6
7
|
//# sourceMappingURL=css_classes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -2,15 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { useControlContext } from '../controls/context.js';
|
|
4
4
|
import cssClasses from '../../css/label/main.module.less.js';
|
|
5
|
-
import { cssLabel, cssLabelRequired, cssLabelError } from './css_classes.js';
|
|
5
|
+
import { cssLabel, cssLabelRequired, cssLabelError, cssLabelAdditionalInfo } from './css_classes.js';
|
|
6
|
+
import Stack from '../stack/index.js';
|
|
6
7
|
|
|
7
|
-
const Label = ({ isRequired = false, children, ...props }) => {
|
|
8
|
+
const Label = ({ isRequired = false, children, additionalInfo, ...props }) => {
|
|
8
9
|
const { errors } = useControlContext();
|
|
9
10
|
const labelClasses = classnames(cssClasses[cssLabel], {
|
|
10
11
|
[cssClasses[cssLabelRequired]]: isRequired,
|
|
11
12
|
[cssClasses[cssLabelError]]: errors
|
|
12
13
|
});
|
|
13
|
-
return (React.createElement("label", { className: labelClasses, ...props },
|
|
14
|
+
return (React.createElement("label", { className: labelClasses, ...props },
|
|
15
|
+
React.createElement(Stack, { align: "center" }, children),
|
|
16
|
+
additionalInfo && React.createElement("span", { className: cssClasses[cssLabelAdditionalInfo] }, additionalInfo)));
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
export default Label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/label/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/label/types.ts"],"names":[],"mappings":"AAAA,OAA+C,OAAO,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { STACK_DIRECTIONS, STACK_JUSTIFICATIONS, STACK_ALIGNMENTS, STACK_WRAP, STACK_DIRECTIONS_TO_CSS_CLASSES_MAP, STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP, STACK_WRAP_TO_CSS_CLASSES_MAP } from './stack_constants.js';
|
|
3
|
+
import { STACK_DIRECTIONS, STACK_JUSTIFICATIONS, STACK_ALIGNMENTS, STACK_WRAP, STACK_DIRECTIONS_TO_CSS_CLASSES_MAP, STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP, STACK_WRAP_TO_CSS_CLASSES_MAP, STACK_CSS_CLASSES } from './stack_constants.js';
|
|
4
4
|
import cssClasses from '../../css/stack/main.module.less.js';
|
|
5
5
|
import { cssStack } from './css_classes.js';
|
|
6
6
|
|
|
7
|
-
const Stack = ({ children, spacing = 0, className = '', direction = STACK_DIRECTIONS.row, justify = STACK_JUSTIFICATIONS.flexStart, align = STACK_ALIGNMENTS.normal, wrap = STACK_WRAP.nowrap, as = 'div' }) => {
|
|
8
|
-
const stackClass = classnames(cssClasses[cssStack], cssClasses[STACK_DIRECTIONS_TO_CSS_CLASSES_MAP[direction]], cssClasses[STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP[align]], cssClasses[STACK_JUSTIFICATIONS[justify]], cssClasses[STACK_WRAP_TO_CSS_CLASSES_MAP[wrap]], className);
|
|
7
|
+
const Stack = ({ children, spacing = 0, className = '', direction = STACK_DIRECTIONS.row, justify = STACK_JUSTIFICATIONS.flexStart, align = STACK_ALIGNMENTS.normal, wrap = STACK_WRAP.nowrap, as = 'div', inline = false }) => {
|
|
8
|
+
const stackClass = classnames(cssClasses[cssStack], cssClasses[STACK_DIRECTIONS_TO_CSS_CLASSES_MAP[direction]], cssClasses[STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP[align]], cssClasses[STACK_JUSTIFICATIONS[justify]], cssClasses[STACK_WRAP_TO_CSS_CLASSES_MAP[wrap]], STACK_CSS_CLASSES.inline ? cssClasses[STACK_CSS_CLASSES.inline] : '', className);
|
|
9
9
|
return React.createElement(as, {
|
|
10
|
-
className: `${stackClass}
|
|
10
|
+
className: `${stackClass}`,
|
|
11
11
|
style: { gap: `${spacing}px` }
|
|
12
12
|
}, children);
|
|
13
13
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const stackCssBaseClass = "stack";
|
|
1
2
|
export declare const STACK_DIRECTIONS: {
|
|
2
3
|
readonly row: "row";
|
|
3
4
|
readonly column: "column";
|
|
@@ -35,7 +36,10 @@ export declare const STACK_WRAP: {
|
|
|
35
36
|
initial: string;
|
|
36
37
|
inherit: string;
|
|
37
38
|
};
|
|
38
|
-
export declare const
|
|
39
|
+
export declare const STACK_CSS_CLASSES: {
|
|
40
|
+
readonly stack: "stack";
|
|
41
|
+
readonly inline: "stack_inline";
|
|
42
|
+
};
|
|
39
43
|
export declare const STACK_DIRECTIONS_TO_CSS_CLASSES_MAP: {
|
|
40
44
|
readonly row: "stack_direction_row";
|
|
41
45
|
readonly column: "stack_direction_column";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const stackCssBaseClass = 'stack';
|
|
1
2
|
const STACK_DIRECTIONS = {
|
|
2
3
|
row: 'row',
|
|
3
4
|
column: 'column',
|
|
@@ -35,7 +36,10 @@ const STACK_WRAP = {
|
|
|
35
36
|
initial: 'initial',
|
|
36
37
|
inherit: 'inherit'
|
|
37
38
|
};
|
|
38
|
-
const
|
|
39
|
+
const STACK_CSS_CLASSES = {
|
|
40
|
+
stack: stackCssBaseClass,
|
|
41
|
+
inline: `${stackCssBaseClass}_inline`
|
|
42
|
+
};
|
|
39
43
|
const STACK_DIRECTIONS_TO_CSS_CLASSES_MAP = {
|
|
40
44
|
[STACK_DIRECTIONS.row]: `${stackCssBaseClass}_direction_row`,
|
|
41
45
|
[STACK_DIRECTIONS.column]: `${stackCssBaseClass}_direction_column`,
|
|
@@ -60,5 +64,5 @@ const STACK_WRAP_TO_CSS_CLASSES_MAP = {
|
|
|
60
64
|
[STACK_WRAP.wrapReverse]: `${stackCssBaseClass}_wrap_wrap-reverse`
|
|
61
65
|
};
|
|
62
66
|
|
|
63
|
-
export { STACK_ALIGNMENTS, STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP, STACK_DIRECTIONS, STACK_DIRECTIONS_TO_CSS_CLASSES_MAP, STACK_JUSTIFICATIONS, STACK_WRAP, STACK_WRAP_TO_CSS_CLASSES_MAP, stackCssBaseClass };
|
|
67
|
+
export { STACK_ALIGNMENTS, STACK_ALIGNMENTS_TO_CSS_CLASSES_MAP, STACK_CSS_CLASSES, STACK_DIRECTIONS, STACK_DIRECTIONS_TO_CSS_CLASSES_MAP, STACK_JUSTIFICATIONS, STACK_WRAP, STACK_WRAP_TO_CSS_CLASSES_MAP, stackCssBaseClass };
|
|
64
68
|
//# sourceMappingURL=stack_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -10,6 +10,7 @@ export declare type TStackProps = {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
as?: string;
|
|
13
|
+
inline?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare type TStackJustify = Any.Keys<typeof STACK_JUSTIFICATIONS_TO_CSS_CLASSES_MAP>;
|
|
15
16
|
export declare type TStackDirection = Any.Keys<typeof STACK_DIRECTIONS>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { TYPOGRAPHY_CSS_CLASSES, TYPOGRAPHY_COMPONENTS_TYPES_TO_CSS_CLASSES_MAP, TYPOGRAPHY_TRANSFORM_TO_CSS_CLASSES_MAP, TYPOGRAPHY_WEIGHT_TO_CSS_CLASSES_MAP } from './typography_constants.js';
|
|
4
|
+
import typographyCssClasses from '../../css/typography/main.module.less.js';
|
|
5
|
+
|
|
6
|
+
const Typography = ({ as = 'p', children, variant = 'h1', weight, transform, cssClasses }) => {
|
|
7
|
+
const typographyClasses = classnames(typographyCssClasses[TYPOGRAPHY_CSS_CLASSES.typography], as ? typographyCssClasses[TYPOGRAPHY_COMPONENTS_TYPES_TO_CSS_CLASSES_MAP[as]] : '', variant ? typographyCssClasses[TYPOGRAPHY_COMPONENTS_TYPES_TO_CSS_CLASSES_MAP[variant]] : '', transform ? typographyCssClasses[TYPOGRAPHY_TRANSFORM_TO_CSS_CLASSES_MAP[transform]] : '', weight ? typographyCssClasses[TYPOGRAPHY_WEIGHT_TO_CSS_CLASSES_MAP[weight]] : '', cssClasses);
|
|
8
|
+
return React.createElement(as, {
|
|
9
|
+
className: typographyClasses
|
|
10
|
+
}, children);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default Typography;
|
|
14
|
+
export { Typography };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const TYPOGRAPHY_COMPONENTS_TYPES: {
|
|
2
|
+
readonly h1: "h1";
|
|
3
|
+
readonly h2: "h2";
|
|
4
|
+
readonly h3: "h3";
|
|
5
|
+
readonly h4: "h4";
|
|
6
|
+
readonly h5: "h5";
|
|
7
|
+
readonly h6: "h6";
|
|
8
|
+
readonly p: "p";
|
|
9
|
+
readonly span: "span";
|
|
10
|
+
readonly div: "div";
|
|
11
|
+
};
|
|
12
|
+
export declare const TYPOGRAPHY_TRANSFORM: {
|
|
13
|
+
readonly uppercase: "uppercase";
|
|
14
|
+
readonly lowercase: "lowercase";
|
|
15
|
+
readonly capitalize: "capitalize";
|
|
16
|
+
};
|
|
17
|
+
export declare const TYPOGRAPHY_WEIGHT: {
|
|
18
|
+
readonly normal: "normal";
|
|
19
|
+
readonly bold: "bold";
|
|
20
|
+
readonly semibold: "semibold";
|
|
21
|
+
};
|
|
22
|
+
export declare const TYPOGRAPHY_CSS_CLASSES: {
|
|
23
|
+
readonly typography: "typography";
|
|
24
|
+
};
|
|
25
|
+
export declare const TYPOGRAPHY_COMPONENTS_TYPES_TO_CSS_CLASSES_MAP: {
|
|
26
|
+
readonly h1: "typography_h1";
|
|
27
|
+
readonly h2: "typography_h2";
|
|
28
|
+
readonly h3: "typography_h3";
|
|
29
|
+
readonly h4: "typography_h4";
|
|
30
|
+
readonly h5: "typography_h5";
|
|
31
|
+
readonly h6: "typography_h6";
|
|
32
|
+
readonly p: "typography_p";
|
|
33
|
+
readonly span: "typography_span";
|
|
34
|
+
};
|
|
35
|
+
export declare const TYPOGRAPHY_TRANSFORM_TO_CSS_CLASSES_MAP: {
|
|
36
|
+
readonly uppercase: "typography_uppercase";
|
|
37
|
+
readonly lowercase: "typography_lowercase";
|
|
38
|
+
readonly capitalize: "typography_capitalize";
|
|
39
|
+
};
|
|
40
|
+
export declare const TYPOGRAPHY_WEIGHT_TO_CSS_CLASSES_MAP: {
|
|
41
|
+
readonly normal: "typography_normal";
|
|
42
|
+
readonly bold: "typography_bold";
|
|
43
|
+
readonly semibold: "typography_semibold";
|
|
44
|
+
};
|