powell-react 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.scss +13 -0
- package/.storybook/preview.tsx +24 -0
- package/README.md +0 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/types/src/components/Button/Button.d.ts +6 -0
- package/dist/cjs/types/src/components/Button/index.d.ts +1 -0
- package/dist/cjs/types/src/components/index.d.ts +1 -0
- package/dist/cjs/types/src/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/api/PowellProvider.d.ts +5 -0
- package/dist/cjs/types/src/powell/api/configService.d.ts +2 -0
- package/dist/cjs/types/src/powell/api/forms.d.ts +73 -0
- package/dist/cjs/types/src/powell/api/index.d.ts +5 -0
- package/dist/cjs/types/src/powell/api/powellDefaults.d.ts +2 -0
- package/dist/cjs/types/src/powell/api/primereact.d.ts +968 -0
- package/dist/cjs/types/src/powell/components/AutoComplete/AutoComplete.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/AutoComplete/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Button/Button.d.ts +22 -0
- package/dist/cjs/types/src/powell/components/Button/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/CascadeSelect/CascadeSelect.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/CascadeSelect/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/Checkbox/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Chips/Chips.d.ts +23 -0
- package/dist/cjs/types/src/powell/components/Chips/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/ColorPicker/ColorPicker.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/ColorPicker/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Dropdown/Dropdown.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/Dropdown/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Editor/Editor.d.ts +23 -0
- package/dist/cjs/types/src/powell/components/Editor/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/FormContainer/FormContainer.d.ts +7 -0
- package/dist/cjs/types/src/powell/components/FormContainer/FormContext.d.ts +4 -0
- package/dist/cjs/types/src/powell/components/FormContainer/index.d.ts +2 -0
- package/dist/cjs/types/src/powell/components/InputMask/InputMask.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/InputMask/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputNumber/InputNumber.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/InputNumber/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputOtp/InputOtp.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/InputOtp/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputPassword/InputPassword.d.ts +23 -0
- package/dist/cjs/types/src/powell/components/InputPassword/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputSwitch/InputSwitch.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/InputSwitch/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputText/InputText.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/InputText/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/InputTextarea/InputTextarea.d.ts +23 -0
- package/dist/cjs/types/src/powell/components/InputTextarea/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Knob/Knob.d.ts +20 -0
- package/dist/cjs/types/src/powell/components/Knob/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/ListBox/ListBox.d.ts +20 -0
- package/dist/cjs/types/src/powell/components/ListBox/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Mention/Mention.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/Mention/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/MultiSelect/MultiSelect.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/MultiSelect/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/MultiStateCheckbox/MultiStateCheckbox.d.ts +20 -0
- package/dist/cjs/types/src/powell/components/MultiStateCheckbox/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/RadioGroup/RadioGroup.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/RadioGroup/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Rating/Rating.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/Rating/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/SelectButton/SelectButton.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/SelectButton/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/Slider/Slider.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/Slider/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/ToggleButton/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/TreeSelect/TreeSelect.d.ts +24 -0
- package/dist/cjs/types/src/powell/components/TreeSelect/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/components/TriStateCheckbox/TriStateCheckbox.d.ts +21 -0
- package/dist/cjs/types/src/powell/components/TriStateCheckbox/index.d.ts +1 -0
- package/dist/cjs/types/src/powell/hooks/index.d.ts +3 -0
- package/dist/cjs/types/src/powell/hooks/useApplyConfig.d.ts +17 -0
- package/dist/cjs/types/src/powell/hooks/useFormContext.d.ts +2 -0
- package/dist/cjs/types/src/powell/hooks/usePowellConfig.d.ts +2 -0
- package/dist/cjs/types/src/powell/index.d.ts +29 -0
- package/dist/cjs/types/src/powell/models/common.d.ts +7 -0
- package/dist/cjs/types/src/powell/models/config.d.ts +13 -0
- package/dist/cjs/types/src/powell/models/forms.d.ts +28 -0
- package/dist/cjs/types/src/powell/models/index.d.ts +3 -0
- package/dist/cjs/types/src/powell/utils/globalState.d.ts +19 -0
- package/dist/cjs/types/src/powell/utils/index.d.ts +2 -0
- package/dist/cjs/types/src/powell/utils/utilsService.d.ts +8 -0
- package/dist/cjs/types/vite.config.d.ts +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types/src/components/Button/Button.d.ts +6 -0
- package/dist/esm/types/src/components/Button/index.d.ts +1 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/dist/esm/types/src/powell/api/PowellProvider.d.ts +5 -0
- package/dist/esm/types/src/powell/api/configService.d.ts +2 -0
- package/dist/esm/types/src/powell/api/forms.d.ts +73 -0
- package/dist/esm/types/src/powell/api/index.d.ts +5 -0
- package/dist/esm/types/src/powell/api/powellDefaults.d.ts +2 -0
- package/dist/esm/types/src/powell/api/primereact.d.ts +968 -0
- package/dist/esm/types/src/powell/components/AutoComplete/AutoComplete.d.ts +24 -0
- package/dist/esm/types/src/powell/components/AutoComplete/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Button/Button.d.ts +22 -0
- package/dist/esm/types/src/powell/components/Button/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/CascadeSelect/CascadeSelect.d.ts +24 -0
- package/dist/esm/types/src/powell/components/CascadeSelect/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/esm/types/src/powell/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Chips/Chips.d.ts +23 -0
- package/dist/esm/types/src/powell/components/Chips/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/ColorPicker/ColorPicker.d.ts +24 -0
- package/dist/esm/types/src/powell/components/ColorPicker/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Dropdown/Dropdown.d.ts +24 -0
- package/dist/esm/types/src/powell/components/Dropdown/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Editor/Editor.d.ts +23 -0
- package/dist/esm/types/src/powell/components/Editor/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/FormContainer/FormContainer.d.ts +7 -0
- package/dist/esm/types/src/powell/components/FormContainer/FormContext.d.ts +4 -0
- package/dist/esm/types/src/powell/components/FormContainer/index.d.ts +2 -0
- package/dist/esm/types/src/powell/components/InputMask/InputMask.d.ts +24 -0
- package/dist/esm/types/src/powell/components/InputMask/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputNumber/InputNumber.d.ts +24 -0
- package/dist/esm/types/src/powell/components/InputNumber/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputOtp/InputOtp.d.ts +21 -0
- package/dist/esm/types/src/powell/components/InputOtp/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputPassword/InputPassword.d.ts +23 -0
- package/dist/esm/types/src/powell/components/InputPassword/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputSwitch/InputSwitch.d.ts +21 -0
- package/dist/esm/types/src/powell/components/InputSwitch/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputText/InputText.d.ts +24 -0
- package/dist/esm/types/src/powell/components/InputText/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/InputTextarea/InputTextarea.d.ts +23 -0
- package/dist/esm/types/src/powell/components/InputTextarea/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Knob/Knob.d.ts +20 -0
- package/dist/esm/types/src/powell/components/Knob/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/ListBox/ListBox.d.ts +20 -0
- package/dist/esm/types/src/powell/components/ListBox/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Mention/Mention.d.ts +24 -0
- package/dist/esm/types/src/powell/components/Mention/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/MultiSelect/MultiSelect.d.ts +24 -0
- package/dist/esm/types/src/powell/components/MultiSelect/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/MultiStateCheckbox/MultiStateCheckbox.d.ts +20 -0
- package/dist/esm/types/src/powell/components/MultiStateCheckbox/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/RadioGroup/RadioGroup.d.ts +24 -0
- package/dist/esm/types/src/powell/components/RadioGroup/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Rating/Rating.d.ts +21 -0
- package/dist/esm/types/src/powell/components/Rating/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/SelectButton/SelectButton.d.ts +21 -0
- package/dist/esm/types/src/powell/components/SelectButton/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/Slider/Slider.d.ts +21 -0
- package/dist/esm/types/src/powell/components/Slider/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/esm/types/src/powell/components/ToggleButton/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/TreeSelect/TreeSelect.d.ts +24 -0
- package/dist/esm/types/src/powell/components/TreeSelect/index.d.ts +1 -0
- package/dist/esm/types/src/powell/components/TriStateCheckbox/TriStateCheckbox.d.ts +21 -0
- package/dist/esm/types/src/powell/components/TriStateCheckbox/index.d.ts +1 -0
- package/dist/esm/types/src/powell/hooks/index.d.ts +3 -0
- package/dist/esm/types/src/powell/hooks/useApplyConfig.d.ts +17 -0
- package/dist/esm/types/src/powell/hooks/useFormContext.d.ts +2 -0
- package/dist/esm/types/src/powell/hooks/usePowellConfig.d.ts +2 -0
- package/dist/esm/types/src/powell/index.d.ts +29 -0
- package/dist/esm/types/src/powell/models/common.d.ts +7 -0
- package/dist/esm/types/src/powell/models/config.d.ts +13 -0
- package/dist/esm/types/src/powell/models/forms.d.ts +28 -0
- package/dist/esm/types/src/powell/models/index.d.ts +3 -0
- package/dist/esm/types/src/powell/utils/globalState.d.ts +19 -0
- package/dist/esm/types/src/powell/utils/index.d.ts +2 -0
- package/dist/esm/types/src/powell/utils/utilsService.d.ts +8 -0
- package/dist/esm/types/vite.config.d.ts +2 -0
- package/package.json +70 -0
- package/rollup.config.mjs +95 -0
- package/src/components/Button/Button.scss +43 -0
- package/src/components/Button/Button.stories.tsx +13 -0
- package/src/components/Button/Button.tsx +19 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/powell/api/PowellProvider.tsx +37 -0
- package/src/powell/api/configService.ts +4 -0
- package/src/powell/api/forms.ts +145 -0
- package/src/powell/api/index.ts +5 -0
- package/src/powell/api/powellDefaults.ts +11 -0
- package/src/powell/api/primereact.ts +1945 -0
- package/src/powell/components/AutoComplete/AutoComplete.scss +126 -0
- package/src/powell/components/AutoComplete/AutoComplete.tsx +190 -0
- package/src/powell/components/AutoComplete/index.ts +1 -0
- package/src/powell/components/Button/Button.tsx +90 -0
- package/src/powell/components/Button/index.ts +1 -0
- package/src/powell/components/CascadeSelect/CascadeSelect.scss +126 -0
- package/src/powell/components/CascadeSelect/CascadeSelect.tsx +190 -0
- package/src/powell/components/CascadeSelect/index.ts +1 -0
- package/src/powell/components/Checkbox/Checkbox.scss +32 -0
- package/src/powell/components/Checkbox/Checkbox.tsx +147 -0
- package/src/powell/components/Checkbox/index.ts +1 -0
- package/src/powell/components/Chips/Chips.scss +126 -0
- package/src/powell/components/Chips/Chips.tsx +190 -0
- package/src/powell/components/Chips/index.ts +1 -0
- package/src/powell/components/ColorPicker/ColorPicker.scss +126 -0
- package/src/powell/components/ColorPicker/ColorPicker.tsx +186 -0
- package/src/powell/components/ColorPicker/index.ts +1 -0
- package/src/powell/components/Dropdown/Dropdown.scss +126 -0
- package/src/powell/components/Dropdown/Dropdown.tsx +190 -0
- package/src/powell/components/Dropdown/index.ts +1 -0
- package/src/powell/components/Editor/Editor.scss +126 -0
- package/src/powell/components/Editor/Editor.tsx +183 -0
- package/src/powell/components/Editor/index.ts +1 -0
- package/src/powell/components/FormContainer/FormContainer.tsx +49 -0
- package/src/powell/components/FormContainer/FormContext.tsx +18 -0
- package/src/powell/components/FormContainer/index.ts +2 -0
- package/src/powell/components/InputMask/InputMask.scss +126 -0
- package/src/powell/components/InputMask/InputMask.tsx +190 -0
- package/src/powell/components/InputMask/index.ts +1 -0
- package/src/powell/components/InputNumber/InputNumber.scss +126 -0
- package/src/powell/components/InputNumber/InputNumber.tsx +190 -0
- package/src/powell/components/InputNumber/index.ts +1 -0
- package/src/powell/components/InputOtp/InputOtp.scss +126 -0
- package/src/powell/components/InputOtp/InputOtp.tsx +154 -0
- package/src/powell/components/InputOtp/index.ts +1 -0
- package/src/powell/components/InputPassword/InputPassword.scss +126 -0
- package/src/powell/components/InputPassword/InputPassword.tsx +189 -0
- package/src/powell/components/InputPassword/index.ts +1 -0
- package/src/powell/components/InputSwitch/InputSwitch.scss +32 -0
- package/src/powell/components/InputSwitch/InputSwitch.tsx +144 -0
- package/src/powell/components/InputSwitch/index.ts +1 -0
- package/src/powell/components/InputText/InputText.scss +126 -0
- package/src/powell/components/InputText/InputText.tsx +190 -0
- package/src/powell/components/InputText/index.ts +1 -0
- package/src/powell/components/InputTextarea/InputTextarea.scss +126 -0
- package/src/powell/components/InputTextarea/InputTextarea.tsx +187 -0
- package/src/powell/components/InputTextarea/index.ts +1 -0
- package/src/powell/components/Knob/Knob.scss +32 -0
- package/src/powell/components/Knob/Knob.tsx +134 -0
- package/src/powell/components/Knob/index.ts +1 -0
- package/src/powell/components/ListBox/ListBox.scss +32 -0
- package/src/powell/components/ListBox/ListBox.tsx +135 -0
- package/src/powell/components/ListBox/index.ts +1 -0
- package/src/powell/components/Mention/Mention.scss +126 -0
- package/src/powell/components/Mention/Mention.tsx +186 -0
- package/src/powell/components/Mention/index.ts +1 -0
- package/src/powell/components/MultiSelect/MultiSelect.scss +126 -0
- package/src/powell/components/MultiSelect/MultiSelect.tsx +190 -0
- package/src/powell/components/MultiSelect/index.ts +1 -0
- package/src/powell/components/MultiStateCheckbox/MultiStateCheckbox.scss +32 -0
- package/src/powell/components/MultiStateCheckbox/MultiStateCheckbox.tsx +143 -0
- package/src/powell/components/MultiStateCheckbox/index.ts +1 -0
- package/src/powell/components/RadioGroup/RadioGroup.scss +32 -0
- package/src/powell/components/RadioGroup/RadioGroup.tsx +167 -0
- package/src/powell/components/RadioGroup/index.ts +1 -0
- package/src/powell/components/Rating/Rating.scss +32 -0
- package/src/powell/components/Rating/Rating.tsx +135 -0
- package/src/powell/components/Rating/index.ts +1 -0
- package/src/powell/components/SelectButton/SelectButton.scss +32 -0
- package/src/powell/components/SelectButton/SelectButton.tsx +144 -0
- package/src/powell/components/SelectButton/index.ts +1 -0
- package/src/powell/components/Slider/Slider.scss +32 -0
- package/src/powell/components/Slider/Slider.tsx +135 -0
- package/src/powell/components/Slider/index.ts +1 -0
- package/src/powell/components/ToggleButton/ToggleButton.scss +32 -0
- package/src/powell/components/ToggleButton/ToggleButton.tsx +144 -0
- package/src/powell/components/ToggleButton/index.ts +1 -0
- package/src/powell/components/TreeSelect/TreeSelect.scss +126 -0
- package/src/powell/components/TreeSelect/TreeSelect.tsx +190 -0
- package/src/powell/components/TreeSelect/index.ts +1 -0
- package/src/powell/components/TriStateCheckbox/TriStateCheckbox.scss +32 -0
- package/src/powell/components/TriStateCheckbox/TriStateCheckbox.tsx +144 -0
- package/src/powell/components/TriStateCheckbox/index.ts +1 -0
- package/src/powell/hooks/index.ts +3 -0
- package/src/powell/hooks/useApplyConfig.ts +36 -0
- package/src/powell/hooks/useFormContext.ts +14 -0
- package/src/powell/hooks/usePowellConfig.ts +64 -0
- package/src/powell/index.ts +29 -0
- package/src/powell/models/common.ts +7 -0
- package/src/powell/models/config.ts +85 -0
- package/src/powell/models/forms.ts +33 -0
- package/src/powell/models/index.ts +3 -0
- package/src/powell/styles/common.scss +9 -0
- package/src/powell/styles/mixins.scss +0 -0
- package/src/powell/themes/arya-blue.css +1 -0
- package/src/powell/themes/arya-green.css +1 -0
- package/src/powell/themes/arya-orange.css +1 -0
- package/src/powell/themes/arya-purple.css +1 -0
- package/src/powell/themes/bootstrap4-dark-blue.css +1 -0
- package/src/powell/themes/bootstrap4-dark-purple.css +1 -0
- package/src/powell/themes/bootstrap4-light-blue.css +1 -0
- package/src/powell/themes/bootstrap4-light-purple.css +1 -0
- package/src/powell/themes/fluent-light.css +1 -0
- package/src/powell/themes/lara-dark-amber.css +1 -0
- package/src/powell/themes/lara-dark-blue.css +1 -0
- package/src/powell/themes/lara-dark-cyan.css +1 -0
- package/src/powell/themes/lara-dark-green.css +1 -0
- package/src/powell/themes/lara-dark-indigo.css +1 -0
- package/src/powell/themes/lara-dark-pink.css +1 -0
- package/src/powell/themes/lara-dark-purple.css +1 -0
- package/src/powell/themes/lara-dark-teal.css +1 -0
- package/src/powell/themes/lara-light-amber.css +1 -0
- package/src/powell/themes/lara-light-blue.css +1 -0
- package/src/powell/themes/lara-light-cyan.css +1 -0
- package/src/powell/themes/lara-light-green.css +1 -0
- package/src/powell/themes/lara-light-indigo.css +1 -0
- package/src/powell/themes/lara-light-pink.css +1 -0
- package/src/powell/themes/lara-light-purple.css +1 -0
- package/src/powell/themes/lara-light-teal.css +1 -0
- package/src/powell/themes/luna-amber.css +1 -0
- package/src/powell/themes/luna-blue.css +1 -0
- package/src/powell/themes/luna-green.css +1 -0
- package/src/powell/themes/luna-pink.css +1 -0
- package/src/powell/themes/md-dark-deeppurple.css +1 -0
- package/src/powell/themes/md-dark-indigo.css +1 -0
- package/src/powell/themes/md-light-deeppurple.css +1 -0
- package/src/powell/themes/md-light-indigo.css +1 -0
- package/src/powell/themes/mdc-dark-deeppurple.css +1 -0
- package/src/powell/themes/mdc-dark-indigo.css +1 -0
- package/src/powell/themes/mdc-light-deeppurple.css +1 -0
- package/src/powell/themes/mdc-light-indigo.css +1 -0
- package/src/powell/themes/mira.css +1 -0
- package/src/powell/themes/nano.css +1 -0
- package/src/powell/themes/nova-accent.css +1 -0
- package/src/powell/themes/nova-alt.css +1 -0
- package/src/powell/themes/nova.css +1 -0
- package/src/powell/themes/rhea.css +1 -0
- package/src/powell/themes/saga-blue.css +1 -0
- package/src/powell/themes/saga-green.css +1 -0
- package/src/powell/themes/saga-orange.css +1 -0
- package/src/powell/themes/saga-purple.css +1 -0
- package/src/powell/themes/soho-dark.css +1 -0
- package/src/powell/themes/soho-light.css +1 -0
- package/src/powell/themes/tailwind-light.css +1 -0
- package/src/powell/themes/vela-blue.css +1 -0
- package/src/powell/themes/vela-green.css +1 -0
- package/src/powell/themes/vela-orange.css +1 -0
- package/src/powell/themes/vela-purple.css +1 -0
- package/src/powell/themes/viva-dark.css +1 -0
- package/src/powell/themes/viva-light.css +1 -0
- package/src/powell/utils/globalState.ts +96 -0
- package/src/powell/utils/index.ts +2 -0
- package/src/powell/utils/utilsService.tsx +55 -0
- package/src/stories/Button.stories.tsx +16 -0
- package/tsconfig.json +55 -0
- package/vite.config.ts +14 -0
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./SelectButton";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@powell/models";
|
3
|
+
import { $SliderProps } from "@powell/api";
|
4
|
+
import { SafeAny } from "@powell/models";
|
5
|
+
import '@components/Slider/Slider.scss';
|
6
|
+
interface SliderProps extends Omit<$SliderProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const Slider: (props: SliderProps) => import("react").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Slider";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@powell/models";
|
3
|
+
import { $ToggleButtonProps } from "@powell/api";
|
4
|
+
import { SafeAny } from "@powell/models";
|
5
|
+
import '@components/ToggleButton/ToggleButton.scss';
|
6
|
+
interface ToggleButtonProps extends Omit<$ToggleButtonProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const ToggleButton: (props: ToggleButtonProps) => import("react").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./ToggleButton";
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { Addon, LabelPosition, Size } from "@powell/models";
|
3
|
+
import { $IconFieldProps, $TreeSelectProps } from "@powell/api";
|
4
|
+
import { SafeAny } from "@powell/models";
|
5
|
+
import '@components/TreeSelect/TreeSelect.scss';
|
6
|
+
interface TreeSelectProps extends $TreeSelectProps {
|
7
|
+
name?: string;
|
8
|
+
parseError?: (error: string) => ReactNode;
|
9
|
+
transform?: {
|
10
|
+
input?: (value: SafeAny) => string;
|
11
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
12
|
+
};
|
13
|
+
showRequiredStar?: boolean;
|
14
|
+
rtl?: boolean;
|
15
|
+
label?: string;
|
16
|
+
icon?: string | ReactNode;
|
17
|
+
hint?: string;
|
18
|
+
inputSize?: Size;
|
19
|
+
addon?: Addon;
|
20
|
+
iconPosition?: $IconFieldProps["iconPosition"];
|
21
|
+
labelPosition?: LabelPosition;
|
22
|
+
}
|
23
|
+
export declare const TreeSelect: (props: TreeSelectProps) => import("react").JSX.Element;
|
24
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./TreeSelect";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ChangeEvent, ReactNode } from "react";
|
2
|
+
import { FixLabelPosition } from "@powell/models";
|
3
|
+
import { $TriStateCheckboxProps } from "@powell/api";
|
4
|
+
import { SafeAny } from "@powell/models";
|
5
|
+
import '@components/TriStateCheckbox/TriStateCheckbox.scss';
|
6
|
+
interface TriStateCheckboxProps extends Omit<$TriStateCheckboxProps, 'checked'> {
|
7
|
+
checked?: boolean;
|
8
|
+
name?: string;
|
9
|
+
parseError?: (error: string) => ReactNode;
|
10
|
+
transform?: {
|
11
|
+
input?: (value: SafeAny) => string;
|
12
|
+
output?: (event: ChangeEvent<HTMLInputElement>) => SafeAny;
|
13
|
+
};
|
14
|
+
showRequiredStar?: boolean;
|
15
|
+
rtl?: boolean;
|
16
|
+
label?: string;
|
17
|
+
hint?: string;
|
18
|
+
labelPosition?: FixLabelPosition;
|
19
|
+
}
|
20
|
+
export declare const TriStateCheckbox: (props: TriStateCheckboxProps) => import("react").JSX.Element;
|
21
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./TriStateCheckbox";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { PowellConfig } from "@powell/models";
|
2
|
+
interface ApplyConfigOptions {
|
3
|
+
isFixLabel?: boolean;
|
4
|
+
sizable?: boolean;
|
5
|
+
}
|
6
|
+
interface CommonConfigProps {
|
7
|
+
rtl?: PowellConfig["rtl"];
|
8
|
+
showRequiredStar?: PowellConfig["showRequiredStar"];
|
9
|
+
labelPosition?: PowellConfig["labelPosition"];
|
10
|
+
inputSize?: PowellConfig["inputSize"];
|
11
|
+
}
|
12
|
+
export declare const useApplyConfig: <T extends CommonConfigProps>(props: T, options?: ApplyConfigOptions) => T & {
|
13
|
+
rtl: boolean | undefined;
|
14
|
+
showRequiredStar: boolean | undefined;
|
15
|
+
labelPosition: import("@powell/models").LabelPosition | undefined;
|
16
|
+
};
|
17
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export { PowellProvider } from "./api/PowellProvider";
|
2
|
+
export { AutoComplete } from "./components/AutoComplete";
|
3
|
+
export { Button } from "./components/Button";
|
4
|
+
export { CascadeSelect } from "./components/CascadeSelect";
|
5
|
+
export { Checkbox } from "./components/Checkbox";
|
6
|
+
export { Chips } from "./components/Chips";
|
7
|
+
export { ColorPicker } from "./components/ColorPicker";
|
8
|
+
export { Dropdown } from "./components/Dropdown";
|
9
|
+
export { Editor } from "./components/Editor";
|
10
|
+
export { FormContainer } from "./components/FormContainer";
|
11
|
+
export { InputMask } from "./components/InputMask";
|
12
|
+
export { InputNumber } from "./components/InputNumber";
|
13
|
+
export { InputOtp } from "./components/InputOtp";
|
14
|
+
export { InputPassword } from "./components/InputPassword";
|
15
|
+
export { InputSwitch } from "./components/InputSwitch";
|
16
|
+
export { InputText } from "./components/InputText";
|
17
|
+
export { InputTextarea } from "./components/InputTextarea";
|
18
|
+
export { Knob } from "./components/Knob";
|
19
|
+
export { ListBox } from "./components/ListBox";
|
20
|
+
export { Mention } from "./components/Mention";
|
21
|
+
export { MultiSelect } from "./components/MultiSelect";
|
22
|
+
export { MultiStateCheckbox } from "./components/MultiStateCheckbox";
|
23
|
+
export { RadioGroup } from "./components/RadioGroup";
|
24
|
+
export { Rating } from "./components/Rating";
|
25
|
+
export { SelectButton } from "./components/SelectButton";
|
26
|
+
export { Slider } from "./components/Slider";
|
27
|
+
export { ToggleButton } from "./components/ToggleButton";
|
28
|
+
export { TreeSelect } from "./components/TreeSelect";
|
29
|
+
export { TriStateCheckbox } from "./components/TriStateCheckbox";
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export type ButtonAppearance = 'default' | 'text' | 'outlined' | 'link';
|
2
|
+
export type Direction = 'rtl' | 'ltr';
|
3
|
+
export type Size = 'sm' | 'md' | 'lg';
|
4
|
+
export type Orientation = 'horizontal' | 'vertical';
|
5
|
+
export type Position = 'left' | 'right' | 'top' | 'bottom';
|
6
|
+
export type Nullable<T = void> = T | null | undefined;
|
7
|
+
export type SafeAny = any;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { $APIOptions } from "@powell/api";
|
2
|
+
import { FixLabelPosition, LabelPosition, Size } from "@powell/models";
|
3
|
+
export type ThemeName = "arya-blue" | "arya-green" | "arya-orange" | "arya-purple" | "bootstrap4-dark-blue" | "bootstrap4-dark-purple" | "bootstrap4-light-blue" | "bootstrap4-light-purple" | "fluent-light" | "lara-dark-amber" | "lara-dark-blue" | "lara-dark-cyan" | "lara-dark-green" | "lara-dark-indigo" | "lara-dark-pink" | "lara-dark-purple" | "lara-dark-teal" | "lara-light-amber" | "lara-light-blue" | "lara-light-cyan" | "lara-light-green" | "lara-light-indigo" | "lara-light-pink" | "lara-light-purple" | "lara-light-teal" | "luna-amber" | "luna-blue" | "luna-green" | "luna-pink" | "md-dark-deeppurple" | "md-dark-indigo" | "md-light-deeppurple" | "md-light-indigo" | "mdc-dark-deeppurple" | "mdc-dark-indigo" | "mdc-light-deeppurple" | "mdc-light-indigo" | "mira" | "nano" | "nova" | "nova-accent" | "nova-alt" | "rhea" | "saga-blue" | "saga-green" | "saga-orange" | "saga-purple" | "soho-dark" | "soho-light" | "tailwind-light" | "vela-blue" | "vela-green" | "vela-orange" | "vela-purple" | "viva-dark" | "viva-light";
|
4
|
+
type OmittedApiOptions = Omit<$APIOptions, "setAppendTo" | "setStyleContainer" | "setAutoZIndex" | "setCssTransition" | "setFilterMatchModeOptions" | "setHideOverlaysOnDocumentScrolling" | "setInputStyle" | "setLocale" | "setNonce" | "setNullSortOrder" | "setRipple" | "setZIndex" | "setPt" | "changeTheme">;
|
5
|
+
export interface PowellConfig extends OmittedApiOptions {
|
6
|
+
theme?: ThemeName;
|
7
|
+
rtl?: boolean;
|
8
|
+
showRequiredStar?: boolean;
|
9
|
+
inputSize?: Size;
|
10
|
+
labelPosition?: LabelPosition;
|
11
|
+
fixLabelPosition?: FixLabelPosition;
|
12
|
+
}
|
13
|
+
export {};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { $ButtonProps } from "@powell/api";
|
2
|
+
import { ButtonAppearance, Nullable, Position, SafeAny } from "@powell/models";
|
3
|
+
import { MouseEvent } from "react";
|
4
|
+
export type LabelPosition = 'float' | 'fix-side' | 'fix-top';
|
5
|
+
export type FixLabelPosition = Exclude<LabelPosition, 'float'>;
|
6
|
+
export type IconPosition = Exclude<Position, 'top' | 'bottom'>;
|
7
|
+
export interface AddonConfig {
|
8
|
+
type: 'button' | 'icon' | 'text';
|
9
|
+
label?: string;
|
10
|
+
severity?: $ButtonProps["severity"];
|
11
|
+
appearance?: ButtonAppearance;
|
12
|
+
icon?: string;
|
13
|
+
iconPosition?: IconPosition;
|
14
|
+
text?: string;
|
15
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
16
|
+
}
|
17
|
+
export interface Addon {
|
18
|
+
before?: AddonConfig;
|
19
|
+
after?: AddonConfig;
|
20
|
+
}
|
21
|
+
export type TransformOptions<V = SafeAny, T = SafeAny> = {
|
22
|
+
value: Nullable<V>;
|
23
|
+
onChange: (...event: SafeAny[]) => void;
|
24
|
+
transform?: {
|
25
|
+
input?: (value: Nullable<V>) => SafeAny;
|
26
|
+
output?: (...event: T[]) => SafeAny;
|
27
|
+
};
|
28
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { SetStateAction } from "react";
|
2
|
+
type Set<T> = (newState: SetStateAction<T>, callback?: (newState: T) => void) => void;
|
3
|
+
type UseSelector<T> = <TSelected = unknown>(selector: (state: T) => TSelected, equalityFn?: Comparator<TSelected>) => TSelected;
|
4
|
+
export interface StateWithValue<T> {
|
5
|
+
use: () => [T, Set<T>];
|
6
|
+
useValue: () => T;
|
7
|
+
get: () => T;
|
8
|
+
useSelector: UseSelector<T>;
|
9
|
+
set: Set<T>;
|
10
|
+
reset: () => void;
|
11
|
+
subscribe(subscriber: SubscriberFunc<T>): () => void;
|
12
|
+
}
|
13
|
+
type SubscriberFunc<T> = (newState: T, previousState: T) => void;
|
14
|
+
interface Options<T> {
|
15
|
+
onSet?: SubscriberFunc<T>;
|
16
|
+
}
|
17
|
+
type Comparator<TSelected = unknown> = (a: TSelected, b: TSelected) => boolean;
|
18
|
+
export declare function globalState<T>(initialValue: T, options?: Options<T>): StateWithValue<T>;
|
19
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AddonConfig, TransformOptions } from "@powell/models";
|
2
|
+
import { $FormikContextType, $FormikValues } from "@powell/api";
|
3
|
+
export declare const getAddonTemplate: (config?: AddonConfig) => import("react").JSX.Element;
|
4
|
+
export declare const isRequiredField: (formContext: $FormikContextType<$FormikValues> | null, name: string | undefined) => any;
|
5
|
+
export declare const transformer: <V = any, T = any>(options: TransformOptions<V, T>) => {
|
6
|
+
value: V;
|
7
|
+
onChange: (...event: T[]) => void;
|
8
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "powell-react",
|
3
|
+
"version": "0.0.0",
|
4
|
+
"description": "",
|
5
|
+
"author": "itismohammadreza",
|
6
|
+
"license": "MIT",
|
7
|
+
"repository": {
|
8
|
+
"type": "git",
|
9
|
+
"url": ""
|
10
|
+
},
|
11
|
+
"homepage": "",
|
12
|
+
"main": "dist/cjs/index.js",
|
13
|
+
"module": "dist/esm/index.js",
|
14
|
+
"types": "dist/index.d.ts",
|
15
|
+
"type": "module",
|
16
|
+
"engines": {
|
17
|
+
"node": ">=18"
|
18
|
+
},
|
19
|
+
"scripts": {
|
20
|
+
"start": "npm run storybook",
|
21
|
+
"build": "rimraf dist && rollup -c",
|
22
|
+
"release": "npm run build && npm publish",
|
23
|
+
"storybook": "storybook dev -p 6006",
|
24
|
+
"storybook:build": "storybook build"
|
25
|
+
},
|
26
|
+
"peerDependencies": {
|
27
|
+
"react": "18.x",
|
28
|
+
"react-dom": "18.x"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"@chromatic-com/storybook": "^2.0.2",
|
32
|
+
"@rollup/plugin-alias": "^5.1.1",
|
33
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
34
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
35
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
36
|
+
"@rollup/plugin-url": "^8.0.2",
|
37
|
+
"@storybook/addon-docs": "^8.3.1",
|
38
|
+
"@storybook/addon-essentials": "^8.3.1",
|
39
|
+
"@storybook/addon-interactions": "^8.3.1",
|
40
|
+
"@storybook/addon-links": "^8.3.1",
|
41
|
+
"@storybook/addon-onboarding": "^8.3.1",
|
42
|
+
"@storybook/blocks": "^8.3.1",
|
43
|
+
"@storybook/react": "^8.3.1",
|
44
|
+
"@storybook/react-vite": "^8.3.1",
|
45
|
+
"@storybook/test": "^8.3.1",
|
46
|
+
"@svgr/rollup": "^8.1.0",
|
47
|
+
"@types/node": "^22.5.5",
|
48
|
+
"@types/react": "^18.3.7",
|
49
|
+
"@types/react-dom": "^18.3.0",
|
50
|
+
"@vitejs/plugin-react": "^4.3.1",
|
51
|
+
"react": "^18.3.1",
|
52
|
+
"react-dom": "^18.3.1",
|
53
|
+
"rimraf": "^6.0.1",
|
54
|
+
"rollup": "^4.22.4",
|
55
|
+
"rollup-plugin-dts": "^6.1.1",
|
56
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
57
|
+
"rollup-plugin-postcss": "^4.0.2",
|
58
|
+
"rollup-plugin-terser": "^7.0.2",
|
59
|
+
"sass": "^1.78.0",
|
60
|
+
"storybook": "^8.3.1",
|
61
|
+
"typescript": "5.5.4",
|
62
|
+
"vite": "^5.4.6",
|
63
|
+
"vite-plugin-svgr": "^4.2.0"
|
64
|
+
},
|
65
|
+
"dependencies": {
|
66
|
+
"formik": "^2.4.6",
|
67
|
+
"primereact": "^10.8.4",
|
68
|
+
"yup": "^1.4.0"
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import { readFileSync } from 'fs';
|
2
|
+
import { defineConfig } from 'rollup';
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
4
|
+
import commonjs from '@rollup/plugin-commonjs';
|
5
|
+
import typescript from '@rollup/plugin-typescript';
|
6
|
+
import url from '@rollup/plugin-url';
|
7
|
+
import svgr from '@svgr/rollup';
|
8
|
+
import external from 'rollup-plugin-peer-deps-external';
|
9
|
+
import postcss from 'rollup-plugin-postcss';
|
10
|
+
import dts from 'rollup-plugin-dts';
|
11
|
+
import { terser } from 'rollup-plugin-terser';
|
12
|
+
import typescriptEngine from 'typescript';
|
13
|
+
import alias from '@rollup/plugin-alias';
|
14
|
+
import path from 'path';
|
15
|
+
import { fileURLToPath } from 'url';
|
16
|
+
|
17
|
+
const packageJson = JSON.parse(readFileSync('./package.json'));
|
18
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
19
|
+
const projectRootDir = path.resolve(__dirname);
|
20
|
+
|
21
|
+
export default defineConfig(
|
22
|
+
{
|
23
|
+
input: './src/index.ts',
|
24
|
+
output: [
|
25
|
+
{
|
26
|
+
file: packageJson.main,
|
27
|
+
format: 'cjs',
|
28
|
+
sourcemap: false,
|
29
|
+
exports: 'named',
|
30
|
+
name: packageJson.name,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
file: packageJson.module,
|
34
|
+
format: 'es',
|
35
|
+
exports: 'named',
|
36
|
+
sourcemap: false,
|
37
|
+
},
|
38
|
+
],
|
39
|
+
plugins: [
|
40
|
+
postcss({
|
41
|
+
plugins: [],
|
42
|
+
minimize: true,
|
43
|
+
}),
|
44
|
+
alias({
|
45
|
+
entries: [
|
46
|
+
{ find: "@powell/*", replacement: path.resolve(projectRootDir, '/src/powell/*') },
|
47
|
+
]
|
48
|
+
}),
|
49
|
+
external({ includeDependencies: true }),
|
50
|
+
resolve(),
|
51
|
+
commonjs(),
|
52
|
+
typescript({
|
53
|
+
tsconfig: './tsconfig.json',
|
54
|
+
typescript: typescriptEngine,
|
55
|
+
sourceMap: false,
|
56
|
+
exclude: [
|
57
|
+
'coverage',
|
58
|
+
'.storybook',
|
59
|
+
'storybook-static',
|
60
|
+
'config',
|
61
|
+
'dist',
|
62
|
+
'node_modules/**',
|
63
|
+
'*.cjs',
|
64
|
+
'*.mjs',
|
65
|
+
'**/__snapshots__/*',
|
66
|
+
'**/__tests__',
|
67
|
+
'**/*.test.js+(|x)',
|
68
|
+
'**/*.test.ts+(|x)',
|
69
|
+
'**/*.mdx',
|
70
|
+
'**/*.story.ts+(|x)',
|
71
|
+
'**/*.story.js+(|x)',
|
72
|
+
'**/*.stories.ts+(|x)',
|
73
|
+
'**/*.stories.js+(|x)',
|
74
|
+
'setupTests.ts',
|
75
|
+
'vitest.config.ts',
|
76
|
+
],
|
77
|
+
}),
|
78
|
+
url(),
|
79
|
+
svgr(),
|
80
|
+
terser(),
|
81
|
+
],
|
82
|
+
onwarn: (warning, warn) => {
|
83
|
+
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
|
84
|
+
return
|
85
|
+
}
|
86
|
+
warn(warning)
|
87
|
+
},
|
88
|
+
},
|
89
|
+
{
|
90
|
+
input: 'dist/esm/types/src/index.d.ts',
|
91
|
+
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
|
92
|
+
external: [/\.(sc|sa|c)ss$/],
|
93
|
+
plugins: [dts()],
|
94
|
+
},
|
95
|
+
);
|
@@ -0,0 +1,43 @@
|
|
1
|
+
.button {
|
2
|
+
position: relative;
|
3
|
+
background-color: #4caf50;
|
4
|
+
border: none;
|
5
|
+
font-size: 28px;
|
6
|
+
color: #ffffff;
|
7
|
+
padding: 20px;
|
8
|
+
width: 200px;
|
9
|
+
text-align: center;
|
10
|
+
-webkit-transition-duration: 0.4s; /* Safari */
|
11
|
+
transition-duration: 0.4s;
|
12
|
+
text-decoration: none;
|
13
|
+
overflow: hidden;
|
14
|
+
cursor: pointer;
|
15
|
+
box-shadow:
|
16
|
+
0 8px 16px 0 rgba(0, 0, 0, 0.2),
|
17
|
+
0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
18
|
+
|
19
|
+
&:after {
|
20
|
+
content: '';
|
21
|
+
background: #f1f1f1;
|
22
|
+
display: block;
|
23
|
+
position: absolute;
|
24
|
+
padding-top: 300%;
|
25
|
+
padding-left: 350%;
|
26
|
+
margin-left: -20px !important;
|
27
|
+
margin-top: -120%;
|
28
|
+
opacity: 0;
|
29
|
+
transition: all 0.8s;
|
30
|
+
}
|
31
|
+
|
32
|
+
&:active:after {
|
33
|
+
padding: 0;
|
34
|
+
margin: 0;
|
35
|
+
opacity: 1;
|
36
|
+
transition: 0s;
|
37
|
+
}
|
38
|
+
|
39
|
+
&--dsiabled {
|
40
|
+
opacity: 0.5;
|
41
|
+
background-color: grey;
|
42
|
+
}
|
43
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React, { ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
2
|
+
|
3
|
+
import './Button.scss';
|
4
|
+
|
5
|
+
export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
6
|
+
children?: ReactNode;
|
7
|
+
}
|
8
|
+
|
9
|
+
export const Button: FC<IButtonProps> = ({ onClick, disabled, className, children, ...rest }) => (
|
10
|
+
<button
|
11
|
+
type="button"
|
12
|
+
className={`button ${className} ${disabled && 'button--dsiabled'}`}
|
13
|
+
onClick={onClick}
|
14
|
+
disabled={disabled}
|
15
|
+
{...rest}
|
16
|
+
>
|
17
|
+
{children}
|
18
|
+
</button>
|
19
|
+
);
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Button';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Button';
|
package/src/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components';
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {PropsWithChildren} from "react";
|
2
|
+
import {configService, powellDefaults, $PrimeReactProvider} from "@powell/api";
|
3
|
+
import {PowellConfig, ThemeName} from "@powell/models";
|
4
|
+
|
5
|
+
const createThemeLink = () => {
|
6
|
+
const headEl = document.head;
|
7
|
+
const linkEl = document.createElement("link");
|
8
|
+
linkEl.rel = "stylesheet";
|
9
|
+
linkEl.type = "text/css";
|
10
|
+
linkEl.id = "powell-theme-link";
|
11
|
+
headEl.appendChild(linkEl);
|
12
|
+
return linkEl;
|
13
|
+
}
|
14
|
+
|
15
|
+
const applyTheme = (theme: ThemeName) => {
|
16
|
+
let themeEl: HTMLLinkElement = document.getElementById('powell-theme-link') as HTMLLinkElement;
|
17
|
+
if (!themeEl) {
|
18
|
+
themeEl = createThemeLink();
|
19
|
+
}
|
20
|
+
const themeLink = `/src/powell/themes/${theme}.css`;
|
21
|
+
themeEl.setAttribute('href', themeLink);
|
22
|
+
}
|
23
|
+
|
24
|
+
export const PowellProvider = (props: PropsWithChildren<{ config?: PowellConfig }>) => {
|
25
|
+
const {children, config} = props;
|
26
|
+
const defaultConfig: PowellConfig = {
|
27
|
+
...powellDefaults,
|
28
|
+
...config
|
29
|
+
};
|
30
|
+
configService.set(defaultConfig);
|
31
|
+
applyTheme(defaultConfig.theme!);
|
32
|
+
return (
|
33
|
+
<$PrimeReactProvider value={defaultConfig}>
|
34
|
+
{children}
|
35
|
+
</$PrimeReactProvider>
|
36
|
+
)
|
37
|
+
}
|