diff --git a/.gitignore b/.gitignore index 5d5db1a3..5bf1f5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,28 @@ .DS_Store node_modules docs/.vitepress/.temp -docs/.vitepress/dist \ No newline at end of file +docs/.vitepress/dist +storybook-static + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.postcssrc.js b/.postcssrc.js new file mode 100644 index 00000000..33ad091d --- /dev/null +++ b/.postcssrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 00000000..0f820258 --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,17 @@ +/** @type { import('@storybook/vue3-vite').StorybookConfig } */ +const config = { + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], + addons: [ + '@storybook/addon-links', + '@storybook/addon-essentials', + '@storybook/addon-interactions', + ], + framework: { + name: '@storybook/vue3-vite', + options: {}, + }, + docs: { + autodocs: 'tag', + }, +} +export default config diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html new file mode 100644 index 00000000..05da1e9d --- /dev/null +++ b/.storybook/preview-head.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 00000000..bae6de1c --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,24 @@ +import '../src/style.css' + +/** @type { import('@storybook/vue3').Preview } */ +const preview = { + parameters: { + layout: 'centered', + backgrounds: { + default: 'white', + values: [ + { name: 'white', value: '#ffffff' }, + { name: 'black', value: '#000000' }, + ], + }, + actions: { argTypesRegex: '^on[A-Z].*' }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, + }, +} + +export default preview diff --git a/App.vue b/App.vue new file mode 100644 index 00000000..c663fce7 --- /dev/null +++ b/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/index.html b/index.html new file mode 100644 index 00000000..5378c060 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Frappe UI + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 00000000..9331fdd6 --- /dev/null +++ b/main.js @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import './src/style.css' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..d8694de5 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] + publish = "storybook-static" + command = "yarn build-storybook" diff --git a/package.json b/package.json index 677d4699..e009fdcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frappe-ui", - "version": "0.0.112", + "version": "0.1.0-alpha.14", "description": "A set of components and utilities for rapid UI development", "main": "./src/index.js", "scripts": { @@ -10,10 +10,16 @@ "bump-and-release": "git pull --rebase origin main && yarn version --patch && git push && git push --tags", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", - "docs:serve": "vitepress serve docs" + "docs:serve": "vitepress serve docs", + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" }, "files": [ - "src" + "src", + "vite.js" ], "repository": { "type": "git", @@ -22,45 +28,62 @@ "author": "Frappe Technologies Pvt. Ltd.", "license": "MIT", "dependencies": { - "@headlessui/vue": "^1.5.0", + "@headlessui/vue": "^1.7.14", "@popperjs/core": "^2.11.2", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.0", - "@tiptap/extension-color": "^2.0.0-beta.205", - "@tiptap/extension-highlight": "^2.0.0-beta.205", - "@tiptap/extension-image": "^2.0.0-beta.205", - "@tiptap/extension-link": "^2.0.0-beta.205", - "@tiptap/extension-mention": "^2.0.0-beta.205", - "@tiptap/extension-placeholder": "^2.0.0-beta.205", - "@tiptap/extension-table": "^2.0.0-beta.205", - "@tiptap/extension-table-cell": "^2.0.0-beta.205", - "@tiptap/extension-table-header": "^2.0.0-beta.205", - "@tiptap/extension-table-row": "^2.0.0-beta.205", - "@tiptap/extension-text-align": "^2.0.0-beta.205", - "@tiptap/extension-text-style": "^2.0.0-beta.205", - "@tiptap/extension-typography": "^2.0.0-beta.205", - "@tiptap/pm": "^2.0.0-beta.220", - "@tiptap/prosemirror-tables": "^1.1.3", - "@tiptap/starter-kit": "^2.0.0-beta.205", - "@tiptap/suggestion": "^2.0.0-beta.205", - "@tiptap/vue-3": "^2.0.0-beta.205", - "autoprefixer": "^10.4.2", + "@tiptap/extension-color": "^2.0.3", + "@tiptap/extension-highlight": "^2.0.3", + "@tiptap/extension-image": "^2.0.3", + "@tiptap/extension-link": "^2.0.3", + "@tiptap/extension-mention": "^2.0.3", + "@tiptap/extension-placeholder": "^2.0.3", + "@tiptap/extension-table": "^2.0.3", + "@tiptap/extension-table-cell": "^2.0.3", + "@tiptap/extension-table-header": "^2.0.3", + "@tiptap/extension-table-row": "^2.0.3", + "@tiptap/extension-text-align": "^2.0.3", + "@tiptap/extension-text-style": "^2.0.3", + "@tiptap/extension-typography": "^2.0.3", + "@tiptap/pm": "^2.0.3", + "@tiptap/starter-kit": "^2.0.3", + "@tiptap/suggestion": "^2.0.3", + "@tiptap/vue-3": "^2.0.3", "feather-icons": "^4.28.0", "idb-keyval": "^6.2.0", - "postcss": "^8.4.5", "showdown": "^2.1.0", "socket.io-client": "^4.5.1", - "tailwindcss": "^3.0.12", "tippy.js": "^6.3.7" }, + "peerDependencies": { + "vue": "^3.2.45", + "vue-router": "^4.1.6" + }, "devDependencies": { + "@storybook/addon-essentials": "^7.0.0-beta.61", + "@storybook/addon-interactions": "^7.0.0-beta.61", + "@storybook/addon-links": "^7.0.0-beta.61", + "@storybook/blocks": "^7.0.0-alpha.8", + "@storybook/testing-library": "^0.0.14-next.1", + "@storybook/vue3": "^7.0.0-beta.61", + "@storybook/vue3-vite": "^7.0.0-beta.61", + "@vitejs/plugin-vue": "^4.0.0", + "autoprefixer": "^10.4.13", "cross-fetch": "^3.1.5", "husky": ">=6", "lint-staged": ">=10", + "postcss": "^8.4.21", "prettier": "2.7.1", "prettier-plugin-tailwindcss": "^0.1.13", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "storybook": "^7.0.0-beta.61", + "tailwindcss": "^3.2.7", + "typescript": "^5.0.2", + "vite": "^4.1.0", "vitepress": "^1.0.0-alpha.29", - "vue": "^3.2.45" + "vue": "^3.2.45", + "vue-router": "^4.1.6" }, "lint-staged": { "*.{js,css,md,vue}": "prettier --write" diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index a145e367..6cbd0c7d 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -1,88 +1,107 @@