@bitrix24/b24ui-nuxt 0.3.3 → 0.3.5

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 (36) hide show
  1. package/.nuxt/b24ui/container.ts +1 -1
  2. package/.nuxt/b24ui/index.ts +1 -0
  3. package/.nuxt/b24ui/slideover.ts +101 -0
  4. package/.nuxt/b24ui/toaster.ts +1 -1
  5. package/dist/meta.cjs +696 -233
  6. package/dist/meta.d.cts +696 -233
  7. package/dist/meta.d.mts +696 -233
  8. package/dist/meta.d.ts +696 -233
  9. package/dist/meta.mjs +696 -233
  10. package/dist/module.cjs +1 -2
  11. package/dist/module.json +1 -1
  12. package/dist/module.mjs +1 -2
  13. package/dist/runtime/components/App.vue +3 -4
  14. package/dist/runtime/components/Modal.vue +4 -2
  15. package/dist/runtime/components/OverlayProvider.vue +29 -0
  16. package/dist/runtime/components/Slideover.vue +193 -0
  17. package/dist/runtime/composables/useOverlay.d.ts +30 -0
  18. package/dist/runtime/composables/useOverlay.js +71 -0
  19. package/dist/runtime/types/index.d.ts +1 -0
  20. package/dist/runtime/types/index.js +1 -0
  21. package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
  22. package/dist/runtime/vue/composables/useAppConfig.js +2 -0
  23. package/dist/runtime/vue/stubs.d.ts +10 -0
  24. package/dist/runtime/vue/stubs.js +22 -0
  25. package/dist/shared/{b24ui-nuxt.BTln9cW-.mjs → b24ui-nuxt.CeQRWQD-.mjs} +121 -2
  26. package/dist/shared/{b24ui-nuxt.ngV6AJEg.cjs → b24ui-nuxt.M7bz91Io.cjs} +121 -2
  27. package/dist/unplugin.cjs +3 -3
  28. package/dist/unplugin.mjs +3 -3
  29. package/dist/vite.cjs +1 -1
  30. package/dist/vite.mjs +1 -1
  31. package/package.json +1 -1
  32. package/dist/runtime/components/ModalProvider.vue +0 -12
  33. package/dist/runtime/composables/useModal.d.ts +0 -17
  34. package/dist/runtime/composables/useModal.js +0 -46
  35. package/dist/runtime/plugins/modal.d.ts +0 -2
  36. package/dist/runtime/plugins/modal.js +0 -10
@@ -1510,7 +1510,7 @@ const chip = {
1510
1510
  };
1511
1511
 
1512
1512
  const container = {
1513
- base: "max-w-[80rem] mx-auto px-4 sm:px-6 lg:px-8"
1513
+ base: "max-w-[80rem] mx-auto px-5"
1514
1514
  // max-w-7xl w-full
1515
1515
  };
1516
1516
 
@@ -4089,6 +4089,124 @@ const skeleton = {
4089
4089
  base: "animate-pulse rounded-md bg-gray-200 dark:bg-gray-800"
4090
4090
  };
4091
4091
 
4092
+ const slideover = {
4093
+ slots: {
4094
+ overlay: "fixed inset-0 bg-base-950/20 dark:bg-base-950/30",
4095
+ content: [
4096
+ "fixed",
4097
+ "bg-base-50 dark:bg-base-950",
4098
+ // 'divide-y divide-(--ui-border)',
4099
+ "sm:shadow-lg",
4100
+ "flex flex-col focus:outline-none"
4101
+ ].join(" "),
4102
+ header: [
4103
+ "mt-4 px-5",
4104
+ "flex items-center gap-1.5"
4105
+ ].join(" "),
4106
+ wrapper: "min-h-2xl",
4107
+ body: [
4108
+ "mx-0 mt-2",
4109
+ "flex-1 overflow-y-auto"
4110
+ ].join(" "),
4111
+ footer: "bg-white dark:bg-base-950 flex items-center justify-center gap-3 py-4 border-t border-t-1 border-t-base-900/10 dark:border-t-white/20 shadow-top-md p-2 pr-(--scrollbar-width)",
4112
+ title: "font-b24-system font-light text-4.5xl leading-none text-base-900 dark:text-base-150",
4113
+ description: "mt-2 mb-1 text-base-500 dark:text-base-400 text-sm",
4114
+ close: "absolute"
4115
+ },
4116
+ variants: {
4117
+ side: {
4118
+ top: {
4119
+ content: "inset-x-0 top-0 max-h-full"
4120
+ },
4121
+ right: {
4122
+ content: "right-0 inset-y-0 w-full max-w-[28rem]"
4123
+ },
4124
+ bottom: {
4125
+ content: "inset-x-0 bottom-0 max-h-full"
4126
+ },
4127
+ left: {
4128
+ content: "left-0 inset-y-0 w-full max-w-[28rem]"
4129
+ }
4130
+ },
4131
+ transition: {
4132
+ true: {
4133
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
4134
+ }
4135
+ },
4136
+ scrollbarThin: {
4137
+ true: {
4138
+ body: "scrollbar-thin"
4139
+ }
4140
+ }
4141
+ },
4142
+ compoundVariants: [
4143
+ // region close ////
4144
+ // close: 'absolute ' ////
4145
+ {
4146
+ side: "right",
4147
+ class: {
4148
+ close: [
4149
+ "pl-1.5 pr-2.5",
4150
+ "top-3 -translate-x-full left-0",
4151
+ "rounded-l-full"
4152
+ ].join(" ")
4153
+ }
4154
+ },
4155
+ {
4156
+ side: "left",
4157
+ class: {
4158
+ close: [
4159
+ "pr-1.5 pl-2.5",
4160
+ "top-3 translate-x-full right-0",
4161
+ "rounded-r-full"
4162
+ ].join(" ")
4163
+ }
4164
+ },
4165
+ {
4166
+ side: ["top", "bottom"],
4167
+ class: {
4168
+ close: [
4169
+ "top-4 end-4"
4170
+ ].join(" ")
4171
+ }
4172
+ },
4173
+ // endregion ////
4174
+ // region transition ////
4175
+ {
4176
+ transition: true,
4177
+ side: "top",
4178
+ class: {
4179
+ content: "data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"
4180
+ }
4181
+ },
4182
+ {
4183
+ transition: true,
4184
+ side: "right",
4185
+ class: {
4186
+ content: "data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"
4187
+ }
4188
+ },
4189
+ {
4190
+ transition: true,
4191
+ side: "bottom",
4192
+ class: {
4193
+ content: "data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"
4194
+ }
4195
+ },
4196
+ {
4197
+ transition: true,
4198
+ side: "left",
4199
+ class: {
4200
+ content: "data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"
4201
+ }
4202
+ }
4203
+ ],
4204
+ defaultVariants: {
4205
+ side: "right",
4206
+ scrollbarThin: true
4207
+ }
4208
+ };
4209
+
4092
4210
  const _switch = {
4093
4211
  slots: {
4094
4212
  root: "relative flex items-start",
@@ -4947,7 +5065,7 @@ const toast = {
4947
5065
 
4948
5066
  const toaster = {
4949
5067
  slots: {
4950
- viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none",
5068
+ viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none mr-(--scrollbar-width)",
4951
5069
  base: "pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[expanded=false]:data-[front=false]:h-(--front-height) data-[expanded=false]:data-[front=false]:*:invisible data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"
4952
5070
  },
4953
5071
  variants: {
@@ -5068,6 +5186,7 @@ const theme = {
5068
5186
  selectMenu: selectMenu,
5069
5187
  separator: separator,
5070
5188
  skeleton: skeleton,
5189
+ slideover: slideover,
5071
5190
  switch: _switch,
5072
5191
  tabs: tabs,
5073
5192
  textarea: textarea,
package/dist/unplugin.cjs CHANGED
@@ -5,7 +5,7 @@ const pathe = require('pathe');
5
5
  const unplugin = require('unplugin');
6
6
  const defu = require('defu');
7
7
  const tailwind = require('@tailwindcss/vite');
8
- const templates = require('./shared/b24ui-nuxt.ngV6AJEg.cjs');
8
+ const templates = require('./shared/b24ui-nuxt.M7bz91Io.cjs');
9
9
  const tinyglobby = require('tinyglobby');
10
10
  const knitwork = require('knitwork');
11
11
  const MagicString = require('magic-string');
@@ -194,7 +194,7 @@ function Bitrix24EnvironmentPlugin() {
194
194
  function AutoImportPlugin(options, meta) {
195
195
  const pluginOptions = defu.defu(options.autoImport, {
196
196
  dts: options.dts ?? true,
197
- dirs: [pathe.join(runtimeDir, "composables")]
197
+ dirs: [pathe.join(runtimeDir, "composables"), pathe.join(runtimeDir, "vue/composables")]
198
198
  });
199
199
  return AutoImport__default.raw(pluginOptions, meta);
200
200
  }
@@ -202,7 +202,7 @@ function AutoImportPlugin(options, meta) {
202
202
  const runtimeDir = pathe.normalize(node_url.fileURLToPath(new URL("./runtime", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('unplugin.cjs', document.baseURI).href)))));
203
203
  const Bitrix24UIPlugin = unplugin.createUnplugin((_options = {}, meta) => {
204
204
  const options = defu.defu(_options, { devtools: { enabled: false } }, templates.defaultOptions);
205
- const appConfig = defu.defu({ b24ui: options.b24ui }, { b24ui: templates.getDefaultUiConfig() });
205
+ const appConfig = defu.defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: templates.getDefaultUiConfig() });
206
206
  return [
207
207
  Bitrix24EnvironmentPlugin(),
208
208
  ComponentImportPlugin(options, meta),
package/dist/unplugin.mjs CHANGED
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import { defu } from 'defu';
5
5
  import tailwind from '@tailwindcss/vite';
6
- import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.BTln9cW-.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.CeQRWQD-.mjs';
7
7
  import { globSync } from 'tinyglobby';
8
8
  import { genSafeVariableName } from 'knitwork';
9
9
  import MagicString from 'magic-string';
@@ -184,7 +184,7 @@ function Bitrix24EnvironmentPlugin() {
184
184
  function AutoImportPlugin(options, meta) {
185
185
  const pluginOptions = defu(options.autoImport, {
186
186
  dts: options.dts ?? true,
187
- dirs: [join(runtimeDir, "composables")]
187
+ dirs: [join(runtimeDir, "composables"), join(runtimeDir, "vue/composables")]
188
188
  });
189
189
  return AutoImport.raw(pluginOptions, meta);
190
190
  }
@@ -192,7 +192,7 @@ function AutoImportPlugin(options, meta) {
192
192
  const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
193
193
  const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
194
194
  const options = defu(_options, { devtools: { enabled: false } }, defaultOptions);
195
- const appConfig = defu({ b24ui: options.b24ui }, { b24ui: getDefaultUiConfig() });
195
+ const appConfig = defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: getDefaultUiConfig() });
196
196
  return [
197
197
  Bitrix24EnvironmentPlugin(),
198
198
  ComponentImportPlugin(options, meta),
package/dist/vite.cjs CHANGED
@@ -6,7 +6,7 @@ require('pathe');
6
6
  require('unplugin');
7
7
  require('defu');
8
8
  require('@tailwindcss/vite');
9
- require('./shared/b24ui-nuxt.ngV6AJEg.cjs');
9
+ require('./shared/b24ui-nuxt.M7bz91Io.cjs');
10
10
  require('scule');
11
11
  require('@nuxt/kit');
12
12
  require('tinyglobby');
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/b24ui-nuxt.BTln9cW-.mjs';
7
+ import './shared/b24ui-nuxt.CeQRWQD-.mjs';
8
8
  import 'scule';
9
9
  import '@nuxt/kit';
10
10
  import 'tinyglobby';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrix24/b24ui-nuxt",
3
3
  "description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
4
- "version": "0.3.3",
4
+ "version": "0.3.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"
@@ -1,12 +0,0 @@
1
- <script setup lang="ts">
2
- import { inject } from 'vue'
3
- import { useModal, modalInjectionKey } from '../composables/useModal'
4
-
5
- const modalState = inject(modalInjectionKey)
6
-
7
- const { isOpen } = useModal()
8
- </script>
9
-
10
- <template>
11
- <component :is="modalState.component" v-if="modalState" v-bind="modalState.props" v-model:open="isOpen" />
12
- </template>
@@ -1,17 +0,0 @@
1
- import type { ShallowRef, Component, InjectionKey } from 'vue';
2
- import type { ComponentProps } from 'vue-component-type-helpers';
3
- import type { ModalProps } from '../types';
4
- export interface ModalState {
5
- component: Component | string;
6
- props: ModalProps;
7
- }
8
- export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
9
- declare function _useModal(): {
10
- open: <T extends Component>(component: T, props?: ModalProps & ComponentProps<T>) => void;
11
- close: () => Promise<void>;
12
- reset: () => void;
13
- patch: <T extends Component = Record<string, never>>(props: Partial<ModalProps & ComponentProps<T>>) => void;
14
- isOpen: import("vue").Ref<boolean, boolean>;
15
- };
16
- export declare const useModal: typeof _useModal;
17
- export {};
@@ -1,46 +0,0 @@
1
- import { ref, inject } from "vue";
2
- import { createSharedComposable } from "@vueuse/core";
3
- export const modalInjectionKey = Symbol("bitrix24-ui.modal");
4
- function _useModal() {
5
- const modalState = inject(modalInjectionKey);
6
- const isOpen = ref(false);
7
- function open(component, props) {
8
- if (!modalState) {
9
- throw new Error("useModal() is called without provider");
10
- }
11
- modalState.value = {
12
- component,
13
- props: props ?? {}
14
- };
15
- isOpen.value = true;
16
- }
17
- async function close() {
18
- if (!modalState) return;
19
- isOpen.value = false;
20
- }
21
- function reset() {
22
- if (!modalState) return;
23
- modalState.value = {
24
- component: "div",
25
- props: {}
26
- };
27
- }
28
- function patch(props) {
29
- if (!modalState) return;
30
- modalState.value = {
31
- ...modalState.value,
32
- props: {
33
- ...modalState.value.props,
34
- ...props
35
- }
36
- };
37
- }
38
- return {
39
- open,
40
- close,
41
- reset,
42
- patch,
43
- isOpen
44
- };
45
- }
46
- export const useModal = createSharedComposable(_useModal);
@@ -1,2 +0,0 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- import { shallowRef } from "vue";
2
- import { defineNuxtPlugin } from "#imports";
3
- import { modalInjectionKey } from "../composables/useModal.js";
4
- export default defineNuxtPlugin((nuxtApp) => {
5
- const modalState = shallowRef({
6
- component: "div",
7
- props: {}
8
- });
9
- nuxtApp.vueApp.provide(modalInjectionKey, modalState);
10
- });