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,85 @@
|
|
1
|
+
import {$APIOptions} from "@powell/api";
|
2
|
+
import {FixLabelPosition, LabelPosition, Size} from "@powell/models";
|
3
|
+
|
4
|
+
export type ThemeName =
|
5
|
+
"arya-blue" |
|
6
|
+
"arya-green" |
|
7
|
+
"arya-orange" |
|
8
|
+
"arya-purple" |
|
9
|
+
"bootstrap4-dark-blue" |
|
10
|
+
"bootstrap4-dark-purple" |
|
11
|
+
"bootstrap4-light-blue" |
|
12
|
+
"bootstrap4-light-purple" |
|
13
|
+
"fluent-light" |
|
14
|
+
"lara-dark-amber" |
|
15
|
+
"lara-dark-blue" |
|
16
|
+
"lara-dark-cyan" |
|
17
|
+
"lara-dark-green" |
|
18
|
+
"lara-dark-indigo" |
|
19
|
+
"lara-dark-pink" |
|
20
|
+
"lara-dark-purple" |
|
21
|
+
"lara-dark-teal" |
|
22
|
+
"lara-light-amber" |
|
23
|
+
"lara-light-blue" |
|
24
|
+
"lara-light-cyan" |
|
25
|
+
"lara-light-green" |
|
26
|
+
"lara-light-indigo" |
|
27
|
+
"lara-light-pink" |
|
28
|
+
"lara-light-purple" |
|
29
|
+
"lara-light-teal" |
|
30
|
+
"luna-amber" |
|
31
|
+
"luna-blue" |
|
32
|
+
"luna-green" |
|
33
|
+
"luna-pink" |
|
34
|
+
"md-dark-deeppurple" |
|
35
|
+
"md-dark-indigo" |
|
36
|
+
"md-light-deeppurple" |
|
37
|
+
"md-light-indigo" |
|
38
|
+
"mdc-dark-deeppurple" |
|
39
|
+
"mdc-dark-indigo" |
|
40
|
+
"mdc-light-deeppurple" |
|
41
|
+
"mdc-light-indigo" |
|
42
|
+
"mira" |
|
43
|
+
"nano" |
|
44
|
+
"nova" |
|
45
|
+
"nova-accent" |
|
46
|
+
"nova-alt" |
|
47
|
+
"rhea" |
|
48
|
+
"saga-blue" |
|
49
|
+
"saga-green" |
|
50
|
+
"saga-orange" |
|
51
|
+
"saga-purple" |
|
52
|
+
"soho-dark" |
|
53
|
+
"soho-light" |
|
54
|
+
"tailwind-light" |
|
55
|
+
"vela-blue" |
|
56
|
+
"vela-green" |
|
57
|
+
"vela-orange" |
|
58
|
+
"vela-purple" |
|
59
|
+
"viva-dark" |
|
60
|
+
"viva-light";
|
61
|
+
|
62
|
+
type OmittedApiOptions = Omit<$APIOptions,
|
63
|
+
"setAppendTo" |
|
64
|
+
"setStyleContainer" |
|
65
|
+
"setAutoZIndex" |
|
66
|
+
"setCssTransition" |
|
67
|
+
"setFilterMatchModeOptions" |
|
68
|
+
"setHideOverlaysOnDocumentScrolling" |
|
69
|
+
"setInputStyle" |
|
70
|
+
"setLocale" |
|
71
|
+
"setNonce" |
|
72
|
+
"setNullSortOrder" |
|
73
|
+
"setRipple" |
|
74
|
+
"setZIndex" |
|
75
|
+
"setPt" |
|
76
|
+
"changeTheme">;
|
77
|
+
|
78
|
+
export interface PowellConfig extends OmittedApiOptions {
|
79
|
+
theme?: ThemeName;
|
80
|
+
rtl?: boolean;
|
81
|
+
showRequiredStar?: boolean;
|
82
|
+
inputSize?: Size;
|
83
|
+
labelPosition?: LabelPosition;
|
84
|
+
fixLabelPosition?: FixLabelPosition;
|
85
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import {$ButtonProps} from "@powell/api";
|
2
|
+
import {ButtonAppearance, Nullable, Position, SafeAny} from "@powell/models";
|
3
|
+
import {MouseEvent} from "react";
|
4
|
+
|
5
|
+
export type LabelPosition = 'float' | 'fix-side' | 'fix-top';
|
6
|
+
export type FixLabelPosition = Exclude<LabelPosition, 'float'>;
|
7
|
+
export type IconPosition = Exclude<Position, 'top' | 'bottom'>;
|
8
|
+
|
9
|
+
export interface AddonConfig {
|
10
|
+
type: 'button' | 'icon' | 'text';
|
11
|
+
label?: string;
|
12
|
+
severity?: $ButtonProps["severity"];
|
13
|
+
appearance?: ButtonAppearance;
|
14
|
+
icon?: string;
|
15
|
+
iconPosition?: IconPosition;
|
16
|
+
text?: string;
|
17
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
18
|
+
}
|
19
|
+
|
20
|
+
export interface Addon {
|
21
|
+
before?: AddonConfig;
|
22
|
+
after?: AddonConfig;
|
23
|
+
}
|
24
|
+
|
25
|
+
// todo: make transform type [usage] generic in components (remove SafeAny from utils.service)
|
26
|
+
export type TransformOptions<V = SafeAny, T = SafeAny> = {
|
27
|
+
value: Nullable<V>;
|
28
|
+
onChange: (...event: SafeAny[]) => void;
|
29
|
+
transform?: {
|
30
|
+
input?: (value: Nullable<V>) => SafeAny;
|
31
|
+
output?: (...event: T[]) => SafeAny;
|
32
|
+
}
|
33
|
+
}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/arya-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/arya-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/arya-orange/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/arya-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/bootstrap4-dark-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/bootstrap4-dark-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/bootstrap4-light-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/bootstrap4-light-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/fluent-light/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-amber/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-cyan/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-pink/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-dark-teal/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-amber/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-cyan/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-pink/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/lara-light-teal/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/luna-amber/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/luna-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/luna-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/luna-pink/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/md-dark-deeppurple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/md-dark-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/md-light-deeppurple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/md-light-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/mdc-light-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/mdc-dark-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/mdc-light-deeppurple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/mdc-light-indigo/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/nano/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/nano/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/nova-accent/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/nova-alt/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/nova/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/rhea/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/saga-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/saga-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/saga-orange/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/saga-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/soho-dark/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/soho-light/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/tailwind-light/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/vela-blue/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/vela-green/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/vela-orange/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/vela-purple/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/viva-dark/theme.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "primereact/resources/themes/viva-light/theme.css";
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import {SetStateAction, useEffect, useLayoutEffect, useRef, useState} from "react";
|
2
|
+
|
3
|
+
type Set<T> = (newState: SetStateAction<T>, callback?: (newState: T) => void) => void;
|
4
|
+
|
5
|
+
type UseSelector<T> = <TSelected = unknown>(selector: (state: T) => TSelected, equalityFn?: Comparator<TSelected>) => TSelected;
|
6
|
+
|
7
|
+
export interface StateWithValue<T> {
|
8
|
+
use: () => [T, Set<T>];
|
9
|
+
useValue: () => T;
|
10
|
+
get: () => T;
|
11
|
+
useSelector: UseSelector<T>;
|
12
|
+
set: Set<T>;
|
13
|
+
reset: () => void;
|
14
|
+
subscribe(subscriber: SubscriberFunc<T>): () => void;
|
15
|
+
}
|
16
|
+
|
17
|
+
type SubscriberFunc<T> = (newState: T, previousState: T) => void;
|
18
|
+
|
19
|
+
interface Options<T> {
|
20
|
+
onSet?: SubscriberFunc<T>;
|
21
|
+
}
|
22
|
+
|
23
|
+
type Comparator<TSelected = unknown> = (a: TSelected, b: TSelected) => boolean;
|
24
|
+
|
25
|
+
const useIsomorphicLayoutEffect =
|
26
|
+
typeof window !== "undefined" || typeof document !== "undefined"
|
27
|
+
? useLayoutEffect
|
28
|
+
: useEffect;
|
29
|
+
|
30
|
+
const equ: Comparator = (a, b) => a === b;
|
31
|
+
|
32
|
+
const FR = {};
|
33
|
+
|
34
|
+
function useComparator<T>(v: T, c: Comparator<T> = equ): T {
|
35
|
+
const f = useRef(FR as T);
|
36
|
+
let nv = f.current;
|
37
|
+
|
38
|
+
useIsomorphicLayoutEffect(() => {
|
39
|
+
f.current = nv;
|
40
|
+
});
|
41
|
+
|
42
|
+
if (f.current === FR || !c(v, f.current)) {
|
43
|
+
nv = v;
|
44
|
+
}
|
45
|
+
|
46
|
+
return nv;
|
47
|
+
}
|
48
|
+
|
49
|
+
export function globalState<T>(initialValue: T, options?: Options<T>): StateWithValue<T> {
|
50
|
+
let sb: SubscriberFunc<T>[] = [];
|
51
|
+
|
52
|
+
let v: T = initialValue;
|
53
|
+
|
54
|
+
function set(newValue: SetStateAction<T>, callback?: SubscriberFunc<T>) {
|
55
|
+
const pv = v;
|
56
|
+
v = newValue instanceof Function ? newValue(v) : newValue;
|
57
|
+
|
58
|
+
setTimeout(() => {
|
59
|
+
sb.forEach((c) => c(v, pv));
|
60
|
+
callback?.(v, pv);
|
61
|
+
options?.onSet?.(v, pv);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
function subscribe(subscriber: SubscriberFunc<T>): () => void {
|
66
|
+
sb.push(subscriber);
|
67
|
+
return () => {
|
68
|
+
sb = sb.filter((f) => f !== subscriber);
|
69
|
+
};
|
70
|
+
}
|
71
|
+
|
72
|
+
function useSubscription(subscriber: SubscriberFunc<T>) {
|
73
|
+
useIsomorphicLayoutEffect(() => subscribe(subscriber), [subscriber]);
|
74
|
+
}
|
75
|
+
|
76
|
+
function use(): [T, Set<T>] {
|
77
|
+
const [l, s] = useState<T>(v);
|
78
|
+
useSubscription(s);
|
79
|
+
return [l, set];
|
80
|
+
}
|
81
|
+
|
82
|
+
function useSelector<TSelected = unknown>(selector: (state: T) => TSelected, comparator: Comparator<TSelected> = equ): TSelected {
|
83
|
+
const [rv] = use();
|
84
|
+
return useComparator(selector(rv), comparator);
|
85
|
+
}
|
86
|
+
|
87
|
+
return {
|
88
|
+
use,
|
89
|
+
useSelector,
|
90
|
+
useValue: () => use()[0],
|
91
|
+
get: () => v,
|
92
|
+
set,
|
93
|
+
reset: () => set(initialValue),
|
94
|
+
subscribe,
|
95
|
+
};
|
96
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import {AddonConfig, SafeAny, TransformOptions} from "@powell/models";
|
2
|
+
import {Button} from "@powell/components/Button";
|
3
|
+
import {$FormikContextType, $FormikValues} from "@powell/api";
|
4
|
+
|
5
|
+
export const getAddonTemplate = (config?: AddonConfig) => {
|
6
|
+
if (!config) {
|
7
|
+
return <></>
|
8
|
+
}
|
9
|
+
const {type, ...rest} = config;
|
10
|
+
switch (type) {
|
11
|
+
case "button":
|
12
|
+
return <Button {...rest} />
|
13
|
+
case "icon":
|
14
|
+
return (
|
15
|
+
<span className="p-inputgroup-addon" onClick={rest?.onClick}>
|
16
|
+
<i className={rest.icon}></i>
|
17
|
+
</span>
|
18
|
+
)
|
19
|
+
case "text":
|
20
|
+
return <span className="p-inputgroup-addon">{rest.text}</span>
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
export const isRequiredField = (formContext: $FormikContextType<$FormikValues> | null, name: string | undefined) => {
|
25
|
+
const keys = name?.split('.') ?? [];
|
26
|
+
let current = formContext?.validationSchema?.fields;
|
27
|
+
for (const key of keys) {
|
28
|
+
if (!current) {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
if (current[key]?.fields) {
|
32
|
+
current = current[key]?.fields;
|
33
|
+
} else {
|
34
|
+
current = current[key];
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return current?.tests?.some((t: SafeAny) => t.OPTIONS.name === 'required');
|
38
|
+
}
|
39
|
+
|
40
|
+
// todo: make transform type [usage] generic in components (remove SafeAny from models)
|
41
|
+
export const transformer = <V = SafeAny, T = SafeAny>(options: TransformOptions<V, T>) => {
|
42
|
+
const value: V = options.transform?.input?.(options.value) || options.value;
|
43
|
+
const onChange = (...event: T[]) => {
|
44
|
+
if (typeof options.transform?.output === 'function') {
|
45
|
+
options.onChange(options.transform.output(...event));
|
46
|
+
} else {
|
47
|
+
options.onChange(...event);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return {
|
52
|
+
value,
|
53
|
+
onChange
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import { Button } from '@powell/components/Button';
|
3
|
+
|
4
|
+
const meta: Meta<typeof Button> = {
|
5
|
+
component: Button,
|
6
|
+
};
|
7
|
+
|
8
|
+
export default meta;
|
9
|
+
|
10
|
+
type Story = StoryObj<typeof Button>;
|
11
|
+
|
12
|
+
export const Primary: Story = {
|
13
|
+
args: {
|
14
|
+
label: 'Button',
|
15
|
+
},
|
16
|
+
};
|
package/tsconfig.json
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "es2016",
|
4
|
+
"module": "esnext",
|
5
|
+
"jsx": "react",
|
6
|
+
"sourceMap": true,
|
7
|
+
"outDir": "dist",
|
8
|
+
"strict": true,
|
9
|
+
"moduleResolution": "node",
|
10
|
+
"allowSyntheticDefaultImports": true,
|
11
|
+
"esModuleInterop": true,
|
12
|
+
"skipLibCheck": true,
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
14
|
+
"declaration": true,
|
15
|
+
"declarationDir": "types",
|
16
|
+
"noEmit": false,
|
17
|
+
"lib": [
|
18
|
+
"dom",
|
19
|
+
"dom.iterable",
|
20
|
+
"esnext"
|
21
|
+
],
|
22
|
+
"baseUrl": ".",
|
23
|
+
"paths": {
|
24
|
+
"@powell/*": [
|
25
|
+
"src/powell/*"
|
26
|
+
],
|
27
|
+
},
|
28
|
+
"allowJs": true,
|
29
|
+
"isolatedModules": true,
|
30
|
+
"noImplicitAny": true,
|
31
|
+
"resolveJsonModule": true,
|
32
|
+
"strictNullChecks": true,
|
33
|
+
"noUnusedLocals": true,
|
34
|
+
"noUnusedParameters": true,
|
35
|
+
"downlevelIteration": true,
|
36
|
+
"noFallthroughCasesInSwitch": true,
|
37
|
+
"noImplicitReturns": true,
|
38
|
+
"types": [
|
39
|
+
"@testing-library/jest-dom"
|
40
|
+
],
|
41
|
+
"useDefineForClassFields": true,
|
42
|
+
},
|
43
|
+
"include": [
|
44
|
+
"src",
|
45
|
+
"*.tsx",
|
46
|
+
"*.ts",
|
47
|
+
"eslint.config.js"
|
48
|
+
],
|
49
|
+
"exclude": [
|
50
|
+
"coverage",
|
51
|
+
"config",
|
52
|
+
"dist",
|
53
|
+
"node_modules/**"
|
54
|
+
]
|
55
|
+
}
|
package/vite.config.ts
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { defineConfig } from 'vite';
|
2
|
+
import svgr from 'vite-plugin-svgr';
|
3
|
+
import react from '@vitejs/plugin-react';
|
4
|
+
import { resolve } from "path";
|
5
|
+
|
6
|
+
// https://vitejs.dev/config/
|
7
|
+
export default defineConfig({
|
8
|
+
plugins: [react(), svgr({ include: '**/*.svg' })],
|
9
|
+
resolve: {
|
10
|
+
alias: {
|
11
|
+
"@powell": resolve(__dirname, "./src/powell/"),
|
12
|
+
}
|
13
|
+
}
|
14
|
+
});
|