colibri-ui 0.8.1 → 0.8.3
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/{src/components/Accordion/Accordion.module.scss → Accordion/Accordion.module.css} +7 -9
- package/Accordion/index.d.ts +9 -0
- package/Accordion/index.js +67 -0
- package/Accordion/package.json +6 -0
- package/{src/components/Avatar/Avatar.module.scss → Avatar/Avatar.module.css} +3 -4
- package/Avatar/assets/org-circle.svg.js +64 -0
- package/Avatar/assets/user-circle.svg.js +43 -0
- package/Avatar/constants.d.ts +7 -0
- package/Avatar/constants.js +10 -0
- package/Avatar/index.d.ts +4 -0
- package/Avatar/index.js +49 -0
- package/Avatar/index.props.d.ts +15 -0
- package/Avatar/index.props.js +7 -0
- package/Avatar/package.json +6 -0
- package/{src/components/Badge/Badge.module.scss → Badge/Badge.module.css} +13 -16
- package/{src/components/Badge/Control/Control.module.scss → Badge/Control/Control.module.css} +1 -1
- package/Badge/Control/index.d.ts +3 -0
- package/Badge/Control/index.js +23 -0
- package/{src/components/Badge/Control/index.props.ts → Badge/Control/index.props.d.ts} +1 -1
- package/Badge/index.d.ts +4 -0
- package/Badge/index.js +48 -0
- package/Badge/index.props.d.ts +11 -0
- package/Badge/package.json +6 -0
- package/Button/Button.module.css +225 -0
- package/Button/index.d.ts +4 -0
- package/Button/index.js +56 -0
- package/Button/index.props.d.ts +14 -0
- package/Button/package.json +6 -0
- package/Calendar/components/ContinueButton/index.d.ts +10 -0
- package/Calendar/components/ContinueButton/index.js +45 -0
- package/Calendar/components/ContinueButton/index.module.css +4 -0
- package/Calendar/components/Month/Month.d.ts +17 -0
- package/Calendar/components/Month/Month.js +144 -0
- package/{src/components/Calendar/components/Month/index.module.scss → Calendar/components/Month/index.module.css} +48 -62
- package/Calendar/components/Presets/index.d.ts +19 -0
- package/Calendar/components/Presets/index.js +68 -0
- package/{src/components/Calendar/components/Presets/index.module.scss → Calendar/components/Presets/index.module.css} +11 -14
- package/Calendar/index.d.ts +4 -0
- package/Calendar/index.js +222 -0
- package/{src/components/Calendar/index.module.scss → Calendar/index.module.css} +37 -51
- package/Calendar/index.props.d.ts +21 -0
- package/Calendar/package.json +6 -0
- package/Calendar/utils/getMonthWeeks.d.ts +20 -0
- package/Calendar/utils/getMonthWeeks.js +81 -0
- package/Calendar/utils/getNumberOfMonthsBetweenDates.d.ts +4 -0
- package/Calendar/utils/getNumberOfMonthsBetweenDates.js +21 -0
- package/Calendar/utils/getPresets.d.ts +10 -0
- package/Calendar/utils/getStartMonth.d.ts +6 -0
- package/Calendar/utils/getStartMonth.js +15 -0
- package/Checkbox/Checkbox.module.css +89 -0
- package/Checkbox/index.d.ts +4 -0
- package/Checkbox/index.js +59 -0
- package/Checkbox/index.props.d.ts +17 -0
- package/Checkbox/package.json +6 -0
- package/Chip/Chip.module.css +83 -0
- package/Chip/index.d.ts +4 -0
- package/Chip/index.js +56 -0
- package/Chip/index.props.d.ts +10 -0
- package/Chip/package.json +6 -0
- package/ClickOutside/index.d.ts +5 -0
- package/ClickOutside/index.js +36 -0
- package/ClickOutside/package.json +6 -0
- package/{src/components/Counter/Counter.module.scss → Counter/Counter.module.css} +7 -9
- package/Counter/index.d.ts +4 -0
- package/Counter/index.js +71 -0
- package/Counter/index.props.d.ts +9 -0
- package/Counter/package.json +6 -0
- package/{src/components/Datepicker/Datepicker.module.scss → Datepicker/Datepicker.module.css} +1 -1
- package/Datepicker/components/DatePicker/index.d.ts +4 -0
- package/Datepicker/components/DatePicker/index.js +74 -0
- package/{src/components/Datepicker/components/DatePicker/index.module.scss → Datepicker/components/DatePicker/index.module.css} +0 -2
- package/Datepicker/components/DatePicker/index.props.d.ts +5 -0
- package/Datepicker/components/TimePicker/Label/index.d.ts +8 -0
- package/Datepicker/components/TimePicker/Label/index.js +27 -0
- package/Datepicker/components/TimePicker/helpers.d.ts +12 -0
- package/Datepicker/components/TimePicker/helpers.js +41 -0
- package/Datepicker/components/TimePicker/index.d.ts +4 -0
- package/Datepicker/components/TimePicker/index.js +67 -0
- package/{src/components/Datepicker/components/TimePicker/index.module.scss → Datepicker/components/TimePicker/index.module.css} +1 -1
- package/Datepicker/components/TimePicker/index.props.d.ts +8 -0
- package/Datepicker/index.d.ts +4 -0
- package/Datepicker/index.js +35 -0
- package/Datepicker/index.props.d.ts +7 -0
- package/Datepicker/package.json +6 -0
- package/{src/components/DotsLoader/DotsLoader.module.scss → DotsLoader/DotsLoader.module.css} +12 -19
- package/DotsLoader/index.d.ts +5 -0
- package/DotsLoader/index.js +55 -0
- package/DotsLoader/package.json +6 -0
- package/{src/components/Dropdown/Dropdown.module.scss → Dropdown/Dropdown.module.css} +1 -1
- package/Dropdown/index.d.ts +4 -0
- package/Dropdown/index.js +165 -0
- package/Dropdown/index.props.d.ts +20 -0
- package/Dropdown/package.json +6 -0
- package/{src/components/Grid/Grid.module.scss → Grid/Grid.module.css} +1 -2
- package/{src/components/Grid/Item/Grid-Item.module.scss → Grid/Item/Grid-Item.module.css} +2 -2
- package/Grid/Item/index.d.ts +4 -0
- package/Grid/Item/index.js +28 -0
- package/{src/components/Grid/Item/index.props.ts → Grid/Item/index.props.d.ts} +3 -4
- package/Grid/index.d.ts +4 -0
- package/Grid/index.js +34 -0
- package/Grid/index.props.d.ts +6 -0
- package/Grid/package.json +6 -0
- package/Icons/ArrowNext.d.ts +4 -0
- package/Icons/ArrowNext.js +36 -0
- package/Icons/Cart.d.ts +4 -0
- package/Icons/Cart.js +34 -0
- package/Icons/Check.d.ts +4 -0
- package/Icons/Check.js +42 -0
- package/Icons/Chevron.d.ts +4 -0
- package/Icons/Chevron.js +37 -0
- package/Icons/Close.d.ts +4 -0
- package/Icons/Close.js +35 -0
- package/Icons/CrossFill.d.ts +4 -0
- package/Icons/CrossFill.js +33 -0
- package/Icons/Edit.d.ts +4 -0
- package/Icons/Edit.js +35 -0
- package/Icons/Exit.d.ts +4 -0
- package/Icons/Exit.js +36 -0
- package/Icons/EyeClosed.d.ts +4 -0
- package/Icons/EyeClosed.js +34 -0
- package/Icons/EyeOpen.d.ts +4 -0
- package/Icons/EyeOpen.js +41 -0
- package/Icons/Help.d.ts +4 -0
- package/Icons/Help.js +34 -0
- package/Icons/Info.d.ts +4 -0
- package/Icons/Info.js +35 -0
- package/Icons/Minus.d.ts +4 -0
- package/Icons/Minus.js +35 -0
- package/Icons/More.d.ts +4 -0
- package/Icons/More.js +44 -0
- package/Icons/Plus.d.ts +4 -0
- package/Icons/Plus.js +34 -0
- package/Icons/Setting.d.ts +4 -0
- package/Icons/Setting.js +43 -0
- package/Icons/Trash.d.ts +4 -0
- package/Icons/Trash.js +37 -0
- package/Icons/User.d.ts +4 -0
- package/Icons/User.js +42 -0
- package/Icons/index.js +39 -0
- package/{src/components/Icons/index.props.ts → Icons/index.props.d.ts} +4 -5
- package/Icons/package.json +6 -0
- package/Image/Image.module.css +14 -0
- package/Image/index.d.ts +4 -0
- package/Image/index.js +72 -0
- package/Image/index.props.d.ts +10 -0
- package/Image/package.json +6 -0
- package/Input/index.d.ts +4 -0
- package/Input/index.js +55 -0
- package/Input/index.props.d.ts +16 -0
- package/Input/package.json +6 -0
- package/InputRadio/InputRadio.module.css +95 -0
- package/InputRadio/index.d.ts +23 -0
- package/InputRadio/index.js +80 -0
- package/InputRadio/package.json +6 -0
- package/{src/components/Menu/Menu.module.scss → Menu/Menu.module.css} +1 -1
- package/Menu/components/MenuItem/MenuItem.module.css +35 -0
- package/Menu/components/MenuItem/index.d.ts +5 -0
- package/Menu/components/MenuItem/index.js +43 -0
- package/Menu/components/MenuItem/index.props.d.ts +10 -0
- package/Menu/index.d.ts +4 -0
- package/Menu/index.js +48 -0
- package/Menu/index.props.d.ts +11 -0
- package/Menu/package.json +6 -0
- package/{src/components/Modal/Modal.module.scss → Modal/Modal.module.css} +12 -14
- package/{src/components/Modal/components/Close/Close.module.scss → Modal/components/Close/Close.module.css} +1 -1
- package/Modal/components/Close/index.d.ts +5 -0
- package/Modal/components/Close/index.js +29 -0
- package/{src/components/Modal/components/Content/Content.module.scss → Modal/components/Content/Content.module.css} +1 -1
- package/Modal/components/Content/index.d.ts +3 -0
- package/Modal/components/Content/index.js +23 -0
- package/{src/components/Modal/components/Title/Title.module.scss → Modal/components/Title/Title.module.css} +1 -1
- package/Modal/components/Title/index.d.ts +3 -0
- package/Modal/components/Title/index.js +29 -0
- package/Modal/index.d.ts +4 -0
- package/Modal/index.js +71 -0
- package/Modal/index.props.d.ts +5 -0
- package/Modal/package.json +6 -0
- package/MultiSelect/components/MenuOverlay/index.d.ts +19 -0
- package/MultiSelect/components/MenuOverlay/index.js +103 -0
- package/{src/components/MultiSelect/components/MenuOverlay/index.module.scss → MultiSelect/components/MenuOverlay/index.module.css} +1 -1
- package/MultiSelect/components/MenuOverlayItem/index.d.ts +13 -0
- package/MultiSelect/components/MenuOverlayItem/index.js +28 -0
- package/MultiSelect/index.d.ts +4 -0
- package/MultiSelect/index.js +169 -0
- package/{src/components/MultiSelect/index.module.scss → MultiSelect/index.module.css} +6 -9
- package/MultiSelect/index.props.d.ts +32 -0
- package/MultiSelect/package.json +6 -0
- package/MultiSelect/utils/index.d.ts +1 -0
- package/MultiSelect/utils/index.js +7 -0
- package/Portal/index.d.ts +5 -0
- package/Portal/index.js +24 -0
- package/Portal/package.json +6 -0
- package/RadioGroup/Radio.d.ts +19 -0
- package/RadioGroup/Radio.js +45 -0
- package/RadioGroup/RadioGroup.module.css +31 -0
- package/RadioGroup/index.d.ts +26 -0
- package/RadioGroup/index.js +65 -0
- package/RadioGroup/package.json +6 -0
- package/Select/components/MenuOverlay/index.d.ts +11 -0
- package/Select/components/MenuOverlay/index.js +65 -0
- package/{src/components/Select/components/MenuOverlay/index.module.scss → Select/components/MenuOverlay/index.module.css} +1 -1
- package/Select/components/MenuOverlayItem/index.d.ts +14 -0
- package/Select/components/MenuOverlayItem/index.js +47 -0
- package/Select/index.d.ts +4 -0
- package/Select/index.js +108 -0
- package/{src/components/Select/index.module.scss → Select/index.module.css} +11 -15
- package/Select/index.props.d.ts +28 -0
- package/Select/package.json +6 -0
- package/{src/components/Separator/Separator.module.scss → Separator/Separator.module.css} +1 -1
- package/Separator/index.d.ts +6 -0
- package/Separator/index.js +22 -0
- package/Separator/package.json +6 -0
- package/Skeleton/Skeleton.module.css +33 -0
- package/Skeleton/index.d.ts +4 -0
- package/Skeleton/index.js +41 -0
- package/Skeleton/index.props.d.ts +11 -0
- package/Skeleton/package.json +6 -0
- package/Status/index.d.ts +5 -0
- package/Status/index.js +28 -0
- package/Status/index.module.css +45 -0
- package/Status/index.props.d.ts +12 -0
- package/Status/package.json +6 -0
- package/{src/components/Switch/Switch.module.scss → Switch/Switch.module.css} +15 -21
- package/Switch/index.d.ts +4 -0
- package/Switch/index.js +40 -0
- package/Switch/index.props.d.ts +6 -0
- package/Switch/package.json +6 -0
- package/TabsMenu/Tab/Tab.d.ts +4 -0
- package/TabsMenu/Tab/Tab.js +39 -0
- package/TabsMenu/Tab/Tab.module.css +66 -0
- package/TabsMenu/Tab/Tab.props.d.ts +14 -0
- package/{src/components/TabsMenu/TabsMenu.module.scss → TabsMenu/TabsMenu.module.css} +1 -1
- package/TabsMenu/index.d.ts +4 -0
- package/TabsMenu/index.js +93 -0
- package/TabsMenu/index.props.d.ts +11 -0
- package/TabsMenu/package.json +6 -0
- package/TabsPanes/Pane/Pane.d.ts +3 -0
- package/TabsPanes/Pane/Pane.js +22 -0
- package/TabsPanes/Pane/index.props.d.ts +7 -0
- package/TabsPanes/index.d.ts +4 -0
- package/TabsPanes/index.js +35 -0
- package/{src/components/TabsPanes/index.props.ts → TabsPanes/index.props.d.ts} +4 -5
- package/TabsPanes/package.json +6 -0
- package/{src/components/TextArea/TextArea.module.scss → TextArea/TextArea.module.css} +3 -4
- package/TextArea/index.d.ts +4 -0
- package/TextArea/index.js +62 -0
- package/TextArea/index.props.d.ts +13 -0
- package/TextArea/package.json +6 -0
- package/Theme/breakpoints.d.ts +18 -0
- package/Theme/breakpoints.js +38 -0
- package/Theme/colors/common.d.ts +39 -0
- package/Theme/colors/common.js +34 -0
- package/Theme/colors/index.d.ts +64 -0
- package/Theme/colors/index.js +12 -0
- package/Theme/colors/theme_buenos_aires.d.ts +69 -0
- package/Theme/colors/theme_buenos_aires.js +53 -0
- package/Theme/colors/theme_default.d.ts +47 -0
- package/Theme/colors/theme_default.js +40 -0
- package/Theme/global.css +50 -0
- package/Theme/index.d.ts +296 -0
- package/Theme/index.js +11 -0
- package/Theme/package.json +6 -0
- package/Theme/themes/buenos_aires.d.ts +152 -0
- package/Theme/themes/buenos_aires.js +159 -0
- package/Theme/themes/default.d.ts +144 -0
- package/Theme/themes/default.js +151 -0
- package/TimeSelect/Label/index.d.ts +8 -0
- package/TimeSelect/Label/index.js +27 -0
- package/TimeSelect/helpers.d.ts +9 -0
- package/TimeSelect/helpers.js +41 -0
- package/TimeSelect/index.d.ts +11 -0
- package/TimeSelect/index.js +53 -0
- package/TimeSelect/index.props.d.ts +4 -0
- package/TimeSelect/package.json +6 -0
- package/Tooltip/Tooltip.module.css +122 -0
- package/Tooltip/index.d.ts +4 -0
- package/Tooltip/index.js +116 -0
- package/Tooltip/index.props.d.ts +11 -0
- package/Tooltip/package.json +6 -0
- package/Typography/Typography.module.css +64 -0
- package/Typography/index.d.ts +4 -0
- package/Typography/index.js +34 -0
- package/Typography/index.props.d.ts +13 -0
- package/Typography/package.json +6 -0
- package/{src/components/base/BaseInput/BaseInput.module.scss → base/BaseInput/BaseInput.module.css} +3 -4
- package/base/BaseInput/index.d.ts +4 -0
- package/base/BaseInput/index.js +31 -0
- package/base/BaseInput/index.props.d.ts +5 -0
- package/base/FormField/FormField.module.css +11 -0
- package/base/FormField/index.d.ts +4 -0
- package/base/FormField/index.js +37 -0
- package/base/FormField/index.props.d.ts +10 -0
- package/base/InputRoot/InputRoot.module.css +76 -0
- package/base/InputRoot/index.d.ts +4 -0
- package/base/InputRoot/index.js +41 -0
- package/base/InputRoot/index.props.d.ts +15 -0
- package/esm/Accordion/Accordion.module.css +51 -0
- package/esm/Accordion/index.d.ts +9 -0
- package/esm/Accordion/index.js +57 -0
- package/esm/Avatar/Avatar.module.css +15 -0
- package/esm/Avatar/assets/org-circle.svg.js +39 -0
- package/esm/Avatar/assets/user-circle.svg.js +18 -0
- package/esm/Avatar/constants.d.ts +7 -0
- package/esm/Avatar/constants.js +10 -0
- package/esm/Avatar/index.d.ts +4 -0
- package/esm/Avatar/index.js +39 -0
- package/esm/Avatar/index.props.d.ts +15 -0
- package/esm/Avatar/index.props.js +7 -0
- package/esm/Badge/Badge.module.css +30 -0
- package/esm/Badge/Control/Control.module.css +6 -0
- package/esm/Badge/Control/index.d.ts +3 -0
- package/esm/Badge/Control/index.js +15 -0
- package/esm/Badge/Control/index.props.d.ts +3 -0
- package/esm/Badge/index.d.ts +4 -0
- package/esm/Badge/index.js +38 -0
- package/esm/Badge/index.props.d.ts +11 -0
- package/esm/Button/Button.module.css +225 -0
- package/esm/Button/index.d.ts +4 -0
- package/esm/Button/index.js +46 -0
- package/esm/Button/index.props.d.ts +14 -0
- package/esm/Calendar/components/ContinueButton/index.d.ts +10 -0
- package/esm/Calendar/components/ContinueButton/index.js +37 -0
- package/esm/Calendar/components/ContinueButton/index.module.css +4 -0
- package/esm/Calendar/components/Month/Month.d.ts +17 -0
- package/esm/Calendar/components/Month/Month.js +118 -0
- package/esm/Calendar/components/Month/index.module.css +143 -0
- package/esm/Calendar/components/Presets/index.d.ts +19 -0
- package/esm/Calendar/components/Presets/index.js +42 -0
- package/esm/Calendar/components/Presets/index.module.css +28 -0
- package/esm/Calendar/index.d.ts +4 -0
- package/esm/Calendar/index.js +212 -0
- package/esm/Calendar/index.module.css +92 -0
- package/esm/Calendar/index.props.d.ts +21 -0
- package/esm/Calendar/utils/getMonthWeeks.d.ts +20 -0
- package/esm/Calendar/utils/getMonthWeeks.js +79 -0
- package/esm/Calendar/utils/getNumberOfMonthsBetweenDates.d.ts +4 -0
- package/esm/Calendar/utils/getNumberOfMonthsBetweenDates.js +19 -0
- package/esm/Calendar/utils/getPresets.d.ts +10 -0
- package/esm/Calendar/utils/getStartMonth.d.ts +6 -0
- package/esm/Calendar/utils/getStartMonth.js +13 -0
- package/esm/Checkbox/Checkbox.module.css +89 -0
- package/esm/Checkbox/index.d.ts +4 -0
- package/esm/Checkbox/index.js +49 -0
- package/esm/Checkbox/index.props.d.ts +17 -0
- package/esm/Chip/Chip.module.css +83 -0
- package/esm/Chip/index.d.ts +4 -0
- package/esm/Chip/index.js +46 -0
- package/esm/Chip/index.props.d.ts +10 -0
- package/esm/ClickOutside/index.d.ts +5 -0
- package/esm/ClickOutside/index.js +27 -0
- package/esm/Counter/Counter.module.css +34 -0
- package/esm/Counter/index.d.ts +4 -0
- package/esm/Counter/index.js +61 -0
- package/esm/Counter/index.props.d.ts +9 -0
- package/esm/Datepicker/Datepicker.module.css +4 -0
- package/esm/Datepicker/components/DatePicker/index.d.ts +4 -0
- package/esm/Datepicker/components/DatePicker/index.js +64 -0
- package/esm/Datepicker/components/DatePicker/index.module.css +56 -0
- package/esm/Datepicker/components/DatePicker/index.props.d.ts +5 -0
- package/esm/Datepicker/components/TimePicker/Label/index.d.ts +8 -0
- package/esm/Datepicker/components/TimePicker/Label/index.js +19 -0
- package/esm/Datepicker/components/TimePicker/helpers.d.ts +12 -0
- package/esm/Datepicker/components/TimePicker/helpers.js +35 -0
- package/esm/Datepicker/components/TimePicker/index.d.ts +4 -0
- package/esm/Datepicker/components/TimePicker/index.js +57 -0
- package/esm/Datepicker/components/TimePicker/index.module.css +58 -0
- package/esm/Datepicker/components/TimePicker/index.props.d.ts +8 -0
- package/esm/Datepicker/index.d.ts +4 -0
- package/esm/Datepicker/index.js +25 -0
- package/esm/Datepicker/index.props.d.ts +7 -0
- package/esm/DotsLoader/DotsLoader.module.css +39 -0
- package/esm/DotsLoader/index.d.ts +5 -0
- package/esm/DotsLoader/index.js +45 -0
- package/esm/Dropdown/Dropdown.module.css +14 -0
- package/esm/Dropdown/index.d.ts +4 -0
- package/esm/Dropdown/index.js +155 -0
- package/esm/Dropdown/index.props.d.ts +20 -0
- package/esm/Grid/Grid.module.css +15 -0
- package/esm/Grid/Item/Grid-Item.module.css +9 -0
- package/esm/Grid/Item/index.d.ts +4 -0
- package/esm/Grid/Item/index.js +18 -0
- package/esm/Grid/Item/index.props.d.ts +6 -0
- package/esm/Grid/index.d.ts +4 -0
- package/esm/Grid/index.js +24 -0
- package/esm/Grid/index.props.d.ts +6 -0
- package/esm/Icons/ArrowNext.d.ts +4 -0
- package/esm/Icons/ArrowNext.js +28 -0
- package/esm/Icons/Cart.d.ts +4 -0
- package/esm/Icons/Cart.js +26 -0
- package/esm/Icons/Check.d.ts +4 -0
- package/esm/Icons/Check.js +34 -0
- package/esm/Icons/Chevron.d.ts +4 -0
- package/esm/Icons/Chevron.js +29 -0
- package/esm/Icons/Close.d.ts +4 -0
- package/esm/Icons/Close.js +27 -0
- package/esm/Icons/CrossFill.d.ts +4 -0
- package/esm/Icons/CrossFill.js +25 -0
- package/esm/Icons/Edit.d.ts +4 -0
- package/esm/Icons/Edit.js +27 -0
- package/esm/Icons/Exit.d.ts +4 -0
- package/esm/Icons/Exit.js +28 -0
- package/esm/Icons/EyeClosed.d.ts +4 -0
- package/esm/Icons/EyeClosed.js +26 -0
- package/esm/Icons/EyeOpen.d.ts +4 -0
- package/esm/Icons/EyeOpen.js +33 -0
- package/esm/Icons/Help.d.ts +4 -0
- package/esm/Icons/Help.js +26 -0
- package/esm/Icons/Info.d.ts +4 -0
- package/esm/Icons/Info.js +27 -0
- package/esm/Icons/Minus.d.ts +4 -0
- package/esm/Icons/Minus.js +27 -0
- package/esm/Icons/More.d.ts +4 -0
- package/esm/Icons/More.js +36 -0
- package/esm/Icons/Plus.d.ts +4 -0
- package/esm/Icons/Plus.js +26 -0
- package/esm/Icons/Setting.d.ts +4 -0
- package/esm/Icons/Setting.js +35 -0
- package/esm/Icons/Trash.d.ts +4 -0
- package/esm/Icons/Trash.js +29 -0
- package/esm/Icons/User.d.ts +4 -0
- package/esm/Icons/User.js +34 -0
- package/esm/Icons/index.d.ts +17 -0
- package/esm/Icons/index.js +17 -0
- package/esm/Icons/index.props.d.ts +7 -0
- package/esm/Image/Image.module.css +14 -0
- package/esm/Image/index.d.ts +4 -0
- package/esm/Image/index.js +62 -0
- package/esm/Image/index.props.d.ts +10 -0
- package/esm/Input/index.d.ts +4 -0
- package/esm/Input/index.js +46 -0
- package/esm/Input/index.props.d.ts +16 -0
- package/esm/InputRadio/InputRadio.module.css +95 -0
- package/esm/InputRadio/index.d.ts +23 -0
- package/esm/InputRadio/index.js +70 -0
- package/esm/Menu/Menu.module.css +8 -0
- package/esm/Menu/components/MenuItem/MenuItem.module.css +35 -0
- package/esm/Menu/components/MenuItem/index.d.ts +5 -0
- package/esm/Menu/components/MenuItem/index.js +33 -0
- package/esm/Menu/components/MenuItem/index.props.d.ts +10 -0
- package/esm/Menu/index.d.ts +4 -0
- package/esm/Menu/index.js +38 -0
- package/esm/Menu/index.props.d.ts +11 -0
- package/esm/Modal/Modal.module.css +51 -0
- package/esm/Modal/components/Close/Close.module.css +4 -0
- package/esm/Modal/components/Close/index.d.ts +5 -0
- package/esm/Modal/components/Close/index.js +19 -0
- package/esm/Modal/components/Content/Content.module.css +6 -0
- package/esm/Modal/components/Content/index.d.ts +3 -0
- package/esm/Modal/components/Content/index.js +13 -0
- package/esm/Modal/components/Title/Title.module.css +9 -0
- package/esm/Modal/components/Title/index.d.ts +3 -0
- package/esm/Modal/components/Title/index.js +19 -0
- package/esm/Modal/index.d.ts +4 -0
- package/esm/Modal/index.js +61 -0
- package/esm/Modal/index.props.d.ts +5 -0
- package/esm/MultiSelect/components/MenuOverlay/index.d.ts +19 -0
- package/esm/MultiSelect/components/MenuOverlay/index.js +93 -0
- package/esm/MultiSelect/components/MenuOverlay/index.module.css +9 -0
- package/esm/MultiSelect/components/MenuOverlayItem/index.d.ts +13 -0
- package/esm/MultiSelect/components/MenuOverlayItem/index.js +20 -0
- package/esm/MultiSelect/index.d.ts +4 -0
- package/esm/MultiSelect/index.js +159 -0
- package/esm/MultiSelect/index.module.css +49 -0
- package/esm/MultiSelect/index.props.d.ts +32 -0
- package/esm/MultiSelect/utils/index.d.ts +1 -0
- package/esm/MultiSelect/utils/index.js +5 -0
- package/esm/Portal/index.d.ts +5 -0
- package/esm/Portal/index.js +16 -0
- package/esm/RadioGroup/Radio.d.ts +19 -0
- package/esm/RadioGroup/Radio.js +37 -0
- package/esm/RadioGroup/RadioGroup.module.css +31 -0
- package/esm/RadioGroup/index.d.ts +26 -0
- package/esm/RadioGroup/index.js +55 -0
- package/esm/Select/components/MenuOverlay/index.d.ts +11 -0
- package/esm/Select/components/MenuOverlay/index.js +55 -0
- package/esm/Select/components/MenuOverlay/index.module.css +4 -0
- package/esm/Select/components/MenuOverlayItem/index.d.ts +14 -0
- package/esm/Select/components/MenuOverlayItem/index.js +39 -0
- package/esm/Select/index.d.ts +4 -0
- package/esm/Select/index.js +98 -0
- package/esm/Select/index.module.css +37 -0
- package/esm/Select/index.props.d.ts +28 -0
- package/esm/Separator/Separator.module.css +5 -0
- package/esm/Separator/index.d.ts +6 -0
- package/esm/Separator/index.js +12 -0
- package/esm/Skeleton/Skeleton.module.css +33 -0
- package/esm/Skeleton/index.d.ts +4 -0
- package/esm/Skeleton/index.js +32 -0
- package/esm/Skeleton/index.props.d.ts +11 -0
- package/esm/Status/index.d.ts +5 -0
- package/esm/Status/index.js +18 -0
- package/esm/Status/index.module.css +45 -0
- package/esm/Status/index.props.d.ts +12 -0
- package/esm/Switch/Switch.module.css +56 -0
- package/esm/Switch/index.d.ts +4 -0
- package/esm/Switch/index.js +30 -0
- package/esm/Switch/index.props.d.ts +6 -0
- package/esm/TabsMenu/Tab/Tab.d.ts +4 -0
- package/esm/TabsMenu/Tab/Tab.js +29 -0
- package/esm/TabsMenu/Tab/Tab.module.css +66 -0
- package/esm/TabsMenu/Tab/Tab.props.d.ts +14 -0
- package/esm/TabsMenu/TabsMenu.module.css +8 -0
- package/esm/TabsMenu/index.d.ts +4 -0
- package/esm/TabsMenu/index.js +83 -0
- package/esm/TabsMenu/index.props.d.ts +11 -0
- package/esm/TabsPanes/Pane/Pane.d.ts +3 -0
- package/esm/TabsPanes/Pane/Pane.js +15 -0
- package/esm/TabsPanes/Pane/index.props.d.ts +7 -0
- package/esm/TabsPanes/index.d.ts +4 -0
- package/esm/TabsPanes/index.js +26 -0
- package/esm/TabsPanes/index.props.d.ts +8 -0
- package/esm/TextArea/TextArea.module.css +16 -0
- package/esm/TextArea/index.d.ts +4 -0
- package/esm/TextArea/index.js +51 -0
- package/esm/TextArea/index.props.d.ts +13 -0
- package/esm/Theme/breakpoints.d.ts +18 -0
- package/esm/Theme/breakpoints.js +34 -0
- package/esm/Theme/colors/common.d.ts +39 -0
- package/esm/Theme/colors/common.js +26 -0
- package/esm/Theme/colors/index.d.ts +64 -0
- package/esm/Theme/colors/index.js +8 -0
- package/esm/Theme/colors/theme_buenos_aires.d.ts +69 -0
- package/{src/components/Theme/colors/theme_buenos_aires.ts → esm/Theme/colors/theme_buenos_aires.js} +14 -23
- package/esm/Theme/colors/theme_default.d.ts +47 -0
- package/{src/components/Theme/colors/theme_default.ts → esm/Theme/colors/theme_default.js} +12 -19
- package/esm/Theme/global.css +50 -0
- package/esm/Theme/index.d.ts +296 -0
- package/esm/Theme/index.js +9 -0
- package/esm/Theme/themes/buenos_aires.d.ts +152 -0
- package/{src/components/Theme/themes/buenos_aires.ts → esm/Theme/themes/buenos_aires.js} +5 -18
- package/esm/Theme/themes/default.d.ts +144 -0
- package/{src/components/Theme/themes/default.ts → esm/Theme/themes/default.js} +5 -17
- package/esm/TimeSelect/Label/index.d.ts +8 -0
- package/esm/TimeSelect/Label/index.js +19 -0
- package/esm/TimeSelect/helpers.d.ts +9 -0
- package/esm/TimeSelect/helpers.js +35 -0
- package/esm/TimeSelect/index.d.ts +11 -0
- package/esm/TimeSelect/index.js +45 -0
- package/esm/TimeSelect/index.props.d.ts +4 -0
- package/esm/Tooltip/Tooltip.module.css +122 -0
- package/esm/Tooltip/index.d.ts +4 -0
- package/esm/Tooltip/index.js +106 -0
- package/esm/Tooltip/index.props.d.ts +11 -0
- package/esm/Typography/Typography.module.css +64 -0
- package/esm/Typography/index.d.ts +4 -0
- package/esm/Typography/index.js +24 -0
- package/esm/Typography/index.props.d.ts +13 -0
- package/esm/base/BaseInput/BaseInput.module.css +13 -0
- package/esm/base/BaseInput/index.d.ts +4 -0
- package/esm/base/BaseInput/index.js +21 -0
- package/esm/base/BaseInput/index.props.d.ts +5 -0
- package/esm/base/FormField/FormField.module.css +11 -0
- package/esm/base/FormField/index.d.ts +4 -0
- package/esm/base/FormField/index.js +27 -0
- package/esm/base/FormField/index.props.d.ts +10 -0
- package/esm/base/InputRoot/InputRoot.module.css +76 -0
- package/esm/base/InputRoot/index.d.ts +4 -0
- package/esm/base/InputRoot/index.js +31 -0
- package/esm/base/InputRoot/index.props.d.ts +15 -0
- package/esm/helpers/date/index.d.ts +12 -0
- package/esm/helpers/date/index.js +73 -0
- package/esm/helpers/generateUniqID.d.ts +2 -0
- package/esm/helpers/on.d.ts +1 -0
- package/esm/helpers/on.js +10 -0
- package/esm/hooks/useMediaSizes/index.d.ts +5 -0
- package/esm/hooks/useMediaSizes/index.js +36 -0
- package/esm/hooks/useOnClickOutside/index.d.ts +3 -0
- package/esm/hooks/useOnClickOutside/index.js +28 -0
- package/esm/hooks/useScrollLock/index.d.ts +2 -0
- package/esm/hooks/useScrollLock/index.js +22 -0
- package/esm/hooks/useTrapFocus/index.d.ts +3 -0
- package/esm/hooks/useTrapFocus/index.js +30 -0
- package/esm/index.js +54 -0
- package/esm/lib/keyboard.d.ts +4 -0
- package/esm/lib/keyboard.js +25 -0
- package/esm/libs/numbers/leadingZeros.d.ts +4 -0
- package/{src/components/libs/numbers/leadingZeros.ts → esm/libs/numbers/leadingZeros.js} +4 -4
- package/esm/libs/requestIdleCallback/index.d.ts +5 -0
- package/{src/components/libs/requestIdleCallback/index.ts → esm/libs/requestIdleCallback/index.js} +3 -5
- package/esm/theme_ba_variables.css +151 -0
- package/esm/theme_default_variables.css +143 -0
- package/helpers/date/index.d.ts +12 -0
- package/helpers/date/index.js +84 -0
- package/helpers/generateUniqID.d.ts +2 -0
- package/helpers/on.d.ts +1 -0
- package/helpers/on.js +12 -0
- package/hooks/useMediaSizes/index.d.ts +5 -0
- package/hooks/useMediaSizes/index.js +40 -0
- package/hooks/useOnClickOutside/index.d.ts +3 -0
- package/hooks/useOnClickOutside/index.js +32 -0
- package/hooks/useScrollLock/index.d.ts +2 -0
- package/hooks/useScrollLock/index.js +26 -0
- package/hooks/useTrapFocus/index.d.ts +3 -0
- package/hooks/useTrapFocus/index.js +34 -0
- package/index.d.ts +37 -0
- package/index.js +113 -0
- package/lib/keyboard.d.ts +4 -0
- package/lib/keyboard.js +28 -0
- package/libs/numbers/leadingZeros.d.ts +4 -0
- package/libs/numbers/leadingZeros.js +14 -0
- package/libs/requestIdleCallback/index.d.ts +5 -0
- package/libs/requestIdleCallback/index.js +13 -0
- package/package.json +4 -86
- package/theme_ba_variables.css +151 -0
- package/theme_default_variables.css +143 -0
- package/.babelrc +0 -7
- package/.config/jest/__mocks__/noop.js +0 -1
- package/.config/jest/jest.config.ts +0 -207
- package/.config/jest/jest.setup.ts +0 -4
- package/.prettierignore +0 -5
- package/.prettierrc +0 -8
- package/.storybook/AddonThemesSwitcher/constants.ts +0 -7
- package/.storybook/AddonThemesSwitcher/index.ts +0 -45
- package/.storybook/AddonThemesSwitcher/register.tsx +0 -79
- package/.storybook/main.ts +0 -18
- package/.storybook/manager.tsx +0 -1
- package/.storybook/preview-head.html +0 -19
- package/.storybook/preview.tsx +0 -14
- package/.stylelintrc.json +0 -17
- package/@types/image.d.ts +0 -5
- package/@types/typings.d.ts +0 -2
- package/eslint.config.mjs +0 -83
- package/rollup.config.js +0 -81
- package/scripts/buildSass.js +0 -23
- package/scripts/copyFiles.js +0 -32
- package/scripts/postbuild.js +0 -52
- package/scripts/transformCSS.js +0 -35
- package/scripts/updateImports.js +0 -16
- package/scripts/variables.ts +0 -29
- package/src/components/Accordion/Accordion.stories.tsx +0 -47
- package/src/components/Accordion/index.tsx +0 -71
- package/src/components/Avatar/assets/org-circle.svg +0 -1
- package/src/components/Avatar/assets/user-circle.svg +0 -1
- package/src/components/Avatar/constants.ts +0 -7
- package/src/components/Avatar/index.props.ts +0 -17
- package/src/components/Avatar/index.stories.tsx +0 -36
- package/src/components/Avatar/index.tsx +0 -49
- package/src/components/Badge/Control/index.tsx +0 -16
- package/src/components/Badge/__tests__/Badge.test.tsx +0 -27
- package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +0 -28
- package/src/components/Badge/index.props.ts +0 -12
- package/src/components/Badge/index.stories.tsx +0 -68
- package/src/components/Badge/index.tsx +0 -60
- package/src/components/Button/Button.module.scss +0 -265
- package/src/components/Button/index.props.ts +0 -23
- package/src/components/Button/index.stories.tsx +0 -109
- package/src/components/Button/index.tsx +0 -50
- package/src/components/Calendar/components/ContinueButton/index.module.scss +0 -6
- package/src/components/Calendar/components/ContinueButton/index.tsx +0 -45
- package/src/components/Calendar/components/Month/Month.tsx +0 -172
- package/src/components/Calendar/components/Presets/index.tsx +0 -48
- package/src/components/Calendar/index.props.ts +0 -34
- package/src/components/Calendar/index.stories.tsx +0 -45
- package/src/components/Calendar/index.tsx +0 -251
- package/src/components/Calendar/utils/__tests__/getNumberOfMonthsBetweenDates.test.ts +0 -27
- package/src/components/Calendar/utils/getMonthWeeks.ts +0 -135
- package/src/components/Calendar/utils/getNumberOfMonthsBetweenDates.ts +0 -28
- package/src/components/Calendar/utils/getPresets.ts +0 -114
- package/src/components/Calendar/utils/getStartMonth.ts +0 -19
- package/src/components/Checkbox/Checkbox.module.scss +0 -106
- package/src/components/Checkbox/index.props.ts +0 -18
- package/src/components/Checkbox/index.stories.tsx +0 -76
- package/src/components/Checkbox/index.tsx +0 -61
- package/src/components/Chip/Chip.module.scss +0 -93
- package/src/components/Chip/index.props.ts +0 -10
- package/src/components/Chip/index.stories.tsx +0 -97
- package/src/components/Chip/index.tsx +0 -52
- package/src/components/ClickOutside/index.tsx +0 -36
- package/src/components/Counter/index.props.ts +0 -9
- package/src/components/Counter/index.stories.tsx +0 -40
- package/src/components/Counter/index.tsx +0 -67
- package/src/components/Datepicker/components/DatePicker/index.props.ts +0 -5
- package/src/components/Datepicker/components/DatePicker/index.tsx +0 -75
- package/src/components/Datepicker/components/TimePicker/Label/index.tsx +0 -20
- package/src/components/Datepicker/components/TimePicker/helpers.ts +0 -42
- package/src/components/Datepicker/components/TimePicker/index.props.ts +0 -8
- package/src/components/Datepicker/components/TimePicker/index.tsx +0 -60
- package/src/components/Datepicker/index.props.ts +0 -7
- package/src/components/Datepicker/index.stories.tsx +0 -29
- package/src/components/Datepicker/index.tsx +0 -23
- package/src/components/DotsLoader/index.stories.tsx +0 -26
- package/src/components/DotsLoader/index.tsx +0 -29
- package/src/components/Dropdown/__tests__/Dropdown.test.tsx +0 -75
- package/src/components/Dropdown/index.props.ts +0 -27
- package/src/components/Dropdown/index.stories.tsx +0 -40
- package/src/components/Dropdown/index.tsx +0 -210
- package/src/components/Grid/Item/index.tsx +0 -21
- package/src/components/Grid/index.props.ts +0 -6
- package/src/components/Grid/index.stories.tsx +0 -56
- package/src/components/Grid/index.tsx +0 -26
- package/src/components/Icons/ArrowNext.tsx +0 -27
- package/src/components/Icons/Cart.tsx +0 -23
- package/src/components/Icons/Check.tsx +0 -32
- package/src/components/Icons/Chevron.tsx +0 -27
- package/src/components/Icons/Close.tsx +0 -21
- package/src/components/Icons/CrossFill.tsx +0 -22
- package/src/components/Icons/Edit.tsx +0 -25
- package/src/components/Icons/Exit.tsx +0 -26
- package/src/components/Icons/EyeClosed.tsx +0 -22
- package/src/components/Icons/EyeOpen.tsx +0 -30
- package/src/components/Icons/Help.tsx +0 -20
- package/src/components/Icons/Info.tsx +0 -25
- package/src/components/Icons/Minus.tsx +0 -26
- package/src/components/Icons/More.tsx +0 -24
- package/src/components/Icons/Plus.tsx +0 -25
- package/src/components/Icons/Setting.tsx +0 -28
- package/src/components/Icons/Trash.tsx +0 -27
- package/src/components/Icons/User.tsx +0 -33
- package/src/components/Icons/index.stories.tsx +0 -71
- package/src/components/Image/Image.module.scss +0 -16
- package/src/components/Image/index.props.ts +0 -14
- package/src/components/Image/index.stories.tsx +0 -23
- package/src/components/Image/index.tsx +0 -67
- package/src/components/Input/index.props.ts +0 -25
- package/src/components/Input/index.stories.tsx +0 -70
- package/src/components/Input/index.tsx +0 -49
- package/src/components/InputRadio/InputRadio.module.scss +0 -117
- package/src/components/InputRadio/index.tsx +0 -108
- package/src/components/Menu/__tests__/Menu.test.tsx +0 -46
- package/src/components/Menu/components/MenuItem/MenuItem.module.scss +0 -44
- package/src/components/Menu/components/MenuItem/index.props.ts +0 -11
- package/src/components/Menu/components/MenuItem/index.tsx +0 -41
- package/src/components/Menu/index.props.ts +0 -13
- package/src/components/Menu/index.stories.tsx +0 -36
- package/src/components/Menu/index.tsx +0 -49
- package/src/components/Modal/components/Close/index.tsx +0 -12
- package/src/components/Modal/components/Content/index.tsx +0 -10
- package/src/components/Modal/components/Title/index.tsx +0 -15
- package/src/components/Modal/index.props.ts +0 -5
- package/src/components/Modal/index.stories.tsx +0 -32
- package/src/components/Modal/index.tsx +0 -76
- package/src/components/MultiSelect/components/MenuOverlay/index.tsx +0 -120
- package/src/components/MultiSelect/components/MenuOverlayItem/index.tsx +0 -28
- package/src/components/MultiSelect/index.props.ts +0 -37
- package/src/components/MultiSelect/index.stories.tsx +0 -62
- package/src/components/MultiSelect/index.tsx +0 -171
- package/src/components/MultiSelect/utils/index.ts +0 -6
- package/src/components/Portal/index.tsx +0 -18
- package/src/components/RadioGroup/Radio.tsx +0 -56
- package/src/components/RadioGroup/RadioGroup.module.scss +0 -37
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -101
- package/src/components/RadioGroup/index.tsx +0 -92
- package/src/components/Select/__tests__/Select.test.tsx +0 -37
- package/src/components/Select/components/MenuOverlay/index.tsx +0 -66
- package/src/components/Select/components/MenuOverlayItem/index.tsx +0 -53
- package/src/components/Select/index.props.ts +0 -32
- package/src/components/Select/index.stories.tsx +0 -52
- package/src/components/Select/index.tsx +0 -106
- package/src/components/Separator/Separator.stories.tsx +0 -12
- package/src/components/Separator/index.tsx +0 -14
- package/src/components/Skeleton/Skeleton.module.scss +0 -39
- package/src/components/Skeleton/index.props.ts +0 -12
- package/src/components/Skeleton/index.stories.tsx +0 -45
- package/src/components/Skeleton/index.tsx +0 -24
- package/src/components/Status/index.module.scss +0 -54
- package/src/components/Status/index.props.ts +0 -14
- package/src/components/Status/index.stories.tsx +0 -42
- package/src/components/Status/index.tsx +0 -22
- package/src/components/Switch/index.props.ts +0 -8
- package/src/components/Switch/index.stories.tsx +0 -27
- package/src/components/Switch/index.tsx +0 -40
- package/src/components/TabsMenu/Tab/Tab.module.scss +0 -78
- package/src/components/TabsMenu/Tab/Tab.props.ts +0 -20
- package/src/components/TabsMenu/Tab/Tab.tsx +0 -40
- package/src/components/TabsMenu/index.props.ts +0 -13
- package/src/components/TabsMenu/index.stories.tsx +0 -40
- package/src/components/TabsMenu/index.tsx +0 -110
- package/src/components/TabsPanes/Pane/Pane.tsx +0 -14
- package/src/components/TabsPanes/Pane/index.props.ts +0 -8
- package/src/components/TabsPanes/__tests__/TabsPanes.test.tsx +0 -39
- package/src/components/TabsPanes/__tests__/__snapshots__/TabsPanes.test.tsx.snap +0 -189
- package/src/components/TabsPanes/index.stories.tsx +0 -29
- package/src/components/TabsPanes/index.tsx +0 -37
- package/src/components/TextArea/index.props.ts +0 -23
- package/src/components/TextArea/index.stories.tsx +0 -33
- package/src/components/TextArea/index.tsx +0 -56
- package/src/components/Theme/breakpoints.ts +0 -52
- package/src/components/Theme/colors/common.ts +0 -31
- package/src/components/Theme/colors/index.ts +0 -9
- package/src/components/Theme/global.scss +0 -59
- package/src/components/Theme/index.stories.tsx +0 -70
- package/src/components/Theme/index.tsx +0 -7
- package/src/components/TimeSelect/Label/index.tsx +0 -20
- package/src/components/TimeSelect/helpers.ts +0 -37
- package/src/components/TimeSelect/index.props.ts +0 -4
- package/src/components/TimeSelect/index.stories.tsx +0 -64
- package/src/components/TimeSelect/index.tsx +0 -66
- package/src/components/Tooltip/Tooltip.module.scss +0 -148
- package/src/components/Tooltip/__tests__/Tooltip.test.tsx +0 -55
- package/src/components/Tooltip/index.props.ts +0 -27
- package/src/components/Tooltip/index.stories.tsx +0 -50
- package/src/components/Tooltip/index.tsx +0 -151
- package/src/components/Typography/Typography.module.scss +0 -83
- package/src/components/Typography/index.props.ts +0 -37
- package/src/components/Typography/index.stories.tsx +0 -70
- package/src/components/Typography/index.tsx +0 -35
- package/src/components/base/BaseInput/index.props.ts +0 -7
- package/src/components/base/BaseInput/index.tsx +0 -21
- package/src/components/base/FormField/FormField.module.scss +0 -12
- package/src/components/base/FormField/index.props.ts +0 -11
- package/src/components/base/FormField/index.tsx +0 -36
- package/src/components/base/InputRoot/InputRoot.module.scss +0 -93
- package/src/components/base/InputRoot/index.props.ts +0 -18
- package/src/components/base/InputRoot/index.tsx +0 -39
- package/src/components/helpers/__tests__/generateUniqID.test.ts +0 -7
- package/src/components/helpers/date/index.ts +0 -76
- package/src/components/helpers/generateUniqID.ts +0 -6
- package/src/components/helpers/on.ts +0 -13
- package/src/components/hooks/useMediaSizes/index.ts +0 -50
- package/src/components/hooks/useOnClickOutside/index.ts +0 -39
- package/src/components/hooks/useScrollLock/index.ts +0 -26
- package/src/components/hooks/useTrapFocus/index.ts +0 -49
- package/src/components/lib/keyboard.ts +0 -46
- package/src/components/libs/numbers/__tests__/leadingZeros.test.ts +0 -10
- package/tsconfig.json +0 -49
- /package/{src/components/Icons/index.tsx → Icons/index.d.ts} +0 -0
- /package/{src/components/index.ts → esm/index.d.ts} +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import Typography from ".";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Typography> = {
|
|
5
|
-
title: "UI/Typography",
|
|
6
|
-
component: Typography,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
control: { type: "select" },
|
|
13
|
-
options: ["secondary", "alert", "success"],
|
|
14
|
-
},
|
|
15
|
-
tag: {
|
|
16
|
-
control: { type: "select" },
|
|
17
|
-
options: ["span", "p", "h1", "h2", "h3", "div"],
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
control: { type: "select" },
|
|
21
|
-
options: ["small", "medium", "large"],
|
|
22
|
-
},
|
|
23
|
-
fontWeight: {
|
|
24
|
-
control: { type: "select" },
|
|
25
|
-
options: ["normal", "bold", "light"],
|
|
26
|
-
},
|
|
27
|
-
className: { table: { disable: true } },
|
|
28
|
-
style: { table: { disable: true } },
|
|
29
|
-
},
|
|
30
|
-
} satisfies Meta<typeof Typography>;
|
|
31
|
-
|
|
32
|
-
export default meta;
|
|
33
|
-
|
|
34
|
-
type Story = StoryObj<typeof Typography>;
|
|
35
|
-
|
|
36
|
-
const TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
|
|
37
|
-
|
|
38
|
-
export const Default: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
children: TEXT,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Secondary: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
children: TEXT,
|
|
47
|
-
variant: "secondary",
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Alert: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
children: TEXT,
|
|
54
|
-
variant: "alert",
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Success: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
children: TEXT,
|
|
61
|
-
variant: "success",
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const CustomTag: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
children: TEXT,
|
|
68
|
-
tag: "h1",
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames/bind";
|
|
3
|
-
import { type TypographyProps } from "./index.props";
|
|
4
|
-
import styles from "./Typography.module.scss";
|
|
5
|
-
import type { FC, PropsWithChildren } from "react";
|
|
6
|
-
|
|
7
|
-
const clx = classNames.bind(styles);
|
|
8
|
-
|
|
9
|
-
const Typography: FC<PropsWithChildren<TypographyProps>> = ({
|
|
10
|
-
tag: Component = "span",
|
|
11
|
-
children,
|
|
12
|
-
variant,
|
|
13
|
-
size,
|
|
14
|
-
style,
|
|
15
|
-
fontWeight,
|
|
16
|
-
className,
|
|
17
|
-
...props
|
|
18
|
-
}) => (
|
|
19
|
-
<Component
|
|
20
|
-
{...props}
|
|
21
|
-
style={{ ...style }}
|
|
22
|
-
className={clx(
|
|
23
|
-
{
|
|
24
|
-
[`size_${size}`]: Boolean(size),
|
|
25
|
-
[`font-weight_${fontWeight}`]: Boolean(fontWeight),
|
|
26
|
-
[`variant_${variant}`]: Boolean(variant),
|
|
27
|
-
},
|
|
28
|
-
className
|
|
29
|
-
)}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</Component>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export default Typography;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, InputHTMLAttributes } from "react";
|
|
2
|
-
|
|
3
|
-
export interface Props
|
|
4
|
-
extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
5
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>, value: string) => void;
|
|
6
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import styles from "./BaseInput.module.scss";
|
|
4
|
-
import type { ChangeEvent } from "react";
|
|
5
|
-
import type { Props } from "./index.props";
|
|
6
|
-
|
|
7
|
-
const BaseInput = ({ className, onChange, ref, ...props }: Props) => {
|
|
8
|
-
const onChangeHandler = (e: ChangeEvent<HTMLInputElement>) => {
|
|
9
|
-
if (onChange) onChange(e, e.target.value);
|
|
10
|
-
};
|
|
11
|
-
return (
|
|
12
|
-
<input
|
|
13
|
-
className={classNames(styles["base-input"], className)}
|
|
14
|
-
onChange={onChangeHandler}
|
|
15
|
-
ref={ref}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default BaseInput;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
3
|
-
|
|
4
|
-
export type FormFieldProps = PropsWithChildren<{
|
|
5
|
-
className?: string;
|
|
6
|
-
hasError?: boolean;
|
|
7
|
-
hint?: ReactNode;
|
|
8
|
-
label?: ReactNode;
|
|
9
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
}>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import Typography from "../../Typography";
|
|
4
|
-
import styles from "./FormField.module.scss";
|
|
5
|
-
import type { FormFieldProps } from "./index.props";
|
|
6
|
-
|
|
7
|
-
const FormField = ({
|
|
8
|
-
label,
|
|
9
|
-
hint,
|
|
10
|
-
children,
|
|
11
|
-
hasError,
|
|
12
|
-
required,
|
|
13
|
-
className,
|
|
14
|
-
ref,
|
|
15
|
-
}: FormFieldProps) => (
|
|
16
|
-
<div className={classNames(styles.container, className)} ref={ref}>
|
|
17
|
-
{label && (
|
|
18
|
-
<Typography
|
|
19
|
-
className={classNames(styles.label, {
|
|
20
|
-
[styles.label_required]: required,
|
|
21
|
-
})}
|
|
22
|
-
tag="label"
|
|
23
|
-
>
|
|
24
|
-
{label}
|
|
25
|
-
</Typography>
|
|
26
|
-
)}
|
|
27
|
-
{children}
|
|
28
|
-
{hint && (
|
|
29
|
-
<Typography variant={hasError ? "alert" : "secondary"} tag="span">
|
|
30
|
-
{hint}
|
|
31
|
-
</Typography>
|
|
32
|
-
)}
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export default FormField;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
.base-icon {
|
|
2
|
-
align-items: center;
|
|
3
|
-
color: inherit;
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
font-size: 16px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.base-disable-wrapper {
|
|
9
|
-
cursor: not-allowed;
|
|
10
|
-
height: 100%;
|
|
11
|
-
left: 0;
|
|
12
|
-
position: absolute;
|
|
13
|
-
right: 0;
|
|
14
|
-
width: 100%;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.root {
|
|
18
|
-
align-items: center;
|
|
19
|
-
background-color: var(--palette-white);
|
|
20
|
-
border-radius: 0.375rem;
|
|
21
|
-
border-style: solid;
|
|
22
|
-
border-width: 1px;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
color: var(--palette-black);
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
gap: 8px;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
padding: 5px 10px;
|
|
29
|
-
position: relative;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.variant {
|
|
33
|
-
&_primary {
|
|
34
|
-
border-color: var(--input-primary-border-color);
|
|
35
|
-
box-shadow: none;
|
|
36
|
-
transition:
|
|
37
|
-
box-shadow 0.2s ease-in,
|
|
38
|
-
box-shadow 0.1s ease-out;
|
|
39
|
-
|
|
40
|
-
&:hover {
|
|
41
|
-
border-color: var(--palette-primary-3);
|
|
42
|
-
box-shadow: 0 0 0 2px var(--palette-primary-2);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&:active {
|
|
46
|
-
border-color: var(--palette-primary-4);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:focus,
|
|
50
|
-
&:focus-within {
|
|
51
|
-
border-color: var(--palette-primary-4);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&_disabled {
|
|
55
|
-
background-color: var(--palette-bg-1);
|
|
56
|
-
border-color: var(--palette-bg-3);
|
|
57
|
-
color: var(--palette-bg-3);
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&_error {
|
|
63
|
-
background-color: var(--input-primary-bg-error);
|
|
64
|
-
border-color: var(--input-primary-border-color-error);
|
|
65
|
-
|
|
66
|
-
&:hover {
|
|
67
|
-
background-color: var(--palette-white);
|
|
68
|
-
border-color: var(--input-primary-border-color-error);
|
|
69
|
-
box-shadow: 0 0 0 2px var(--input-primary-box-shadow-color-error);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:focus,
|
|
73
|
-
&:focus-within {
|
|
74
|
-
background-color: var(--palette-white);
|
|
75
|
-
border-color: var(--input-primary-border-color-error);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.size {
|
|
82
|
-
&_s {
|
|
83
|
-
height: 32px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&_m {
|
|
87
|
-
height: 36px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&_l {
|
|
91
|
-
height: 42px;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
3
|
-
|
|
4
|
-
export type Size = "s" | "m" | "l";
|
|
5
|
-
|
|
6
|
-
export type Variant = "primary";
|
|
7
|
-
|
|
8
|
-
export type InputProps = PropsWithChildren<{
|
|
9
|
-
variant?: Variant;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
hasError?: boolean;
|
|
12
|
-
className?: string;
|
|
13
|
-
startIcon?: ReactNode;
|
|
14
|
-
endIcon?: ReactNode;
|
|
15
|
-
size?: Size;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
-
}>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import styles from "./InputRoot.module.scss";
|
|
4
|
-
import type { InputProps } from "./index.props";
|
|
5
|
-
|
|
6
|
-
const InputRoot = ({
|
|
7
|
-
className,
|
|
8
|
-
startIcon,
|
|
9
|
-
endIcon,
|
|
10
|
-
children,
|
|
11
|
-
variant = "primary",
|
|
12
|
-
disabled,
|
|
13
|
-
hasError,
|
|
14
|
-
style,
|
|
15
|
-
size,
|
|
16
|
-
ref,
|
|
17
|
-
}: InputProps) => (
|
|
18
|
-
<div
|
|
19
|
-
ref={ref}
|
|
20
|
-
style={style}
|
|
21
|
-
className={classNames(
|
|
22
|
-
styles.root,
|
|
23
|
-
styles[`variant_${variant}`],
|
|
24
|
-
size && styles[`size_${size}`],
|
|
25
|
-
{
|
|
26
|
-
[styles[`variant_${variant}_disabled`]]: disabled,
|
|
27
|
-
[styles[`variant_${variant}_error`]]: hasError,
|
|
28
|
-
},
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
>
|
|
32
|
-
{startIcon && <div className={styles["base-icon"]}>{startIcon}</div>}
|
|
33
|
-
{children}
|
|
34
|
-
{endIcon && <div className={styles["base-icon"]}>{endIcon}</div>}
|
|
35
|
-
{disabled && <div className={styles["base-disable-wrapper"]} />}
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export default InputRoot;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { addDays, format, startOfWeek, parseISO, isValid } from "date-fns";
|
|
2
|
-
import { enGB } from "date-fns/locale";
|
|
3
|
-
|
|
4
|
-
type DateFormat = string | Date;
|
|
5
|
-
|
|
6
|
-
// Helper to parse date strings with fallback
|
|
7
|
-
export const parse = (dateInput: DateFormat): Date => {
|
|
8
|
-
if (!dateInput) {
|
|
9
|
-
return new Date();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const date = typeof dateInput === "string" ? parseISO(dateInput) : dateInput;
|
|
13
|
-
|
|
14
|
-
return isValid(date) ? date : new Date(dateInput);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// Get full month name with the first letter capitalized
|
|
18
|
-
export const getUpperMonthName = (date: DateFormat): string => {
|
|
19
|
-
const parsedDate = parse(date);
|
|
20
|
-
return format(parsedDate, "LLLL", { locale: enGB });
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Get short weekday name by index (e.g., Mo, Tu, etc.)
|
|
24
|
-
export const getShortWeekDayNameByIndex = (index: number): string => {
|
|
25
|
-
const firstDayOfWeek = startOfWeek(new Date());
|
|
26
|
-
return format(addDays(firstDayOfWeek, index), "EEEEEE", { locale: enGB });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Get formatted date string with month and day
|
|
30
|
-
const getDateMonth = (date: DateFormat): string => {
|
|
31
|
-
const parsedDate = parse(date);
|
|
32
|
-
return format(parsedDate, "MMMM d", { locale: enGB });
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Shift the date by a number of days
|
|
36
|
-
export const shiftDate = (date: Date, days: number): Date =>
|
|
37
|
-
addDays(date, days);
|
|
38
|
-
|
|
39
|
-
// Check if two dates are in the same month and year
|
|
40
|
-
export const isSameMonthAndYear = (date: Date, otherDate: Date): boolean =>
|
|
41
|
-
date.getFullYear() === otherDate.getFullYear() &&
|
|
42
|
-
date.getMonth() === otherDate.getMonth();
|
|
43
|
-
|
|
44
|
-
// Convert date to ISO format (YYYY-MM-DD)
|
|
45
|
-
export const toISODate = (date: Date): string => format(date, "yyyy-MM-dd");
|
|
46
|
-
|
|
47
|
-
// Convert date to DMY format (dd.MM.yyyy)
|
|
48
|
-
export const toDMYDate = (dateISO: string): string =>
|
|
49
|
-
dateISO ? format(new Date(dateISO), "dd.MM.yyyy") : "";
|
|
50
|
-
|
|
51
|
-
// Get the period dates as a formatted string
|
|
52
|
-
export const getPeriodDates = (startDate: DateFormat, period = 1): string => {
|
|
53
|
-
const start = parse(startDate);
|
|
54
|
-
if (period === 1) {
|
|
55
|
-
return getDateMonth(start);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const end = shiftDate(start, period - 1);
|
|
59
|
-
const startDateFormat = isSameMonthAndYear(start, end)
|
|
60
|
-
? format(start, "d")
|
|
61
|
-
: getDateMonth(start);
|
|
62
|
-
|
|
63
|
-
return `${startDateFormat} – ${getDateMonth(end)}`;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Clear time from a date
|
|
67
|
-
export const clearTime = (date: Date): Date =>
|
|
68
|
-
new Date(date.setHours(0, 0, 0, 0));
|
|
69
|
-
|
|
70
|
-
// Get the difference in days between two dates
|
|
71
|
-
export const getDaysDiff = (dateStart: Date, dateEnd: Date): number => {
|
|
72
|
-
const start = clearTime(dateStart).getTime();
|
|
73
|
-
const end = clearTime(dateEnd).getTime();
|
|
74
|
-
|
|
75
|
-
return Math.round((end - start) / (1000 * 60 * 60 * 24)); // Convert milliseconds to days
|
|
76
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const on = <K extends keyof HTMLElementEventMap>(
|
|
2
|
-
element: HTMLElement | null | undefined,
|
|
3
|
-
type: K,
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
6
|
-
options?: boolean | AddEventListenerOptions,
|
|
7
|
-
) => {
|
|
8
|
-
element?.addEventListener(type, listener, options);
|
|
9
|
-
|
|
10
|
-
return () => {
|
|
11
|
-
element?.removeEventListener(type, listener, options);
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import Breakpoints from "../../Theme/breakpoints";
|
|
3
|
-
import type { BreakpointsTheme } from "../../Theme/breakpoints";
|
|
4
|
-
|
|
5
|
-
export type QueryInputFunction = (breakpoints: BreakpointsTheme) => string;
|
|
6
|
-
type QueryInput = QueryInputFunction | string;
|
|
7
|
-
|
|
8
|
-
const supportMatchMedia =
|
|
9
|
-
typeof window !== "undefined" && typeof window.matchMedia !== "undefined";
|
|
10
|
-
|
|
11
|
-
const useMediaSizes = (queryInput: QueryInput) => {
|
|
12
|
-
let query =
|
|
13
|
-
typeof queryInput === "function" ? queryInput(Breakpoints) : queryInput;
|
|
14
|
-
|
|
15
|
-
query = query.replace(/^@media( ?)/m, "");
|
|
16
|
-
|
|
17
|
-
const matchMedia = supportMatchMedia ? window.matchMedia : null;
|
|
18
|
-
|
|
19
|
-
const [match, setMatch] = useState(() => {
|
|
20
|
-
if (matchMedia) {
|
|
21
|
-
return matchMedia(query).matches;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return false;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (!matchMedia) return undefined;
|
|
29
|
-
|
|
30
|
-
let active = true;
|
|
31
|
-
|
|
32
|
-
const queryList = matchMedia(query);
|
|
33
|
-
const updateMatch = () => {
|
|
34
|
-
if (active) {
|
|
35
|
-
setMatch(queryList.matches);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
updateMatch();
|
|
39
|
-
queryList.addEventListener("change", updateMatch);
|
|
40
|
-
|
|
41
|
-
return () => {
|
|
42
|
-
active = false;
|
|
43
|
-
queryList.removeEventListener("change", updateMatch);
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return match;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default useMediaSizes;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import type { MutableRefObject, RefObject } from "react";
|
|
3
|
-
|
|
4
|
-
type AnyEvent = MouseEvent | TouchEvent;
|
|
5
|
-
type Ref<T> = RefObject<T> | MutableRefObject<T | undefined>;
|
|
6
|
-
|
|
7
|
-
let element: Ref<HTMLElement> = { current: undefined };
|
|
8
|
-
|
|
9
|
-
function useOnClickOutside<T extends HTMLElement = HTMLElement>(
|
|
10
|
-
ref: RefObject<T> | MutableRefObject<T | undefined>,
|
|
11
|
-
handler: (e: MouseEvent | TouchEvent) => void,
|
|
12
|
-
) {
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const previous = element;
|
|
15
|
-
element = ref;
|
|
16
|
-
|
|
17
|
-
const listener = (event: AnyEvent) => {
|
|
18
|
-
if (ref?.current !== element?.current) return;
|
|
19
|
-
|
|
20
|
-
if (element.current?.contains(event.target as Node)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
handler(event);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
document.addEventListener(`mousedown`, listener, false);
|
|
28
|
-
document.addEventListener(`touchstart`, listener, false);
|
|
29
|
-
|
|
30
|
-
return () => {
|
|
31
|
-
document.removeEventListener(`mousedown`, listener, false);
|
|
32
|
-
document.removeEventListener(`touchstart`, listener, false);
|
|
33
|
-
|
|
34
|
-
element = previous;
|
|
35
|
-
};
|
|
36
|
-
}, [handler, ref]);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default useOnClickOutside;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
const useScrollLock = () => {
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
const body = document.querySelector("body");
|
|
6
|
-
if (!body) return undefined;
|
|
7
|
-
|
|
8
|
-
const { overflow, width } = body.style;
|
|
9
|
-
|
|
10
|
-
const scrollBarWidth =
|
|
11
|
-
window.innerWidth - document.documentElement.clientWidth;
|
|
12
|
-
|
|
13
|
-
body.style.overflow = "hidden";
|
|
14
|
-
|
|
15
|
-
if (scrollBarWidth > 0) {
|
|
16
|
-
body.style.width = `calc(100% - ${scrollBarWidth}px)`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return () => {
|
|
20
|
-
body.style.overflow = overflow;
|
|
21
|
-
body.style.width = width;
|
|
22
|
-
};
|
|
23
|
-
}, []);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default useScrollLock;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import type { RefObject } from "react";
|
|
3
|
-
|
|
4
|
-
const getFocusableModalElements = (element: HTMLElement) =>
|
|
5
|
-
element.querySelectorAll<HTMLElement>(
|
|
6
|
-
'a[href], button, textarea, input[type="text"], input[type="password"], input[type="radio"], input[type="checkbox"], select',
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
function useTrapFocus(refObject: RefObject<HTMLElement>) {
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const handler = (event: KeyboardEvent) => {
|
|
12
|
-
if (!refObject.current || event.code !== "Tab") return;
|
|
13
|
-
|
|
14
|
-
const focusable = Array.from(
|
|
15
|
-
getFocusableModalElements(refObject.current),
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const firstElement = focusable[0];
|
|
19
|
-
const lastElement = focusable[focusable.length - 1];
|
|
20
|
-
if (!lastElement || !firstElement) return;
|
|
21
|
-
|
|
22
|
-
const focusOutside = document.activeElement
|
|
23
|
-
? !focusable.includes(document.activeElement as HTMLElement)
|
|
24
|
-
: true;
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
event.shiftKey &&
|
|
28
|
-
(document.activeElement === firstElement || focusOutside)
|
|
29
|
-
) {
|
|
30
|
-
lastElement.focus();
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
} else if (
|
|
33
|
-
!event.shiftKey &&
|
|
34
|
-
(document.activeElement === lastElement || focusOutside)
|
|
35
|
-
) {
|
|
36
|
-
firstElement.focus();
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
document.addEventListener("keydown", handler);
|
|
42
|
-
|
|
43
|
-
return () => {
|
|
44
|
-
document.removeEventListener("keydown", handler);
|
|
45
|
-
};
|
|
46
|
-
}, [refObject]);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default useTrapFocus;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export type Keys = Record<string, string> & Record<KeyboardKeys, string>;
|
|
2
|
-
|
|
3
|
-
export type KeyboardKeys =
|
|
4
|
-
| "BACKSPACE"
|
|
5
|
-
| "TAB"
|
|
6
|
-
| "ENTER"
|
|
7
|
-
| "CAPS_LOCK"
|
|
8
|
-
| "ESC"
|
|
9
|
-
| "SPACE"
|
|
10
|
-
| "PAGE_UP"
|
|
11
|
-
| "PAGE_DOWN"
|
|
12
|
-
| "END"
|
|
13
|
-
| "HOME"
|
|
14
|
-
| "LEFT"
|
|
15
|
-
| "UP"
|
|
16
|
-
| "RIGHT"
|
|
17
|
-
| "DOWN"
|
|
18
|
-
| "INSERT"
|
|
19
|
-
| "DELETE"
|
|
20
|
-
| string;
|
|
21
|
-
|
|
22
|
-
export const Keys: Keys = {
|
|
23
|
-
BACKSPACE: "Backspace",
|
|
24
|
-
TAB: "Tab",
|
|
25
|
-
ENTER: "Enter",
|
|
26
|
-
CAPS_LOCK: "CapsLock",
|
|
27
|
-
ESC: "Escape",
|
|
28
|
-
SPACE: " ",
|
|
29
|
-
PAGE_UP: "PageUp",
|
|
30
|
-
PAGE_DOWN: "PageDown",
|
|
31
|
-
END: "End",
|
|
32
|
-
HOME: "Home",
|
|
33
|
-
LEFT: "ArrowLeft",
|
|
34
|
-
UP: "ArrowUp",
|
|
35
|
-
RIGHT: "ArrowRight",
|
|
36
|
-
DOWN: "ArrowDown",
|
|
37
|
-
INSERT: "Insert",
|
|
38
|
-
DELETE: "Delete",
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export function isKey(
|
|
42
|
-
eventKey: string,
|
|
43
|
-
keys: Array<KeyboardKeys | string>,
|
|
44
|
-
): boolean {
|
|
45
|
-
return keys.some((value) => Keys[value] === eventKey || value === eventKey);
|
|
46
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { leadingZeros } from "../leadingZeros";
|
|
2
|
-
|
|
3
|
-
describe("Lib. Numbers. leadingZeros", () => {
|
|
4
|
-
it("should return proper strings", () => {
|
|
5
|
-
expect(leadingZeros(1, 0)).toBe("1");
|
|
6
|
-
expect(leadingZeros(1, 1)).toBe("1");
|
|
7
|
-
expect(leadingZeros(1, 2)).toBe("01");
|
|
8
|
-
expect(leadingZeros(1, 3)).toBe("001");
|
|
9
|
-
});
|
|
10
|
-
});
|