@smart-react-components/ui 2.1.9 → 2.2.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/Alert/AlertIcon.d.ts +1 -1
- package/Alert/AlertIcon.js +3 -6
- package/Alert/AlertIcon.test.d.ts +1 -0
- package/Alert/AlertIcon.test.js +24 -0
- package/Alert/index.js +7 -12
- package/Alert/index.test.d.ts +1 -0
- package/Alert/index.test.js +21 -0
- package/Badge/BadgeIcon.d.ts +1 -1
- package/Badge/BadgeIcon.js +3 -3
- package/Badge/BadgeIcon.test.d.ts +1 -0
- package/Badge/BadgeIcon.test.js +27 -0
- package/Badge/BadgeList.d.ts +1 -1
- package/Badge/BadgeList.js +14 -20
- package/Badge/BadgeList.test.d.ts +1 -0
- package/Badge/BadgeList.test.js +19 -0
- package/Badge/index.js +6 -11
- package/Badge/index.test.d.ts +1 -0
- package/Badge/index.test.js +21 -0
- package/Breadcrumb/BreadcrumbItem.js +6 -5
- package/Breadcrumb/BreadcrumbItem.test.d.ts +1 -0
- package/Breadcrumb/BreadcrumbItem.test.js +27 -0
- package/Breadcrumb/BreadcrumbLink.js +7 -9
- package/Breadcrumb/BreadcrumbLink.test.d.ts +1 -0
- package/Breadcrumb/BreadcrumbLink.test.js +30 -0
- package/Breadcrumb/BreadcrumbList.d.ts +1 -1
- package/Breadcrumb/BreadcrumbList.js +12 -20
- package/Breadcrumb/BreadcrumbList.test.d.ts +1 -0
- package/Breadcrumb/BreadcrumbList.test.js +19 -0
- package/Button/ButtonAddon.js +4 -6
- package/Button/ButtonGroup.js +1 -4
- package/Button/ButtonGroup.test.d.ts +1 -0
- package/Button/ButtonGroup.test.js +19 -0
- package/Button/ButtonLink.js +6 -11
- package/Button/ButtonLink.test.d.ts +1 -0
- package/Button/ButtonLink.test.js +17 -0
- package/Button/ButtonList.d.ts +1 -1
- package/Button/ButtonList.js +31 -29
- package/Button/ButtonList.test.d.ts +1 -0
- package/Button/ButtonList.test.js +19 -0
- package/Button/ButtonLoading.d.ts +1 -1
- package/Button/ButtonLoading.js +8 -6
- package/Button/ButtonLoading.test.d.ts +1 -0
- package/Button/ButtonLoading.test.js +30 -0
- package/Button/ButtonSelect.d.ts +1 -1
- package/Button/ButtonSelect.js +19 -15
- package/Button/ButtonSelect.test.d.ts +1 -0
- package/Button/ButtonSelect.test.js +24 -0
- package/Button/index.js +22 -21
- package/Button/index.test.d.ts +1 -0
- package/Button/index.test.js +24 -0
- package/Checkbox/CheckboxAll.d.ts +7 -7
- package/Checkbox/CheckboxAll.js +8 -15
- package/Checkbox/CheckboxGroup.d.ts +6 -6
- package/Checkbox/CheckboxGroup.js +15 -4
- package/Checkbox/CheckboxGroup.test.d.ts +1 -0
- package/Checkbox/CheckboxGroup.test.js +19 -0
- package/Checkbox/index.d.ts +7 -7
- package/Checkbox/index.js +8 -15
- package/Checkbox/index.test.d.ts +1 -0
- package/Checkbox/index.test.js +62 -0
- package/ColorPicker/index.d.ts +2 -2
- package/ColorPicker/index.js +13 -23
- package/ColorPicker/index.test.d.ts +1 -0
- package/ColorPicker/index.test.js +15 -0
- package/DatePicker/index.js +12 -18
- package/Dropdown/DropdownCategory.d.ts +1 -1
- package/Dropdown/DropdownCategory.js +14 -14
- package/Dropdown/DropdownItem.js +8 -6
- package/Dropdown/DropdownItem.test.d.ts +1 -0
- package/Dropdown/DropdownItem.test.js +74 -0
- package/Dropdown/DropdownList.d.ts +1 -1
- package/Dropdown/DropdownList.js +4 -11
- package/Dropdown/DropdownList.test.d.ts +1 -0
- package/Dropdown/DropdownList.test.js +21 -0
- package/Dropdown/index.js +20 -9
- package/Dropdown/index.test.d.ts +1 -0
- package/Dropdown/index.test.js +24 -0
- package/FixedBox/index.d.ts +1 -1
- package/FixedBox/index.js +1 -1
- package/FixedBox/index.test.d.ts +1 -0
- package/FixedBox/index.test.js +33 -0
- package/Grid/Column.d.ts +19 -1
- package/Grid/Column.test.d.ts +1 -0
- package/Grid/Column.test.js +23 -0
- package/Grid/Container.d.ts +19 -1
- package/Grid/Container.test.d.ts +1 -0
- package/Grid/Container.test.js +19 -0
- package/Grid/Row.d.ts +19 -1
- package/Grid/Row.test.d.ts +1 -0
- package/Grid/Row.test.js +15 -0
- package/Input/InputAddon.js +4 -4
- package/Input/InputAddon.test.d.ts +1 -0
- package/Input/InputAddon.test.js +30 -0
- package/Input/InputColorPicker.js +41 -33
- package/Input/InputColorPicker.test.d.ts +1 -0
- package/Input/InputColorPicker.test.js +18 -0
- package/Input/InputDatePicker.js +25 -24
- package/Input/InputFile.d.ts +1 -1
- package/Input/InputFile.js +16 -25
- package/Input/InputFile.test.d.ts +1 -0
- package/Input/InputFile.test.js +27 -0
- package/Input/InputNumber.d.ts +1 -1
- package/Input/InputNumber.js +41 -21
- package/Input/InputNumber.test.d.ts +1 -0
- package/Input/InputNumber.test.js +15 -0
- package/Input/index.d.ts +1 -1
- package/Input/index.js +38 -21
- package/Input/index.test.d.ts +1 -0
- package/Input/index.test.js +38 -0
- package/Loading/index.js +1 -5
- package/Loading/index.test.d.ts +1 -0
- package/Loading/index.test.js +15 -0
- package/Modal/ModalBody.d.ts +10 -1
- package/Modal/ModalFooter.d.ts +10 -1
- package/Modal/ModalHeader.d.ts +10 -1
- package/Modal/ModalHeader.js +1 -2
- package/Modal/ModalTitle.d.ts +10 -1
- package/Modal/index.js +4 -15
- package/Modal/index.test.d.ts +1 -0
- package/Modal/index.test.js +39 -0
- package/Overlay/index.d.ts +1 -1
- package/Overlay/index.js +20 -16
- package/Overlay/index.test.d.ts +1 -0
- package/Overlay/index.test.js +16 -0
- package/Pagination/PaginationItem.js +5 -4
- package/Pagination/PaginationItem.test.d.ts +1 -0
- package/Pagination/PaginationItem.test.js +27 -0
- package/Pagination/PaginationLink.js +6 -8
- package/Pagination/PaginationLink.test.d.ts +1 -0
- package/Pagination/PaginationLink.test.js +30 -0
- package/Pagination/PaginationList.d.ts +1 -1
- package/Pagination/PaginationList.js +12 -20
- package/Pagination/PaginationList.test.d.ts +1 -0
- package/Pagination/PaginationList.test.js +19 -0
- package/PopUp/Alert.js +3 -12
- package/PopUp/Alert.test.d.ts +1 -0
- package/PopUp/Alert.test.js +23 -0
- package/PopUp/Confirm.js +3 -12
- package/PopUp/Confirm.test.d.ts +1 -0
- package/PopUp/Confirm.test.js +31 -0
- package/PopUp/Prompt.js +3 -12
- package/PopUp/Prompt.test.d.ts +1 -0
- package/PopUp/Prompt.test.js +33 -0
- package/Popover/index.d.ts +1 -1
- package/Popover/index.js +17 -7
- package/Popover/index.test.d.ts +1 -0
- package/Popover/index.test.js +34 -0
- package/ProgressBar/index.js +18 -8
- package/ProgressBar/index.test.d.ts +1 -0
- package/ProgressBar/index.test.js +23 -0
- package/README.md +0 -4
- package/Radio/RadioGroup.d.ts +6 -6
- package/Radio/RadioGroup.js +14 -4
- package/Radio/RadioGroup.test.d.ts +1 -0
- package/Radio/RadioGroup.test.js +19 -0
- package/Radio/index.d.ts +7 -7
- package/Radio/index.js +7 -13
- package/Radio/index.test.d.ts +1 -0
- package/Radio/index.test.js +48 -0
- package/Select/Option.js +14 -11
- package/Select/Option.test.d.ts +1 -0
- package/Select/Option.test.js +72 -0
- package/Select/OptionGroup.d.ts +1 -1
- package/Select/OptionGroup.js +21 -17
- package/Select/SelectBox.d.ts +4 -3
- package/Select/SelectBox.js +40 -43
- package/Select/SelectBox.test.d.ts +1 -0
- package/Select/SelectBox.test.js +24 -0
- package/Select/SelectSearchBox.d.ts +1 -1
- package/Select/SelectSearchBox.js +25 -22
- package/Select/index.d.ts +4 -3
- package/Select/index.js +25 -25
- package/Select/index.test.d.ts +1 -0
- package/Select/index.test.js +21 -0
- package/Switch/SwitchGroup.d.ts +1 -1
- package/Switch/SwitchGroup.test.d.ts +1 -0
- package/Switch/SwitchGroup.test.js +19 -0
- package/Switch/index.d.ts +1 -1
- package/Switch/index.js +4 -4
- package/Switch/index.test.d.ts +1 -0
- package/Switch/index.test.js +15 -0
- package/Table/TableContainer.d.ts +1 -1
- package/Table/TableContainer.js +5 -13
- package/Table/Td.d.ts +20 -1
- package/Table/Td.js +3 -1
- package/Table/Th.d.ts +19 -1
- package/Table/Tr.d.ts +10 -1
- package/Table/Tr.js +22 -25
- package/Table/Tr.test.d.ts +1 -0
- package/Table/Tr.test.js +23 -0
- package/Table/index.d.ts +1 -1
- package/Table/index.js +2 -11
- package/Textarea/index.js +10 -11
- package/Textarea/index.test.d.ts +1 -0
- package/Textarea/index.test.js +15 -0
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/index.test.d.ts +1 -0
- package/Tooltip/index.test.js +33 -0
- package/WaveEffect/index.d.ts +1 -1
- package/WaveEffect/index.test.d.ts +1 -0
- package/WaveEffect/index.test.js +29 -0
- package/components/Alert/AlertContent.d.ts +5 -3
- package/components/Alert/AlertElement.d.ts +23 -1
- package/components/Alert/AlertElement.js +26 -27
- package/components/Alert/AlertElement.test.d.ts +1 -0
- package/components/Alert/AlertElement.test.js +67 -0
- package/components/Alert/AlertIconElement.d.ts +23 -1
- package/components/Alert/AlertIconElement.js +20 -23
- package/components/Alert/AlertIconElement.test.d.ts +1 -0
- package/components/Alert/AlertIconElement.test.js +46 -0
- package/components/Badge/BadgeContent.d.ts +5 -3
- package/components/Badge/BadgeElement.d.ts +23 -1
- package/components/Badge/BadgeElement.js +80 -83
- package/components/Badge/BadgeElement.test.d.ts +1 -0
- package/components/Badge/BadgeElement.test.js +76 -0
- package/components/Badge/BadgeIconElement.d.ts +19 -1
- package/components/Badge/BadgeIconElement.js +46 -49
- package/components/Badge/BadgeIconElement.test.d.ts +1 -0
- package/components/Badge/BadgeIconElement.test.js +43 -0
- package/components/Badge/BadgeListElement.d.ts +23 -1
- package/components/Badge/BadgeListElement.js +1 -1
- package/components/Badge/BadgeListElement.test.d.ts +1 -0
- package/components/Badge/BadgeListElement.test.js +15 -0
- package/components/Breadcrumb/BreadcrumbItemElement.d.ts +10 -1
- package/components/Breadcrumb/BreadcrumbItemElement.js +49 -52
- package/components/Breadcrumb/BreadcrumbItemElement.test.d.ts +1 -0
- package/components/Breadcrumb/BreadcrumbItemElement.test.js +47 -0
- package/components/Breadcrumb/BreadcrumbListElement.d.ts +10 -1
- package/components/Breadcrumb/BreadcrumbListElement.js +8 -11
- package/components/Breadcrumb/BreadcrumbListElement.test.d.ts +1 -0
- package/components/Breadcrumb/BreadcrumbListElement.test.js +32 -0
- package/components/Button/ButtonAddonElement.d.ts +23 -1
- package/components/Button/ButtonAddonElement.js +39 -43
- package/components/Button/ButtonAddonElement.test.d.ts +1 -0
- package/components/Button/ButtonAddonElement.test.js +62 -0
- package/components/Button/ButtonContent.d.ts +5 -3
- package/components/Button/ButtonElement.d.ts +23 -1
- package/components/Button/ButtonElement.js +95 -99
- package/components/Button/ButtonElement.test.d.ts +1 -0
- package/components/Button/ButtonElement.test.js +101 -0
- package/components/Button/ButtonGroupElement.d.ts +26 -1
- package/components/Button/ButtonGroupElement.test.d.ts +1 -0
- package/components/Button/ButtonGroupElement.test.js +32 -0
- package/components/Button/ButtonListElement.d.ts +23 -1
- package/components/Button/ButtonListElement.test.d.ts +1 -0
- package/components/Button/ButtonListElement.test.js +32 -0
- package/components/Button/ButtonLoadingElement.d.ts +10 -1
- package/components/Button/ButtonLoadingElement.test.d.ts +1 -0
- package/components/Button/ButtonLoadingElement.test.js +19 -0
- package/components/Checkbox/CheckboxElement.d.ts +24 -1
- package/components/Checkbox/CheckboxElement.js +22 -33
- package/components/Checkbox/CheckboxElement.test.d.ts +1 -0
- package/components/Checkbox/CheckboxElement.test.js +38 -0
- package/components/ColorPicker/ButtonsSection/index.js +1 -1
- package/components/ColorPicker/ColorPickerElement.d.ts +23 -1
- package/components/ColorPicker/ColorPickerElement.js +4 -7
- package/components/ColorPicker/ConsoleSection/ConsoleSectionElement.d.ts +10 -1
- package/components/ColorPicker/ConsoleSection/ConsoleSectionElement.js +6 -9
- package/components/ColorPicker/ConsoleSection/index.js +10 -11
- package/components/ColorPicker/PaletteSection/PaletteItemElement.d.ts +23 -1
- package/components/ColorPicker/PaletteSection/PaletteItemElement.js +6 -9
- package/components/ColorPicker/PaletteSection/PaletteList.js +11 -11
- package/components/ColorPicker/PaletteSection/PaletteListContainerElement.d.ts +10 -1
- package/components/ColorPicker/PaletteSection/index.js +3 -2
- package/components/ColorPicker/PickerSection/DraggerElement.d.ts +10 -1
- package/components/ColorPicker/PickerSection/DraggerElement.js +6 -9
- package/components/ColorPicker/PickerSection/MajorDraggerElement.d.ts +38 -1
- package/components/ColorPicker/PickerSection/MajorDraggerElement.js +4 -7
- package/components/ColorPicker/PickerSection/MajorPicker.js +11 -11
- package/components/ColorPicker/PickerSection/MajorPickerElement.d.ts +39 -2
- package/components/ColorPicker/PickerSection/MajorPickerElement.js +1 -1
- package/components/ColorPicker/PickerSection/MinorDraggerElement.d.ts +38 -1
- package/components/ColorPicker/PickerSection/MinorPicker.js +7 -7
- package/components/ColorPicker/PickerSection/MinorPickerElement.d.ts +38 -1
- package/components/ColorPicker/PickerSection/OpacityPicker.js +11 -10
- package/components/ColorPicker/PickerSection/OpacityPickerElement.d.ts +39 -2
- package/components/ColorPicker/PickerSection/PickerElement.d.ts +10 -1
- package/components/ColorPicker/PickerSection/index.d.ts +2 -2
- package/components/ColorPicker/PickerSection/index.js +3 -3
- package/components/DatePicker/DatePicker/DatePickerHeader.js +1 -1
- package/components/DatePicker/DatePicker/DatePickerHeaderElement.d.ts +23 -1
- package/components/DatePicker/DatePicker/DatePickerHeaderElement.js +3 -6
- package/components/DatePicker/DatePicker/DatePickerItemElement.d.ts +23 -1
- package/components/DatePicker/DatePicker/DatePickerItemElement.js +14 -17
- package/components/DatePicker/DatePicker/DatePickerListElement.d.ts +10 -1
- package/components/DatePicker/DatePicker/DatePickerWeekItemElement.d.ts +23 -1
- package/components/DatePicker/DatePicker/DatePickerWeekItemElement.js +14 -17
- package/components/DatePicker/DatePicker/DatePickerWeekListElement.d.ts +10 -1
- package/components/DatePicker/DatePicker/MonthPicker.js +1 -1
- package/components/DatePicker/DatePicker/WeekPicker.js +2 -2
- package/components/DatePicker/DatePicker/YearPicker.js +1 -1
- package/components/DatePicker/DatePicker/index.js +5 -5
- package/components/DatePicker/DatePickerElement.d.ts +26 -1
- package/components/DatePicker/DatePickerHeader.js +1 -1
- package/components/DatePicker/DatePickerHeaderElement.d.ts +23 -1
- package/components/DatePicker/DatePickerHeaderElement.js +10 -13
- package/components/DatePicker/TimePicker/TimePickerArrowItem.js +5 -5
- package/components/DatePicker/TimePicker/TimePickerElement.d.ts +23 -1
- package/components/DatePicker/TimePicker/TimePickerElement.js +17 -20
- package/components/DatePicker/TimePicker/index.js +1 -1
- package/components/Dropdown/DropdownItemElement.d.ts +10 -1
- package/components/Dropdown/DropdownItemElement.js +30 -33
- package/components/Dropdown/DropdownItemElement.test.d.ts +1 -0
- package/components/Dropdown/DropdownItemElement.test.js +70 -0
- package/components/Dropdown/DropdownListElement.d.ts +23 -3
- package/components/Dropdown/DropdownListElement.js +11 -14
- package/components/Dropdown/DropdownListElement.test.d.ts +1 -0
- package/components/Dropdown/DropdownListElement.test.js +40 -0
- package/components/FixedBox/FixedBoxElement.d.ts +10 -1
- package/components/FixedBox/FixedBoxElement.test.d.ts +1 -0
- package/components/FixedBox/FixedBoxElement.test.js +23 -0
- package/components/FixedBox/OverlayElement.d.ts +17 -1
- package/components/FixedBox/OverlayElement.test.d.ts +1 -0
- package/components/FixedBox/OverlayElement.test.js +19 -0
- package/components/Form/FormBlockLabel.d.ts +23 -1
- package/components/Form/FormBlockLabel.js +8 -11
- package/components/Form/FormBlockLabel.test.d.ts +1 -0
- package/components/Form/FormBlockLabel.test.js +37 -0
- package/components/Form/FormGroup.d.ts +10 -1
- package/components/Form/FormInlineLabel.d.ts +23 -1
- package/components/Form/FormInlineLabel.js +6 -9
- package/components/Form/FormInlineLabel.test.d.ts +1 -0
- package/components/Form/FormInlineLabel.test.js +44 -0
- package/components/Form/HiddenInput.d.ts +3 -1
- package/components/Input/InputAddonElement.d.ts +23 -1
- package/components/Input/InputAddonElement.js +60 -60
- package/components/Input/InputAddonElement.test.d.ts +1 -0
- package/components/Input/InputAddonElement.test.js +67 -0
- package/components/Input/InputElement.d.ts +23 -1
- package/components/Input/InputElement.js +54 -58
- package/components/Input/InputElement.test.d.ts +1 -0
- package/components/Input/InputElement.test.js +74 -0
- package/components/Input/InputFileTemplate.d.ts +1 -1
- package/components/Input/InputFileTemplate.js +1 -1
- package/components/Input/InputFileTemplate.test.d.ts +1 -0
- package/components/Input/InputFileTemplate.test.js +54 -0
- package/components/Input/InputNumberTemplate.js +2 -2
- package/components/Input/InputNumberTemplate.test.d.ts +1 -0
- package/components/Input/InputNumberTemplate.test.js +43 -0
- package/components/Input/InputNumberTemplateElement.d.ts +23 -1
- package/components/Input/InputPlaceholder.d.ts +24 -1
- package/components/Input/InputPlaceholder.js +3 -1
- package/components/Input/InputWrapper.d.ts +10 -1
- package/components/Input/InputWrapper.js +18 -21
- package/components/Loading/LoadingElement.d.ts +24 -1
- package/components/Loading/LoadingElement.test.d.ts +1 -0
- package/components/Loading/LoadingElement.test.js +15 -0
- package/components/Modal/ModalElement.d.ts +23 -1
- package/components/Modal/ModalElement.test.d.ts +1 -0
- package/components/Modal/ModalElement.test.js +42 -0
- package/components/Modal/OverlayElement.d.ts +17 -1
- package/components/Modal/OverlayElement.test.d.ts +1 -0
- package/components/Modal/OverlayElement.test.js +40 -0
- package/components/Overlay/OverlayElement.d.ts +10 -1
- package/components/Overlay/OverlayElement.test.d.ts +1 -0
- package/components/Overlay/OverlayElement.test.js +27 -0
- package/components/Pagination/PaginationItemElement.d.ts +10 -1
- package/components/Pagination/PaginationItemElement.js +80 -83
- package/components/Pagination/PaginationItemElement.test.d.ts +1 -0
- package/components/Pagination/PaginationItemElement.test.js +51 -0
- package/components/Pagination/PaginationListElement.d.ts +10 -1
- package/components/Pagination/PaginationListElement.test.d.ts +1 -0
- package/components/Pagination/PaginationListElement.test.js +15 -0
- package/components/Popover/PopoverArrow.d.ts +6 -4
- package/components/Popover/PopoverElement.d.ts +29 -5
- package/components/Popover/PopoverElement.js +21 -24
- package/components/Popover/PopoverElement.test.d.ts +1 -0
- package/components/Popover/PopoverElement.test.js +77 -0
- package/components/ProgressBar/ProgressBarElement.d.ts +16 -3
- package/components/ProgressBar/ProgressBarElement.js +19 -22
- package/components/ProgressBar/ProgressBarElement.test.d.ts +1 -0
- package/components/ProgressBar/ProgressBarElement.test.js +75 -0
- package/components/Radio/RadioElement.d.ts +24 -1
- package/components/Radio/RadioElement.js +14 -23
- package/components/Radio/RadioElement.test.d.ts +1 -0
- package/components/Radio/RadioElement.test.js +37 -0
- package/components/Select/SelectElement.d.ts +56 -1
- package/components/Select/SelectElement.js +2 -2
- package/components/Select/SelectElement.test.d.ts +1 -0
- package/components/Select/SelectElement.test.js +32 -0
- package/components/Switch/SwitchElement.d.ts +25 -1
- package/components/Switch/SwitchElement.js +20 -26
- package/components/Switch/SwitchElement.test.d.ts +1 -0
- package/components/Switch/SwitchElement.test.js +37 -0
- package/components/Table/TableContainerElement.d.ts +10 -1
- package/components/Table/TableElement.d.ts +23 -1
- package/components/Table/TableElement.js +60 -63
- package/components/Tooltip/TooltipElement.d.ts +23 -3
- package/components/Tooltip/TooltipElement.js +15 -18
- package/components/Tooltip/TooltipElement.test.d.ts +1 -0
- package/components/Tooltip/TooltipElement.test.js +42 -0
- package/components/WaveEffect/WaveEffectElement.d.ts +10 -1
- package/components/WaveEffect/WaveEffectElement.test.d.ts +1 -0
- package/components/WaveEffect/WaveEffectElement.test.js +25 -0
- package/constants/date-picker.js +4 -4
- package/context/ColorPickerProps.d.ts +0 -1
- package/hooks/useAddons.d.ts +2 -2
- package/hooks/useAddons.js +6 -2
- package/hooks/useAddons.test.d.ts +1 -0
- package/hooks/useAddons.test.js +35 -0
- package/hooks/useFixedBoxMethods.d.ts +0 -1
- package/hooks/useFixedBoxMethods.js +3 -12
- package/hooks/useInputMethods.js +1 -1
- package/hooks/useInputMethods.test.d.ts +1 -0
- package/hooks/useInputMethods.test.js +94 -0
- package/hooks/useSelectBoxHover.d.ts +1 -1
- package/hooks/useSelectBoxItemList.d.ts +1 -1
- package/hooks/useSelectSearch.d.ts +1 -1
- package/icons/Add.d.ts +20 -5
- package/icons/ArrowDown.d.ts +20 -5
- package/icons/ArrowLeft.d.ts +20 -5
- package/icons/ArrowMultipleDown.d.ts +20 -5
- package/icons/ArrowRight.d.ts +20 -5
- package/icons/Cancel.d.ts +20 -5
- package/icons/CaretDown.d.ts +20 -5
- package/icons/CaretUp.d.ts +20 -5
- package/icons/Close.d.ts +20 -5
- package/icons/Date.d.ts +20 -5
- package/icons/Eraser.d.ts +20 -5
- package/icons/Palette.d.ts +20 -5
- package/icons/Save.d.ts +20 -5
- package/icons/Time.d.ts +20 -5
- package/package.json +25 -26
- package/types/button.d.ts +1 -1
- package/types/button.js +1 -1
- package/types/color-picker.d.ts +4 -4
- package/types/color-picker.js +1 -1
- package/types/form.d.ts +4 -4
- package/types/global.d.d.ts +5 -0
- package/types/global.d.js +1 -0
- package/types/index.d.ts +1 -1
- package/types/index.js +4 -4
- package/types/wave-effect.d.ts +1 -1
- package/util/color-picker.d.ts +4 -4
- package/util/color-picker.js +3 -3
- package/util/color-picker.test.d.ts +1 -0
- package/util/color-picker.test.js +38 -0
- package/util/css.test.d.ts +1 -0
- package/util/css.test.js +12 -0
- package/util/dom.test.d.ts +1 -0
- package/util/dom.test.js +8 -0
- package/util/fixed-box.js +12 -7
- package/util/form.test.d.ts +1 -0
- package/util/form.test.js +14 -0
- package/util/popover.js +4 -1
- package/util/props.js +11 -2
- package/util/props.test.d.ts +1 -0
- package/util/props.test.js +30 -0
- package/util/radio.test.d.ts +1 -0
- package/util/radio.test.js +10 -0
- package/util/wave-effect.test.d.ts +1 -0
- package/util/wave-effect.test.js +14 -0
package/icons/Time.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, "
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("styled-components/dist/types").Merged<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Merged<Omit<React.SVGProps<SVGSVGElement>, "style"> & {
|
|
4
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
5
|
+
}, StyledProps>, "as" | "forwardedAs"> & {
|
|
6
|
+
as?: import("styled-components").WebTarget;
|
|
7
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
8
|
+
}, "style"> & {
|
|
9
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | (React.CSSProperties & {
|
|
10
|
+
[key: `--${string}`]: string | number;
|
|
11
|
+
});
|
|
12
|
+
}, StyledProps>, "children" | "viewBox"> & Partial<Pick<import("styled-components/dist/types").Merged<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Merged<Omit<React.SVGProps<SVGSVGElement>, "style"> & {
|
|
13
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
14
|
+
}, StyledProps>, "as" | "forwardedAs"> & {
|
|
15
|
+
as?: import("styled-components").WebTarget;
|
|
16
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
17
|
+
}, "style"> & {
|
|
18
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | (React.CSSProperties & {
|
|
19
|
+
[key: `--${string}`]: string | number;
|
|
20
|
+
});
|
|
21
|
+
}, StyledProps>, "children" | "viewBox">>> & string;
|
|
7
22
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-react-components/ui",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "SRC UI includes React and Styled components.",
|
|
@@ -59,35 +59,34 @@
|
|
|
59
59
|
"clear": "rm -rf lib",
|
|
60
60
|
"copy": "cp package.json lib/package.json && cp README.md lib/README.md && cp ../LICENSE lib/LICENSE",
|
|
61
61
|
"dev": "tsc -w --outDir lib",
|
|
62
|
-
"lint": "eslint src",
|
|
63
62
|
"release": "../scripts/release.sh ui",
|
|
64
|
-
"test": "jest"
|
|
63
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
65
64
|
},
|
|
66
65
|
"devDependencies": {
|
|
67
|
-
"@smart-react-components/core": "2.
|
|
68
|
-
"@smart-react-components/router": "2.
|
|
69
|
-
"@smart-react-components/transition": "2.
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@types/
|
|
74
|
-
"@types/
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"jest
|
|
78
|
-
"jest-
|
|
79
|
-
"
|
|
80
|
-
"react
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"typescript": "
|
|
66
|
+
"@smart-react-components/core": "2.2.7",
|
|
67
|
+
"@smart-react-components/router": "2.2.4",
|
|
68
|
+
"@smart-react-components/transition": "2.2.4",
|
|
69
|
+
"@swc/core": "1.16.22",
|
|
70
|
+
"@swc/jest": "0.2.39",
|
|
71
|
+
"@testing-library/react": "16.3.3",
|
|
72
|
+
"@types/jest": "30.0.0",
|
|
73
|
+
"@types/react": "19.3.3",
|
|
74
|
+
"@types/react-dom": "19.3.0",
|
|
75
|
+
"@types/styled-components": "5.1.36",
|
|
76
|
+
"jest": "30.5.2",
|
|
77
|
+
"jest-environment-jsdom": "30.5.2",
|
|
78
|
+
"jest-styled-components": "7.4.1",
|
|
79
|
+
"react": "19.3.1",
|
|
80
|
+
"react-dom": "19.3.1",
|
|
81
|
+
"styled-components": "6.7.0",
|
|
82
|
+
"typescript": "7.0.2"
|
|
84
83
|
},
|
|
85
84
|
"peerDependencies": {
|
|
86
|
-
"@smart-react-components/core": "^2.
|
|
87
|
-
"@smart-react-components/router": "^2.
|
|
88
|
-
"@smart-react-components/transition": "^2.
|
|
89
|
-
"react": "^
|
|
90
|
-
"react-dom": "^
|
|
91
|
-
"styled-components": "^
|
|
85
|
+
"@smart-react-components/core": "^2.2.7",
|
|
86
|
+
"@smart-react-components/router": "^2.2.4",
|
|
87
|
+
"@smart-react-components/transition": "^2.2.4",
|
|
88
|
+
"react": "^19.3.1",
|
|
89
|
+
"react-dom": "^19.3.1",
|
|
90
|
+
"styled-components": "^6.7.0"
|
|
92
91
|
}
|
|
93
92
|
}
|
package/types/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IntrinsicStyledCoreProps } from '@smart-react-components/core/element-props/intrinsic-styled-core-props';
|
|
3
2
|
import { ContentElement, JSXElementProps, PaletteProp, Partial, ResponsiveProp, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
+
import { JSX } from 'react';
|
|
4
4
|
export interface ButtonGenericProps<T extends ContentElement> extends IntrinsicStyledCoreProps, Partial<ResponsiveProp<'size', SizeProp>> {
|
|
5
5
|
children: T | T[];
|
|
6
6
|
elementProps?: JSXElementProps;
|
package/types/button.js
CHANGED
package/types/color-picker.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ export declare enum ColorPickerFormat {
|
|
|
6
6
|
HSL = 2
|
|
7
7
|
}
|
|
8
8
|
export interface ConsoleRef {
|
|
9
|
-
onDrag: (value: Nullable<Color>) => void;
|
|
9
|
+
onDrag: (e: Event, value: Nullable<Color>) => void;
|
|
10
10
|
}
|
|
11
11
|
export interface PickerProps {
|
|
12
12
|
color: MutableRefObject<Color>;
|
|
13
|
-
onDrag: () => void;
|
|
14
|
-
onEnd: (onMove: (e:
|
|
13
|
+
onDrag: (e: Event, value: Nullable<Color>) => void;
|
|
14
|
+
onEnd: (onMove: (e: MouseEvent) => void, onEnd: () => void) => void;
|
|
15
15
|
onRef?: (v: PickerRef) => void;
|
|
16
|
-
onStart: (onMove: (e:
|
|
16
|
+
onStart: (onMove: (e: MouseEvent) => void, onEnd: () => void) => void;
|
|
17
17
|
}
|
|
18
18
|
export interface PickerRef {
|
|
19
19
|
onChange: () => void;
|
package/types/color-picker.js
CHANGED
|
@@ -6,4 +6,4 @@ var ColorPickerFormat;
|
|
|
6
6
|
ColorPickerFormat[ColorPickerFormat["HEX"] = 0] = "HEX";
|
|
7
7
|
ColorPickerFormat[ColorPickerFormat["RGB"] = 1] = "RGB";
|
|
8
8
|
ColorPickerFormat[ColorPickerFormat["HSL"] = 2] = "HSL";
|
|
9
|
-
})(ColorPickerFormat
|
|
9
|
+
})(ColorPickerFormat || (exports.ColorPickerFormat = ColorPickerFormat = {}));
|
package/types/form.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IntrinsicStyledCoreProps } from '@smart-react-components/core/element-props/intrinsic-styled-core-props';
|
|
3
2
|
import { ContentElement, JSXElementProps, PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
+
import { JSX } from 'react';
|
|
4
4
|
import { FormValue } from '../types';
|
|
5
|
-
export interface GenericProps extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
-
active:
|
|
5
|
+
export interface GenericProps<T extends FormValue | FormValue[] = FormValue | FormValue[]> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
+
active: T;
|
|
7
7
|
children: JSX.Element | JSX.Element[];
|
|
8
8
|
elementProps?: JSXElementProps;
|
|
9
9
|
hasBorder?: boolean;
|
|
@@ -21,6 +21,6 @@ export interface GenericProps extends Partial<ResponsiveProp<'size', SizeProp>>,
|
|
|
21
21
|
rightAddon?: ContentElement;
|
|
22
22
|
rightIcon?: ContentElement;
|
|
23
23
|
shape?: ShapeProp;
|
|
24
|
-
setActive: SetState<
|
|
24
|
+
setActive: SetState<T>;
|
|
25
25
|
waveEffectPalette?: PaletteProp;
|
|
26
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types/index.d.ts
CHANGED
package/types/index.js
CHANGED
|
@@ -9,23 +9,23 @@ var InputType;
|
|
|
9
9
|
InputType["TEL"] = "tel";
|
|
10
10
|
InputType["TEXT"] = "text";
|
|
11
11
|
InputType["URL"] = "url";
|
|
12
|
-
})(InputType
|
|
12
|
+
})(InputType || (exports.InputType = InputType = {}));
|
|
13
13
|
var OrderPosition;
|
|
14
14
|
(function (OrderPosition) {
|
|
15
15
|
OrderPosition[OrderPosition["LEFT"] = 1] = "LEFT";
|
|
16
16
|
OrderPosition[OrderPosition["RIGHT"] = 2] = "RIGHT";
|
|
17
|
-
})(OrderPosition
|
|
17
|
+
})(OrderPosition || (exports.OrderPosition = OrderPosition = {}));
|
|
18
18
|
var Position;
|
|
19
19
|
(function (Position) {
|
|
20
20
|
Position[Position["LEFT"] = 1] = "LEFT";
|
|
21
21
|
Position[Position["RIGHT"] = 2] = "RIGHT";
|
|
22
22
|
Position[Position["TOP"] = 4] = "TOP";
|
|
23
23
|
Position[Position["BOTTOM"] = 8] = "BOTTOM";
|
|
24
|
-
})(Position
|
|
24
|
+
})(Position || (exports.Position = Position = {}));
|
|
25
25
|
var TriggerInteraction;
|
|
26
26
|
(function (TriggerInteraction) {
|
|
27
27
|
TriggerInteraction[TriggerInteraction["NONE"] = 0] = "NONE";
|
|
28
28
|
TriggerInteraction[TriggerInteraction["CLICK"] = 1] = "CLICK";
|
|
29
29
|
TriggerInteraction[TriggerInteraction["HOVER"] = 2] = "HOVER";
|
|
30
30
|
TriggerInteraction[TriggerInteraction["RIGHT_CLICK"] = 4] = "RIGHT_CLICK";
|
|
31
|
-
})(TriggerInteraction
|
|
31
|
+
})(TriggerInteraction || (exports.TriggerInteraction = TriggerInteraction = {}));
|
package/types/wave-effect.d.ts
CHANGED
package/util/color-picker.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Nullable } from '@smart-react-components/core/types';
|
|
1
|
+
import { Color, Nullable } from '@smart-react-components/core/types';
|
|
2
2
|
import { ColorPickerFormat } from '../types/color-picker';
|
|
3
3
|
/**
|
|
4
4
|
* Converts color to string by given format.
|
|
5
5
|
*/
|
|
6
|
-
export declare const colorToString: (color: Color
|
|
6
|
+
export declare const colorToString: (color: Nullable<Color>, format: ColorPickerFormat) => Nullable<string>;
|
|
7
7
|
/**
|
|
8
8
|
* Calculates new position of the dragger.
|
|
9
9
|
*/
|
|
@@ -16,11 +16,11 @@ export declare const calculateDraggerPosition: (e: MouseEvent, pickerEl: HTMLDiv
|
|
|
16
16
|
/**
|
|
17
17
|
* Converts color to the given format as string.
|
|
18
18
|
*/
|
|
19
|
-
export declare const convertColor: (color: Color
|
|
19
|
+
export declare const convertColor: (color: Nullable<Color>, format: ColorPickerFormat) => Nullable<string>;
|
|
20
20
|
/**
|
|
21
21
|
* Checks if two given colors are equal.
|
|
22
22
|
*/
|
|
23
|
-
export declare const isEqual: (color1: Color
|
|
23
|
+
export declare const isEqual: (color1: Nullable<Color>, color2: Nullable<Color>) => boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Checks if the given color is light.
|
|
26
26
|
*/
|
package/util/color-picker.js
CHANGED
|
@@ -12,7 +12,7 @@ const colorToString = (color, format) => {
|
|
|
12
12
|
if (format === color_picker_1.ColorPickerFormat.HSL) {
|
|
13
13
|
return color.hsl().toString();
|
|
14
14
|
}
|
|
15
|
-
if (format === color_picker_1.ColorPickerFormat.RGB || color.
|
|
15
|
+
if (format === color_picker_1.ColorPickerFormat.RGB || color.alpha() < 1) {
|
|
16
16
|
return color.rgb().toString();
|
|
17
17
|
}
|
|
18
18
|
return color.hex().toString();
|
|
@@ -58,7 +58,7 @@ const convertColor = (color, format) => {
|
|
|
58
58
|
if (format === color_picker_1.ColorPickerFormat.HSL) {
|
|
59
59
|
return color.hsl().toString();
|
|
60
60
|
}
|
|
61
|
-
return (format === color_picker_1.ColorPickerFormat.RGB || color.
|
|
61
|
+
return (format === color_picker_1.ColorPickerFormat.RGB || color.alpha() < 1) ? color.rgb().toString() : color.hex().toString();
|
|
62
62
|
};
|
|
63
63
|
exports.convertColor = convertColor;
|
|
64
64
|
/**
|
|
@@ -72,6 +72,6 @@ exports.isEqual = isEqual;
|
|
|
72
72
|
*/
|
|
73
73
|
const isLight = (color, hasOpacity) => {
|
|
74
74
|
const isLight = color.isLight();
|
|
75
|
-
return hasOpacity ? (isLight || color.
|
|
75
|
+
return hasOpacity ? (isLight || color.alpha() < .4) : isLight;
|
|
76
76
|
};
|
|
77
77
|
exports.isLight = isLight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@smart-react-components/core/util/color");
|
|
4
|
+
const color_picker_1 = require("../types/color-picker");
|
|
5
|
+
const color_picker_2 = require("./color-picker");
|
|
6
|
+
describe('color', () => {
|
|
7
|
+
it('should convert color to string by given format', () => {
|
|
8
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('#FFF'), color_picker_1.ColorPickerFormat.HEX)).toEqual('#FFFFFF');
|
|
9
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('rgba(255, 255, 255, .5)'), color_picker_1.ColorPickerFormat.HEX)).toEqual('rgba(255, 255, 255, 0.5)');
|
|
10
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('#FFF'), color_picker_1.ColorPickerFormat.RGB)).toEqual('rgb(255, 255, 255)');
|
|
11
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('rgba(255, 255, 255, .5)'), color_picker_1.ColorPickerFormat.RGB)).toEqual('rgba(255, 255, 255, 0.5)');
|
|
12
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('#FFF'), color_picker_1.ColorPickerFormat.HSL)).toEqual('hsl(0, 0%, 100%)');
|
|
13
|
+
expect((0, color_picker_2.colorToString)((0, color_1.getColor)('rgba(255, 255, 255, .5)'), color_picker_1.ColorPickerFormat.HSL)).toEqual('hsla(0, 0%, 100%, 0.5)');
|
|
14
|
+
expect((0, color_picker_2.colorToString)(null, color_picker_1.ColorPickerFormat.HEX)).toBeFalsy();
|
|
15
|
+
});
|
|
16
|
+
it('should convert color by format', () => {
|
|
17
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('#0000FF'), color_picker_1.ColorPickerFormat.HEX)).toEqual('#0000FF');
|
|
18
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('#0000FF'), color_picker_1.ColorPickerFormat.RGB)).toEqual('rgb(0, 0, 255)');
|
|
19
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('#0000FF'), color_picker_1.ColorPickerFormat.HSL)).toEqual('hsl(240, 100%, 50%)');
|
|
20
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('rgba(0,0,255,.5)'), color_picker_1.ColorPickerFormat.HEX)).toEqual('rgba(0, 0, 255, 0.5)');
|
|
21
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('rgba(0,0,255,.5)'), color_picker_1.ColorPickerFormat.RGB)).toEqual('rgba(0, 0, 255, 0.5)');
|
|
22
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)('rgba(0,0,255,.5)'), color_picker_1.ColorPickerFormat.HSL)).toEqual('hsla(240, 100%, 50%, 0.5)');
|
|
23
|
+
expect((0, color_picker_2.convertColor)((0, color_1.getColor)(''), color_picker_1.ColorPickerFormat.HEX)).toBeNull();
|
|
24
|
+
});
|
|
25
|
+
it('should check if colors are equal', () => {
|
|
26
|
+
expect((0, color_picker_2.isEqual)((0, color_1.getColor)('#FFF'), (0, color_1.getColor)('#FFF'))).toBeTruthy();
|
|
27
|
+
expect((0, color_picker_2.isEqual)((0, color_1.getColor)('#FFF'), (0, color_1.getColor)('#000'))).toBeFalsy();
|
|
28
|
+
expect((0, color_picker_2.isEqual)((0, color_1.getColor)('#FFF'), null)).toBeFalsy();
|
|
29
|
+
expect((0, color_picker_2.isEqual)(null, (0, color_1.getColor)('#000'))).toBeFalsy();
|
|
30
|
+
expect((0, color_picker_2.isEqual)(null, null)).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
it('should check if color is light', () => {
|
|
33
|
+
expect((0, color_picker_2.isLight)((0, color_1.getColor)('#FFF'), true)).toBeTruthy();
|
|
34
|
+
expect((0, color_picker_2.isLight)((0, color_1.getColor)('#000'), true)).toBeFalsy();
|
|
35
|
+
expect((0, color_picker_2.isLight)((0, color_1.getColor)('rgba(0,0,0,.3)'), true)).toBeTruthy();
|
|
36
|
+
expect((0, color_picker_2.isLight)((0, color_1.getColor)('rgba(0,0,0,.3)'), false)).toBeFalsy();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/util/css.test.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const css_1 = require("./css");
|
|
4
|
+
describe('css', () => {
|
|
5
|
+
it('should extract CSS number unit', () => {
|
|
6
|
+
expect((0, css_1.extractNumberUnit)('16px')).toEqual(16);
|
|
7
|
+
expect((0, css_1.extractNumberUnit)(16)).toEqual(16);
|
|
8
|
+
});
|
|
9
|
+
it('should modify the CSS value and return it back', () => {
|
|
10
|
+
expect((0, css_1.toCSSValue)('.125rem')(value => value / 2)).toEqual('0.0625rem');
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/util/dom.test.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dom_1 = require("./dom");
|
|
4
|
+
describe("DOM", () => {
|
|
5
|
+
it("element should not be able to get rendered in the portal", () => {
|
|
6
|
+
expect((0, dom_1.canBeRenderedInPortal)()).toBe(false);
|
|
7
|
+
});
|
|
8
|
+
});
|
package/util/fixed-box.js
CHANGED
|
@@ -12,7 +12,10 @@ const calculatePosition = (triggerEl, boxEl, e, position, maxWidth, minWidth, sp
|
|
|
12
12
|
}
|
|
13
13
|
const windowWidth = window.innerWidth;
|
|
14
14
|
const windowHeight = window.innerHeight;
|
|
15
|
-
const triggerRect =
|
|
15
|
+
const triggerRect = {
|
|
16
|
+
...triggerEl.getBoundingClientRect(),
|
|
17
|
+
...(0, dom_1.calculateShownPart)(triggerEl),
|
|
18
|
+
};
|
|
16
19
|
if (triggerRect.width <= 0 || triggerRect.height <= 0) {
|
|
17
20
|
boxEl.setAttribute('style', 'pointer-events: none; visibility: hidden;');
|
|
18
21
|
return;
|
|
@@ -35,11 +38,12 @@ exports.calculatePosition = calculatePosition;
|
|
|
35
38
|
* Calculates fixed box position and sized based on X axis position.
|
|
36
39
|
*/
|
|
37
40
|
const calculatePositionBasedOnXAxis = (triggerRect, boxEl, e, position, space, windowWidth, windowHeight, isOverflowPrevented) => {
|
|
38
|
-
var _a, _b, _c, _d
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
var _e, _f, _g, _h;
|
|
39
43
|
// left & width
|
|
40
44
|
let left;
|
|
41
45
|
const width = boxEl.offsetWidth + .5;
|
|
42
|
-
const triggerLeft = (
|
|
46
|
+
const triggerLeft = (_f = (_e = e === null || e === void 0 ? void 0 : e.clientX) !== null && _e !== void 0 ? _e : (_b = (_a = e === null || e === void 0 ? void 0 : e.touches) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.pageX) !== null && _f !== void 0 ? _f : triggerRect.left;
|
|
43
47
|
const triggerWidth = e ? 0 : triggerRect.width;
|
|
44
48
|
const diffLeft = triggerRect.left - (space + width);
|
|
45
49
|
const diffRight = windowWidth - (triggerLeft + triggerWidth + space + width);
|
|
@@ -56,7 +60,7 @@ const calculatePositionBasedOnXAxis = (triggerRect, boxEl, e, position, space, w
|
|
|
56
60
|
// top & height
|
|
57
61
|
let top;
|
|
58
62
|
let height = boxEl.offsetHeight;
|
|
59
|
-
const triggerTop = (_h = (
|
|
63
|
+
const triggerTop = (_h = (_g = e === null || e === void 0 ? void 0 : e.clientY) !== null && _g !== void 0 ? _g : (_d = (_c = e === null || e === void 0 ? void 0 : e.touches) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.pageY) !== null && _h !== void 0 ? _h : triggerRect.top;
|
|
60
64
|
const triggerHeight = e ? 0 : triggerRect.height + triggerRect.top <= windowHeight ? triggerRect.height : (windowHeight - triggerRect.top);
|
|
61
65
|
const diffBottom = windowHeight - (triggerRect.top + height);
|
|
62
66
|
const diffTop = (triggerRect.top + triggerHeight) - height;
|
|
@@ -79,11 +83,12 @@ const calculatePositionBasedOnXAxis = (triggerRect, boxEl, e, position, space, w
|
|
|
79
83
|
* Calculates fixed box position and sized based on Y axis position.
|
|
80
84
|
*/
|
|
81
85
|
const calculatePositionBasedOnYAxis = (triggerRect, boxEl, e, position, space, windowWidth, windowHeight, isOverflowPrevented) => {
|
|
82
|
-
var _a, _b, _c, _d
|
|
86
|
+
var _a, _b, _c, _d;
|
|
87
|
+
var _e, _f, _g, _h;
|
|
83
88
|
// left & width
|
|
84
89
|
let left;
|
|
85
90
|
const width = boxEl.offsetWidth + .5;
|
|
86
|
-
const triggerLeft = (
|
|
91
|
+
const triggerLeft = (_f = (_e = e === null || e === void 0 ? void 0 : e.clientX) !== null && _e !== void 0 ? _e : (_b = (_a = e === null || e === void 0 ? void 0 : e.touches) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.pageX) !== null && _f !== void 0 ? _f : triggerRect.left;
|
|
87
92
|
const triggerWidth = e ? 0 : triggerRect.width;
|
|
88
93
|
const diffLeft = windowWidth - (triggerLeft + width);
|
|
89
94
|
const diffRight = triggerLeft - width;
|
|
@@ -99,7 +104,7 @@ const calculatePositionBasedOnYAxis = (triggerRect, boxEl, e, position, space, w
|
|
|
99
104
|
// top & height
|
|
100
105
|
let top;
|
|
101
106
|
let height = boxEl.offsetHeight;
|
|
102
|
-
const triggerTop = (_h = (
|
|
107
|
+
const triggerTop = (_h = (_g = e === null || e === void 0 ? void 0 : e.clientY) !== null && _g !== void 0 ? _g : (_d = (_c = e === null || e === void 0 ? void 0 : e.touches) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.pageY) !== null && _h !== void 0 ? _h : triggerRect.top;
|
|
103
108
|
const triggerHeight = e ? 0 : triggerRect.height;
|
|
104
109
|
const diffBottom = windowHeight - (triggerTop + triggerHeight + height + space);
|
|
105
110
|
const diffTop = (triggerTop + triggerHeight) - (height + 1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const form_1 = require("./form");
|
|
4
|
+
describe('form', () => {
|
|
5
|
+
it('should calculate the margin X value of the form label', () => {
|
|
6
|
+
expect((0, form_1.calculateFormLabelMarginX)(.5)).toEqual('0.46874');
|
|
7
|
+
});
|
|
8
|
+
it('should get input value', () => {
|
|
9
|
+
expect((0, form_1.getInputValue)('value')).toEqual('value');
|
|
10
|
+
expect((0, form_1.getInputValue)(['value-1', 'value-2'])).toEqual('value-1,value-2');
|
|
11
|
+
expect((0, form_1.getInputValue)(null)).toEqual('');
|
|
12
|
+
expect((0, form_1.getInputValue)([])).toEqual('');
|
|
13
|
+
});
|
|
14
|
+
});
|
package/util/popover.js
CHANGED
|
@@ -96,7 +96,10 @@ const calculatePosition = (triggerEl, boxEl, headerEl, arrowEl, position, space)
|
|
|
96
96
|
}
|
|
97
97
|
const windowWidth = window.innerWidth;
|
|
98
98
|
const windowHeight = window.innerHeight;
|
|
99
|
-
const triggerRect =
|
|
99
|
+
const triggerRect = {
|
|
100
|
+
...triggerEl.getBoundingClientRect(),
|
|
101
|
+
...(0, dom_1.calculateShownPart)(triggerEl),
|
|
102
|
+
};
|
|
100
103
|
if (triggerRect.width <= 0 || triggerRect.height <= 0) {
|
|
101
104
|
boxEl.setAttribute('style', 'pointer-events: none; visibility: hidden;');
|
|
102
105
|
return;
|
package/util/props.js
CHANGED
|
@@ -10,7 +10,13 @@ const types_1 = require("../types");
|
|
|
10
10
|
* @param responsivePropKey - Name of the applied prop.
|
|
11
11
|
* @param valueCallback - It is invoked with the given size prop value to return the responsive prop value.
|
|
12
12
|
*/
|
|
13
|
-
const applyResponsiveStyledProp = (sizeProps, sizePropKey, responsivePropKey, valueCallback) => (
|
|
13
|
+
const applyResponsiveStyledProp = (sizeProps, sizePropKey, responsivePropKey, valueCallback) => ({
|
|
14
|
+
[responsivePropKey]: valueCallback(sizeProps[sizePropKey]),
|
|
15
|
+
...(sizeProps[`${sizePropKey}Sm`] && { [`${responsivePropKey}Sm`]: valueCallback(sizeProps[`${sizePropKey}Sm`]) }),
|
|
16
|
+
...(sizeProps[`${sizePropKey}Md`] && { [`${responsivePropKey}Md`]: valueCallback(sizeProps[`${sizePropKey}Md`]) }),
|
|
17
|
+
...(sizeProps[`${sizePropKey}Lg`] && { [`${responsivePropKey}Lg`]: valueCallback(sizeProps[`${sizePropKey}Lg`]) }),
|
|
18
|
+
...(sizeProps[`${sizePropKey}Xl`] && { [`${responsivePropKey}Xl`]: valueCallback(sizeProps[`${sizePropKey}Xl`]) }),
|
|
19
|
+
});
|
|
14
20
|
exports.applyResponsiveStyledProp = applyResponsiveStyledProp;
|
|
15
21
|
/**
|
|
16
22
|
* Apply the given props to each breakpoint which has a corresponding size prop.
|
|
@@ -22,7 +28,10 @@ exports.applyResponsiveStyledProp = applyResponsiveStyledProp;
|
|
|
22
28
|
const applyResponsiveStyledProps = (sizeProps, sizePropKey, responsiveProps) => {
|
|
23
29
|
let result = {};
|
|
24
30
|
Object.keys(responsiveProps).forEach(key => {
|
|
25
|
-
result =
|
|
31
|
+
result = {
|
|
32
|
+
...result,
|
|
33
|
+
...(0, exports.applyResponsiveStyledProp)(sizeProps, sizePropKey, key, responsiveProps[key]),
|
|
34
|
+
};
|
|
26
35
|
});
|
|
27
36
|
return result;
|
|
28
37
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("../types");
|
|
4
|
+
const props_1 = require("./props");
|
|
5
|
+
describe('props', () => {
|
|
6
|
+
it('should apply the given responsive prop', () => {
|
|
7
|
+
expect((0, props_1.applyResponsiveStyledProp)({ size: 'small', sizeMd: 'medium', sizeLg: 'large' }, 'size', 'iconSize', v => `$size.icon.${v}`)).toEqual({
|
|
8
|
+
iconSize: '$size.icon.small',
|
|
9
|
+
iconSizeMd: '$size.icon.medium',
|
|
10
|
+
iconSizeLg: '$size.icon.large',
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
it('should apply the given responsive props', () => {
|
|
14
|
+
expect((0, props_1.applyResponsiveStyledProps)({ size: 'small', sizeMd: 'medium', sizeLg: 'large' }, 'size', {
|
|
15
|
+
height: v => `$size.icon.${v}`,
|
|
16
|
+
width: v => `$size.icon.${v}`,
|
|
17
|
+
})).toEqual({
|
|
18
|
+
height: '$size.icon.small',
|
|
19
|
+
width: '$size.icon.small',
|
|
20
|
+
heightMd: '$size.icon.medium',
|
|
21
|
+
widthMd: '$size.icon.medium',
|
|
22
|
+
heightLg: '$size.icon.large',
|
|
23
|
+
widthLg: '$size.icon.large',
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
it('should get reverse value of the order position', () => {
|
|
27
|
+
expect((0, props_1.getReverseOrderPosition)(types_1.OrderPosition.LEFT)).toEqual(types_1.OrderPosition.RIGHT);
|
|
28
|
+
expect((0, props_1.getReverseOrderPosition)(types_1.OrderPosition.RIGHT)).toEqual(types_1.OrderPosition.LEFT);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const radio_1 = require("./radio");
|
|
4
|
+
describe('radio', () => {
|
|
5
|
+
it('should calculate the inner circle size of the radio element', () => {
|
|
6
|
+
expect((0, radio_1.calculateRadioInnerCircleSize)(12)).toEqual(2);
|
|
7
|
+
expect((0, radio_1.calculateRadioInnerCircleSize)(16)).toEqual(4);
|
|
8
|
+
expect((0, radio_1.calculateRadioInnerCircleSize)(20)).toEqual(4);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const wave_effect_1 = require("./wave-effect");
|
|
4
|
+
describe('wave-effect', () => {
|
|
5
|
+
it('should get wave effect palette', () => {
|
|
6
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ waveEffectPalette: 'secondary' }, false)).toEqual('secondary');
|
|
7
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: 'light' }, false)).toEqual('dark');
|
|
8
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: 'dynamic' }, false)).toEqual('dark');
|
|
9
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: '!dynamic' }, true)).toEqual('dark');
|
|
10
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: 'dark' }, false)).toEqual('light');
|
|
11
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: 'dynamic' }, true)).toEqual('light');
|
|
12
|
+
expect((0, wave_effect_1.getWaveEffectPalette)({ palette: '!dynamic' }, false)).toEqual('light');
|
|
13
|
+
});
|
|
14
|
+
});
|