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,106 +0,0 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.label {
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
line-height: 18px;
|
|
10
|
-
position: relative;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.text {
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
margin-block-start: -1px;
|
|
16
|
-
margin-inline-start: 8px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.fake-checkbox {
|
|
20
|
-
background-color: var(--palette-white);
|
|
21
|
-
block-size: 16px;
|
|
22
|
-
border: 1px solid var(--palette-bg-3);
|
|
23
|
-
border-radius: 4px;
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
direction: ltr;
|
|
26
|
-
display: block;
|
|
27
|
-
flex-shrink: 0;
|
|
28
|
-
inline-size: 16px;
|
|
29
|
-
position: relative;
|
|
30
|
-
transition:
|
|
31
|
-
background 0.16s ease,
|
|
32
|
-
border-color 0.16s ease,
|
|
33
|
-
box-shadow 0.16s ease;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.checked {
|
|
37
|
-
background-color: var(--checkbox-bg-checked);
|
|
38
|
-
border: 0;
|
|
39
|
-
|
|
40
|
-
&::after {
|
|
41
|
-
block-size: 8px;
|
|
42
|
-
border-block-end: 2px solid var(--palette-black);
|
|
43
|
-
border-inline-end: 2px solid var(--palette-black);
|
|
44
|
-
box-sizing: content-box;
|
|
45
|
-
content: "";
|
|
46
|
-
display: block;
|
|
47
|
-
inline-size: 4px;
|
|
48
|
-
inset-block-start: 45%;
|
|
49
|
-
inset-inline-start: 50%;
|
|
50
|
-
position: absolute;
|
|
51
|
-
transform: translate(-50%, -50%) rotate(45deg);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.variant {
|
|
56
|
-
&_primary {
|
|
57
|
-
&_error {
|
|
58
|
-
border-color: var(--palette-alert);
|
|
59
|
-
box-shadow: 0 0 0 2px var(--palette-alert);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&_checked {
|
|
63
|
-
&::after {
|
|
64
|
-
border-block-end: 2px solid var(--palette-black);
|
|
65
|
-
border-inline-end: 2px solid var(--palette-black);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.control {
|
|
72
|
-
inset-inline-start: -9999px;
|
|
73
|
-
position: absolute;
|
|
74
|
-
|
|
75
|
-
&:disabled + .fake-checkbox::after {
|
|
76
|
-
border-block-end: 2px solid var(--palette-bg-4);
|
|
77
|
-
border-inline-end: 2px solid var(--palette-bg-4);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:hover:not(:disabled) + .fake-checkbox {
|
|
81
|
-
border-color: var(--palette-bg-3);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.control_variant {
|
|
86
|
-
&_primary {
|
|
87
|
-
&:focus:not(:disabled) + .fake-checkbox {
|
|
88
|
-
box-shadow: 0 0 0 2px var(--checkbox-box-shadow-focused);
|
|
89
|
-
}
|
|
90
|
-
/* stylelint-disable-next-line no-descending-specificity */
|
|
91
|
-
&:disabled + .fake-checkbox {
|
|
92
|
-
background-color: var(--checkbox-bg-disabled);
|
|
93
|
-
z-index: 1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&:hover:not(:disabled) + .fake-checkbox {
|
|
97
|
-
background-color: var(--checkbox-bg-hovered);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
&:active:not(:disabled) + .fake-checkbox {
|
|
101
|
-
background-color: var(--checkbox-bg-active);
|
|
102
|
-
border-color: var(--checkbox-border-color-active);
|
|
103
|
-
box-shadow: var(--checkbox-box-shadow-active);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { FocusEvent, ChangeEvent, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export interface CheckboxProps {
|
|
4
|
-
checked?: boolean;
|
|
5
|
-
className?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
hasError?: boolean;
|
|
8
|
-
hint?: ReactNode;
|
|
9
|
-
id?: string;
|
|
10
|
-
label?: ReactNode;
|
|
11
|
-
name?: string;
|
|
12
|
-
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
-
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
15
|
-
size?: "s" | "m" | "l";
|
|
16
|
-
value?: string | number;
|
|
17
|
-
variant?: "primary";
|
|
18
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import Checkbox from ".";
|
|
3
|
-
import type { Meta } from "@storybook/react";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Checkbox> = {
|
|
6
|
-
title: "UI/Checkbox",
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
size: {
|
|
12
|
-
control: { type: "select" },
|
|
13
|
-
options: ["s", "m", "l"],
|
|
14
|
-
},
|
|
15
|
-
variant: {
|
|
16
|
-
control: { type: "select" },
|
|
17
|
-
options: ["primary"],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
disabled: false,
|
|
22
|
-
hasError: false,
|
|
23
|
-
checked: false,
|
|
24
|
-
},
|
|
25
|
-
component: Checkbox,
|
|
26
|
-
} satisfies Meta<typeof Checkbox>;
|
|
27
|
-
|
|
28
|
-
export default meta;
|
|
29
|
-
|
|
30
|
-
const TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
|
|
31
|
-
|
|
32
|
-
const Example = ({ checked: controlledChecked, onChange, ...args }): JSX.Element => {
|
|
33
|
-
const [isChecked, setChecked] = useState<boolean>(controlledChecked ?? false);
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setChecked(controlledChecked);
|
|
37
|
-
}, [controlledChecked]);
|
|
38
|
-
|
|
39
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
40
|
-
setChecked(event.target.checked);
|
|
41
|
-
onChange?.(event);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Checkbox
|
|
46
|
-
checked={isChecked}
|
|
47
|
-
onChange={handleChange}
|
|
48
|
-
hint={args.hasError ? "Error text" : ""}
|
|
49
|
-
{...args}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export const Default = (args): JSX.Element => (
|
|
56
|
-
<ul style={{ listStyleType: "none" }}>
|
|
57
|
-
<li style={{ padding: "3px" }}>
|
|
58
|
-
<Example {...args} label="Label one" />
|
|
59
|
-
</li>
|
|
60
|
-
<li style={{ padding: "3px" }}>
|
|
61
|
-
<Example {...args} label="Label two" />
|
|
62
|
-
</li>
|
|
63
|
-
<li style={{ padding: "3px" }}>
|
|
64
|
-
<Example {...args} label="Disabled" disabled />
|
|
65
|
-
</li>
|
|
66
|
-
<li style={{ padding: "3px" }}>
|
|
67
|
-
<Example {...args} label="Disabled checked" checked disabled />
|
|
68
|
-
</li>
|
|
69
|
-
</ul>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
export const LongText = (args): JSX.Element => (
|
|
73
|
-
<div style={{ width: 300 }}>
|
|
74
|
-
<Example label={TEXT} {...args} />
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames/bind";
|
|
3
|
-
import Typography from "../Typography";
|
|
4
|
-
import styles from "./Checkbox.module.scss";
|
|
5
|
-
import type { FC } from "react";
|
|
6
|
-
import type { CheckboxProps } from "./index.props";
|
|
7
|
-
|
|
8
|
-
const clx = classNames.bind(styles);
|
|
9
|
-
|
|
10
|
-
const Checkbox: FC<CheckboxProps> = ({
|
|
11
|
-
id,
|
|
12
|
-
name,
|
|
13
|
-
value,
|
|
14
|
-
label,
|
|
15
|
-
hint,
|
|
16
|
-
checked,
|
|
17
|
-
onChange,
|
|
18
|
-
onFocus,
|
|
19
|
-
onBlur,
|
|
20
|
-
variant = "primary",
|
|
21
|
-
className,
|
|
22
|
-
disabled,
|
|
23
|
-
hasError,
|
|
24
|
-
}) => (
|
|
25
|
-
<div className={clx(styles.root)}>
|
|
26
|
-
<label className={clx(styles.label)} htmlFor={id}>
|
|
27
|
-
<input
|
|
28
|
-
className={clx(
|
|
29
|
-
styles.control,
|
|
30
|
-
styles[`control_variant_${variant}`],
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
type="checkbox"
|
|
34
|
-
id={id}
|
|
35
|
-
name={name}
|
|
36
|
-
value={value}
|
|
37
|
-
checked={checked}
|
|
38
|
-
onChange={onChange}
|
|
39
|
-
onFocus={onFocus}
|
|
40
|
-
onBlur={onBlur}
|
|
41
|
-
disabled={disabled}
|
|
42
|
-
/>
|
|
43
|
-
<span
|
|
44
|
-
className={clx(styles["fake-checkbox"], styles[`variant_${variant}`], {
|
|
45
|
-
[styles[`variant_${variant}_disabled`]]: disabled,
|
|
46
|
-
[styles[`variant_${variant}_error`]]: hasError,
|
|
47
|
-
[styles[`variant_${variant}_checked`]]: checked,
|
|
48
|
-
[styles.checked]: checked,
|
|
49
|
-
})}
|
|
50
|
-
/>
|
|
51
|
-
<span className={clx(styles.text)}>{label}</span>
|
|
52
|
-
</label>
|
|
53
|
-
{hint && (
|
|
54
|
-
<Typography variant={hasError ? "alert" : "secondary"} tag="span">
|
|
55
|
-
{hint}
|
|
56
|
-
</Typography>
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
export default Checkbox;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
.chip {
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.inner {
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
display: flex;
|
|
9
|
-
font: inherit;
|
|
10
|
-
min-width: 0;
|
|
11
|
-
place-items: stretch flex-start;
|
|
12
|
-
transition-duration: 0.3s;
|
|
13
|
-
transition-property: background, box-shadow, transform;
|
|
14
|
-
transition-timing-function: ease;
|
|
15
|
-
|
|
16
|
-
&_active {
|
|
17
|
-
background: var(--palette-bg-1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&_inactive {
|
|
21
|
-
background: var(--palette-white);
|
|
22
|
-
box-shadow: rgb(193 193 193 / 40%) 0 5px 20px;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
box-shadow: rgb(193 193 193 / 40%) 0 5px 20px;
|
|
26
|
-
transform: translateY(-2px);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:active {
|
|
30
|
-
background: rgb(0 0 0 / 2%);
|
|
31
|
-
box-shadow: rgb(193 193 193 / 40%) 0 1px 3px;
|
|
32
|
-
outline: 0;
|
|
33
|
-
transition-duration: 0.15s;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@media (hover: none) {
|
|
37
|
-
&:hover {
|
|
38
|
-
box-shadow: rgb(193 193 193 / 40%) 0 5px 20px;
|
|
39
|
-
transform: translateY(0);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:active {
|
|
43
|
-
box-shadow: rgb(193 193 193 / 40%) 0 1px 3px;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&[data-size="s"] {
|
|
49
|
-
border-radius: 32px;
|
|
50
|
-
font-size: 0.875rem;
|
|
51
|
-
line-height: 2.2;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&[data-size="m"] {
|
|
55
|
-
border-radius: 36px;
|
|
56
|
-
font-size: 1rem;
|
|
57
|
-
line-height: 2.3;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&[data-size="l"] {
|
|
61
|
-
border-radius: 44px;
|
|
62
|
-
font-size: 1.15rem;
|
|
63
|
-
line-height: 2.4;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.content {
|
|
68
|
-
align-items: center;
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: flex-start;
|
|
71
|
-
max-width: 200px;
|
|
72
|
-
padding: 0 1rem;
|
|
73
|
-
user-select: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.content-inner {
|
|
77
|
-
display: block;
|
|
78
|
-
overflow: hidden;
|
|
79
|
-
text-overflow: ellipsis;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.icon-right {
|
|
83
|
-
align-items: center;
|
|
84
|
-
color: var(--palette-bg-5);
|
|
85
|
-
display: flex;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
margin-left: -11px;
|
|
88
|
-
padding-right: 0.8rem;
|
|
89
|
-
|
|
90
|
-
&:hover {
|
|
91
|
-
color: var(--palette-black);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react'
|
|
2
|
-
import Chip from ".";
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
|
-
import generateUniqID from '../helpers/generateUniqID';
|
|
5
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
6
|
-
import CrossFill from '../Icons/CrossFill';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof Chip> = {
|
|
9
|
-
title: "UI/Chip",
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: "centered",
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
size: {
|
|
15
|
-
control: { type: "select" },
|
|
16
|
-
options: ["s", "m", "l"],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
component: Chip,
|
|
20
|
-
} satisfies Meta<typeof Chip>;
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof Chip>;
|
|
25
|
-
|
|
26
|
-
const menuItems = [
|
|
27
|
-
{
|
|
28
|
-
href: '#',
|
|
29
|
-
text: 'Best sellers',
|
|
30
|
-
isActive: false,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
href: '#',
|
|
34
|
-
text: 'Fiction',
|
|
35
|
-
isActive: false,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
href: '#',
|
|
39
|
-
text: 'Education',
|
|
40
|
-
isActive: false,
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
export const Default = (args: Story) => {
|
|
45
|
-
const [items, setItems] = useState(menuItems);
|
|
46
|
-
|
|
47
|
-
const handleClick = useCallback((index: number) => {
|
|
48
|
-
setItems((prevState) => {
|
|
49
|
-
prevState[index].isActive = !prevState[index].isActive
|
|
50
|
-
return [
|
|
51
|
-
...prevState,
|
|
52
|
-
];
|
|
53
|
-
});
|
|
54
|
-
}, [items]);
|
|
55
|
-
|
|
56
|
-
return(
|
|
57
|
-
<div>
|
|
58
|
-
{items.map((item, index) => (<>
|
|
59
|
-
<Chip key={generateUniqID(index)} isActive={item.isActive} onClick={() => handleClick(index)} {...args}>
|
|
60
|
-
{item.text}
|
|
61
|
-
</Chip>{' '}</>))}
|
|
62
|
-
</div>
|
|
63
|
-
)};
|
|
64
|
-
|
|
65
|
-
export const Sizes = (args: Story) => {
|
|
66
|
-
return(
|
|
67
|
-
<>
|
|
68
|
-
<Chip size="s" {...args}>
|
|
69
|
-
Chip s
|
|
70
|
-
</Chip>{' '}
|
|
71
|
-
<Chip size="m" {...args}>
|
|
72
|
-
Chip m
|
|
73
|
-
</Chip>{' '}
|
|
74
|
-
<Chip size="l" {...args}>
|
|
75
|
-
Chip l
|
|
76
|
-
</Chip>
|
|
77
|
-
</>
|
|
78
|
-
)};
|
|
79
|
-
|
|
80
|
-
export const Deletable = (args: Story) => {
|
|
81
|
-
const handleDelete = () => {
|
|
82
|
-
alert('Click');
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return(
|
|
86
|
-
<>
|
|
87
|
-
<Chip size="s" iconEnd={<CrossFill/>} onClickIcon={handleDelete} {...args}>
|
|
88
|
-
Chip 1
|
|
89
|
-
</Chip>{' '}
|
|
90
|
-
<Chip size="s" iconEnd={<CrossFill/>} onClickIcon={handleDelete} {...args}>
|
|
91
|
-
Chip 2
|
|
92
|
-
</Chip>{' '}
|
|
93
|
-
<Chip size="s" iconEnd={<CrossFill/>} onClickIcon={handleDelete} {...args}>
|
|
94
|
-
Long long chip 3
|
|
95
|
-
</Chip>
|
|
96
|
-
</>
|
|
97
|
-
)};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames/bind";
|
|
3
|
-
import styles from "./Chip.module.scss";
|
|
4
|
-
import type { ChipProps } from "./index.props";
|
|
5
|
-
import type { FC, PropsWithChildren } from "react";
|
|
6
|
-
|
|
7
|
-
const clx = classNames.bind(styles);
|
|
8
|
-
|
|
9
|
-
const Chip: FC<PropsWithChildren<ChipProps>> = ({
|
|
10
|
-
children,
|
|
11
|
-
iconEnd,
|
|
12
|
-
isActive,
|
|
13
|
-
onClick,
|
|
14
|
-
onClickIcon,
|
|
15
|
-
size = "m",
|
|
16
|
-
testID = "chip",
|
|
17
|
-
...props
|
|
18
|
-
}) => (
|
|
19
|
-
<span className={clx("chip")} data-testid={testID} {...props}>
|
|
20
|
-
<span
|
|
21
|
-
className={clx("inner", {
|
|
22
|
-
inner_active: iconEnd || isActive,
|
|
23
|
-
inner_inactive: !iconEnd && !isActive,
|
|
24
|
-
})}
|
|
25
|
-
data-size={size}
|
|
26
|
-
>
|
|
27
|
-
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
|
28
|
-
<span
|
|
29
|
-
className={clx("content")}
|
|
30
|
-
aria-pressed={isActive}
|
|
31
|
-
role="button"
|
|
32
|
-
tabIndex={0}
|
|
33
|
-
onClick={onClick}
|
|
34
|
-
>
|
|
35
|
-
<span className={clx("content-inner")}>{children}</span>
|
|
36
|
-
</span>
|
|
37
|
-
{iconEnd && (
|
|
38
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
39
|
-
<span
|
|
40
|
-
className={clx("icon-right")}
|
|
41
|
-
role="button"
|
|
42
|
-
tabIndex={0}
|
|
43
|
-
onClick={onClickIcon}
|
|
44
|
-
>
|
|
45
|
-
{iconEnd}
|
|
46
|
-
</span>
|
|
47
|
-
)}
|
|
48
|
-
</span>
|
|
49
|
-
</span>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
export default Chip;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { cloneElement, useRef } from "react";
|
|
2
|
-
import useOnClickOutside from "../hooks/useOnClickOutside";
|
|
3
|
-
import type { FC, PropsWithChildren, ReactElement } from "react";
|
|
4
|
-
|
|
5
|
-
const ClickOutside: FC<
|
|
6
|
-
PropsWithChildren<{
|
|
7
|
-
onClick: (e: MouseEvent | TouchEvent) => void;
|
|
8
|
-
}>
|
|
9
|
-
> = ({ children, onClick }) => {
|
|
10
|
-
const childRef = useRef<HTMLElement>();
|
|
11
|
-
|
|
12
|
-
useOnClickOutside(childRef, onClick);
|
|
13
|
-
|
|
14
|
-
if (!React.isValidElement(children)) return null;
|
|
15
|
-
|
|
16
|
-
const combinedRef = (node: HTMLElement) => {
|
|
17
|
-
childRef.current = node;
|
|
18
|
-
|
|
19
|
-
if (React.isValidElement(children) && "ref" in children.props) {
|
|
20
|
-
const childRefProp = children.props.ref;
|
|
21
|
-
|
|
22
|
-
if (typeof childRefProp === "function") {
|
|
23
|
-
childRefProp(node);
|
|
24
|
-
} else if (childRefProp && typeof childRefProp === "object") {
|
|
25
|
-
(childRefProp as React.MutableRefObject<HTMLElement | null>).current =
|
|
26
|
-
node;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return cloneElement(children as ReactElement, {
|
|
32
|
-
ref: combinedRef,
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default ClickOutside;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import Counter from ".";
|
|
4
|
-
import type { Meta } from "@storybook/react";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Counter> = {
|
|
7
|
-
title: "UI/Counter",
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
value: {
|
|
13
|
-
control: { type: "number" },
|
|
14
|
-
},
|
|
15
|
-
min: {
|
|
16
|
-
control: { type: "number" },
|
|
17
|
-
},
|
|
18
|
-
max: {
|
|
19
|
-
control: { type: "number" },
|
|
20
|
-
},
|
|
21
|
-
disabled: {
|
|
22
|
-
control: { type: "boolean" },
|
|
23
|
-
options: [true, false],
|
|
24
|
-
},
|
|
25
|
-
fullWidth: {
|
|
26
|
-
control: { type: "boolean" },
|
|
27
|
-
options: [true, false],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
component: Counter,
|
|
31
|
-
} satisfies Meta<typeof Counter>;
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
|
|
35
|
-
export const Default = (args) => {
|
|
36
|
-
const [value, setValue] = useState(1);
|
|
37
|
-
return (
|
|
38
|
-
<Counter onChange={setValue} min={1} value={value} max={10} {...args} />
|
|
39
|
-
);
|
|
40
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
import classNames from "classnames/bind";
|
|
3
|
-
import Button from "../Button";
|
|
4
|
-
import MinusIcon from "../Icons/Minus";
|
|
5
|
-
import PlusIcon from "../Icons/Plus";
|
|
6
|
-
import styles from "./Counter.module.scss";
|
|
7
|
-
import type { CounterProps } from "./index.props";
|
|
8
|
-
|
|
9
|
-
const clx = classNames.bind(styles);
|
|
10
|
-
|
|
11
|
-
const Counter: React.FC<CounterProps> = ({
|
|
12
|
-
value = 1,
|
|
13
|
-
max,
|
|
14
|
-
min = 0,
|
|
15
|
-
fullWidth,
|
|
16
|
-
onChange,
|
|
17
|
-
disabled,
|
|
18
|
-
className,
|
|
19
|
-
}) => {
|
|
20
|
-
const lastNumValue = useRef<number>(value);
|
|
21
|
-
const minusDisabled = disabled || value <= min;
|
|
22
|
-
const plusDisabled = disabled || value >= max;
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
className={clx(
|
|
27
|
-
styles.root,
|
|
28
|
-
{
|
|
29
|
-
root_fullWidth: fullWidth ? 1 : 0,
|
|
30
|
-
},
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
className={clx(styles.control, {
|
|
36
|
-
control_fullWidth: fullWidth ? 1 : 0,
|
|
37
|
-
})}
|
|
38
|
-
>
|
|
39
|
-
<Button
|
|
40
|
-
icon={<MinusIcon width={16} height={16} />}
|
|
41
|
-
disabled={minusDisabled}
|
|
42
|
-
type="button"
|
|
43
|
-
onClick={(e) => {
|
|
44
|
-
e.stopPropagation();
|
|
45
|
-
onChange(value - 1);
|
|
46
|
-
lastNumValue.current = value - 1;
|
|
47
|
-
}}
|
|
48
|
-
aria-label="decrease"
|
|
49
|
-
/>
|
|
50
|
-
<div className={clx(styles.value)}>{value}</div>
|
|
51
|
-
<Button
|
|
52
|
-
icon={<PlusIcon width={16} height={16} />}
|
|
53
|
-
disabled={plusDisabled}
|
|
54
|
-
type="button"
|
|
55
|
-
onClick={(e) => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
onChange(value + 1);
|
|
58
|
-
lastNumValue.current = value + 1;
|
|
59
|
-
}}
|
|
60
|
-
aria-label="increase"
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default Counter;
|