@v1nt1248/3nclient-lib 0.3.48 → 0.3.50

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.
Files changed (35) hide show
  1. package/README.md +44 -1
  2. package/dist/chunks/{plugins-keys-CmrMlx3F.js → plugins-keys-DdadrIAg.js} +84 -77
  3. package/dist/chunks/ui3n-notification-o0tuhTpO.js +272 -0
  4. package/dist/mixins.scss +0 -23
  5. package/dist/src/components/ui3n-autocomplete/types.d.ts +12 -0
  6. package/dist/src/components/ui3n-input/ui3n-input.d.ts +2 -2
  7. package/dist/src/components/ui3n-notification/types.d.ts +5 -0
  8. package/dist/src/components/ui3n-notification/ui3n-notification.d.ts +1 -0
  9. package/dist/src/components/ui3n-text/ui3n-text.d.ts +2 -2
  10. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -1
  11. package/dist/src/constants/plugins-keys.d.ts +2 -0
  12. package/dist/src/directives/ui3n-ripple.d.ts +2 -1
  13. package/dist/src/directives/ui3n-title.d.ts +1 -1
  14. package/dist/src/plugins/index.d.ts +4 -1
  15. package/dist/src/plugins/theme/store-theme.d.ts +4 -0
  16. package/dist/src/plugins/theme/theme.d.ts +10 -0
  17. package/dist/src/plugins/theme/types.d.ts +12 -0
  18. package/dist/src/ui3n-plugins.d.ts +5 -3
  19. package/dist/src/utils/index.d.ts +1 -0
  20. package/dist/src/utils/ui/to-css-length.d.ts +1 -0
  21. package/dist/style.css +1 -1
  22. package/dist/ui3n-components.js +1239 -1199
  23. package/dist/ui3n-plugins.js +83 -34
  24. package/dist/ui3n-utils.js +4 -4
  25. package/dist/variables.css +5 -91
  26. package/package.json +1 -1
  27. package/src/components/ui3n-autocomplete/types.ts +12 -0
  28. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +49 -7
  29. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +6 -9
  30. package/src/components/ui3n-notification/types.ts +5 -0
  31. package/src/components/ui3n-notification/ui3n-notification.vue +38 -16
  32. package/src/components/ui3n-radio-group/ui3n-radio.vue +9 -6
  33. package/src/components/ui3n-switch/ui3n-switch.vue +2 -1
  34. package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -3
  35. package/dist/chunks/ui3n-notification-DPC5Ke4b.js +0 -278
package/README.md CHANGED
@@ -55,11 +55,13 @@ You can run the project as `pnpm dev` or `npm run dev`.
55
55
  - dialogs
56
56
  - notifications
57
57
  - vue-bus
58
+ - theme
58
59
 
59
60
  ### Store plugins [`@v1nt1248/3nclient-lib/plugins`]
60
61
  - store-dialogs
61
62
  - store-notifications
62
63
  - store-vue-bus
64
+ - store-theme
63
65
 
64
66
  ### Constants
65
67
  - emoticons
@@ -114,4 +116,45 @@ You also need to import the required CSS files into your `main.ts`:
114
116
  ```ts
115
117
  import '@v1nt1248/3nclient-lib/variables.css';
116
118
  import '@v1nt1248/3nclient-lib/style.css';
117
- ```
119
+ ```
120
+
121
+ `variables.css` contains design tokens only (palette, theme semantics, `--color-*` mapping). Light tokens and the color mapping are applied on `:root`, so `<html>` classes are **not** required for the default (light) look.
122
+
123
+ `.default-theme` is a deprecated alias of `.light-theme`.
124
+
125
+ To start with another theme or switch at runtime:
126
+
127
+ ```ts
128
+ import { createApp, inject } from 'vue';
129
+ import { theme, THEME_KEY } from '@v1nt1248/3nclient-lib/plugins';
130
+
131
+ const app = createApp(App);
132
+ app.use(theme, { theme: 'light' }); // omit or `'light'` → light; `'dark'` | `'dark2'` also valid
133
+ app.mount('#app');
134
+
135
+ const { setTheme } = inject(THEME_KEY)!;
136
+ setTheme('dark');
137
+ ```
138
+
139
+ With Pinia store:
140
+
141
+ ```ts
142
+ import { createApp } from 'vue';
143
+ import { createPinia } from 'pinia';
144
+ import { theme, storeTheme } from '@v1nt1248/3nclient-lib/plugins';
145
+
146
+ const app = createApp(App);
147
+ const pinia = createPinia();
148
+
149
+ app.use(theme, { theme: 'light' });
150
+ pinia.use(storeTheme);
151
+ app.use(pinia);
152
+ app.mount('#app');
153
+
154
+ // Inside any Pinia store action:
155
+ // this.$theme.setTheme('dark');
156
+ // this.$theme.theme.value; // 'dark'
157
+ ```
158
+
159
+ Without the plugin you can still switch manually: `document.documentElement.classList.add('dark-theme', 'colors')`.
160
+