powell-react 0.0.8 → 0.0.9
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 -321
- package/dist/cjs/index.js +1 -72407
- 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/{api → src/powell/api}/PowellProvider.d.ts +2 -2
- package/dist/cjs/types/src/powell/api/configService.d.ts +2 -0
- package/dist/cjs/types/{api → src/powell/api}/powellDefaults.d.ts +1 -1
- package/dist/cjs/types/{api → src/powell/api}/primereact.d.ts +0 -14
- package/dist/cjs/types/{components → src/powell/components}/AutoComplete/AutoComplete.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Button/Button.d.ts +3 -3
- package/dist/{esm/types → cjs/types/src/powell}/components/CascadeSelect/CascadeSelect.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/Chips/Chips.d.ts +3 -3
- package/dist/{esm/types → cjs/types/src/powell}/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Dropdown/Dropdown.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Editor/Editor.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/FormContainer/FormContainer.d.ts +1 -1
- package/dist/cjs/types/{components → src/powell/components}/FormContainer/FormContext.d.ts +2 -2
- package/dist/{esm/types → cjs/types/src/powell}/components/InputMask/InputMask.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/InputNumber/InputNumber.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/InputOtp/InputOtp.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/InputPassword/InputPassword.d.ts +3 -3
- package/dist/{esm/types → cjs/types/src/powell}/components/InputSwitch/InputSwitch.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/InputText/InputText.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/InputTextarea/InputTextarea.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/Knob/Knob.d.ts +3 -3
- package/dist/cjs/types/{components → src/powell/components}/ListBox/ListBox.d.ts +3 -3
- package/dist/{esm/types → cjs/types/src/powell}/components/Mention/Mention.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/MultiSelect/MultiSelect.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/MultiStateCheckbox/MultiStateCheckbox.d.ts +3 -3
- package/dist/cjs/types/{components → src/powell/components}/RadioGroup/RadioGroup.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Rating/Rating.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/SelectButton/SelectButton.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/components/Slider/Slider.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/ToggleButton/ToggleButton.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/TreeSelect/TreeSelect.d.ts +4 -4
- package/dist/cjs/types/{components → src/powell/components}/TriStateCheckbox/TriStateCheckbox.d.ts +4 -4
- package/dist/{esm/types → cjs/types/src/powell}/hooks/useApplyConfig.d.ts +2 -2
- package/dist/cjs/types/{hooks → src/powell/hooks}/useFormContext.d.ts +1 -1
- package/dist/cjs/types/{hooks → src/powell/hooks}/usePowellConfig.d.ts +1 -1
- package/dist/cjs/types/{models → src/powell/models}/config.d.ts +2 -2
- package/dist/cjs/types/{models → src/powell/models}/forms.d.ts +2 -2
- package/dist/{esm/types → cjs/types/src/powell}/utils/utilsService.d.ts +3 -3
- package/dist/cjs/types/vite.config.d.ts +2 -0
- package/dist/esm/index.js +1 -72377
- 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/{api → src/powell/api}/PowellProvider.d.ts +2 -2
- package/dist/esm/types/src/powell/api/configService.d.ts +2 -0
- package/dist/esm/types/{api → src/powell/api}/powellDefaults.d.ts +1 -1
- package/dist/esm/types/{api → src/powell/api}/primereact.d.ts +0 -14
- package/dist/esm/types/{components → src/powell/components}/AutoComplete/AutoComplete.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Button/Button.d.ts +3 -3
- package/dist/{cjs/types → esm/types/src/powell}/components/CascadeSelect/CascadeSelect.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/Chips/Chips.d.ts +3 -3
- package/dist/{cjs/types → esm/types/src/powell}/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Dropdown/Dropdown.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Editor/Editor.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/FormContainer/FormContainer.d.ts +1 -1
- package/dist/esm/types/{components → src/powell/components}/FormContainer/FormContext.d.ts +2 -2
- package/dist/{cjs/types → esm/types/src/powell}/components/InputMask/InputMask.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/InputNumber/InputNumber.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/InputOtp/InputOtp.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/InputPassword/InputPassword.d.ts +3 -3
- package/dist/{cjs/types → esm/types/src/powell}/components/InputSwitch/InputSwitch.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/InputText/InputText.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/InputTextarea/InputTextarea.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/Knob/Knob.d.ts +3 -3
- package/dist/esm/types/{components → src/powell/components}/ListBox/ListBox.d.ts +3 -3
- package/dist/{cjs/types → esm/types/src/powell}/components/Mention/Mention.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/MultiSelect/MultiSelect.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/MultiStateCheckbox/MultiStateCheckbox.d.ts +3 -3
- package/dist/esm/types/{components → src/powell/components}/RadioGroup/RadioGroup.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Rating/Rating.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/SelectButton/SelectButton.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/components/Slider/Slider.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/ToggleButton/ToggleButton.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/TreeSelect/TreeSelect.d.ts +4 -4
- package/dist/esm/types/{components → src/powell/components}/TriStateCheckbox/TriStateCheckbox.d.ts +4 -4
- package/dist/{cjs/types → esm/types/src/powell}/hooks/useApplyConfig.d.ts +2 -2
- package/dist/esm/types/{hooks → src/powell/hooks}/useFormContext.d.ts +1 -1
- package/dist/esm/types/{hooks → src/powell/hooks}/usePowellConfig.d.ts +1 -1
- package/dist/esm/types/{models → src/powell/models}/config.d.ts +2 -2
- package/dist/esm/types/{models → src/powell/models}/forms.d.ts +2 -2
- package/dist/{cjs/types → esm/types/src/powell}/utils/utilsService.d.ts +3 -3
- package/dist/esm/types/vite.config.d.ts +2 -0
- package/package.json +45 -57
- 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
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/api/configService.d.ts +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/api/configService.d.ts +0 -2
- package/dist/index.d.ts +0 -495
- /package/dist/cjs/types/{api → src/powell/api}/forms.d.ts +0 -0
- /package/dist/cjs/types/{api → src/powell/api}/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/AutoComplete/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Button/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/CascadeSelect/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Checkbox/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Chips/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/ColorPicker/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Dropdown/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Editor/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/FormContainer/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputMask/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputNumber/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputOtp/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputPassword/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputSwitch/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputText/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/InputTextarea/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Knob/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/ListBox/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Mention/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/MultiSelect/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/MultiStateCheckbox/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/RadioGroup/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Rating/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/SelectButton/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/Slider/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/ToggleButton/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/TreeSelect/index.d.ts +0 -0
- /package/dist/cjs/types/{components → src/powell/components}/TriStateCheckbox/index.d.ts +0 -0
- /package/dist/cjs/types/{hooks → src/powell/hooks}/index.d.ts +0 -0
- /package/dist/cjs/types/{index.d.ts → src/powell/index.d.ts} +0 -0
- /package/dist/cjs/types/{models → src/powell/models}/common.d.ts +0 -0
- /package/dist/cjs/types/{models → src/powell/models}/index.d.ts +0 -0
- /package/dist/cjs/types/{utils → src/powell/utils}/globalState.d.ts +0 -0
- /package/dist/cjs/types/{utils → src/powell/utils}/index.d.ts +0 -0
- /package/dist/esm/types/{api → src/powell/api}/forms.d.ts +0 -0
- /package/dist/esm/types/{api → src/powell/api}/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/AutoComplete/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Button/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/CascadeSelect/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Checkbox/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Chips/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/ColorPicker/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Dropdown/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Editor/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/FormContainer/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputMask/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputNumber/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputOtp/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputPassword/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputSwitch/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputText/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/InputTextarea/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Knob/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/ListBox/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Mention/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/MultiSelect/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/MultiStateCheckbox/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/RadioGroup/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Rating/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/SelectButton/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/Slider/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/ToggleButton/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/TreeSelect/index.d.ts +0 -0
- /package/dist/esm/types/{components → src/powell/components}/TriStateCheckbox/index.d.ts +0 -0
- /package/dist/esm/types/{hooks → src/powell/hooks}/index.d.ts +0 -0
- /package/dist/esm/types/{index.d.ts → src/powell/index.d.ts} +0 -0
- /package/dist/esm/types/{models → src/powell/models}/common.d.ts +0 -0
- /package/dist/esm/types/{models → src/powell/models}/index.d.ts +0 -0
- /package/dist/esm/types/{utils → src/powell/utils}/globalState.d.ts +0 -0
- /package/dist/esm/types/{utils → src/powell/utils}/index.d.ts +0 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
import { mergeConfig } from 'vite';
|
2
|
+
import svgr from 'vite-plugin-svgr';
|
3
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
4
|
+
|
5
|
+
const config: StorybookConfig = {
|
6
|
+
'stories': ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
7
|
+
|
8
|
+
'addons': [
|
9
|
+
'@storybook/addon-links',
|
10
|
+
'@storybook/addon-essentials',
|
11
|
+
'@chromatic-com/storybook',
|
12
|
+
'@storybook/addon-interactions'
|
13
|
+
],
|
14
|
+
|
15
|
+
'framework': {
|
16
|
+
'name': '@storybook/react-vite',
|
17
|
+
'options': {},
|
18
|
+
},
|
19
|
+
'docs': {},
|
20
|
+
'typescript': {
|
21
|
+
'reactDocgen': 'react-docgen-typescript'
|
22
|
+
},
|
23
|
+
'core': {
|
24
|
+
'disableTelemetry': true
|
25
|
+
},
|
26
|
+
};
|
27
|
+
|
28
|
+
export default config;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { Preview } from "@storybook/react";
|
2
|
+
import { PowellProvider } from "@powell/api";
|
3
|
+
|
4
|
+
const preview: Preview = {
|
5
|
+
decorators: [
|
6
|
+
(Story) => (
|
7
|
+
<PowellProvider>
|
8
|
+
<Story />
|
9
|
+
</PowellProvider>
|
10
|
+
),
|
11
|
+
],
|
12
|
+
parameters: {
|
13
|
+
controls: {
|
14
|
+
matchers: {
|
15
|
+
color: /(background|color)$/i,
|
16
|
+
date: /Date$/i,
|
17
|
+
},
|
18
|
+
},
|
19
|
+
},
|
20
|
+
|
21
|
+
tags: ["autodocs", "autodocs"]
|
22
|
+
};
|
23
|
+
|
24
|
+
export default preview;
|
package/README.md
CHANGED
@@ -1,321 +0,0 @@
|
|
1
|
-
# My React Library
|
2
|
-
|
3
|
-
This is a React component library built with TypeScript, Rollup, and Storybook.
|
4
|
-
|
5
|
-
## Step-by-Step Guide
|
6
|
-
|
7
|
-
### Step 1: Initialize Your Project
|
8
|
-
|
9
|
-
Create a new project directory and initialize it with NPM:
|
10
|
-
|
11
|
-
```bash
|
12
|
-
mkdir my-react-library
|
13
|
-
cd my-react-library
|
14
|
-
npm init -y
|
15
|
-
```
|
16
|
-
|
17
|
-
### Step 2: Install Dependencies
|
18
|
-
|
19
|
-
Install the necessary development dependencies:
|
20
|
-
|
21
|
-
```bash
|
22
|
-
npm install -D typescript react react-dom
|
23
|
-
npm install -D rollup @rollup/plugin-node-resolve @rollup/plugin-typescript @rollup/plugin-commonjs rollup-plugin-dts rollup-plugin-postcss
|
24
|
-
npm install -D tslib postcss
|
25
|
-
npm install -D @storybook/react-webpack5 @storybook/addon-essentials
|
26
|
-
npm install -D @babel/core @babel/preset-env @babel/preset-react @babel/preset-typescript
|
27
|
-
npm install -D @types/react
|
28
|
-
```
|
29
|
-
|
30
|
-
### Step 3: Set Up TypeScript
|
31
|
-
|
32
|
-
Initialize TypeScript configuration:
|
33
|
-
|
34
|
-
```bash
|
35
|
-
npx tsc --init
|
36
|
-
```
|
37
|
-
|
38
|
-
Edit the tsconfig.json file to match the following configuration:
|
39
|
-
|
40
|
-
```json
|
41
|
-
{
|
42
|
-
"compilerOptions": {
|
43
|
-
"target": "esnext",
|
44
|
-
"jsx": "react-jsx",
|
45
|
-
"module": "ESNext",
|
46
|
-
"moduleResolution": "Node",
|
47
|
-
"allowJs": false,
|
48
|
-
"maxNodeModuleJsDepth": 1,
|
49
|
-
"declaration": true,
|
50
|
-
"emitDeclarationOnly": true,
|
51
|
-
"sourceMap": true,
|
52
|
-
"outDir": "dist",
|
53
|
-
"declarationDir": "types",
|
54
|
-
"allowSyntheticDefaultImports": true,
|
55
|
-
"esModuleInterop": true,
|
56
|
-
"forceConsistentCasingInFileNames": true,
|
57
|
-
"strict": true,
|
58
|
-
"noUnusedLocals": true,
|
59
|
-
"noUnusedParameters": true,
|
60
|
-
"noImplicitReturns": true,
|
61
|
-
"noFallthroughCasesInSwitch": true,
|
62
|
-
"noUncheckedIndexedAccess": true,
|
63
|
-
"allowUnreachableCode": false,
|
64
|
-
"skipLibCheck": true
|
65
|
-
}
|
66
|
-
}
|
67
|
-
```
|
68
|
-
|
69
|
-
### Step 4: Create Your Components
|
70
|
-
|
71
|
-
Create the following directory structure and files:
|
72
|
-
|
73
|
-
```css
|
74
|
-
src
|
75
|
-
└── components
|
76
|
-
├── Button
|
77
|
-
│ ├── Button.tsx
|
78
|
-
│ └── index.ts
|
79
|
-
└── Input
|
80
|
-
├── Input.tsx
|
81
|
-
└── index.ts
|
82
|
-
└── index.ts
|
83
|
-
```
|
84
|
-
|
85
|
-
Example Button Component (src/components/Button/Button.tsx):
|
86
|
-
|
87
|
-
```tsx
|
88
|
-
import React from "react";
|
89
|
-
|
90
|
-
interface ButtonProps {
|
91
|
-
label: string;
|
92
|
-
}
|
93
|
-
|
94
|
-
const Button: React.FC<ButtonProps> = ({ label }) => {
|
95
|
-
return <button>{label}</button>;
|
96
|
-
};
|
97
|
-
|
98
|
-
export default Button;
|
99
|
-
```
|
100
|
-
|
101
|
-
Button Component Index (src/components/Button/index.ts):
|
102
|
-
|
103
|
-
```tsx
|
104
|
-
import Button from "./Button";
|
105
|
-
export default Button;
|
106
|
-
```
|
107
|
-
|
108
|
-
Example Input Component (src/components/Input/Input.tsx):
|
109
|
-
|
110
|
-
```tsx
|
111
|
-
import React from "react";
|
112
|
-
|
113
|
-
interface InputProps {
|
114
|
-
placeholder: string;
|
115
|
-
}
|
116
|
-
|
117
|
-
const Input: React.FC<InputProps> = ({ placeholder }) => {
|
118
|
-
return <input placeholder={placeholder} />;
|
119
|
-
};
|
120
|
-
|
121
|
-
export default Input;
|
122
|
-
```
|
123
|
-
|
124
|
-
Input Component Index (src/components/Input/index.ts):
|
125
|
-
|
126
|
-
```tsx
|
127
|
-
import Input from "./Input";
|
128
|
-
export default Input;
|
129
|
-
```
|
130
|
-
|
131
|
-
Main Index File (src/index.ts):
|
132
|
-
|
133
|
-
```tsx
|
134
|
-
export { default as Button } from "./components/Button";
|
135
|
-
export { default as Input } from "./components/Input";
|
136
|
-
```
|
137
|
-
|
138
|
-
### Step 5: Set Up Rollup
|
139
|
-
|
140
|
-
Create a Rollup configuration file rollup.config.mjs:
|
141
|
-
|
142
|
-
```javascript
|
143
|
-
import commonjs from "@rollup/plugin-commonjs";
|
144
|
-
import resolve from "@rollup/plugin-node-resolve";
|
145
|
-
import typescript from "@rollup/plugin-typescript";
|
146
|
-
import dts from "rollup-plugin-dts";
|
147
|
-
import postcss from "rollup-plugin-postcss";
|
148
|
-
import packageJson from "./package.json" assert { type: "json" };
|
149
|
-
|
150
|
-
export default [
|
151
|
-
{
|
152
|
-
preserveModules: true,
|
153
|
-
input: "src/index.ts",
|
154
|
-
output: [
|
155
|
-
{
|
156
|
-
file: packageJson.main,
|
157
|
-
format: "cjs",
|
158
|
-
sourcemap: true,
|
159
|
-
},
|
160
|
-
{
|
161
|
-
file: packageJson.module,
|
162
|
-
format: "esm",
|
163
|
-
sourcemap: true,
|
164
|
-
},
|
165
|
-
],
|
166
|
-
plugins: [
|
167
|
-
resolve(),
|
168
|
-
commonjs(),
|
169
|
-
typescript({
|
170
|
-
tsconfig: "./tsconfig.json",
|
171
|
-
exclude: ["**/*.test.tsx", "**/*.test.ts", "**/*.stories.ts"],
|
172
|
-
}),
|
173
|
-
postcss({ extensions: [".css"], inject: true, extract: false }),
|
174
|
-
],
|
175
|
-
},
|
176
|
-
{
|
177
|
-
input: "dist/esm/types/index.d.ts",
|
178
|
-
output: [{ file: "dist/index.d.ts", format: "esm" }],
|
179
|
-
plugins: [dts()],
|
180
|
-
external: [/\.css$/],
|
181
|
-
},
|
182
|
-
];
|
183
|
-
```
|
184
|
-
|
185
|
-
### Step 6: Set Up Storybook
|
186
|
-
|
187
|
-
Initialize Storybook:
|
188
|
-
|
189
|
-
```bash
|
190
|
-
npx sb init
|
191
|
-
```
|
192
|
-
|
193
|
-
Create a .storybook directory and add main.ts:
|
194
|
-
|
195
|
-
```javascript
|
196
|
-
import type { StorybookConfig } from "@storybook/react-webpack5";
|
197
|
-
|
198
|
-
const config: StorybookConfig = {
|
199
|
-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
200
|
-
addons: [
|
201
|
-
"@storybook/addon-links",
|
202
|
-
"@storybook/addon-essentials",
|
203
|
-
],
|
204
|
-
framework: {
|
205
|
-
name: "@storybook/react-webpack5",
|
206
|
-
options: {},
|
207
|
-
},
|
208
|
-
};
|
209
|
-
|
210
|
-
export default config;
|
211
|
-
```
|
212
|
-
|
213
|
-
### Step 7: Configure package.json
|
214
|
-
|
215
|
-
Update package.json with the necessary fields:
|
216
|
-
|
217
|
-
```json
|
218
|
-
{
|
219
|
-
"name": "my-react-library",
|
220
|
-
"version": "0.0.1",
|
221
|
-
"main": "dist/cjs/index.js",
|
222
|
-
"module": "dist/esm/index.js",
|
223
|
-
"types": "dist/index.d.ts",
|
224
|
-
"files": ["dist"],
|
225
|
-
"scripts": {
|
226
|
-
"dev": "rollup -c --watch",
|
227
|
-
"build": "rollup -c",
|
228
|
-
"storybook": "storybook dev -p 6006",
|
229
|
-
"build-storybook": "storybook build"
|
230
|
-
},
|
231
|
-
"babel": {
|
232
|
-
"sourceType": "unambiguous",
|
233
|
-
"presets": [
|
234
|
-
[
|
235
|
-
"@babel/preset-env",
|
236
|
-
{
|
237
|
-
"targets": {
|
238
|
-
"chrome": 100,
|
239
|
-
"safari": 15,
|
240
|
-
"firefox": 91
|
241
|
-
}
|
242
|
-
}
|
243
|
-
],
|
244
|
-
[
|
245
|
-
"@babel/preset-react",
|
246
|
-
{
|
247
|
-
"runtime": "automatic"
|
248
|
-
}
|
249
|
-
],
|
250
|
-
"@babel/preset-typescript"
|
251
|
-
]
|
252
|
-
},
|
253
|
-
"author": "",
|
254
|
-
"license": "ISC",
|
255
|
-
"description": "",
|
256
|
-
"devDependencies": {
|
257
|
-
"@babel/core": "^7.24.6",
|
258
|
-
"@babel/preset-env": "^7.24.6",
|
259
|
-
"@babel/preset-react": "^7.24.6",
|
260
|
-
"@babel/preset-typescript": "^7.24.6",
|
261
|
-
"@rollup/plugin-commonjs": "^25.0.8",
|
262
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
263
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
264
|
-
"@storybook/addon-essentials": "^8.1.5",
|
265
|
-
"@storybook/addon-links": "^8.1.5",
|
266
|
-
"@storybook/react": "^8.1.5",
|
267
|
-
"@storybook/react-webpack5": "^8.1.5",
|
268
|
-
"@types/react": "^18.3.3",
|
269
|
-
"postcss": "^8.4.38",
|
270
|
-
"react": "^18.3.1",
|
271
|
-
"react-dom": "^18.3.1",
|
272
|
-
"rollup": "^4.18.0",
|
273
|
-
"rollup-plugin-dts": "^6.1.1",
|
274
|
-
"rollup-plugin-postcss": "^4.0.2",
|
275
|
-
"storybook": "^8.1.5",
|
276
|
-
"tslib": "^2.6.2",
|
277
|
-
"typescript": "^5.4.5"
|
278
|
-
},
|
279
|
-
"peerDependencies": {
|
280
|
-
"react": "^18.2.0"
|
281
|
-
}
|
282
|
-
}
|
283
|
-
```
|
284
|
-
|
285
|
-
### Step 8: Build Your Package
|
286
|
-
|
287
|
-
To build your package, run:
|
288
|
-
|
289
|
-
```bash
|
290
|
-
npm run build
|
291
|
-
```
|
292
|
-
|
293
|
-
### Step 9: Run Storybook
|
294
|
-
|
295
|
-
To start Storybook, run:
|
296
|
-
|
297
|
-
```bash
|
298
|
-
npm run storybook
|
299
|
-
```
|
300
|
-
|
301
|
-
### Step 10: Publish to NPM
|
302
|
-
|
303
|
-
First, log in to your NPM account:
|
304
|
-
|
305
|
-
```bash
|
306
|
-
npm login
|
307
|
-
```
|
308
|
-
|
309
|
-
Publish your package:
|
310
|
-
|
311
|
-
```bash
|
312
|
-
npm publish
|
313
|
-
```
|
314
|
-
|
315
|
-
If your package is scoped and you want to make it public, use:
|
316
|
-
|
317
|
-
```bash
|
318
|
-
npm publish --access public
|
319
|
-
```
|
320
|
-
|
321
|
-
Congratulations!🎉 You've successfully created and published a React component library with TypeScript, Rollup, and Storybook.
|