@mirai/ui 2.0.42 → 2.1.1
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/components/Action/Action.js +24 -30
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.stories.js +3 -6
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/index.js +1 -1
- package/build/components/Action/index.js.map +1 -1
- package/build/components/Button/Button.js +32 -39
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/Button.stories.js +25 -48
- package/build/components/Button/Button.stories.js.map +1 -1
- package/build/components/Button/index.js +1 -1
- package/build/components/Button/index.js.map +1 -1
- package/build/components/Calendar/Calendar.Month.js +45 -57
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +54 -83
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +15 -15
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.constants.js +2 -4
- package/build/components/Calendar/Calendar.constants.js.map +1 -1
- package/build/components/Calendar/Calendar.js +110 -162
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/Calendar.stories.js +75 -90
- package/build/components/Calendar/Calendar.stories.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfMonth.js +2 -2
- package/build/components/Calendar/helpers/getFirstDateOfMonth.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfWeek.js +6 -6
- package/build/components/Calendar/helpers/getFirstDateOfWeek.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDayOfWeek.js +5 -5
- package/build/components/Calendar/helpers/getFirstDayOfWeek.js.map +1 -1
- package/build/components/Calendar/helpers/getHeader.js +6 -6
- package/build/components/Calendar/helpers/getHeader.js.map +1 -1
- package/build/components/Calendar/helpers/getMonthRef.js +9 -8
- package/build/components/Calendar/helpers/getMonthRef.js.map +1 -1
- package/build/components/Calendar/helpers/getScrollTo.js +8 -15
- package/build/components/Calendar/helpers/getScrollTo.js.map +1 -1
- package/build/components/Calendar/helpers/getToday.js +1 -3
- package/build/components/Calendar/helpers/getToday.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekDays.js +8 -8
- package/build/components/Calendar/helpers/getWeekDays.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekNumber.js +3 -3
- package/build/components/Calendar/helpers/getWeekNumber.js.map +1 -1
- package/build/components/Calendar/helpers/index.js +9 -9
- package/build/components/Calendar/helpers/index.js.map +1 -1
- package/build/components/Calendar/index.js +1 -1
- package/build/components/Calendar/index.js.map +1 -1
- package/build/components/Form/Form.constants.js +5 -10
- package/build/components/Form/Form.constants.js.map +1 -1
- package/build/components/Form/Form.js +86 -118
- package/build/components/Form/Form.js.map +1 -1
- package/build/components/Form/Form.stories.js +47 -83
- package/build/components/Form/Form.stories.js.map +1 -1
- package/build/components/Form/helpers/getChildrenErrors.js +18 -22
- package/build/components/Form/helpers/getChildrenErrors.js.map +1 -1
- package/build/components/Form/helpers/getChildrenValues.js +15 -22
- package/build/components/Form/helpers/getChildrenValues.js.map +1 -1
- package/build/components/Form/helpers/getField.js +5 -4
- package/build/components/Form/helpers/getField.js.map +1 -1
- package/build/components/Form/helpers/groupState.js +8 -10
- package/build/components/Form/helpers/groupState.js.map +1 -1
- package/build/components/Form/helpers/index.js +4 -4
- package/build/components/Form/helpers/index.js.map +1 -1
- package/build/components/Form/index.js +1 -1
- package/build/components/Form/index.js.map +1 -1
- package/build/components/InputDate/InputDate.js +23 -38
- package/build/components/InputDate/InputDate.js.map +1 -1
- package/build/components/InputDate/InputDate.stories.js +18 -34
- package/build/components/InputDate/InputDate.stories.js.map +1 -1
- package/build/components/InputDate/helpers/formatValue.js +11 -13
- package/build/components/InputDate/helpers/formatValue.js.map +1 -1
- package/build/components/InputDate/helpers/index.js +1 -1
- package/build/components/InputDate/helpers/index.js.map +1 -1
- package/build/components/InputDate/index.js +1 -1
- package/build/components/InputDate/index.js.map +1 -1
- package/build/components/InputNumber/InputNumber.js +31 -44
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/InputNumber.stories.js +8 -20
- package/build/components/InputNumber/InputNumber.stories.js.map +1 -1
- package/build/components/InputNumber/index.js +1 -1
- package/build/components/InputNumber/index.js.map +1 -1
- package/build/components/InputOption/InputOption.constants.js +3 -6
- package/build/components/InputOption/InputOption.constants.js.map +1 -1
- package/build/components/InputOption/InputOption.js +34 -38
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/InputOption.stories.js +8 -20
- package/build/components/InputOption/InputOption.stories.js.map +1 -1
- package/build/components/InputOption/index.js +2 -2
- package/build/components/InputOption/index.js.map +1 -1
- package/build/components/InputPhone/InputPhone.js +99 -143
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/InputPhone.stories.js +22 -45
- package/build/components/InputPhone/InputPhone.stories.js.map +1 -1
- package/build/components/InputPhone/helpers/index.js +2 -2
- package/build/components/InputPhone/helpers/index.js.map +1 -1
- package/build/components/InputPhone/helpers/parseValue.js +8 -17
- package/build/components/InputPhone/helpers/parseValue.js.map +1 -1
- package/build/components/InputPhone/helpers/sanitizePrefixes.js +4 -12
- package/build/components/InputPhone/helpers/sanitizePrefixes.js.map +1 -1
- package/build/components/InputPhone/index.js +1 -1
- package/build/components/InputPhone/index.js.map +1 -1
- package/build/components/InputSelect/InputSelect.js +47 -70
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/InputSelect.stories.js +12 -26
- package/build/components/InputSelect/InputSelect.stories.js.map +1 -1
- package/build/components/InputSelect/index.js +1 -1
- package/build/components/InputSelect/index.js.map +1 -1
- package/build/components/InputSelect/partials/InputSelect.Expand.js +3 -3
- package/build/components/InputSelect/partials/InputSelect.Expand.js.map +1 -1
- package/build/components/InputSelect/partials/index.js +1 -1
- package/build/components/InputSelect/partials/index.js.map +1 -1
- package/build/components/InputText/InputText.js +54 -87
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.stories.js +17 -36
- package/build/components/InputText/InputText.stories.js.map +1 -1
- package/build/components/InputText/index.js +1 -1
- package/build/components/InputText/index.js.map +1 -1
- package/build/components/InputText/partials/InputText.Hint.js +8 -9
- package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
- package/build/components/InputText/partials/InputText.IconState.js +10 -8
- package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +13 -15
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/InputText/partials/index.js +3 -3
- package/build/components/InputText/partials/index.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +14 -15
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +30 -41
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/Menu.stories.js +9 -23
- package/build/components/Menu/Menu.stories.js.map +1 -1
- package/build/components/Menu/index.js +1 -1
- package/build/components/Menu/index.js.map +1 -1
- package/build/components/Modal/Modal.constants.js +2 -4
- package/build/components/Modal/Modal.constants.js.map +1 -1
- package/build/components/Modal/Modal.js +70 -103
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/Modal.stories.js +15 -36
- package/build/components/Modal/Modal.stories.js.map +1 -1
- package/build/components/Modal/index.js +2 -2
- package/build/components/Modal/index.js.map +1 -1
- package/build/components/Notification/Notification.js +24 -26
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.stories.js +14 -17
- package/build/components/Notification/Notification.stories.js.map +1 -1
- package/build/components/Notification/index.js +1 -1
- package/build/components/Notification/index.js.map +1 -1
- package/build/components/Progress/Progress.js +11 -15
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/Progress.stories.js +4 -7
- package/build/components/Progress/Progress.stories.js.map +1 -1
- package/build/components/Progress/index.js +1 -1
- package/build/components/Progress/index.js.map +1 -1
- package/build/components/Slider/Slider.Item.js +17 -25
- package/build/components/Slider/Slider.Item.js.map +1 -1
- package/build/components/Slider/Slider.constants.js +2 -4
- package/build/components/Slider/Slider.constants.js.map +1 -1
- package/build/components/Slider/Slider.js +78 -130
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/Slider.stories.js +25 -30
- package/build/components/Slider/Slider.stories.js.map +1 -1
- package/build/components/Slider/index.js +1 -1
- package/build/components/Slider/index.js.map +1 -1
- package/build/components/Table/Table.ColumnFilter.js +77 -116
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.Filter.js +31 -41
- package/build/components/Table/Table.Filter.js.map +1 -1
- package/build/components/Table/Table.Row.js +48 -65
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.constants.js +4 -7
- package/build/components/Table/Table.constants.js.map +1 -1
- package/build/components/Table/Table.js +96 -125
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.stories.js +38 -70
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/helpers/index.js +2 -2
- package/build/components/Table/helpers/index.js.map +1 -1
- package/build/components/Table/helpers/select.js +54 -68
- package/build/components/Table/helpers/select.js.map +1 -1
- package/build/components/Table/helpers/storage.js +5 -6
- package/build/components/Table/helpers/storage.js.map +1 -1
- package/build/components/Table/index.js +1 -1
- package/build/components/Table/index.js.map +1 -1
- package/build/components/Tooltip/Tooltip.js +63 -84
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/Tooltip.stories.js +87 -100
- package/build/components/Tooltip/Tooltip.stories.js.map +1 -1
- package/build/components/Tooltip/helpers/index.js +1 -1
- package/build/components/Tooltip/helpers/index.js.map +1 -1
- package/build/components/Tooltip/helpers/isPressableInstance.js +6 -5
- package/build/components/Tooltip/helpers/isPressableInstance.js.map +1 -1
- package/build/components/Tooltip/index.js +1 -1
- package/build/components/Tooltip/index.js.map +1 -1
- package/build/components/components.customElements.js.map +1 -1
- package/build/components/index.js +17 -17
- package/build/components/index.js.map +1 -1
- package/build/helpers/CustomElement.js +9 -29
- package/build/helpers/CustomElement.js.map +1 -1
- package/build/helpers/getIconState.js +6 -5
- package/build/helpers/getIconState.js.map +1 -1
- package/build/helpers/getInputDateErrors.js +10 -10
- package/build/helpers/getInputDateErrors.js.map +1 -1
- package/build/helpers/getInputErrors.js +25 -28
- package/build/helpers/getInputErrors.js.map +1 -1
- package/build/helpers/getInputPhoneErrors.js +11 -13
- package/build/helpers/getInputPhoneErrors.js.map +1 -1
- package/build/helpers/getNavigator.js +10 -10
- package/build/helpers/getNavigator.js.map +1 -1
- package/build/helpers/index.js +9 -9
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/isJest.js +4 -6
- package/build/helpers/isJest.js.map +1 -1
- package/build/helpers/isPlaywright.js +3 -4
- package/build/helpers/isPlaywright.js.map +1 -1
- package/build/helpers/isValidDate.js +21 -38
- package/build/helpers/isValidDate.js.map +1 -1
- package/build/helpers/isValidEmail.js +3 -3
- package/build/helpers/isValidEmail.js.map +1 -1
- package/build/helpers/isValidPhone.js +9 -8
- package/build/helpers/isValidPhone.js.map +1 -1
- package/build/helpers/styles.js +3 -7
- package/build/helpers/styles.js.map +1 -1
- package/build/hooks/helpers/getResolution.js +7 -8
- package/build/hooks/helpers/getResolution.js.map +1 -1
- package/build/hooks/helpers/index.js +2 -2
- package/build/hooks/helpers/index.js.map +1 -1
- package/build/hooks/helpers/sanitizePx.js +1 -3
- package/build/hooks/helpers/sanitizePx.js.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useDevice.js +21 -39
- package/build/hooks/useDevice.js.map +1 -1
- package/build/hooks/useDevice.stories.js +7 -16
- package/build/hooks/useDevice.stories.js.map +1 -1
- package/build/index.js +5 -5
- package/build/index.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.js +18 -18
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.stories.js +8 -20
- package/build/primitives/Checkbox/Checkbox.stories.js.map +1 -1
- package/build/primitives/Checkbox/index.js +1 -1
- package/build/primitives/Checkbox/index.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js +1 -2
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/Icon.js +34 -41
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/Icon.stories.js +8 -10
- package/build/primitives/Icon/Icon.stories.js.map +1 -1
- package/build/primitives/Icon/index.js +2 -2
- package/build/primitives/Icon/index.js.map +1 -1
- package/build/primitives/Input/Input.js +49 -63
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Input/Input.stories.js +14 -29
- package/build/primitives/Input/Input.stories.js.map +1 -1
- package/build/primitives/Input/helpers/index.js +1 -1
- package/build/primitives/Input/helpers/index.js.map +1 -1
- package/build/primitives/Input/helpers/parseValue.js +5 -5
- package/build/primitives/Input/helpers/parseValue.js.map +1 -1
- package/build/primitives/Input/index.js +1 -1
- package/build/primitives/Input/index.js.map +1 -1
- package/build/primitives/Layer/Layer.js +79 -93
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/Layer.stories.js +10 -13
- package/build/primitives/Layer/Layer.stories.js.map +1 -1
- package/build/primitives/Layer/LayerContent.js +5 -3
- package/build/primitives/Layer/LayerContent.js.map +1 -1
- package/build/primitives/Layer/helpers/getElementLayout.js +18 -15
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js +66 -69
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/build/primitives/Layer/helpers/getModalParent.js +10 -9
- package/build/primitives/Layer/helpers/getModalParent.js.map +1 -1
- package/build/primitives/Layer/helpers/getScrollParent.js +4 -3
- package/build/primitives/Layer/helpers/getScrollParent.js.map +1 -1
- package/build/primitives/Layer/helpers/index.js +5 -5
- package/build/primitives/Layer/helpers/index.js.map +1 -1
- package/build/primitives/Layer/helpers/isComponentFixed.js +8 -19
- package/build/primitives/Layer/helpers/isComponentFixed.js.map +1 -1
- package/build/primitives/Layer/index.js +2 -2
- package/build/primitives/Layer/index.js.map +1 -1
- package/build/primitives/Pressable/Pressable.constants.js +1 -2
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js +34 -44
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/Pressable.stories.js +5 -8
- package/build/primitives/Pressable/Pressable.stories.js.map +1 -1
- package/build/primitives/Pressable/index.js +1 -1
- package/build/primitives/Pressable/index.js.map +1 -1
- package/build/primitives/Primitive/Primitive.constants.js +4 -8
- package/build/primitives/Primitive/Primitive.constants.js.map +1 -1
- package/build/primitives/Primitive/Primitive.js +20 -28
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/Primitive.stories.js +7 -10
- package/build/primitives/Primitive/Primitive.stories.js.map +1 -1
- package/build/primitives/Primitive/helpers/getProps.js +8 -17
- package/build/primitives/Primitive/helpers/getProps.js.map +1 -1
- package/build/primitives/Primitive/helpers/getTag.js +4 -4
- package/build/primitives/Primitive/helpers/getTag.js.map +1 -1
- package/build/primitives/Primitive/helpers/index.js +2 -2
- package/build/primitives/Primitive/helpers/index.js.map +1 -1
- package/build/primitives/Primitive/index.js +1 -1
- package/build/primitives/Primitive/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +11 -15
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/Radio.stories.js +8 -20
- package/build/primitives/Radio/Radio.stories.js.map +1 -1
- package/build/primitives/Radio/index.js +1 -1
- package/build/primitives/Radio/index.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.js +73 -96
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.stories.js +12 -17
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/index.js +1 -1
- package/build/primitives/ScrollView/index.js.map +1 -1
- package/build/primitives/Select/Select.js +44 -54
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Select/Select.stories.js +14 -29
- package/build/primitives/Select/Select.stories.js.map +1 -1
- package/build/primitives/Select/index.js +1 -1
- package/build/primitives/Select/index.js.map +1 -1
- package/build/primitives/Switch/Switch.js +14 -16
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/Switch.stories.js +8 -20
- package/build/primitives/Switch/Switch.stories.js.map +1 -1
- package/build/primitives/Switch/index.js +1 -1
- package/build/primitives/Switch/index.js.map +1 -1
- package/build/primitives/Text/Text.js +43 -55
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.stories.js +8 -10
- package/build/primitives/Text/Text.stories.js.map +1 -1
- package/build/primitives/Text/helpers/color.js +13 -12
- package/build/primitives/Text/helpers/color.js.map +1 -1
- package/build/primitives/Text/helpers/index.js +2 -2
- package/build/primitives/Text/helpers/index.js.map +1 -1
- package/build/primitives/Text/helpers/parseMarkdown.js +41 -54
- package/build/primitives/Text/helpers/parseMarkdown.js.map +1 -1
- package/build/primitives/Text/index.js +1 -1
- package/build/primitives/Text/index.js.map +1 -1
- package/build/primitives/View/View.js +16 -25
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/View.stories.js +7 -10
- package/build/primitives/View/View.stories.js.map +1 -1
- package/build/primitives/View/index.js +1 -1
- package/build/primitives/View/index.js.map +1 -1
- package/build/primitives/index.js +12 -12
- package/build/primitives/index.js.map +1 -1
- package/build/primitives/primitives.customElements.js.map +1 -1
- package/build/theme/default.theme.css +4 -4
- package/build/theme/helpers/camelcase.js +3 -5
- package/build/theme/helpers/camelcase.js.map +1 -1
- package/build/theme/helpers/index.js +2 -2
- package/build/theme/helpers/index.js.map +1 -1
- package/build/theme/helpers/palette.js +18 -32
- package/build/theme/helpers/palette.js.map +1 -1
- package/build/theme/index.js +2 -2
- package/build/theme/index.js.map +1 -1
- package/build/theme/theme.constants.js +16 -23
- package/build/theme/theme.constants.js.map +1 -1
- package/build/theme/theme.js +61 -81
- package/build/theme/theme.js.map +1 -1
- package/build/theme/theme.stories.js +25 -38
- package/build/theme/theme.stories.js.map +1 -1
- package/package.json +18 -15
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = exports.Story = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _Checkbox = require("./Checkbox");
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
13
|
-
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
var _default = {
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
+
var _default = exports.default = {
|
|
20
13
|
title: 'Primitives'
|
|
21
14
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
checked = _useState2[0],
|
|
27
|
-
setChecked = _useState2[1];
|
|
28
|
-
var handleChange = function handleChange(next) {
|
|
29
|
-
var _console;
|
|
15
|
+
const Story = props => {
|
|
16
|
+
const [checked, setChecked] = (0, _react.useState)(true);
|
|
17
|
+
const handleChange = function (next) {
|
|
30
18
|
setChecked(next);
|
|
31
19
|
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
32
20
|
others[_key - 1] = arguments[_key];
|
|
33
21
|
}
|
|
34
|
-
|
|
22
|
+
console.log('<Checkbox>::onChange', next, ...others);
|
|
35
23
|
};
|
|
36
24
|
return /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, _extends({}, props, {
|
|
37
25
|
checked: checked,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.stories.js","names":["title","Story","props","
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.js","names":["_react","_interopRequireWildcard","require","_Checkbox","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_default","exports","title","Story","props","checked","setChecked","useState","handleChange","next","_len","others","Array","_key","console","log","createElement","Checkbox","onChange","storyName","args","children","disabled","name","value","testId","style","argTypes"],"sources":["../../../src/primitives/Checkbox/Checkbox.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Checkbox } from './Checkbox';\n\nexport default { title: 'Primitives' };\n\nexport const Story = (props) => {\n const [checked, setChecked] = useState(true);\n\n const handleChange = (next, ...others) => {\n setChecked(next);\n console.log('<Checkbox>::onChange', next, ...others);\n };\n\n return <Checkbox {...props} checked={checked} onChange={handleChange} />;\n};\n\nStory.storyName = 'Checkbox';\n\nStory.args = {\n children: 'children',\n disabled: false,\n name: 'checkbox',\n value: 'value',\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,S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UAAU;EAChBC,KAAK,EAAE,OAAO;EACd;EACAC,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC;AAEDvB,KAAK,CAACwB,QAAQ,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Checkbox/index.js"],"sourcesContent":["export * from './Checkbox';\n"],"mappings":";;;;;AAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Checkbox","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/primitives/Checkbox/index.js"],"sourcesContent":["export * from './Checkbox';\n"],"mappings":";;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ var _MdOutlineSearch = require("@react-icons/all-files/md/MdOutlineSearch");
|
|
|
25
25
|
var _MdOutlineVisibility = require("@react-icons/all-files/md/MdOutlineVisibility");
|
|
26
26
|
var _MdOutlineVisibilityOff = require("@react-icons/all-files/md/MdOutlineVisibilityOff");
|
|
27
27
|
var _MdOutlineWarningAmber = require("@react-icons/all-files/md/MdOutlineWarningAmber");
|
|
28
|
-
|
|
28
|
+
const ICON = exports.ICON = {
|
|
29
29
|
// <Calendar>
|
|
30
30
|
LEFT: _MdOutlineArrowBack.MdOutlineArrowBack,
|
|
31
31
|
RIGHT: _MdOutlineArrowForward.MdOutlineArrowForward,
|
|
@@ -58,5 +58,4 @@ var ICON = {
|
|
|
58
58
|
// Filetype
|
|
59
59
|
MARKDOWN: _LiaMarkdown.LiaMarkdown
|
|
60
60
|
};
|
|
61
|
-
exports.ICON = ICON;
|
|
62
61
|
//# sourceMappingURL=Icon.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.constants.js","names":["ICON","LEFT","RIGHT","UP","DOWN","CHECK","ADD","REMOVE","EXPAND_LESS","EXPAND_MORE","SEARCH","EYE_OPEN","EYE_CLOSE","CLOSE","ERROR","INFO","SUCCESS","WARNING","PHOTO_LIBRARY","REPLAY","FILTER","MARKDOWN"],"sources":["../../../src/primitives/Icon/Icon.constants.js"],"sourcesContent":["import { LiaMarkdown as MARKDOWN } from '@react-icons/all-files/lia/LiaMarkdown';\nimport { MdCheckCircleOutline as SUCCESS } from '@react-icons/all-files/md/MdCheckCircleOutline';\nimport { MdErrorOutline as ERROR } from '@react-icons/all-files/md/MdErrorOutline';\nimport { MdOutlineAdd as ADD } from '@react-icons/all-files/md/MdOutlineAdd';\nimport { MdOutlineArrowBack as LEFT } from '@react-icons/all-files/md/MdOutlineArrowBack';\nimport { MdOutlineArrowDownward as DOWN } from '@react-icons/all-files/md/MdOutlineArrowDownward';\nimport { MdOutlineArrowForward as RIGHT } from '@react-icons/all-files/md/MdOutlineArrowForward';\nimport { MdOutlineArrowUpward as UP } from '@react-icons/all-files/md/MdOutlineArrowUpward';\nimport { MdOutlineCheck as CHECK } from '@react-icons/all-files/md/MdOutlineCheck';\nimport { MdOutlineClose as CLOSE } from '@react-icons/all-files/md/MdOutlineClose';\nimport { MdOutlineExpandLess as EXPAND_LESS } from '@react-icons/all-files/md/MdOutlineExpandLess';\nimport { MdOutlineExpandMore as EXPAND_MORE } from '@react-icons/all-files/md/MdOutlineExpandMore';\nimport { MdOutlineFilterList as FILTER } from '@react-icons/all-files/md/MdOutlineFilterList';\nimport { MdOutlineInfo as INFO } from '@react-icons/all-files/md/MdOutlineInfo';\nimport { MdOutlinePhotoLibrary as PHOTO_LIBRARY } from '@react-icons/all-files/md/MdOutlinePhotoLibrary';\nimport { MdOutlineRemove as REMOVE } from '@react-icons/all-files/md/MdOutlineRemove';\nimport { MdOutlineReplay as REPLAY } from '@react-icons/all-files/md/MdOutlineReplay';\nimport { MdOutlineSearch as SEARCH } from '@react-icons/all-files/md/MdOutlineSearch';\nimport { MdOutlineVisibility as EYE_OPEN } from '@react-icons/all-files/md/MdOutlineVisibility';\nimport { MdOutlineVisibilityOff as EYE_CLOSE } from '@react-icons/all-files/md/MdOutlineVisibilityOff';\nimport { MdOutlineWarningAmber as WARNING } from '@react-icons/all-files/md/MdOutlineWarningAmber';\n\nexport const ICON = {\n // <Calendar>\n LEFT,\n RIGHT,\n UP,\n DOWN,\n // <Check>\n CHECK,\n // <InputOption>\n ADD,\n REMOVE,\n // <InputSelect>\n EXPAND_LESS,\n EXPAND_MORE,\n // <InputText>\n SEARCH,\n EYE_OPEN,\n EYE_CLOSE,\n // <Modal>\n CLOSE,\n // <Notification> & <InputText>\n ERROR,\n INFO,\n SUCCESS,\n WARNING,\n // <Slider>\n PHOTO_LIBRARY,\n REPLAY,\n // <Table>\n FILTER,\n // Filetype\n MARKDOWN,\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,
|
|
1
|
+
{"version":3,"file":"Icon.constants.js","names":["_LiaMarkdown","require","_MdCheckCircleOutline","_MdErrorOutline","_MdOutlineAdd","_MdOutlineArrowBack","_MdOutlineArrowDownward","_MdOutlineArrowForward","_MdOutlineArrowUpward","_MdOutlineCheck","_MdOutlineClose","_MdOutlineExpandLess","_MdOutlineExpandMore","_MdOutlineFilterList","_MdOutlineInfo","_MdOutlinePhotoLibrary","_MdOutlineRemove","_MdOutlineReplay","_MdOutlineSearch","_MdOutlineVisibility","_MdOutlineVisibilityOff","_MdOutlineWarningAmber","ICON","exports","LEFT","RIGHT","UP","DOWN","CHECK","ADD","REMOVE","EXPAND_LESS","EXPAND_MORE","SEARCH","EYE_OPEN","EYE_CLOSE","CLOSE","ERROR","INFO","SUCCESS","WARNING","PHOTO_LIBRARY","REPLAY","FILTER","MARKDOWN"],"sources":["../../../src/primitives/Icon/Icon.constants.js"],"sourcesContent":["import { LiaMarkdown as MARKDOWN } from '@react-icons/all-files/lia/LiaMarkdown';\nimport { MdCheckCircleOutline as SUCCESS } from '@react-icons/all-files/md/MdCheckCircleOutline';\nimport { MdErrorOutline as ERROR } from '@react-icons/all-files/md/MdErrorOutline';\nimport { MdOutlineAdd as ADD } from '@react-icons/all-files/md/MdOutlineAdd';\nimport { MdOutlineArrowBack as LEFT } from '@react-icons/all-files/md/MdOutlineArrowBack';\nimport { MdOutlineArrowDownward as DOWN } from '@react-icons/all-files/md/MdOutlineArrowDownward';\nimport { MdOutlineArrowForward as RIGHT } from '@react-icons/all-files/md/MdOutlineArrowForward';\nimport { MdOutlineArrowUpward as UP } from '@react-icons/all-files/md/MdOutlineArrowUpward';\nimport { MdOutlineCheck as CHECK } from '@react-icons/all-files/md/MdOutlineCheck';\nimport { MdOutlineClose as CLOSE } from '@react-icons/all-files/md/MdOutlineClose';\nimport { MdOutlineExpandLess as EXPAND_LESS } from '@react-icons/all-files/md/MdOutlineExpandLess';\nimport { MdOutlineExpandMore as EXPAND_MORE } from '@react-icons/all-files/md/MdOutlineExpandMore';\nimport { MdOutlineFilterList as FILTER } from '@react-icons/all-files/md/MdOutlineFilterList';\nimport { MdOutlineInfo as INFO } from '@react-icons/all-files/md/MdOutlineInfo';\nimport { MdOutlinePhotoLibrary as PHOTO_LIBRARY } from '@react-icons/all-files/md/MdOutlinePhotoLibrary';\nimport { MdOutlineRemove as REMOVE } from '@react-icons/all-files/md/MdOutlineRemove';\nimport { MdOutlineReplay as REPLAY } from '@react-icons/all-files/md/MdOutlineReplay';\nimport { MdOutlineSearch as SEARCH } from '@react-icons/all-files/md/MdOutlineSearch';\nimport { MdOutlineVisibility as EYE_OPEN } from '@react-icons/all-files/md/MdOutlineVisibility';\nimport { MdOutlineVisibilityOff as EYE_CLOSE } from '@react-icons/all-files/md/MdOutlineVisibilityOff';\nimport { MdOutlineWarningAmber as WARNING } from '@react-icons/all-files/md/MdOutlineWarningAmber';\n\nexport const ICON = {\n // <Calendar>\n LEFT,\n RIGHT,\n UP,\n DOWN,\n // <Check>\n CHECK,\n // <InputOption>\n ADD,\n REMOVE,\n // <InputSelect>\n EXPAND_LESS,\n EXPAND_MORE,\n // <InputText>\n SEARCH,\n EYE_OPEN,\n EYE_CLOSE,\n // <Modal>\n CLOSE,\n // <Notification> & <InputText>\n ERROR,\n INFO,\n SUCCESS,\n WARNING,\n // <Slider>\n PHOTO_LIBRARY,\n REPLAY,\n // <Table>\n FILTER,\n // Filetype\n MARKDOWN,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,oBAAA,GAAAZ,OAAA;AACA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,sBAAA,GAAAd,OAAA;AACA,IAAAe,gBAAA,GAAAf,OAAA;AACA,IAAAgB,gBAAA,GAAAhB,OAAA;AACA,IAAAiB,gBAAA,GAAAjB,OAAA;AACA,IAAAkB,oBAAA,GAAAlB,OAAA;AACA,IAAAmB,uBAAA,GAAAnB,OAAA;AACA,IAAAoB,sBAAA,GAAApB,OAAA;AAEO,MAAMqB,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClB;EACAE,IAAI,EAAJA,sCAAI;EACJC,KAAK,EAALA,4CAAK;EACLC,EAAE,EAAFA,0CAAE;EACFC,IAAI,EAAJA,8CAAI;EACJ;EACAC,KAAK,EAALA,8BAAK;EACL;EACAC,GAAG,EAAHA,0BAAG;EACHC,MAAM,EAANA,gCAAM;EACN;EACAC,WAAW,EAAXA,wCAAW;EACXC,WAAW,EAAXA,wCAAW;EACX;EACAC,MAAM,EAANA,gCAAM;EACNC,QAAQ,EAARA,wCAAQ;EACRC,SAAS,EAATA,8CAAS;EACT;EACAC,KAAK,EAALA,8BAAK;EACL;EACAC,KAAK,EAALA,8BAAK;EACLC,IAAI,EAAJA,4BAAI;EACJC,OAAO,EAAPA,0CAAO;EACPC,OAAO,EAAPA,4CAAO;EACP;EACAC,aAAa,EAAbA,4CAAa;EACbC,MAAM,EAANA,gCAAM;EACN;EACAC,MAAM,EAANA,wCAAM;EACN;EACAC,QAAQ,EAARA;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -9,49 +8,43 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _helpers = require("../../helpers");
|
|
11
10
|
var _Primitive = require("../Primitive");
|
|
12
|
-
var _helpers2 = require("../Text/helpers");
|
|
13
11
|
var _IconModule = _interopRequireDefault(require("./Icon.module.css"));
|
|
14
|
-
var
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
success = _ref.success,
|
|
38
|
-
value = _ref.value,
|
|
39
|
-
warning = _ref.warning,
|
|
40
|
-
others = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, _objectSpread(_objectSpread({}, others), {}, {
|
|
12
|
+
var _helpers2 = require("../Text/helpers");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const Icon = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
accent,
|
|
17
|
+
accentLight,
|
|
18
|
+
accentDark,
|
|
19
|
+
action,
|
|
20
|
+
dark,
|
|
21
|
+
error,
|
|
22
|
+
headline,
|
|
23
|
+
info,
|
|
24
|
+
level = 3,
|
|
25
|
+
light,
|
|
26
|
+
paragraph,
|
|
27
|
+
small,
|
|
28
|
+
success,
|
|
29
|
+
value,
|
|
30
|
+
warning,
|
|
31
|
+
...others
|
|
32
|
+
} = _ref;
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
34
|
+
...others,
|
|
42
35
|
tag: 'icon',
|
|
43
36
|
className: (0, _helpers.styles)(_IconModule.default.icon, (0, _helpers2.color)({
|
|
44
|
-
accent
|
|
45
|
-
accentDark
|
|
46
|
-
accentLight
|
|
47
|
-
dark
|
|
48
|
-
error
|
|
49
|
-
info
|
|
50
|
-
light
|
|
51
|
-
success
|
|
52
|
-
warning
|
|
53
|
-
}), headline ? _IconModule.default[
|
|
54
|
-
}
|
|
37
|
+
accent,
|
|
38
|
+
accentDark,
|
|
39
|
+
accentLight,
|
|
40
|
+
dark,
|
|
41
|
+
error,
|
|
42
|
+
info,
|
|
43
|
+
light,
|
|
44
|
+
success,
|
|
45
|
+
warning
|
|
46
|
+
}), headline ? _IconModule.default[`headline-${level}`] : action ? _IconModule.default.action : small ? _IconModule.default.small : paragraph ? _IconModule.default.paragraph : _IconModule.default[`headline-${level}`], others.className)
|
|
47
|
+
}, value ? /*#__PURE__*/_react.default.createElement(value) : undefined);
|
|
55
48
|
};
|
|
56
49
|
exports.Icon = Icon;
|
|
57
50
|
Icon.displayName = 'Primitive:Icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["Icon","accent","accentLight","accentDark","action","dark","error","headline","info","level","light","paragraph","small","success","value","warning","others","React","createElement","Primitive","tag","className","styles","style","icon","color","undefined","displayName","propTypes","PropTypes","bool","number","func","isRequired"],"sources":["../../../src/primitives/Icon/Icon.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { color } from '../Text/helpers';\
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["_propTypes","_interopRequireDefault","require","_react","_helpers","_Primitive","_IconModule","_helpers2","e","__esModule","default","Icon","_ref","accent","accentLight","accentDark","action","dark","error","headline","info","level","light","paragraph","small","success","value","warning","others","React","createElement","Primitive","tag","className","styles","style","icon","color","undefined","exports","displayName","propTypes","PropTypes","bool","number","func","isRequired"],"sources":["../../../src/primitives/Icon/Icon.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport style from './Icon.module.css';\nimport { color } from '../Text/helpers';\n\nconst Icon = ({\n accent,\n accentLight,\n accentDark,\n action,\n dark,\n error,\n headline,\n info,\n level = 3,\n light,\n paragraph,\n small,\n success,\n value,\n warning,\n ...others\n}) =>\n React.createElement(\n Primitive,\n {\n ...others,\n tag: 'icon',\n className: styles(\n style.icon,\n color({ accent, accentDark, accentLight, dark, error, info, light, success, warning }),\n headline\n ? style[`headline-${level}`]\n : action\n ? style.action\n : small\n ? style.small\n : paragraph\n ? style.paragraph\n : style[`headline-${level}`],\n others.className,\n ),\n },\n value ? React.createElement(value) : undefined,\n );\n\nIcon.displayName = 'Primitive:Icon';\n\nIcon.propTypes = {\n accent: PropTypes.bool,\n accentLight: PropTypes.bool,\n accentDark: PropTypes.bool,\n action: PropTypes.bool,\n dark: PropTypes.bool,\n error: PropTypes.bool,\n headline: PropTypes.bool,\n info: PropTypes.bool,\n level: PropTypes.number,\n light: PropTypes.bool,\n paragraph: PropTypes.bool,\n small: PropTypes.bool,\n success: PropTypes.bool,\n value: PropTypes.func.isRequired,\n warning: PropTypes.bool,\n};\n\nexport { Icon };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAAwC,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExC,MAAMG,IAAI,GAAGC,IAAA;EAAA,IAAC;IACZC,MAAM;IACNC,WAAW;IACXC,UAAU;IACVC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC,IAAI;IACJC,KAAK,GAAG,CAAC;IACTC,KAAK;IACLC,SAAS;IACTC,KAAK;IACLC,OAAO;IACPC,KAAK;IACLC,OAAO;IACP,GAAGC;EACL,CAAC,GAAAhB,IAAA;EAAA,oBACCiB,cAAK,CAACC,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AS,CAACC,IAAI;EACrBlB,OAAO,EAAEiB,kBAAS,CAACC,IAAI;EACvBjB,KAAK,EAAEgB,kBAAS,CAACG,IAAI,CAACC,UAAU;EAChCnB,OAAO,EAAEe,kBAAS,CAACC;AACrB,CAAC","ignoreList":[]}
|
|
@@ -6,18 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.Story = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ = require("./");
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
-
var _default = {
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */
|
|
11
|
+
var _default = exports.default = {
|
|
15
12
|
title: 'Primitives'
|
|
16
13
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props
|
|
14
|
+
const Story = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
value,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
21
19
|
return /*#__PURE__*/_react.default.createElement(_.Icon, _extends({}, props, {
|
|
22
20
|
value: _.ICON[value]
|
|
23
21
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.stories.js","names":["title","Story","value","props","ICON","storyName","args","accent","accentDark","accentLight","action","dark","error","headline","info","level","light","paragraph","small","success","undefined","warning","testId","style","argTypes","options","
|
|
1
|
+
{"version":3,"file":"Icon.stories.js","names":["_react","_interopRequireDefault","require","_","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_default","exports","title","Story","_ref","value","props","createElement","Icon","ICON","storyName","args","accent","accentDark","accentLight","action","dark","error","headline","info","level","light","paragraph","small","success","undefined","warning","testId","style","argTypes","options","keys","control","type","defaultValue"],"sources":["../../../src/primitives/Icon/Icon.stories.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { Icon, ICON } from './';\n\nexport default { title: 'Primitives' };\n\nexport const Story = ({ value, ...props }) => <Icon {...props} value={ICON[value]} />;\n\nStory.storyName = 'Icon';\n\nStory.args = {\n accent: false,\n accentDark: false,\n accentLight: false,\n action: false,\n dark: false,\n error: false,\n headline: false,\n info: false,\n level: 3,\n light: false,\n paragraph: false,\n small: false,\n success: false,\n value: undefined,\n warning: false,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n value: {\n options: Object.keys(ICON),\n control: { type: 'select' },\n defaultValue: Object.keys(ICON)[0],\n },\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAAgC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,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AACV,CAAC;AAEDzB,KAAK,CAAC0B,QAAQ,GAAG;EACfxB,KAAK,EAAE;IACLyB,OAAO,EAAEzC,MAAM,CAAC0C,IAAI,CAACtB,MAAI,CAAC;IAC1BuB,OAAO,EAAE;MAAEC,IAAI,EAAE;IAAS,CAAC;IAC3BC,YAAY,EAAE7C,MAAM,CAAC0C,IAAI,CAACtB,MAAI,CAAC,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ var _exportNames = {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "ICON", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function
|
|
11
|
+
get: function () {
|
|
12
12
|
return _Icon2.ICON;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -19,7 +19,7 @@ Object.keys(_Icon).forEach(function (key) {
|
|
|
19
19
|
if (key in exports && exports[key] === _Icon[key]) return;
|
|
20
20
|
Object.defineProperty(exports, key, {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function
|
|
22
|
+
get: function () {
|
|
23
23
|
return _Icon[key];
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Icon/index.js"],"sourcesContent":["export * from './Icon';\nexport { ICON } from './Icon.constants';\n"],"mappings":";;;;;;;;;;;;;;AAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Icon","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Icon2"],"sources":["../../../src/primitives/Icon/index.js"],"sourcesContent":["export * from './Icon';\nexport { ICON } from './Icon.constants';\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAb,OAAA","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,43 +10,28 @@ var _helpers = require("../../helpers");
|
|
|
11
10
|
var _Primitive = require("../Primitive");
|
|
12
11
|
var _helpers2 = require("./helpers");
|
|
13
12
|
var _InputModule = _interopRequireDefault(require("./Input.module.css"));
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
37
|
-
onChange = _ref.onChange,
|
|
38
|
-
onEnter = _ref.onEnter,
|
|
39
|
-
onError = _ref.onError,
|
|
40
|
-
onLeave = _ref.onLeave,
|
|
41
|
-
others = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
-
var ref = (0, _react.useRef)(null);
|
|
43
|
-
var _useState = (0, _react.useState)(),
|
|
44
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
-
height = _useState2[0],
|
|
46
|
-
setHeight = _useState2[1];
|
|
47
|
-
(0, _react.useEffect)(function () {
|
|
48
|
-
var errors = (0, _helpers.getInputErrors)(_objectSpread(_objectSpread({}, others), {}, {
|
|
49
|
-
type: type
|
|
50
|
-
}));
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const Input = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
autoResize,
|
|
19
|
+
disabled,
|
|
20
|
+
multiLine,
|
|
21
|
+
type = 'text',
|
|
22
|
+
onChange,
|
|
23
|
+
onEnter,
|
|
24
|
+
onError,
|
|
25
|
+
onLeave,
|
|
26
|
+
...others
|
|
27
|
+
} = _ref;
|
|
28
|
+
const ref = (0, _react.useRef)(null);
|
|
29
|
+
const [height, setHeight] = (0, _react.useState)();
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
31
|
+
const errors = (0, _helpers.getInputErrors)({
|
|
32
|
+
...others,
|
|
33
|
+
type
|
|
34
|
+
});
|
|
51
35
|
if (errors && onError) onError(errors);
|
|
52
36
|
if (autoResize && multiLine) {
|
|
53
37
|
setHeight(ref.current.clientHeight);
|
|
@@ -55,40 +39,42 @@ var Input = function Input(_ref) {
|
|
|
55
39
|
}
|
|
56
40
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
41
|
}, []);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
42
|
+
const handleChange = function () {
|
|
43
|
+
let next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
44
|
+
let event = arguments.length > 1 ? arguments[1] : undefined;
|
|
45
|
+
const {
|
|
46
|
+
max,
|
|
47
|
+
min
|
|
48
|
+
} = others;
|
|
63
49
|
if (type === 'number' && isNaN(next)) return;
|
|
64
|
-
|
|
65
|
-
onError && onError((0, _helpers.getInputErrors)(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
const value = (0, _helpers2.parseValue)(next, type, others);
|
|
51
|
+
onError && onError((0, _helpers.getInputErrors)({
|
|
52
|
+
...others,
|
|
53
|
+
type,
|
|
54
|
+
value
|
|
55
|
+
}));
|
|
56
|
+
onChange && onChange(value !== undefined ? type === 'number' && (max || min) ? Math.min(Math.max(value, min || value), max || value) : value : '', event);
|
|
70
57
|
if (autoResize && multiLine) resize(value);
|
|
71
58
|
};
|
|
72
|
-
|
|
73
|
-
if (!
|
|
74
|
-
ref.current.style.height =
|
|
59
|
+
const resize = value => {
|
|
60
|
+
if (!ref?.current) return;
|
|
61
|
+
ref.current.style.height = `${value ? ref.current.scrollHeight : height}px`;
|
|
75
62
|
};
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive,
|
|
77
|
-
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
64
|
+
...others,
|
|
65
|
+
disabled,
|
|
78
66
|
ref: autoResize ? ref : undefined,
|
|
79
67
|
tag: multiLine ? 'textarea' : 'input',
|
|
80
68
|
test: undefined,
|
|
81
69
|
type: !multiLine ? type : undefined,
|
|
82
|
-
value: others.value !== undefined ? others.value : ''
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
onBlur: onLeave
|
|
89
|
-
} : {}), {}, {
|
|
70
|
+
value: others.value !== undefined ? others.value : '',
|
|
71
|
+
...(!disabled ? {
|
|
72
|
+
onChange: event => handleChange(event.target.value, event),
|
|
73
|
+
onFocus: onEnter,
|
|
74
|
+
onBlur: onLeave
|
|
75
|
+
} : {}),
|
|
90
76
|
className: (0, _helpers.styles)(_InputModule.default.input, autoResize && multiLine && _InputModule.default.autoResize, others.className)
|
|
91
|
-
})
|
|
77
|
+
});
|
|
92
78
|
};
|
|
93
79
|
exports.Input = Input;
|
|
94
80
|
Input.displayName = 'Primitive:Input';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["Input","autoResize","disabled","multiLine","type","onChange","onEnter","onError","onLeave","others","ref","useRef","
|
|
1
|
+
{"version":3,"file":"Input.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_helpers","_Primitive","_helpers2","_InputModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Input","_ref","autoResize","disabled","multiLine","type","onChange","onEnter","onError","onLeave","others","ref","useRef","height","setHeight","useState","useEffect","errors","getInputErrors","current","clientHeight","resize","value","handleChange","next","arguments","length","undefined","event","max","min","isNaN","parseValue","Math","style","scrollHeight","React","createElement","Primitive","tag","test","target","onFocus","onBlur","className","styles","input","exports","displayName","propTypes","PropTypes","bool","number","name","string","isRequired","func"],"sources":["../../../src/primitives/Input/Input.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { parseValue } from './helpers';\nimport style from './Input.module.css';\n\nconst Input = ({ autoResize, disabled, multiLine, type = 'text', onChange, onEnter, onError, onLeave, ...others }) => {\n const ref = useRef(null);\n\n const [height, setHeight] = useState();\n\n useEffect(() => {\n const errors = getInputErrors({ ...others, type });\n if (errors && onError) onError(errors);\n\n if (autoResize && multiLine) {\n setHeight(ref.current.clientHeight);\n resize(others.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChange = (next = '', event) => {\n const { max, min } = others;\n if (type === 'number' && isNaN(next)) return;\n const value = parseValue(next, type, others);\n\n onError && onError(getInputErrors({ ...others, type, value }));\n onChange &&\n onChange(\n value !== undefined\n ? type === 'number' && (max || min)\n ? Math.min(Math.max(value, min || value), max || value)\n : value\n : '',\n event,\n );\n if (autoResize && multiLine) resize(value);\n };\n\n const resize = (value) => {\n if (!ref?.current) return;\n ref.current.style.height = `${value ? ref.current.scrollHeight : height}px`;\n };\n\n return React.createElement(Primitive, {\n ...others,\n disabled,\n ref: autoResize ? ref : undefined,\n tag: multiLine ? 'textarea' : 'input',\n test: undefined,\n type: !multiLine ? type : undefined,\n value: others.value !== undefined ? others.value : '',\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n className: styles(style.input, autoResize && multiLine && style.autoResize, others.className),\n });\n};\n\nInput.displayName = 'Primitive:Input';\n\nInput.propTypes = {\n autoResize: PropTypes.bool,\n disabled: PropTypes.bool,\n max: PropTypes.number,\n min: PropTypes.number,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n type: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { Input };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBA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