@livestorm/ui-vue 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/{UiTimelineItem.vue_vue_type_style_index_0_lang-BN5208td.mjs → UiTimelineItem.vue_vue_type_style_index_0_lang-B0UKmlqE.mjs} +405 -404
- package/dist/components.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/layouts.mjs +27 -26
- package/dist/responsive.mjs +33 -19
- package/dist/types/src/utils/responsive.d.ts +9 -1
- package/package.json +3 -4
- package/src/components/Toast/LayoutToasts.vue +4 -1
- package/src/components/UiPage/UiPage.vue +4 -1
- package/src/utils/responsive.js +70 -16
package/README.md
CHANGED
|
@@ -103,23 +103,35 @@ registerComponents(app, 'Ls') // optional custom prefix: LsButton, LsTag, ...
|
|
|
103
103
|
|
|
104
104
|
### App setup
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
No runtime plugin is required: beyond the Tailwind CSS setup above, create the app and use components.
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
109
|
import { createApp } from 'vue'
|
|
110
|
-
import Responsive from '@livestorm/ui-vue/responsive'
|
|
111
110
|
import { registerComponents } from '@livestorm/ui-vue/components-vite'
|
|
112
111
|
import '@livestorm/ui-vue/style'
|
|
113
112
|
import App from './App.vue'
|
|
114
113
|
|
|
115
114
|
const app = createApp(App)
|
|
116
115
|
|
|
117
|
-
app.use(Responsive) // provides $responsive (required by UiPage, toasts)
|
|
118
116
|
registerComponents(app) // optional: register all Ui* components globally
|
|
119
117
|
|
|
120
118
|
app.mount('#app')
|
|
121
119
|
```
|
|
122
120
|
|
|
121
|
+
Layout components (`UiPage`, the toast layout) read the viewport from a shared responsive singleton that initializes itself on first use. Installing the `@livestorm/ui-vue/responsive` plugin is optional: do it only to customize the breakpoint flags (`mobile`, `tablet`, ...) or to expose `$responsive` to your own templates.
|
|
122
|
+
|
|
123
|
+
Server-side rendering works out of the box: pages render with a desktop layout on the server, then adapt to the real screen size as soon as they load in the browser. No configuration and no hydration warnings.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import Responsive from '@livestorm/ui-vue/responsive'
|
|
127
|
+
|
|
128
|
+
app.use(Responsive, {
|
|
129
|
+
computed: {
|
|
130
|
+
mobile: state => state.width < 900, // override the built-in flag
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
```
|
|
134
|
+
|
|
123
135
|
The overlay components (dialogs, dropdowns, menus, popovers, tooltips) render through client-only teleports; under SSR they hydrate on the client with no extra setup.
|
|
124
136
|
|
|
125
137
|
### Storybook
|