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
package/scripts/postbuild.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const {
|
|
3
|
-
promises: { readdir },
|
|
4
|
-
writeFileSync,
|
|
5
|
-
} = require("fs");
|
|
6
|
-
|
|
7
|
-
const generatePackageJsons = async () => {
|
|
8
|
-
try {
|
|
9
|
-
const components = (
|
|
10
|
-
await readdir(path.resolve(__dirname, "../dist"), { withFileTypes: true })
|
|
11
|
-
)
|
|
12
|
-
.filter((dir) => dir.isDirectory())
|
|
13
|
-
.filter((dir) => {
|
|
14
|
-
if (dir.name[0].toUpperCase() == dir.name[0]) {
|
|
15
|
-
return dir.name;
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
.map((dir) => dir.name);
|
|
19
|
-
|
|
20
|
-
for (let item of components) {
|
|
21
|
-
const packageJsonContent = {
|
|
22
|
-
sideEffects: false,
|
|
23
|
-
module: `../esm/${item}/index.js`,
|
|
24
|
-
main: "./index.js",
|
|
25
|
-
types: "./index.d.ts",
|
|
26
|
-
};
|
|
27
|
-
const componentPath = path.join(
|
|
28
|
-
path.resolve(__dirname, `../dist/`),
|
|
29
|
-
item,
|
|
30
|
-
);
|
|
31
|
-
writeFileSync(
|
|
32
|
-
`${componentPath}/package.json`,
|
|
33
|
-
JSON.stringify(packageJsonContent, null, 2),
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
} catch (err) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
`Could not create package.json file because of an error: ${err}`,
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
async function run() {
|
|
44
|
-
try {
|
|
45
|
-
await generatePackageJsons();
|
|
46
|
-
} catch (err) {
|
|
47
|
-
console.error(err);
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
run();
|
package/scripts/transformCSS.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const { dirname, relative, resolve } = require("path");
|
|
2
|
-
const { readFile, writeFile, ensureDir } = require('fs-extra');
|
|
3
|
-
const fg = require("fast-glob");
|
|
4
|
-
const postcss = require('postcss')
|
|
5
|
-
|
|
6
|
-
const inputDir = './src';
|
|
7
|
-
const distPaths = ["dist", "dist/esm"];
|
|
8
|
-
|
|
9
|
-
const plugins = [
|
|
10
|
-
require('postcss-import')(),
|
|
11
|
-
require('autoprefixer'),
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
const transformCSS = async () => {
|
|
15
|
-
const files = await fg(`${inputDir}/**/*.scss`);
|
|
16
|
-
const firstDistPath = distPaths[0];
|
|
17
|
-
const postcssProcessor = postcss([
|
|
18
|
-
...plugins
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
files.forEach(async (fileName) => {
|
|
22
|
-
const css = await readFile(fileName);
|
|
23
|
-
const distFilename = resolve(firstDistPath, relative(inputDir, fileName));
|
|
24
|
-
const processedCss = await postcssProcessor.process(css, { from: fileName, to: distFilename });
|
|
25
|
-
for (const outputDir of distPaths) {
|
|
26
|
-
const relativePath = relative(`${inputDir}/components`, fileName);
|
|
27
|
-
const newPath = resolve(outputDir, relativePath);
|
|
28
|
-
await ensureDir(dirname(newPath));
|
|
29
|
-
writeFile(newPath, processedCss.css);
|
|
30
|
-
console.log(`Compiled ${newPath} to SASS.`);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
transformCSS().catch(err => console.error(err));
|
package/scripts/updateImports.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const { writeFile, readFile } = require('fs-extra');
|
|
2
|
-
const fg = require("fast-glob");
|
|
3
|
-
|
|
4
|
-
const inputDir = 'dist';
|
|
5
|
-
|
|
6
|
-
async function updateTsImports() {
|
|
7
|
-
const files = await fg(`${inputDir}/**/*.js`);
|
|
8
|
-
|
|
9
|
-
for (const file of files) {
|
|
10
|
-
const fileContent = await readFile(file, 'utf-8');
|
|
11
|
-
const updatedTsFileContent = fileContent.replace(/\.scss/g, '.css');
|
|
12
|
-
await writeFile(file, updatedTsFileContent);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
updateTsImports().catch(err => console.error(err));
|
package/scripts/variables.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const { writeFile, ensureDir } = require('fs-extra');
|
|
2
|
-
const { resolve, dirname } = require("path");
|
|
3
|
-
const { THEMES } = require('../src/components/Theme');
|
|
4
|
-
|
|
5
|
-
const inputDir = './src';
|
|
6
|
-
const distPaths = ["dist", "dist/esm"];
|
|
7
|
-
|
|
8
|
-
async function variables() {
|
|
9
|
-
let themeDefault = "";
|
|
10
|
-
let themeBA = "";
|
|
11
|
-
Object.entries(THEMES.DEFAULT).forEach(([key, value]) => {
|
|
12
|
-
themeDefault += `--${key}: ${value};\r\n`;
|
|
13
|
-
});
|
|
14
|
-
Object.entries(THEMES.BA).forEach(([key, value]) => {
|
|
15
|
-
themeBA += `--${key}: ${value};\r\n`;
|
|
16
|
-
});
|
|
17
|
-
const defaultContent = `.theme {\r\n${themeDefault}}`;
|
|
18
|
-
const baContent = `.theme {\r\n${themeBA}}`;
|
|
19
|
-
|
|
20
|
-
for (const outputDir of distPaths) {
|
|
21
|
-
const defaultPath = resolve(outputDir, 'theme_default_variables.css');
|
|
22
|
-
const baPath = resolve(outputDir, 'theme_ba_variables.css');
|
|
23
|
-
await ensureDir(dirname(defaultPath));
|
|
24
|
-
await writeFile(defaultPath, defaultContent);
|
|
25
|
-
await writeFile(baPath, baContent);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
variables().catch(err => console.error(err));
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Accordion from '.';
|
|
3
|
-
import { Meta } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Accordion> = {
|
|
6
|
-
title: "UI/Accordion",
|
|
7
|
-
parameters: {
|
|
8
|
-
},
|
|
9
|
-
argTypes: {
|
|
10
|
-
boldTitle: {
|
|
11
|
-
control: { type: "boolean" },
|
|
12
|
-
options: [true, false],
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
args: {
|
|
16
|
-
title: "Accordion title",
|
|
17
|
-
},
|
|
18
|
-
component: Accordion,
|
|
19
|
-
} satisfies Meta<typeof Accordion>;
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
|
|
23
|
-
const wrapperStyles = {
|
|
24
|
-
height: '400px',
|
|
25
|
-
width: '600px',
|
|
26
|
-
backgroundColor: '#DFE7FA',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Default = (args): React.ReactElement => {
|
|
30
|
-
return (
|
|
31
|
-
<div style={wrapperStyles}>
|
|
32
|
-
<Accordion {...args}>
|
|
33
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
|
34
|
-
</Accordion>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const BoldTitle = (args): React.ReactElement => {
|
|
40
|
-
return (
|
|
41
|
-
<div style={wrapperStyles}>
|
|
42
|
-
<Accordion boldTitle {...args}>
|
|
43
|
-
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
|
|
44
|
-
</Accordion>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
-
|
|
3
|
-
import classNames from "classnames/bind";
|
|
4
|
-
import { Chevron } from "../Icons";
|
|
5
|
-
import Typography from "../Typography";
|
|
6
|
-
import styles from "./Accordion.module.scss";
|
|
7
|
-
import type { FC, ReactNode, PropsWithChildren } from "react";
|
|
8
|
-
|
|
9
|
-
const clx = classNames.bind(styles);
|
|
10
|
-
|
|
11
|
-
type Props = {
|
|
12
|
-
title: ReactNode;
|
|
13
|
-
className?: string;
|
|
14
|
-
boldTitle?: boolean;
|
|
15
|
-
tabIndex?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const Accordion: FC<PropsWithChildren<Props>> = ({
|
|
19
|
-
title,
|
|
20
|
-
boldTitle = false,
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
tabIndex,
|
|
24
|
-
}) => {
|
|
25
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
26
|
-
const contentRef = useRef<HTMLDivElement>(null);
|
|
27
|
-
|
|
28
|
-
const toggleAccordion = () => setIsOpen(!isOpen);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (contentRef.current) {
|
|
32
|
-
contentRef.current.style.blockSize = isOpen
|
|
33
|
-
? `${contentRef.current.scrollHeight}px`
|
|
34
|
-
: "0px";
|
|
35
|
-
}
|
|
36
|
-
}, [isOpen]);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div className={clx("root", className)}>
|
|
40
|
-
<div className={clx("header")}>
|
|
41
|
-
<button
|
|
42
|
-
className={clx("button")}
|
|
43
|
-
onClick={toggleAccordion}
|
|
44
|
-
type="button"
|
|
45
|
-
role="button"
|
|
46
|
-
aria-expanded={isOpen}
|
|
47
|
-
tabIndex={tabIndex}
|
|
48
|
-
aria-label="Toggle"
|
|
49
|
-
>
|
|
50
|
-
<Chevron
|
|
51
|
-
className={clx("chevron", { chevron_open: isOpen })}
|
|
52
|
-
width={20}
|
|
53
|
-
height={20}
|
|
54
|
-
/>
|
|
55
|
-
<Typography
|
|
56
|
-
className={clx("text")}
|
|
57
|
-
fontWeight={boldTitle ? "bold" : "normal"}
|
|
58
|
-
>
|
|
59
|
-
{title}
|
|
60
|
-
</Typography>
|
|
61
|
-
<div className={clx("line")} />
|
|
62
|
-
</button>
|
|
63
|
-
</div>
|
|
64
|
-
<div ref={contentRef} className={clx("content")}>
|
|
65
|
-
{children}
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export default Accordion;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" fill="none" viewBox="0 0 42 42"><circle cx="21" cy="21" r="21" fill="#eceef2"/><mask id="org-circle_svg__a" width="42" height="42" x="0" y="0" maskUnits="userSpaceOnUse"><circle cx="21" cy="21" r="21" fill="#eceef2"/></mask><g mask="url(#org-circle_svg__a)"><path fill="#bcc1cc" fill-rule="evenodd" d="M19.103 27.36V34H9V12.062L22.567 6v21.36h-3.464zm-6.64 0v1.733h3.176V27.36h-3.175zm0-6.638v1.732h6.64v-1.732h-6.64zm0-4.042v1.732h6.64V16.68h-6.64zM32.67 27.36h-6.062v1.733h6.062V34h-9.526V18.124h9.526v9.237z" clip-rule="evenodd"/></g></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="39" fill="none"><path fill="#ECEEF2" fillRule="evenodd" d="M33.6 37.997c-2.9-1.709-7-4.725-8.6-4.725h-3.802c-.9 0-2.8-.805-3-1.507-.199-.503-.199-1.408-.1-2.212 0-.1.303-.1.402 0 .8.905 1.099 1.508 1.9 1.508h1.8c.7 0 3.1-2.111 4.099-4.725.2-.603.4-1.608.5-2.713 0-.1.1-.202.1-.1.1.501.3 1.105.4 1.105.3.201.7-.603 1.2-1.709.5-1.006.5-1.608.7-2.413.3-1.105-.1-1.91-.4-1.91a.91.91 0 0 0-.7.302c-.1 0-.2 0-.2-.1 0-.704.1-1.81.9-2.413-1.1-1.005-.4-2.714-.4-2.714.4.2.4 0 .4 0l-.2-1.106c.6-.1 1.1-.603 1.1-.603s-1.6-.402-2.4-1.005c.7-.202 1.117-.957 1.117-.957S27 9.952 26 9.65c.9-.904.3-2.15.3-2.15s-1.6.441-4.7.441c-2.2-.1-3-.402-4.6 1.207-1.9 1.909-1.9 2.412-3.1 2.412 1 1.407.5 2.814.5 2.814l-.1 2.112.1.401s0 .1.1.302c0 .101 0 .303.1.402l.3 1.61s-.1.1-.2 0a1.42 1.42 0 0 0-1.2-.604c-.3 0-.8.805-.4 1.91.3.804.6 1.306.9 2.412s.9 1.91 1.2 1.71q.15-.153.3-.906c0-.1.1 0 .2.102.1 1.004.3 1.908.5 2.411.2.302.4.703.6 1.005-.2 1.709-.4 3.82-.8 5.428-2.6.704-6.6 1.91-10 2.714C2.2 31.967 0 26.74 0 21.11 0 9.45 9.4 0 21 0s21 9.45 21 21.11c0 6.936-3.3 13.066-8.4 16.887" clipRule="evenodd"/></svg>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
import type { AvatarSizes } from "./constants";
|
|
3
|
-
|
|
4
|
-
export enum AccountType {
|
|
5
|
-
Person = "person",
|
|
6
|
-
Organization = "org",
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type AvatarProps = {
|
|
10
|
-
accountType?: AccountType;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
alt?: string;
|
|
13
|
-
size?: AvatarSizes | number;
|
|
14
|
-
avatarURL?: string;
|
|
15
|
-
bordered?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Avatar from ".";
|
|
3
|
-
import type { Meta } from "@storybook/react";
|
|
4
|
-
import { AccountType } from "./index.props";
|
|
5
|
-
import { AvatarSizes } from "./constants";
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof Avatar> = {
|
|
8
|
-
title: "UI/Avatar",
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered'
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
accountType: {
|
|
14
|
-
control: { type: "select" },
|
|
15
|
-
options: Object.values(AccountType),
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
control: { type: "select" },
|
|
19
|
-
options: [AvatarSizes.S, AvatarSizes.M, AvatarSizes.L, AvatarSizes.XL, AvatarSizes.XXL],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
args: {
|
|
23
|
-
size: AvatarSizes.XXL
|
|
24
|
-
},
|
|
25
|
-
component: Avatar,
|
|
26
|
-
} satisfies Meta<typeof Avatar>;
|
|
27
|
-
|
|
28
|
-
export default meta;
|
|
29
|
-
|
|
30
|
-
export const Default = (args) => {
|
|
31
|
-
return <Avatar {...args}/>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Bordered = (args) => {
|
|
35
|
-
return <Avatar bordered {...args}/>;
|
|
36
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React, { memo } from "react";
|
|
2
|
-
|
|
3
|
-
import classNames from "classnames/bind";
|
|
4
|
-
import { AvatarSizes } from "./constants";
|
|
5
|
-
import userCircleUrl from "./assets/user-circle.svg";
|
|
6
|
-
import orgCircleUrl from "./assets/org-circle.svg";
|
|
7
|
-
import styles from "./Avatar.module.scss";
|
|
8
|
-
import { AccountType } from "./index.props";
|
|
9
|
-
import type { AvatarProps } from "./index.props";
|
|
10
|
-
import type { FC } from "react";
|
|
11
|
-
|
|
12
|
-
const clx = classNames.bind(styles);
|
|
13
|
-
|
|
14
|
-
const getStubImage = (type: AccountType) =>
|
|
15
|
-
type === AccountType.Organization ? orgCircleUrl : userCircleUrl;
|
|
16
|
-
|
|
17
|
-
const Avatar: FC<AvatarProps> = memo((props) => {
|
|
18
|
-
const {
|
|
19
|
-
avatarURL,
|
|
20
|
-
style,
|
|
21
|
-
size = AvatarSizes.M,
|
|
22
|
-
className,
|
|
23
|
-
bordered,
|
|
24
|
-
alt = "profile image",
|
|
25
|
-
accountType = AccountType.Organization,
|
|
26
|
-
...rest
|
|
27
|
-
} = props;
|
|
28
|
-
const stubImageURL = getStubImage(accountType);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<img
|
|
32
|
-
alt={alt}
|
|
33
|
-
src={(avatarURL || stubImageURL) as string}
|
|
34
|
-
width={size}
|
|
35
|
-
height={size}
|
|
36
|
-
style={style}
|
|
37
|
-
className={clx(
|
|
38
|
-
"avatar",
|
|
39
|
-
{
|
|
40
|
-
avatar_bordered: !!bordered,
|
|
41
|
-
},
|
|
42
|
-
[className],
|
|
43
|
-
)}
|
|
44
|
-
{...rest}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export default Avatar;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import styles from "./Control.module.scss";
|
|
4
|
-
import type { FC, PropsWithChildren } from "react";
|
|
5
|
-
|
|
6
|
-
import type { ControlProps } from "./index.props";
|
|
7
|
-
|
|
8
|
-
export const BadgeControl: FC<PropsWithChildren<ControlProps>> = ({
|
|
9
|
-
className,
|
|
10
|
-
children,
|
|
11
|
-
...props
|
|
12
|
-
}) => (
|
|
13
|
-
<span className={classNames(styles.root, className)} {...props}>
|
|
14
|
-
{children}
|
|
15
|
-
</span>
|
|
16
|
-
);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import Cart from "../../Icons/Cart";
|
|
5
|
-
import Badge from "..";
|
|
6
|
-
|
|
7
|
-
describe("<Badge />", () => {
|
|
8
|
-
it('should render correctly', () => {
|
|
9
|
-
const { container } = render(
|
|
10
|
-
<Badge content={3}>
|
|
11
|
-
<Cart />
|
|
12
|
-
</Badge>,
|
|
13
|
-
);
|
|
14
|
-
expect(container).toMatchSnapshot();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('has the correct number', () => {
|
|
18
|
-
render(
|
|
19
|
-
<Badge content={3}>
|
|
20
|
-
<Cart />
|
|
21
|
-
</Badge>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const badge = screen.getByTestId('badge');
|
|
25
|
-
expect(badge).toHaveTextContent('3');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Badge /> should render correctly 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<span
|
|
6
|
-
class="root"
|
|
7
|
-
>
|
|
8
|
-
<svg
|
|
9
|
-
fill="currentColor"
|
|
10
|
-
focusable="false"
|
|
11
|
-
height="24"
|
|
12
|
-
viewBox="0 0 20 24"
|
|
13
|
-
width="24"
|
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
>
|
|
16
|
-
<path
|
|
17
|
-
d="M17.677,5.214 C17.6474966,4.87676512 17.3655221,4.61778237 17.027,4.617 L14.47,4.617 C14.47,2.033 12.103,0 9.54,0 C6.976,0 4.768,2.063 4.729,4.617 L2.052,4.617 C1.71273371,4.61587046 1.42966152,4.87586137 1.402,5.214 L0.042,20.519 C0.037,22.32 1.634,23.738 3.601,23.738 L15.478,23.738 C17.444,23.738 19.042,22.32 19.042,20.578 C19.042,20.558 17.677,5.214 17.677,5.214 L17.677,5.214 Z M15.762,22.62 L3.438,22.62 C2.158,22.62 1.12,21.774 1.1,20.731 L2.45,5.5 L4.73,5.5 L4.728,7.566 C4.728,7.944 5.03,8.246 5.408,8.246 C5.786,8.246 6.088,7.944 6.088,7.566 L6.09,5.5 L13.107,5.5 L13.107,7.566 C13.107,7.944 13.409,8.246 13.787,8.246 C13.9678664,8.24679795 14.1415988,8.17550771 14.2697731,8.04789639 C14.3979474,7.92028506 14.4700018,7.7468682 14.47,7.566 L14.47,5.5 L16.745,5.5 L18.1,20.731 C18.08,21.774 17.037,22.621 15.762,22.621 L15.762,22.62 Z M9.595,1.13 C11.482,1.13 13.07,2.716 13.11,4.62 L6.09,4.62 C6.13,2.716 7.708,1.13 9.595,1.13 L9.595,1.13 Z"
|
|
18
|
-
/>
|
|
19
|
-
</svg>
|
|
20
|
-
<span
|
|
21
|
-
class="root root_direction_right"
|
|
22
|
-
data-testid="badge"
|
|
23
|
-
>
|
|
24
|
-
3
|
|
25
|
-
</span>
|
|
26
|
-
</span>
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ControlProps } from "./Control/index.props";
|
|
2
|
-
|
|
3
|
-
export interface Props extends ControlProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
background?: string;
|
|
7
|
-
content?: number;
|
|
8
|
-
invisible?: boolean;
|
|
9
|
-
max?: number;
|
|
10
|
-
showZero?: boolean;
|
|
11
|
-
direction?: "right" | "left";
|
|
12
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import User from "../Icons/User";
|
|
3
|
-
import Cart from "../Icons/Cart";
|
|
4
|
-
import generateUniqID from '../helpers/generateUniqID';
|
|
5
|
-
import Badge from ".";
|
|
6
|
-
import type { ReactNode } from "react";
|
|
7
|
-
import type { Meta } from "@storybook/react";
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof Badge> = {
|
|
10
|
-
title: "UI/Badge",
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: "centered",
|
|
13
|
-
},
|
|
14
|
-
argTypes: {
|
|
15
|
-
content: {
|
|
16
|
-
control: { type: "number" },
|
|
17
|
-
},
|
|
18
|
-
max: {
|
|
19
|
-
control: { type: "number" },
|
|
20
|
-
},
|
|
21
|
-
color: {
|
|
22
|
-
control: { type: "color" },
|
|
23
|
-
},
|
|
24
|
-
background: {
|
|
25
|
-
control: { type: "color" },
|
|
26
|
-
},
|
|
27
|
-
invisible: {
|
|
28
|
-
control: { type: "boolean" },
|
|
29
|
-
options: [true, false],
|
|
30
|
-
},
|
|
31
|
-
showZero: {
|
|
32
|
-
control: { type: "boolean" },
|
|
33
|
-
options: [true, false],
|
|
34
|
-
},
|
|
35
|
-
direction: {
|
|
36
|
-
control: { type: "select" },
|
|
37
|
-
options: ["right", "left"],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
args: {
|
|
41
|
-
invisible: false,
|
|
42
|
-
showZero: false,
|
|
43
|
-
background: "#FC5759",
|
|
44
|
-
color: "#fff",
|
|
45
|
-
direction: "right",
|
|
46
|
-
},
|
|
47
|
-
component: Badge,
|
|
48
|
-
} satisfies Meta<typeof Badge>;
|
|
49
|
-
|
|
50
|
-
export default meta;
|
|
51
|
-
|
|
52
|
-
function render(args) {
|
|
53
|
-
return (
|
|
54
|
-
<div style={{ display: "flex", gap: "30px" }}>
|
|
55
|
-
{[<Cart />, <User />].map((icon: ReactNode, index: number) => {
|
|
56
|
-
return (
|
|
57
|
-
<Badge key={generateUniqID(index)} content={3} {...args}>
|
|
58
|
-
{icon}
|
|
59
|
-
</Badge>
|
|
60
|
-
);
|
|
61
|
-
})}
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const Default = (args) => {
|
|
67
|
-
return <div style={{display: 'flex', flexWrap: 'wrap', gap: '10px'}} >{render(args)}</div>;
|
|
68
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames/bind";
|
|
3
|
-
import { BadgeControl as Control } from "./Control";
|
|
4
|
-
import styles from "./Badge.module.scss";
|
|
5
|
-
import type { FC, PropsWithChildren } from "react";
|
|
6
|
-
import type { Props } from "./index.props";
|
|
7
|
-
|
|
8
|
-
const clx = classNames.bind(styles);
|
|
9
|
-
|
|
10
|
-
const Badge: FC<PropsWithChildren<Props>> = ({
|
|
11
|
-
background,
|
|
12
|
-
children,
|
|
13
|
-
className,
|
|
14
|
-
color,
|
|
15
|
-
content,
|
|
16
|
-
direction = "right",
|
|
17
|
-
invisible: invisibleProp,
|
|
18
|
-
max = 99,
|
|
19
|
-
showZero = false,
|
|
20
|
-
...props
|
|
21
|
-
}) => {
|
|
22
|
-
let invisible = invisibleProp;
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
invisibleProp == null &&
|
|
26
|
-
((content === 0 && !showZero) || content == null)
|
|
27
|
-
) {
|
|
28
|
-
invisible = true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const displayValue = content
|
|
32
|
-
? content > max
|
|
33
|
-
? `${max}+`
|
|
34
|
-
: content
|
|
35
|
-
: undefined;
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Control {...props}>
|
|
39
|
-
{children}
|
|
40
|
-
{displayValue && (
|
|
41
|
-
<span
|
|
42
|
-
className={clx(
|
|
43
|
-
"root",
|
|
44
|
-
{
|
|
45
|
-
[`root_direction_${direction}`]: !!direction,
|
|
46
|
-
root_invisible: invisible,
|
|
47
|
-
},
|
|
48
|
-
className,
|
|
49
|
-
)}
|
|
50
|
-
data-testid="badge"
|
|
51
|
-
style={{ backgroundColor: background, color }}
|
|
52
|
-
>
|
|
53
|
-
{displayValue}
|
|
54
|
-
</span>
|
|
55
|
-
)}
|
|
56
|
-
</Control>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export default Badge;
|