Skip to content

Commit 6736d96

Browse files
anwarulislamAndrewBastinJoelJacobStephen
authored
feat: modal and toast improvements (#7)
* feat: vue soner added * feat: wrapper function added for soner * chore: initial impl * feat: simple and input modal story added * feat: legacy toast support * chore: rich colors for toast * feat: legacy modal story * chore: fixes spelling mistake * feat: modal wrapper added * feat: modal examples added * chore: removed bracket * feat: improve example * feat: nested modal with props * chore: update modals export * chore: modal props warning issue updated * feat: legacy toast action support * chore: toast types updated * chore: minor improvements across modal and toast related files * chore: legacy toast type * chore: toast ui * chore: toast type improved * chore: refactor toast module * chore: export naming consistency * chore: separated legacy toast * chore: bump vue-sonner to 1.1.2 * chore: make toast dismissal work programmatically * chore: export improvements * fix: import legacy toast * chore: theme.css for default styling * chore: change histoire.scss to theme.scss * chore: update README * chore: legacy toast styling * chore: made legacy-toast deprecated * feat: vue-sonner replaced with @hoppscotch/vue-sonner * fix: vue-sonner type issue fixed * feat: new modal added as beta --------- Co-authored-by: Andrew Bastin <[email protected]> Co-authored-by: Joel Jacob Stephen <[email protected]>
1 parent 49c279c commit 6736d96

23 files changed

+7477
-4740
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ import App from "./App.vue"
3333
// Import the library
3434
import { plugin as HoppUI } from "@hoppscotch/ui"
3535

36+
// Import theme styles for default styling (optional)
37+
import "@hoppscotch/ui/themes.css"
38+
3639
// Import the styles
3740
import "@hoppscotch/ui/style.css"
3841

histoire.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ export default defineConfig({
1515
setupFile: "histoire.setup.ts",
1616
plugins: [HstVue()],
1717
viteIgnorePlugins: ["vite:dts"],
18+
viteNodeInlineDeps: [
19+
/vue-promise-modals/,
20+
/@boringer-avatars\/vue3/
21+
]
1822
})

histoire.setup.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
import "./src/assets/scss/histoire.scss"
1+
import { defineSetupVue3 } from "@histoire/plugin-vue"
2+
import { plugin } from "vue-promise-modals"
3+
4+
import GlobalWrapper from "./src/GlobalWrapper.vue"
5+
6+
import "./src/assets/scss/themes.scss"
7+
import "./src/assets/scss/styles.scss"
28

39
import "@fontsource-variable/inter"
410
import "@fontsource-variable/material-symbols-rounded"
511
import "@fontsource-variable/roboto-mono"
612

7-
export function setupVue3() {}
13+
export const setupVue3 = defineSetupVue3(({ app, addWrapper }) => {
14+
app.use(plugin, {})
15+
addWrapper(GlobalWrapper)
16+
})

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hoppscotch/ui",
3-
"version": "0.1.4",
3+
"version": "0.2.0",
44
"license": "MIT",
55
"description": "Hoppscotch UI",
66
"author": "Hoppscotch ([email protected])",
@@ -18,9 +18,10 @@
1818
"hoppscotch api"
1919
],
2020
"scripts": {
21-
"dev": "histoire dev",
21+
"dev": "histoire dev --port 6006",
2222
"watch": "vite build --watch",
23-
"build": "vite build",
23+
"build": "vite build && npm run build:css",
24+
"build:css": "sass src/assets/scss/themes.scss dist/themes.css --no-source-map",
2425
"story:build": "histoire build",
2526
"story:preview": "histoire preview",
2627
"prepublish": "pnpm run build"
@@ -33,19 +34,22 @@
3334
"@fontsource-variable/inter": "^5.0.5",
3435
"@fontsource-variable/material-symbols-rounded": "^5.0.5",
3536
"@fontsource-variable/roboto-mono": "^5.0.6",
37+
"@hoppscotch/vue-sonner": "^1.2.2",
3638
"@hoppscotch/vue-toasted": "^0.1.0",
3739
"@vitejs/plugin-legacy": "^2.3.0",
3840
"@vueuse/core": "^8.7.5",
3941
"fp-ts": "^2.12.1",
4042
"lodash-es": "^4.17.21",
4143
"path": "^0.12.7",
4244
"vite-plugin-eslint": "^1.8.1",
45+
"vue-promise-modals": "^0.1.0",
46+
"vue-sonner": "^1.1.2",
4347
"vuedraggable-es": "^4.1.1"
4448
},
4549
"devDependencies": {
4650
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
4751
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
48-
"@histoire/plugin-vue": "^0.12.4",
52+
"@histoire/plugin-vue": "^0.17.14",
4953
"@iconify-json/lucide": "^1.1.109",
5054
"@intlify/vite-plugin-vue-i18n": "^6.0.1",
5155
"@rushstack/eslint-patch": "^1.1.4",
@@ -62,17 +66,17 @@
6266
"eslint": "^8.24.0",
6367
"eslint-plugin-prettier": "^4.2.1",
6468
"eslint-plugin-vue": "^9.5.1",
65-
"histoire": "^0.12.4",
69+
"histoire": "^0.17.14",
6670
"npm-run-all": "^4.1.5",
6771
"postcss": "^8.4.23",
6872
"prettier": "^3.1.0",
6973
"prettier-plugin-tailwindcss": "^0.5.7",
7074
"rollup-plugin-polyfill-node": "^0.10.1",
71-
"sass": "^1.53.0",
75+
"sass": "^1.77.0",
7276
"tailwindcss": "^3.3.2",
7377
"typescript": "^4.5.4",
74-
"unplugin-icons": "^0.16.1",
7578
"unplugin-fonts": "^1.0.3",
79+
"unplugin-icons": "^0.16.1",
7680
"unplugin-vue-components": "^0.21.0",
7781
"vite": "^3.2.3",
7882
"vite-plugin-checker": "^0.5.1",
@@ -103,7 +107,7 @@
103107
"exports": {
104108
".": "./dist/index.js",
105109
"./style.css": "./dist/style.css",
106-
"./themes.scss": "./dist/themes.scss",
110+
"./themes.css": "./dist/themes.css",
107111
"./ui-preset": {
108112
"import": "./dist/ui-preset.js",
109113
"require": "./dist/ui-preset.js",

0 commit comments

Comments
 (0)