@livestorm/ui-vue 2.0.0 → 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 CHANGED
@@ -103,34 +103,36 @@ registerComponents(app, 'Ls') // optional custom prefix: LsButton, LsTag, ...
103
103
 
104
104
  ### App setup
105
105
 
106
- Beyond the Tailwind CSS setup above, two runtime plugins must be registered when you create the app:
107
-
108
- - **`@livestorm/ui-vue/responsive`** installs the `$responsive` global that layout components (`UiPage`, the toast layout) read; without it those components won't render correctly.
109
- - **`floating-vue`** backs the tooltips on `UiButton`, `UiLabel`, `UiFieldWrapper` and `UiInputCheckbox` (the `v-tooltip` directive). Install it alongside the library and import its stylesheet:
110
-
111
- ```bash
112
- pnpm add floating-vue
113
- ```
106
+ No runtime plugin is required: beyond the Tailwind CSS setup above, create the app and use components.
114
107
 
115
108
  ```ts
116
109
  import { createApp } from 'vue'
117
- import FloatingVue from 'floating-vue'
118
- import 'floating-vue/dist/style.css'
119
- import Responsive from '@livestorm/ui-vue/responsive'
120
110
  import { registerComponents } from '@livestorm/ui-vue/components-vite'
121
111
  import '@livestorm/ui-vue/style'
122
112
  import App from './App.vue'
123
113
 
124
114
  const app = createApp(App)
125
115
 
126
- app.use(Responsive) // provides $responsive (required by UiPage, toasts)
127
- app.use(FloatingVue) // enables v-tooltip on UiButton, UiLabel, UiFieldWrapper, UiInputCheckbox
128
116
  registerComponents(app) // optional: register all Ui* components globally
129
117
 
130
118
  app.mount('#app')
131
119
  ```
132
120
 
133
- The overlay components (dialogs, dropdowns, menus, popovers) render through client-only teleports; under SSR they hydrate on the client with no extra setup.
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
+
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.
134
136
 
135
137
  ### Storybook
136
138