@3df-spa/ui 1.1.0 → 1.3.0

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as y, ref as h, watch as b, onBeforeUnmount as _, provide as L, openBlock as P, createElementBlock as x, renderSlot as O, nextTick as g, inject as C, useAttrs as B, computed as T, createBlock as S, Teleport as A, mergeProps as F, unref as m, createCommentVNode as U, watchEffect as z, withKeys as $, withModifiers as k } from "vue";
1
+ import { defineComponent as y, ref as h, watch as b, onBeforeUnmount as _, provide as L, openBlock as P, createElementBlock as x, renderSlot as O, nextTick as g, inject as C, useAttrs as T, computed as B, createBlock as S, Teleport as A, mergeProps as F, unref as m, createCommentVNode as U, watchEffect as z, withKeys as $, withModifiers as k } from "vue";
2
2
  import { c as H } from "./utils-C9QoOYNG.js";
3
3
  const E = /* @__PURE__ */ Symbol("popover");
4
4
  let I = 0;
@@ -40,7 +40,9 @@ const Z = /* @__PURE__ */ y({
40
40
  n.value && !n.value.contains(d) && l.value && !l.value.contains(d) && a();
41
41
  }
42
42
  return b(i, (u) => {
43
- u ? document.addEventListener("click", f, !0) : document.removeEventListener("click", f, !0);
43
+ u ? setTimeout(() => {
44
+ document.addEventListener("click", f, !0);
45
+ }, 0) : document.removeEventListener("click", f, !0);
44
46
  }), _(() => {
45
47
  document.removeEventListener("click", f, !0);
46
48
  }), L(E, {
@@ -163,7 +165,7 @@ const G = ["aria-labelledby"], ee = /* @__PURE__ */ y({
163
165
  viewportPadding: { default: 8 }
164
166
  },
165
167
  setup(e) {
166
- const t = e, o = C(E), s = B(), i = T(() => {
168
+ const t = e, o = C(E), s = T(), i = B(() => {
167
169
  const { class: v, ...f } = s;
168
170
  return f;
169
171
  }), n = h(!1), l = h(!1);
@@ -209,7 +211,7 @@ const G = ["aria-labelledby"], ee = /* @__PURE__ */ y({
209
211
  class: m(H)(
210
212
  "z-50 w-72 max-w-[calc(100vw-1rem)]",
211
213
  "bg-popover text-popover-foreground",
212
- "border-ui border-border rounded-md p-4 shadow-lg",
214
+ "border border-border rounded-md p-4 shadow-lg",
213
215
  "transition-all duration-150",
214
216
  l.value ? "opacity-100 scale-100 ease-out" : "opacity-0 scale-[0.97] ease-in",
215
217
  m(s).class
package/dist/calendar.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as j, useAttrs as E, computed as w, ref as A, watch as H, openBlock as f, createElementBlock as h, mergeProps as B, unref as p, createElementVNode as a, normalizeClass as U, Fragment as P, renderList as R, createCommentVNode as $, toDisplayString as S, createBlock as _, withCtx as y, createVNode as k } from "vue";
2
2
  import { startOfWeek as T, format as x, addDays as W, addMonths as F, startOfMonth as J, eachDayOfInterval as I, endOfMonth as K, endOfWeek as Q, isToday as X, isSameMonth as Y, isSameDay as V, subMonths as Z } from "date-fns";
3
3
  import { c as C } from "./utils-C9QoOYNG.js";
4
- import { _ as N, a as z, b as L } from "./UiPopoverTrigger.vue_vue_type_script_setup_true_lang-DKJgwMAw.js";
4
+ import { _ as N, a as z, b as L } from "./UiPopoverTrigger.vue_vue_type_script_setup_true_lang-Ci8kd-fi.js";
5
5
  function ee(t, n, e) {
6
6
  if (n) {
7
7
  if (t === "single" && n instanceof Date) return n;
package/dist/index.d.ts CHANGED
@@ -116,8 +116,10 @@ viewportPadding: number;
116
116
 
117
117
  declare const __VLS_component_124: DefineComponent<UiCommandProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
118
118
  select: (value: string) => any;
119
+ "update:selected": (value: string) => any;
119
120
  }, string, PublicProps, Readonly<UiCommandProps> & Readonly<{
120
121
  onSelect?: ((value: string) => any) | undefined;
122
+ "onUpdate:selected"?: ((value: string) => any) | undefined;
121
123
  }>, {
122
124
  filter: (value: string, search: string) => boolean;
123
125
  label: string;
@@ -125,13 +127,16 @@ label: string;
125
127
 
126
128
  declare const __VLS_component_125: DefineComponent<UiCommandDialogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
127
129
  select: (value: string) => any;
130
+ "update:selected": (value: string) => any;
128
131
  "update:open": (value: boolean) => any;
129
132
  }, string, PublicProps, Readonly<UiCommandDialogProps> & Readonly<{
130
133
  onSelect?: ((value: string) => any) | undefined;
134
+ "onUpdate:selected"?: ((value: string) => any) | undefined;
131
135
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
132
136
  }>, {
133
137
  open: boolean;
134
138
  defaultOpen: boolean;
139
+ showClose: boolean;
135
140
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
136
141
 
137
142
  declare const __VLS_component_126: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -271,6 +276,31 @@ align: "center" | "start" | "between" | null;
271
276
  dismissible: boolean;
272
277
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
273
278
 
279
+ declare const __VLS_component_147: DefineComponent<Props_11, {
280
+ config: Ref< {
281
+ version: number;
282
+ radiusStep: number;
283
+ borderOpacity: number;
284
+ letterSpacing: number;
285
+ colorPreset: string;
286
+ fontId: string;
287
+ }, Ui3dfConfig | {
288
+ version: number;
289
+ radiusStep: number;
290
+ borderOpacity: number;
291
+ letterSpacing: number;
292
+ colorPreset: string;
293
+ fontId: string;
294
+ }>;
295
+ reset: () => void;
296
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
297
+ "update:modelValue": (config: Ui3dfConfig) => any;
298
+ }, string, PublicProps, Readonly<Props_11> & Readonly<{
299
+ "onUpdate:modelValue"?: ((config: Ui3dfConfig) => any) | undefined;
300
+ }>, {
301
+ title: string;
302
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
303
+
274
304
  declare const __VLS_component_15: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
275
305
 
276
306
  declare const __VLS_component_16: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -1335,6 +1365,15 @@ declare function __VLS_template_146(): {
1335
1365
  rootEl: any;
1336
1366
  };
1337
1367
 
1368
+ declare function __VLS_template_147(): {
1369
+ attrs: Partial<{}>;
1370
+ slots: {
1371
+ default?(_: {}): any;
1372
+ };
1373
+ refs: {};
1374
+ rootEl: any;
1375
+ };
1376
+
1338
1377
  declare function __VLS_template_15(): {
1339
1378
  attrs: Partial<{}>;
1340
1379
  slots: {
@@ -2323,6 +2362,8 @@ declare type __VLS_TemplateResult_145 = ReturnType<typeof __VLS_template_145>;
2323
2362
 
2324
2363
  declare type __VLS_TemplateResult_146 = ReturnType<typeof __VLS_template_146>;
2325
2364
 
2365
+ declare type __VLS_TemplateResult_147 = ReturnType<typeof __VLS_template_147>;
2366
+
2326
2367
  declare type __VLS_TemplateResult_15 = ReturnType<typeof __VLS_template_15>;
2327
2368
 
2328
2369
  declare type __VLS_TemplateResult_16 = ReturnType<typeof __VLS_template_16>;
@@ -2899,6 +2940,12 @@ declare type __VLS_WithTemplateSlots_157<T, S> = T & {
2899
2940
  };
2900
2941
  };
2901
2942
 
2943
+ declare type __VLS_WithTemplateSlots_158<T, S> = T & {
2944
+ new (): {
2945
+ $slots: S;
2946
+ };
2947
+ };
2948
+
2902
2949
  declare type __VLS_WithTemplateSlots_16<T, S> = T & {
2903
2950
  new (): {
2904
2951
  $slots: S;
@@ -3555,6 +3602,10 @@ export declare const alertVariants: (props?: ({
3555
3602
  variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
3556
3603
  } & ClassProp) | undefined) => string;
3557
3604
 
3605
+ export declare function applyColorVars(presetId: string, isDark: boolean): void;
3606
+
3607
+ export declare function applyFontVar(fontId: string): void;
3608
+
3558
3609
  export declare const Avatar: __VLS_WithTemplateSlots_31<typeof __VLS_component_31, __VLS_TemplateResult_31["slots"]>;
3559
3610
 
3560
3611
  export declare const AVATAR_KEY: InjectionKey<AvatarContext>;
@@ -3653,6 +3704,17 @@ export declare interface CollapsibleContext {
3653
3704
 
3654
3705
  export declare const CollapsibleTrigger: __VLS_WithTemplateSlots_144<typeof __VLS_component_134, __VLS_TemplateResult_134["slots"]>;
3655
3706
 
3707
+ export declare const COLOR_PRESETS: ColorPreset[];
3708
+
3709
+ export declare interface ColorPreset {
3710
+ id: string;
3711
+ label: string;
3712
+ preview: [string, string, string];
3713
+ previewDark: [string, string, string];
3714
+ varsLight: Record<string, string>;
3715
+ varsDark: Record<string, string>;
3716
+ }
3717
+
3656
3718
  export declare const Combobox: DefineComponent<UiComboboxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
3657
3719
  "update:modelValue": (value: string) => any;
3658
3720
  }, string, PublicProps, Readonly<UiComboboxProps> & Readonly<{
@@ -3711,6 +3773,22 @@ export declare const CommandSeparator: DefineComponent< {}, {}, {}, {}, {}, C
3711
3773
 
3712
3774
  export declare const CommandShortcut: __VLS_WithTemplateSlots_139<typeof __VLS_component_130, __VLS_TemplateResult_130["slots"]>;
3713
3775
 
3776
+ export declare const config3df: Ref< {
3777
+ version: number;
3778
+ radiusStep: number;
3779
+ borderOpacity: number;
3780
+ letterSpacing: number;
3781
+ colorPreset: string;
3782
+ fontId: string;
3783
+ }, Ui3dfConfig | {
3784
+ version: number;
3785
+ radiusStep: number;
3786
+ borderOpacity: number;
3787
+ letterSpacing: number;
3788
+ colorPreset: string;
3789
+ fontId: string;
3790
+ }>;
3791
+
3714
3792
  export declare const CONTEXT_MENU_ITEM_KEY: InjectionKey<ContextMenuItemRegistration>;
3715
3793
 
3716
3794
  export declare const CONTEXT_MENU_KEY: InjectionKey<ContextMenuContext>;
@@ -3799,6 +3877,8 @@ export { ContextMenuSubTrigger }
3799
3877
 
3800
3878
  export declare const ContextMenuTrigger: __VLS_WithTemplateSlots_126<typeof __VLS_component_118, __VLS_TemplateResult_118["slots"]>;
3801
3879
 
3880
+ export declare const DEFAULT_CONFIG: Ui3dfConfig;
3881
+
3802
3882
  export declare const Dialog: __VLS_WithTemplateSlots_93<DefineComponent< {
3803
3883
  open?: boolean;
3804
3884
  defaultOpen?: boolean;
@@ -3940,6 +4020,14 @@ declare type FloatingAlign = 'start' | 'center' | 'end';
3940
4020
 
3941
4021
  declare type FloatingSide = 'top' | 'bottom' | 'left' | 'right';
3942
4022
 
4023
+ export declare const FONT_OPTIONS: FontOption[];
4024
+
4025
+ export declare interface FontOption {
4026
+ id: string;
4027
+ label: string;
4028
+ stack: string;
4029
+ }
4030
+
3943
4031
  export declare interface HeroAction {
3944
4032
  label: string;
3945
4033
  href?: string;
@@ -4246,6 +4334,11 @@ declare interface Props_10 {
4246
4334
  dismissible?: boolean;
4247
4335
  }
4248
4336
 
4337
+ declare interface Props_11 {
4338
+ title?: string;
4339
+ modelValue?: Partial<Ui3dfConfig>;
4340
+ }
4341
+
4249
4342
  declare interface Props_2 {
4250
4343
  logos: LogoItem[];
4251
4344
  direction?: MarqueeDirection;
@@ -4340,6 +4433,32 @@ export declare const Radio: DefineComponent<UiRadioProps, {}, {}, {}, {}, Compon
4340
4433
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
4341
4434
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
4342
4435
 
4436
+ export declare const RADIUS_STEPS: readonly [{
4437
+ readonly label: "None";
4438
+ readonly value: "0px";
4439
+ }, {
4440
+ readonly label: "XS";
4441
+ readonly value: "0.25rem";
4442
+ }, {
4443
+ readonly label: "SM";
4444
+ readonly value: "0.5rem";
4445
+ }, {
4446
+ readonly label: "MD";
4447
+ readonly value: "0.75rem";
4448
+ }, {
4449
+ readonly label: "LG";
4450
+ readonly value: "1rem";
4451
+ }, {
4452
+ readonly label: "XL";
4453
+ readonly value: "1.5rem";
4454
+ }, {
4455
+ readonly label: "2XL";
4456
+ readonly value: "2rem";
4457
+ }, {
4458
+ readonly label: "3XL";
4459
+ readonly value: "3rem";
4460
+ }];
4461
+
4343
4462
  export declare const ScrollArea: __VLS_WithTemplateSlots_25<typeof __VLS_component_25, __VLS_TemplateResult_25["slots"]>;
4344
4463
 
4345
4464
  export declare const Select: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
@@ -4671,6 +4790,27 @@ export declare interface TooltipContext {
4671
4790
 
4672
4791
  export declare const TooltipTrigger: __VLS_WithTemplateSlots_88<typeof __VLS_component_85, __VLS_TemplateResult_85["slots"]>;
4673
4792
 
4793
+ export declare const Ui3df: __VLS_WithTemplateSlots_158<typeof __VLS_component_147, __VLS_TemplateResult_147["slots"]>;
4794
+
4795
+ export declare const Ui3dfBorderOpacity: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
4796
+
4797
+ export declare const Ui3dfColorPreset: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
4798
+
4799
+ export declare interface Ui3dfConfig {
4800
+ version: number;
4801
+ radiusStep: number;
4802
+ borderOpacity: number;
4803
+ letterSpacing: number;
4804
+ colorPreset: string;
4805
+ fontId: string;
4806
+ }
4807
+
4808
+ export declare const Ui3dfFont: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
4809
+
4810
+ export declare const Ui3dfLetterSpacing: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
4811
+
4812
+ export declare const Ui3dfRadius: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
4813
+
4674
4814
  declare interface UiBadgeProps {
4675
4815
  variant?: BadgeVariants['variant'];
4676
4816
  size?: BadgeVariants['size'];
@@ -4715,6 +4855,7 @@ declare interface UiComboboxProps {
4715
4855
  declare interface UiCommandDialogProps {
4716
4856
  open?: boolean;
4717
4857
  defaultOpen?: boolean;
4858
+ showClose?: boolean;
4718
4859
  }
4719
4860
 
4720
4861
  declare interface UiCommandGroupProps {
@@ -4908,6 +5049,51 @@ declare interface UiTooltipContentProps {
4908
5049
  viewportPadding?: number;
4909
5050
  }
4910
5051
 
5052
+ export declare function use3dfConfig(): {
5053
+ config: Ref< {
5054
+ version: number;
5055
+ radiusStep: number;
5056
+ borderOpacity: number;
5057
+ letterSpacing: number;
5058
+ colorPreset: string;
5059
+ fontId: string;
5060
+ }, Ui3dfConfig | {
5061
+ version: number;
5062
+ radiusStep: number;
5063
+ borderOpacity: number;
5064
+ letterSpacing: number;
5065
+ colorPreset: string;
5066
+ fontId: string;
5067
+ }>;
5068
+ reset: () => void;
5069
+ RADIUS_STEPS: readonly [{
5070
+ readonly label: "None";
5071
+ readonly value: "0px";
5072
+ }, {
5073
+ readonly label: "XS";
5074
+ readonly value: "0.25rem";
5075
+ }, {
5076
+ readonly label: "SM";
5077
+ readonly value: "0.5rem";
5078
+ }, {
5079
+ readonly label: "MD";
5080
+ readonly value: "0.75rem";
5081
+ }, {
5082
+ readonly label: "LG";
5083
+ readonly value: "1rem";
5084
+ }, {
5085
+ readonly label: "XL";
5086
+ readonly value: "1.5rem";
5087
+ }, {
5088
+ readonly label: "2XL";
5089
+ readonly value: "2rem";
5090
+ }, {
5091
+ readonly label: "3XL";
5092
+ readonly value: "3rem";
5093
+ }];
5094
+ DEFAULT_CONFIG: Ui3dfConfig;
5095
+ };
5096
+
4911
5097
  export declare function useSidebar(): SidebarContext;
4912
5098
 
4913
5099
  export { }