@bitrix24/b24ui-nuxt 0.2.2 → 0.2.3

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 (38) hide show
  1. package/.nuxt/b24ui/button.ts +9 -2
  2. package/.nuxt/b24ui/checkbox.ts +1 -1
  3. package/.nuxt/b24ui/index.ts +1 -0
  4. package/.nuxt/b24ui/input-menu.ts +1 -1
  5. package/.nuxt/b24ui/modal.ts +28 -0
  6. package/.nuxt/b24ui/radio-group.ts +1 -1
  7. package/.nuxt/b24ui/range.ts +1 -1
  8. package/.nuxt/b24ui/select-menu.ts +1 -1
  9. package/.nuxt/b24ui/select.ts +1 -1
  10. package/.nuxt/b24ui/switch.ts +1 -1
  11. package/.nuxt/b24ui/tabs.ts +2 -2
  12. package/.nuxt/b24ui/toaster.ts +4 -4
  13. package/dist/meta.cjs +1357 -13
  14. package/dist/meta.d.cts +1357 -13
  15. package/dist/meta.d.mts +1357 -13
  16. package/dist/meta.d.ts +1357 -13
  17. package/dist/meta.mjs +1357 -13
  18. package/dist/module.cjs +1 -1
  19. package/dist/module.json +1 -1
  20. package/dist/module.mjs +1 -1
  21. package/dist/runtime/components/App.vue +2 -2
  22. package/dist/runtime/components/Modal.vue +179 -0
  23. package/dist/runtime/components/ModalDialogClose.vue +17 -0
  24. package/dist/runtime/components/ModalProvider.vue +12 -0
  25. package/dist/runtime/composables/useComponentIcons.d.ts +2 -2
  26. package/dist/runtime/composables/useModal.d.ts +17 -0
  27. package/dist/runtime/composables/useModal.js +46 -0
  28. package/dist/runtime/plugins/modal.d.ts +2 -0
  29. package/dist/runtime/plugins/modal.js +10 -0
  30. package/dist/runtime/types/index.d.ts +2 -0
  31. package/dist/runtime/types/index.js +2 -0
  32. package/dist/shared/{b24ui-nuxt.DgnM0VWe.cjs → b24ui-nuxt.Ce3hzs_q.cjs} +79 -26
  33. package/dist/shared/{b24ui-nuxt.CYvh5VlN.mjs → b24ui-nuxt.DY8ePXC7.mjs} +79 -26
  34. package/dist/unplugin.cjs +1 -1
  35. package/dist/unplugin.mjs +1 -1
  36. package/dist/vite.cjs +1 -1
  37. package/dist/vite.mjs +1 -1
  38. package/package.json +6 -4
package/dist/module.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const defu = require('defu');
4
4
  const kit = require('@nuxt/kit');
5
- const templates = require('./shared/b24ui-nuxt.DgnM0VWe.cjs');
5
+ const templates = require('./shared/b24ui-nuxt.Ce3hzs_q.cjs');
6
6
  require('node:url');
7
7
  require('scule');
8
8
 
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.13.1"
6
6
  },
7
7
  "docs": "https://bitrix24.github.io/b24ui/guide/installation-nuxt-app.html",
8
- "version": "0.2.2",
8
+ "version": "0.2.3",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defu } from 'defu';
2
2
  import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
3
- import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.CYvh5VlN.mjs';
3
+ import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.DY8ePXC7.mjs';
4
4
  import 'node:url';
5
5
  import 'scule';
6
6
 
@@ -23,7 +23,7 @@ import { toRef, useId, provide } from 'vue'
23
23
  import { ConfigProvider, TooltipProvider, useForwardProps } from 'reka-ui'
24
24
  import { reactivePick } from '@vueuse/core'
25
25
  import B24Toaster from './Toaster.vue'
26
- // import B24ModalProvider from './ModalProvider.vue'
26
+ import B24ModalProvider from './ModalProvider.vue'
27
27
  // import B24SlideoverProvider from './SlideoverProvider.vue'
28
28
 
29
29
  const props = defineProps<AppProps>()
@@ -44,7 +44,7 @@ provide(localeContextInjectionKey, locale)
44
44
  <slot />
45
45
  </B24Toaster>
46
46
  <slot v-else />
47
- <!-- B24ModalProvider / -->
47
+ <B24ModalProvider />
48
48
  <!-- B24SlideoverProvider / -->
49
49
  </TooltipProvider>
50
50
  </ConfigProvider>
@@ -0,0 +1,179 @@
1
+ <script lang="ts">
2
+ import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'reka-ui'
3
+ import type { AppConfig } from '@nuxt/schema'
4
+ import _appConfig from '#build/app.config'
5
+ import theme from '#build/b24ui/modal'
6
+ import { tv } from '../utils/tv'
7
+ import type { ButtonProps, IconComponent } from '../types'
8
+
9
+ const appConfigModal = _appConfig as AppConfig & { b24ui: { modal: Partial<typeof theme> } }
10
+
11
+ const modal = tv({ extend: tv(theme), ...(appConfigModal.b24ui?.modal || {}) })
12
+
13
+ export interface ModalProps extends DialogRootProps {
14
+ title?: string
15
+ description?: string
16
+ /** The content of the modal. */
17
+ content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
18
+ /**
19
+ * Render an overlay behind the modal.
20
+ * @defaultValue true
21
+ */
22
+ overlay?: boolean
23
+ /**
24
+ * Animate the modal when opening or closing.
25
+ * @defaultValue true
26
+ */
27
+ transition?: boolean
28
+ /**
29
+ * When `true`, the modal will take up the full screen.
30
+ * @defaultValue false
31
+ */
32
+ fullscreen?: boolean
33
+ /**
34
+ * Render the modal in a portal.
35
+ * @defaultValue true
36
+ */
37
+ portal?: boolean
38
+ /**
39
+ * Display a close button to dismiss the modal.
40
+ * `{ size: 'xs', color: 'link' }`{lang="ts-type"}
41
+ * @defaultValue true
42
+ */
43
+ close?: ButtonProps | boolean
44
+ /**
45
+ * The icon displayed in the close button.
46
+ * @defaultValue icons.close
47
+ */
48
+ closeIcon?: IconComponent
49
+ /**
50
+ * When `false`, the modal will not close when clicking outside or pressing escape.
51
+ * @defaultValue true
52
+ */
53
+ dismissible?: boolean
54
+ class?: any
55
+ b24ui?: Partial<typeof modal.slots>
56
+ }
57
+
58
+ export interface ModalEmits extends DialogRootEmits {}
59
+
60
+ export interface ModalSlots {
61
+ default(props: { open: boolean }): any
62
+ content(props?: {}): any
63
+ header(props?: {}): any
64
+ title(props?: {}): any
65
+ description(props?: {}): any
66
+ close(props: { b24ui: any }): any
67
+ body(props?: {}): any
68
+ footer(props?: {}): any
69
+ }
70
+ </script>
71
+
72
+ <script setup lang="ts">
73
+ import { computed, toRef } from 'vue'
74
+ import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from 'reka-ui'
75
+ import { reactivePick } from '@vueuse/core'
76
+ import { useLocale } from '../composables/useLocale'
77
+ import icons from '../dictionary/icons'
78
+ import B24Button from './Button.vue'
79
+
80
+ const props = withDefaults(defineProps<ModalProps>(), {
81
+ close: true,
82
+ portal: true,
83
+ overlay: true,
84
+ transition: true,
85
+ modal: true,
86
+ dismissible: true
87
+ })
88
+ const emits = defineEmits<ModalEmits>()
89
+ const slots = defineSlots<ModalSlots>()
90
+
91
+ const { t } = useLocale()
92
+
93
+ const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
94
+ const contentProps = toRef(() => props.content)
95
+ const contentEvents = computed(() => {
96
+ if (!props.dismissible) {
97
+ return {
98
+ pointerDownOutside: (e: Event) => e.preventDefault(),
99
+ interactOutside: (e: Event) => e.preventDefault(),
100
+ escapeKeyDown: (e: Event) => e.preventDefault()
101
+ }
102
+ }
103
+
104
+ return {}
105
+ })
106
+
107
+ const b24ui = computed(() => modal({
108
+ transition: props.transition,
109
+ fullscreen: props.fullscreen
110
+ }))
111
+ </script>
112
+
113
+ <template>
114
+ <DialogRoot v-slot="{ open }" v-bind="rootProps">
115
+ <DialogTrigger v-if="!!slots.default" as-child :class="props.class">
116
+ <slot :open="open" />
117
+ </DialogTrigger>
118
+
119
+ <DialogPortal :disabled="!portal">
120
+ <DialogOverlay v-if="overlay" :class="b24ui.overlay({ class: props.b24ui?.overlay })" />
121
+
122
+ <DialogContent :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })" v-bind="contentProps" v-on="contentEvents">
123
+ <VisuallyHidden v-if="!!slots.content && ((title || !!slots.title) || (description || !!slots.description))">
124
+ <DialogTitle v-if="title || !!slots.title">
125
+ <slot name="title">
126
+ {{ title }}
127
+ </slot>
128
+ </DialogTitle>
129
+
130
+ <DialogDescription v-if="description || !!slots.description">
131
+ <slot name="description">
132
+ {{ description }}
133
+ </slot>
134
+ </DialogDescription>
135
+ </VisuallyHidden>
136
+
137
+ <slot name="content">
138
+ <div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
139
+ <slot name="header">
140
+ <DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
141
+ <slot name="title">
142
+ {{ title }}
143
+ </slot>
144
+ </DialogTitle>
145
+
146
+ <DialogDescription v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
147
+ <slot name="description">
148
+ {{ description }}
149
+ </slot>
150
+ </DialogDescription>
151
+
152
+ <DialogClose as-child>
153
+ <slot name="close" :b24ui="b24ui">
154
+ <B24Button
155
+ v-if="close"
156
+ :icon="closeIcon || icons.close"
157
+ size="xs"
158
+ color="link"
159
+ :aria-label="t('modal.close')"
160
+ v-bind="typeof close === 'object' ? close : undefined"
161
+ :class="b24ui.close({ class: props.b24ui?.close })"
162
+ />
163
+ </slot>
164
+ </DialogClose>
165
+ </slot>
166
+ </div>
167
+
168
+ <div v-if="!!slots.body" :class="b24ui.body({ class: props.b24ui?.body })">
169
+ <slot name="body" />
170
+ </div>
171
+
172
+ <div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
173
+ <slot name="footer" />
174
+ </div>
175
+ </slot>
176
+ </DialogContent>
177
+ </DialogPortal>
178
+ </DialogRoot>
179
+ </template>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ export interface ModalDialogCloseSlots {
3
+ default(props: {}): any
4
+ }
5
+ </script>
6
+
7
+ <script setup lang="ts">
8
+ import { DialogClose } from 'reka-ui'
9
+
10
+ defineSlots<ModalDialogCloseSlots>()
11
+ </script>
12
+
13
+ <template>
14
+ <DialogClose as-child>
15
+ <slot />
16
+ </DialogClose>
17
+ </template>
@@ -0,0 +1,12 @@
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>
@@ -15,6 +15,6 @@ export interface UseComponentIconsProps {
15
15
  export declare function useComponentIcons(componentProps: MaybeRefOrGetter<UseComponentIconsProps>): {
16
16
  isLeading: import("vue").ComputedRef<any>;
17
17
  isTrailing: import("vue").ComputedRef<boolean>;
18
- leadingIconName: import("vue").ComputedRef<IconComponent | undefined>;
19
- trailingIconName: import("vue").ComputedRef<IconComponent | undefined>;
18
+ leadingIconName: import("vue").ComputedRef<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
19
+ trailingIconName: import("vue").ComputedRef<import("vue").FunctionalComponent<import("vue").HTMLAttributes & import("vue").VNodeProps, {}, any, {}> | undefined>;
20
20
  };
@@ -0,0 +1,17 @@
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 {};
@@ -0,0 +1,46 @@
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);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,10 @@
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
+ });
@@ -17,6 +17,8 @@ export * from '../components/Input.vue';
17
17
  export * from '../components/InputMenu.vue';
18
18
  export * from '../components/Kbd.vue';
19
19
  export * from '../components/Link.vue';
20
+ export * from '../components/Modal.vue';
21
+ export * from '../components/ModalDialogClose.vue';
20
22
  export * from '../components/Progress.vue';
21
23
  export * from '../components/RadioGroup.vue';
22
24
  export * from '../components/Range.vue';
@@ -17,6 +17,8 @@ export * from "../components/Input.vue";
17
17
  export * from "../components/InputMenu.vue";
18
18
  export * from "../components/Kbd.vue";
19
19
  export * from "../components/Link.vue";
20
+ export * from "../components/Modal.vue";
21
+ export * from "../components/ModalDialogClose.vue";
20
22
  export * from "../components/Progress.vue";
21
23
  export * from "../components/RadioGroup.vue";
22
24
  export * from "../components/Range.vue";
@@ -720,7 +720,8 @@ const button = {
720
720
  slots: {
721
721
  base: [
722
722
  "select-none cursor-pointer inline-flex items-center",
723
- "relative focus:outline-hidden",
723
+ "relative",
724
+ "outline-transparent focus:outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
724
725
  "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:opacity-50",
725
726
  "transition duration-150 ease-linear"
726
727
  // transition-colors
@@ -737,7 +738,6 @@ const button = {
737
738
  variants: {
738
739
  ...buttonGroupVariant,
739
740
  color: {
740
- // DEFAULT ////
741
741
  default: [
742
742
  "text-white dark:text-base-100 bg-base-650 border border-base-650",
743
743
  "hover:bg-base-850 hover:border-base-850 hover:focus-visible:ring-0",
@@ -754,7 +754,6 @@ const button = {
754
754
  "focus-visible:outline-red-720",
755
755
  "ring-red-800 focus-visible:ring-red-800"
756
756
  ].join(" "),
757
- // SUCCESS ////
758
757
  success: [
759
758
  "text-base-900 bg-green-450 border border-green-450",
760
759
  "hover:bg-green-370 hover:border-green-370 hover:focus-visible:ring-0",
@@ -763,7 +762,6 @@ const button = {
763
762
  "focus-visible:outline-green-450",
764
763
  "ring-green-500 focus-visible:ring-green-500"
765
764
  ].join(" "),
766
- // new WARNING ////
767
765
  warning: [
768
766
  "text-white dark:text-orange-100 bg-orange-500 border border-orange-500",
769
767
  "hover:bg-orange-500/75 hover:border-orange-500/75 hover:focus-visible:ring-0",
@@ -772,7 +770,6 @@ const button = {
772
770
  "focus-visible:outline-orange-500",
773
771
  "ring-orange-800 focus-visible:ring-orange-800"
774
772
  ].join(" "),
775
- // PRIMARY ////
776
773
  primary: [
777
774
  "text-white dark:text-blue-100 bg-blue-530 border border-blue-530",
778
775
  "hover:bg-blue-450 hover:border-blue-450 hover:focus-visible:ring-0",
@@ -781,7 +778,6 @@ const button = {
781
778
  "focus-visible:outline-blue-530",
782
779
  "ring-blue-800 focus-visible:ring-blue-800"
783
780
  ].join(" "),
784
- // SECONDARY ////
785
781
  secondary: [
786
782
  "text-base-900 bg-cyan-160 border border-cyan-230",
787
783
  "hover:bg-cyan-150 hover:border-cyan-230 hover:focus-visible:ring-0",
@@ -790,7 +786,6 @@ const button = {
790
786
  "focus-visible:outline-cyan-160",
791
787
  "ring-cyan-500 focus-visible:ring-cyan-500"
792
788
  ].join(" "),
793
- // COLLAB ////
794
789
  collab: [
795
790
  "text-white dark:text-collab-100 bg-collab-600 border border-collab-600",
796
791
  "hover:bg-collab-500 hover:border-collab-500 hover:focus-visible:ring-0",
@@ -799,7 +794,6 @@ const button = {
799
794
  "focus-visible:outline-collab-600",
800
795
  "ring-collab-900 focus-visible:ring-collab-900"
801
796
  ].join(" "),
802
- // AI ////
803
797
  ai: [
804
798
  "text-white dark:text-ai-100 bg-ai-450 border border-ai-450",
805
799
  "hover:bg-ai-370 hover:border-ai-370 hover:focus-visible:ring-0",
@@ -808,7 +802,6 @@ const button = {
808
802
  "focus-visible:outline-ai-450",
809
803
  "ring-ai-900 focus-visible:ring-ai-900"
810
804
  ].join(" "),
811
- // LINK ////
812
805
  link: [
813
806
  "no-underline decoration-solid decoration-auto",
814
807
  "text-base-900 decoration-gray-900 bg-transparent border border-transparent dark:text-base-300",
@@ -896,7 +889,6 @@ const button = {
896
889
  compoundVariants: [
897
890
  // region default ////
898
891
  {
899
- // BASE_LIGHT ////
900
892
  color: "default",
901
893
  depth: "light",
902
894
  class: [
@@ -904,7 +896,8 @@ const button = {
904
896
  "hover:bg-base-320 hover:border-base-320 hover:focus-visible:ring-0",
905
897
  "active:bg-base-250 active:border-base-250 active:focus-visible:ring-0",
906
898
  "disabled:bg-base-200 aria-disabled:bg-base-200 disabled:border-base-300 aria-disabled:border-base-300",
907
- "focus-visible:outline-base-200"
899
+ "focus-visible:outline-base-200",
900
+ "ring-base-320 focus-visible:ring-base-320"
908
901
  ].join(" ")
909
902
  },
910
903
  {
@@ -1125,12 +1118,18 @@ const button = {
1125
1118
  ].join(" ")
1126
1119
  },
1127
1120
  {
1128
- // LIGHT_BORDER ////
1121
+ // LINK ////
1129
1122
  color: "link",
1130
1123
  depth: "light",
1131
1124
  useLabel: true,
1132
1125
  class: "ps-1.5 pe-1.5"
1133
1126
  },
1127
+ {
1128
+ color: "link",
1129
+ depth: "normal",
1130
+ useLabel: true,
1131
+ class: "ps-0 pe-0"
1132
+ },
1134
1133
  {
1135
1134
  // LIGHT_BORDER ////
1136
1135
  color: "link",
@@ -1266,7 +1265,11 @@ const button = {
1266
1265
  const checkbox = {
1267
1266
  slots: {
1268
1267
  root: "relative flex items-start",
1269
- base: "cursor-pointer shrink-0 flex items-center justify-center rounded-2xs text-white dark:text-base-150 ring ring-inset ring-base-300 dark:ring-base-700 focus-visible:outline-2 focus-visible:outline-offset-2",
1268
+ base: [
1269
+ "cursor-pointer shrink-0 flex items-center justify-center rounded-2xs text-white dark:text-base-150",
1270
+ "ring ring-inset ring-base-300 dark:ring-base-700",
1271
+ "outline-transparent focus-visible:outline-2 focus-visible:outline-offset-2"
1272
+ ].join(" "),
1270
1273
  container: "flex items-center",
1271
1274
  wrapper: "font-b24-primary ms-2",
1272
1275
  icon: "shrink-0 size-full",
@@ -2477,9 +2480,9 @@ const inputMenu = () => {
2477
2480
  trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
2478
2481
  arrow: "fill-base-master/10 dark:fill-base-100/20",
2479
2482
  content: [
2480
- "w-[var(--reka-popper-anchor-width)]",
2483
+ "w-(--reka-popper-anchor-width)",
2481
2484
  // 'max-h-60',
2482
- // 'h-[var(--reka-popper-available-height)]',
2485
+ // 'h-(--reka-popper-available-height)',
2483
2486
  "bg-white dark:bg-base-dark",
2484
2487
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
2485
2488
  "overflow-hidden",
@@ -2752,6 +2755,46 @@ const link = (options) => ({
2752
2755
  }
2753
2756
  });
2754
2757
 
2758
+ const modal = {
2759
+ slots: {
2760
+ overlay: "fixed inset-0 bg-base-950/20 dark:bg-base-950/30",
2761
+ content: [
2762
+ "py-md2 px-5",
2763
+ "fixed w-full h-dvh bg-white dark:bg-base-950",
2764
+ // 'divide-y divide-base-900/10 dark:divide-white/20',
2765
+ "flex flex-col focus:outline-none"
2766
+ ].join(" "),
2767
+ header: "pe-5 pt-0",
2768
+ body: "flex-1 overflow-y-auto my-2.5 text-md leading-normal",
2769
+ footer: "flex items-center justify-center gap-3 mt-2.5 pt-4 border-t border-t-1 border-t-base-900/10 dark:border-t-white/20",
2770
+ title: "font-bold text-md leading-normal text-base-900 dark:text-base-150",
2771
+ description: "mt-0.5 mb-1 text-base-500 dark:text-base-400 text-sm",
2772
+ close: "absolute top-2 end-1.5 p-0.5"
2773
+ },
2774
+ variants: {
2775
+ transition: {
2776
+ true: {
2777
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",
2778
+ content: "data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"
2779
+ }
2780
+ },
2781
+ fullscreen: {
2782
+ true: {
2783
+ content: "inset-0"
2784
+ },
2785
+ false: {
2786
+ content: [
2787
+ "top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]",
2788
+ "sm:min-w-[400px]",
2789
+ "sm:max-w-[420px] sm:h-auto sm:max-h-[calc(100vh-4rem)]",
2790
+ "sm:rounded-md sm:shadow-lg",
2791
+ "sm:ring ring-base-300 dark:ring-base-800"
2792
+ ].join(" ")
2793
+ }
2794
+ }
2795
+ }
2796
+ };
2797
+
2755
2798
  const progress = {
2756
2799
  slots: {
2757
2800
  root: "gap-2",
@@ -3032,7 +3075,11 @@ const radioGroup = {
3032
3075
  fieldset: "flex",
3033
3076
  legend: "mb-1.5 block font-medium text-base-master dark:text-base-400",
3034
3077
  item: "flex items-start",
3035
- base: "cursor-pointer rounded-full ring ring-inset ring-base-300 dark:ring-base-700 focus-visible:outline-2 focus-visible:outline-offset-2",
3078
+ base: [
3079
+ "cursor-pointer rounded-full",
3080
+ "ring ring-inset ring-base-300 dark:ring-base-700",
3081
+ "outline-transparent focus-visible:outline-2 focus-visible:outline-offset-2"
3082
+ ].join(" "),
3036
3083
  indicator: " flex items-center justify-center size-full rounded-full after:bg-white dark:after:bg-base-dark after:rounded-full",
3037
3084
  container: "flex items-center",
3038
3085
  wrapper: "font-b24-primary font-regular ms-2",
@@ -3144,7 +3191,11 @@ const range = {
3144
3191
  root: "relative flex items-center select-none touch-none",
3145
3192
  track: "relative bg-base-200 dark:bg-base-800 overflow-hidden rounded-full grow",
3146
3193
  range: "absolute rounded-full",
3147
- thumb: "rounded-full bg-white dark:bg-base-100 ring-2 focus-visible:outline-2 focus-visible:outline-offset-2"
3194
+ thumb: [
3195
+ "rounded-full bg-white dark:bg-base-100",
3196
+ "ring-2",
3197
+ "outline-transparent focus-visible:outline-2 focus-visible:outline-offset-2"
3198
+ ].join(" ")
3148
3199
  },
3149
3200
  variants: {
3150
3201
  color: {
@@ -3330,9 +3381,9 @@ const select = () => {
3330
3381
  placeholder: "truncate text-base-400 dark:text-base-300",
3331
3382
  arrow: "fill-base-master/10 dark:fill-base-100/20",
3332
3383
  content: [
3333
- "w-[var(--reka-popper-anchor-width)]",
3384
+ "w-(--reka-popper-anchor-width)",
3334
3385
  // 'max-h-60',
3335
- // 'h-[var(--reka-popper-available-height)]',
3386
+ // 'h-(--reka-popper-available-height)',
3336
3387
  "bg-white dark:bg-base-dark",
3337
3388
  "shadow-md rounded-2xs ring ring-base-300 dark:ring-base-800",
3338
3389
  "overflow-hidden",
@@ -3542,7 +3593,8 @@ const _switch = {
3542
3593
  slots: {
3543
3594
  root: "relative flex items-start",
3544
3595
  base: [
3545
- "cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800",
3596
+ "cursor-pointer inline-flex items-center shrink-0 rounded-full border-2 border-transparent data-[state=unchecked]:bg-base-200 dark:data-[state=unchecked]:bg-base-800",
3597
+ "outline-transparent focus-visible:outline-2 focus-visible:outline-offset-2",
3546
3598
  "transition-colors duration-200"
3547
3599
  ].join(" "),
3548
3600
  container: "flex items-center",
@@ -3700,12 +3752,12 @@ const tabs = {
3700
3752
  horizontal: {
3701
3753
  root: "flex-col",
3702
3754
  list: "w-full",
3703
- indicator: "left-0 w-[var(--reka-tabs-indicator-size)] translate-x-[var(--reka-tabs-indicator-position)]",
3755
+ indicator: "left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",
3704
3756
  trigger: "justify-center"
3705
3757
  },
3706
3758
  vertical: {
3707
3759
  list: "flex-col",
3708
- indicator: "top-0 h-[var(--reka-tabs-indicator-size)] translate-y-[var(--reka-tabs-indicator-position)]"
3760
+ indicator: "top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"
3709
3761
  }
3710
3762
  },
3711
3763
  size: {
@@ -4395,8 +4447,8 @@ const toast = {
4395
4447
 
4396
4448
  const toaster = {
4397
4449
  slots: {
4398
- viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[var(--height)] focus:outline-none",
4399
- base: "pointer-events-auto absolute inset-x-0 z-[var(--index)] transform-[var(--transform)] data-[expanded=false]:data-[front=false]:h-[var(--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"
4450
+ viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none",
4451
+ 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"
4400
4452
  },
4401
4453
  variants: {
4402
4454
  position: {
@@ -4454,14 +4506,14 @@ const toaster = {
4454
4506
  "left",
4455
4507
  "right"
4456
4508
  ],
4457
- class: "data-[swipe=move]:translate-x-[var(--reka-toast-swipe-move-x)] data-[swipe=end]:translate-x-[var(--reka-toast-swipe-end-x)] data-[swipe=cancel]:translate-x-0"
4509
+ class: "data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0"
4458
4510
  },
4459
4511
  {
4460
4512
  swipeDirection: [
4461
4513
  "up",
4462
4514
  "down"
4463
4515
  ],
4464
- class: "data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)] data-[swipe=end]:translate-y-[var(--reka-toast-swipe-end-y)] data-[swipe=cancel]:translate-y-0"
4516
+ class: "data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0"
4465
4517
  }
4466
4518
  ],
4467
4519
  defaultVariants: {
@@ -4507,6 +4559,7 @@ const theme = {
4507
4559
  inputMenu: inputMenu,
4508
4560
  kbd: kbd,
4509
4561
  link: link,
4562
+ modal: modal,
4510
4563
  progress: progress,
4511
4564
  radioGroup: radioGroup,
4512
4565
  range: range,