vuetify 3.3.13 → 3.3.14

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 (94) hide show
  1. package/dist/json/attributes.json +70 -66
  2. package/dist/json/importMap-labs.json +4 -4
  3. package/dist/json/importMap.json +12 -12
  4. package/dist/json/tags.json +5 -4
  5. package/dist/json/web-types.json +180 -140
  6. package/dist/vuetify-labs.css +363 -304
  7. package/dist/vuetify-labs.d.ts +384 -236
  8. package/dist/vuetify-labs.esm.js +410 -297
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +409 -296
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.css +291 -232
  13. package/dist/vuetify.d.ts +232 -76
  14. package/dist/vuetify.esm.js +210 -160
  15. package/dist/vuetify.esm.js.map +1 -1
  16. package/dist/vuetify.js +209 -159
  17. package/dist/vuetify.js.map +1 -1
  18. package/dist/vuetify.min.css +2 -2
  19. package/dist/vuetify.min.js +838 -827
  20. package/dist/vuetify.min.js.map +1 -1
  21. package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
  22. package/lib/components/VAppBar/index.d.mts +6 -6
  23. package/lib/components/VAutocomplete/VAutocomplete.mjs +12 -2
  24. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  25. package/lib/components/VBadge/VBadge.css +1 -1
  26. package/lib/components/VBadge/_variables.scss +1 -1
  27. package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
  28. package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
  29. package/lib/components/VCheckbox/VCheckboxBtn.mjs +14 -11
  30. package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
  31. package/lib/components/VColorPicker/VColorPickerEdit.css +4 -2
  32. package/lib/components/VColorPicker/VColorPickerPreview.css +11 -6
  33. package/lib/components/VCombobox/VCombobox.mjs +11 -1
  34. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  35. package/lib/components/VField/VField.css +22 -7
  36. package/lib/components/VField/VField.sass +8 -1
  37. package/lib/components/VField/_variables.scss +1 -0
  38. package/lib/components/VGrid/VGrid.css +153 -142
  39. package/lib/components/VProgressLinear/VProgressLinear.css +3 -2
  40. package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
  41. package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
  42. package/lib/components/VRangeSlider/index.d.mts +114 -33
  43. package/lib/components/VSelect/VSelect.mjs +12 -2
  44. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  45. package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -1
  46. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  47. package/lib/components/VSlider/VSlider.mjs.map +1 -1
  48. package/lib/components/VSlider/VSliderThumb.css +8 -4
  49. package/lib/components/VSlider/VSliderTrack.css +22 -12
  50. package/lib/components/VSlider/index.d.mts +114 -33
  51. package/lib/components/VSwitch/VSwitch.mjs +9 -9
  52. package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
  53. package/lib/components/VTimeline/VTimeline.css +19 -10
  54. package/lib/components/VTimeline/VTimeline.sass +5 -0
  55. package/lib/components/VToolbar/VToolbar.css +4 -2
  56. package/lib/components/index.d.mts +228 -72
  57. package/lib/composables/color.mjs +6 -1
  58. package/lib/composables/color.mjs.map +1 -1
  59. package/lib/composables/defaults.mjs +9 -9
  60. package/lib/composables/defaults.mjs.map +1 -1
  61. package/lib/composables/theme.mjs +2 -5
  62. package/lib/composables/theme.mjs.map +1 -1
  63. package/lib/entry-bundler.mjs +1 -1
  64. package/lib/framework.mjs +1 -1
  65. package/lib/index.d.mts +4 -4
  66. package/lib/labs/VDateInput/index.d.mts +2 -2
  67. package/lib/labs/VDatePicker/VDateCard.mjs +3 -0
  68. package/lib/labs/VDatePicker/VDateCard.mjs.map +1 -1
  69. package/lib/labs/VDatePicker/VDatePicker.mjs +51 -21
  70. package/lib/labs/VDatePicker/VDatePicker.mjs.map +1 -1
  71. package/lib/labs/VDatePicker/VDatePickerControls.css +1 -1
  72. package/lib/labs/VDatePicker/VDatePickerControls.mjs +53 -35
  73. package/lib/labs/VDatePicker/VDatePickerControls.mjs.map +1 -1
  74. package/lib/labs/VDatePicker/VDatePickerMonth.mjs +37 -28
  75. package/lib/labs/VDatePicker/VDatePickerMonth.mjs.map +1 -1
  76. package/lib/labs/VDatePicker/VDatePickerYears.mjs +19 -17
  77. package/lib/labs/VDatePicker/VDatePickerYears.mjs.map +1 -1
  78. package/lib/labs/VDatePicker/index.d.mts +148 -156
  79. package/lib/labs/VDateRangePicker/VDateRangeCard.mjs +3 -0
  80. package/lib/labs/VDateRangePicker/VDateRangeCard.mjs.map +1 -1
  81. package/lib/labs/VDateRangePicker/index.d.mts +59 -52
  82. package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
  83. package/lib/labs/VSkeletonLoader/index.d.mts +8 -8
  84. package/lib/labs/components.d.mts +156 -164
  85. package/lib/locale/no.mjs +1 -1
  86. package/lib/locale/no.mjs.map +1 -1
  87. package/lib/styles/tools/_rtl.sass +4 -2
  88. package/lib/util/colorUtils.mjs +6 -0
  89. package/lib/util/colorUtils.mjs.map +1 -1
  90. package/lib/util/helpers.mjs +10 -4
  91. package/lib/util/helpers.mjs.map +1 -1
  92. package/lib/util/injectSelf.mjs +2 -1
  93. package/lib/util/injectSelf.mjs.map +1 -1
  94. package/package.json +2 -2
@@ -820,7 +820,7 @@ declare const VAppBar: {
820
820
  name?: string | undefined;
821
821
  border?: string | number | boolean | undefined;
822
822
  color?: string | undefined;
823
- scrollBehavior?: "hide" | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
823
+ scrollBehavior?: "hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
824
824
  title?: string | undefined;
825
825
  image?: string | undefined;
826
826
  class?: any;
@@ -941,7 +941,7 @@ declare const VAppBar: {
941
941
  name?: string | undefined;
942
942
  border?: string | number | boolean | undefined;
943
943
  color?: string | undefined;
944
- scrollBehavior?: "hide" | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
944
+ scrollBehavior?: "hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
945
945
  title?: string | undefined;
946
946
  image?: string | undefined;
947
947
  class?: any;
@@ -1051,7 +1051,7 @@ declare const VAppBar: {
1051
1051
  name?: string | undefined;
1052
1052
  border?: string | number | boolean | undefined;
1053
1053
  color?: string | undefined;
1054
- scrollBehavior?: "hide" | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
1054
+ scrollBehavior?: "hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
1055
1055
  title?: string | undefined;
1056
1056
  image?: string | undefined;
1057
1057
  class?: any;
@@ -1108,7 +1108,7 @@ declare const VAppBar: {
1108
1108
  name?: string | undefined;
1109
1109
  border?: string | number | boolean | undefined;
1110
1110
  color?: string | undefined;
1111
- scrollBehavior?: "hide" | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
1111
+ scrollBehavior?: "hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image" | undefined;
1112
1112
  title?: string | undefined;
1113
1113
  image?: string | undefined;
1114
1114
  class?: any;
@@ -1237,7 +1237,7 @@ declare const VAppBar: {
1237
1237
  floating: BooleanConstructor;
1238
1238
  image: StringConstructor;
1239
1239
  title: StringConstructor;
1240
- scrollBehavior: PropType<"hide" | "collapse" | "inverted" | "elevate" | "fade-image">;
1240
+ scrollBehavior: PropType<"hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image">;
1241
1241
  modelValue: {
1242
1242
  type: BooleanConstructor;
1243
1243
  default: boolean;
@@ -1305,7 +1305,7 @@ declare const VAppBar: {
1305
1305
  floating: BooleanConstructor;
1306
1306
  image: StringConstructor;
1307
1307
  title: StringConstructor;
1308
- scrollBehavior: PropType<"hide" | "collapse" | "inverted" | "elevate" | "fade-image">;
1308
+ scrollBehavior: PropType<"hide" | (string & {}) | "collapse" | "inverted" | "elevate" | "fade-image">;
1309
1309
  modelValue: {
1310
1310
  type: BooleanConstructor;
1311
1311
  default: boolean;
@@ -38562,6 +38562,12 @@ declare const VRadioGroup: {
38562
38562
  }>>;
38563
38563
  type VRadioGroup = InstanceType<typeof VRadioGroup>;
38564
38564
 
38565
+ type Tick = {
38566
+ value: number;
38567
+ position: number;
38568
+ label?: string;
38569
+ };
38570
+
38565
38571
  declare const VRangeSlider: {
38566
38572
  new (...args: any[]): {
38567
38573
  $: vue.ComponentInternalInstance;
@@ -38605,9 +38611,14 @@ declare const VRangeSlider: {
38605
38611
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38606
38612
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38607
38613
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38614
+ 'thumb-label'?: ((arg: {
38615
+ modelValue: number;
38616
+ }) => vue.VNodeChild) | undefined;
38617
+ 'tick-label'?: ((arg: {
38618
+ tick: Tick;
38619
+ index: number;
38620
+ }) => vue.VNodeChild) | undefined;
38608
38621
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38609
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
38610
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
38611
38622
  };
38612
38623
  ref?: vue.VNodeRef | undefined;
38613
38624
  ref_for?: boolean | undefined;
@@ -38619,9 +38630,14 @@ declare const VRangeSlider: {
38619
38630
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38620
38631
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38621
38632
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38633
+ 'thumb-label'?: false | ((arg: {
38634
+ modelValue: number;
38635
+ }) => vue.VNodeChild) | undefined;
38636
+ 'tick-label'?: false | ((arg: {
38637
+ tick: Tick;
38638
+ index: number;
38639
+ }) => vue.VNodeChild) | undefined;
38622
38640
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38623
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
38624
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
38625
38641
  } | undefined;
38626
38642
  onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
38627
38643
  [key: string]: any;
@@ -38676,12 +38692,17 @@ declare const VRangeSlider: {
38676
38692
  hint?: string | undefined;
38677
38693
  hideDetails?: boolean | "auto" | undefined;
38678
38694
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38679
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
38695
+ "v-slot:tick-label"?: false | ((arg: {
38696
+ tick: Tick;
38697
+ index: number;
38698
+ }) => vue.VNodeChild) | undefined;
38680
38699
  trackColor?: string | undefined;
38681
38700
  trackFillColor?: string | undefined;
38682
38701
  thumbColor?: string | undefined;
38683
38702
  ticks?: readonly number[] | Record<number, string> | undefined;
38684
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
38703
+ "v-slot:thumb-label"?: false | ((arg: {
38704
+ modelValue: number;
38705
+ }) => vue.VNodeChild) | undefined;
38685
38706
  onEnd?: ((value: [number, number]) => any) | undefined;
38686
38707
  onStart?: ((value: [number, number]) => any) | undefined;
38687
38708
  };
@@ -38707,13 +38728,18 @@ declare const VRangeSlider: {
38707
38728
  message?: ((arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38708
38729
  [key: string]: any;
38709
38730
  }>[]) | undefined;
38710
- label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38731
+ 'thumb-label'?: ((arg: {
38732
+ modelValue: number;
38733
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38711
38734
  [key: string]: any;
38712
38735
  }>[]) | undefined;
38713
- 'tick-label'?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
38736
+ 'tick-label'?: ((arg: {
38737
+ tick: Tick;
38738
+ index: number;
38739
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38714
38740
  [key: string]: any;
38715
38741
  }>[]) | undefined;
38716
- 'thumb-label'?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
38742
+ label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38717
38743
  [key: string]: any;
38718
38744
  }>[]) | undefined;
38719
38745
  }>;
@@ -38774,9 +38800,14 @@ declare const VRangeSlider: {
38774
38800
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38775
38801
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38776
38802
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38803
+ 'thumb-label'?: ((arg: {
38804
+ modelValue: number;
38805
+ }) => vue.VNodeChild) | undefined;
38806
+ 'tick-label'?: ((arg: {
38807
+ tick: Tick;
38808
+ index: number;
38809
+ }) => vue.VNodeChild) | undefined;
38777
38810
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38778
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
38779
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
38780
38811
  };
38781
38812
  'v-slots'?: {
38782
38813
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -38784,9 +38815,14 @@ declare const VRangeSlider: {
38784
38815
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38785
38816
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38786
38817
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38818
+ 'thumb-label'?: false | ((arg: {
38819
+ modelValue: number;
38820
+ }) => vue.VNodeChild) | undefined;
38821
+ 'tick-label'?: false | ((arg: {
38822
+ tick: Tick;
38823
+ index: number;
38824
+ }) => vue.VNodeChild) | undefined;
38787
38825
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38788
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
38789
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
38790
38826
  } | undefined;
38791
38827
  } & {
38792
38828
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -38794,9 +38830,14 @@ declare const VRangeSlider: {
38794
38830
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38795
38831
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38796
38832
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38833
+ "v-slot:thumb-label"?: false | ((arg: {
38834
+ modelValue: number;
38835
+ }) => vue.VNodeChild) | undefined;
38836
+ "v-slot:tick-label"?: false | ((arg: {
38837
+ tick: Tick;
38838
+ index: number;
38839
+ }) => vue.VNodeChild) | undefined;
38797
38840
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38798
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
38799
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
38800
38841
  } & {
38801
38842
  "onUpdate:modelValue"?: ((value: [number, number]) => any) | undefined;
38802
38843
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -38850,13 +38891,18 @@ declare const VRangeSlider: {
38850
38891
  message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38851
38892
  [key: string]: any;
38852
38893
  }>[];
38853
- label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38894
+ 'thumb-label': (arg: {
38895
+ modelValue: number;
38896
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38854
38897
  [key: string]: any;
38855
38898
  }>[];
38856
- 'tick-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
38899
+ 'tick-label': (arg: {
38900
+ tick: Tick;
38901
+ index: number;
38902
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38857
38903
  [key: string]: any;
38858
38904
  }>[];
38859
- 'thumb-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
38905
+ label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
38860
38906
  [key: string]: any;
38861
38907
  }>[];
38862
38908
  }>>> & {
@@ -38932,9 +38978,14 @@ declare const VRangeSlider: {
38932
38978
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38933
38979
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38934
38980
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38981
+ 'thumb-label'?: ((arg: {
38982
+ modelValue: number;
38983
+ }) => vue.VNodeChild) | undefined;
38984
+ 'tick-label'?: ((arg: {
38985
+ tick: Tick;
38986
+ index: number;
38987
+ }) => vue.VNodeChild) | undefined;
38935
38988
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38936
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
38937
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
38938
38989
  };
38939
38990
  'v-slots'?: {
38940
38991
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -38942,9 +38993,14 @@ declare const VRangeSlider: {
38942
38993
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38943
38994
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38944
38995
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
38996
+ 'thumb-label'?: false | ((arg: {
38997
+ modelValue: number;
38998
+ }) => vue.VNodeChild) | undefined;
38999
+ 'tick-label'?: false | ((arg: {
39000
+ tick: Tick;
39001
+ index: number;
39002
+ }) => vue.VNodeChild) | undefined;
38945
39003
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38946
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
38947
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
38948
39004
  } | undefined;
38949
39005
  } & {
38950
39006
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -38952,9 +39008,14 @@ declare const VRangeSlider: {
38952
39008
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38953
39009
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38954
39010
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
39011
+ "v-slot:thumb-label"?: false | ((arg: {
39012
+ modelValue: number;
39013
+ }) => vue.VNodeChild) | undefined;
39014
+ "v-slot:tick-label"?: false | ((arg: {
39015
+ tick: Tick;
39016
+ index: number;
39017
+ }) => vue.VNodeChild) | undefined;
38955
39018
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
38956
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
38957
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
38958
39019
  } & {
38959
39020
  "onUpdate:modelValue"?: ((value: [number, number]) => any) | undefined;
38960
39021
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -39017,9 +39078,14 @@ declare const VRangeSlider: {
39017
39078
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39018
39079
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39019
39080
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
39081
+ 'thumb-label'?: ((arg: {
39082
+ modelValue: number;
39083
+ }) => vue.VNodeChild) | undefined;
39084
+ 'tick-label'?: ((arg: {
39085
+ tick: Tick;
39086
+ index: number;
39087
+ }) => vue.VNodeChild) | undefined;
39020
39088
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39021
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
39022
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
39023
39089
  };
39024
39090
  'v-slots'?: {
39025
39091
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -39027,9 +39093,14 @@ declare const VRangeSlider: {
39027
39093
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39028
39094
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39029
39095
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
39096
+ 'thumb-label'?: false | ((arg: {
39097
+ modelValue: number;
39098
+ }) => vue.VNodeChild) | undefined;
39099
+ 'tick-label'?: false | ((arg: {
39100
+ tick: Tick;
39101
+ index: number;
39102
+ }) => vue.VNodeChild) | undefined;
39030
39103
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39031
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
39032
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
39033
39104
  } | undefined;
39034
39105
  } & {
39035
39106
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -39037,9 +39108,14 @@ declare const VRangeSlider: {
39037
39108
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39038
39109
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39039
39110
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
39111
+ "v-slot:thumb-label"?: false | ((arg: {
39112
+ modelValue: number;
39113
+ }) => vue.VNodeChild) | undefined;
39114
+ "v-slot:tick-label"?: false | ((arg: {
39115
+ tick: Tick;
39116
+ index: number;
39117
+ }) => vue.VNodeChild) | undefined;
39040
39118
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
39041
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
39042
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
39043
39119
  } & {
39044
39120
  "onUpdate:modelValue"?: ((value: [number, number]) => any) | undefined;
39045
39121
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -39093,13 +39169,18 @@ declare const VRangeSlider: {
39093
39169
  message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
39094
39170
  [key: string]: any;
39095
39171
  }>[];
39096
- label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
39172
+ 'thumb-label': (arg: {
39173
+ modelValue: number;
39174
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
39097
39175
  [key: string]: any;
39098
39176
  }>[];
39099
- 'tick-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
39177
+ 'tick-label': (arg: {
39178
+ tick: Tick;
39179
+ index: number;
39180
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
39100
39181
  [key: string]: any;
39101
39182
  }>[];
39102
- 'thumb-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
39183
+ label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
39103
39184
  [key: string]: any;
39104
39185
  }>[];
39105
39186
  }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
@@ -42774,9 +42855,14 @@ declare const VSlider: {
42774
42855
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42775
42856
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42776
42857
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
42858
+ 'thumb-label'?: ((arg: {
42859
+ modelValue: number;
42860
+ }) => vue.VNodeChild) | undefined;
42861
+ 'tick-label'?: ((arg: {
42862
+ tick: Tick;
42863
+ index: number;
42864
+ }) => vue.VNodeChild) | undefined;
42777
42865
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42778
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
42779
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
42780
42866
  };
42781
42867
  ref?: vue.VNodeRef | undefined;
42782
42868
  ref_for?: boolean | undefined;
@@ -42788,9 +42874,14 @@ declare const VSlider: {
42788
42874
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42789
42875
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42790
42876
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
42877
+ 'thumb-label'?: false | ((arg: {
42878
+ modelValue: number;
42879
+ }) => vue.VNodeChild) | undefined;
42880
+ 'tick-label'?: false | ((arg: {
42881
+ tick: Tick;
42882
+ index: number;
42883
+ }) => vue.VNodeChild) | undefined;
42791
42884
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42792
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
42793
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
42794
42885
  } | undefined;
42795
42886
  onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
42796
42887
  [key: string]: any;
@@ -42845,12 +42936,17 @@ declare const VSlider: {
42845
42936
  hint?: string | undefined;
42846
42937
  hideDetails?: boolean | "auto" | undefined;
42847
42938
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42848
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
42939
+ "v-slot:tick-label"?: false | ((arg: {
42940
+ tick: Tick;
42941
+ index: number;
42942
+ }) => vue.VNodeChild) | undefined;
42849
42943
  trackColor?: string | undefined;
42850
42944
  trackFillColor?: string | undefined;
42851
42945
  thumbColor?: string | undefined;
42852
42946
  ticks?: readonly number[] | Record<number, string> | undefined;
42853
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
42947
+ "v-slot:thumb-label"?: false | ((arg: {
42948
+ modelValue: number;
42949
+ }) => vue.VNodeChild) | undefined;
42854
42950
  onEnd?: ((value: number) => any) | undefined;
42855
42951
  onStart?: ((value: number) => any) | undefined;
42856
42952
  };
@@ -42876,13 +42972,18 @@ declare const VSlider: {
42876
42972
  message?: ((arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
42877
42973
  [key: string]: any;
42878
42974
  }>[]) | undefined;
42879
- label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
42975
+ 'thumb-label'?: ((arg: {
42976
+ modelValue: number;
42977
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
42880
42978
  [key: string]: any;
42881
42979
  }>[]) | undefined;
42882
- 'tick-label'?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
42980
+ 'tick-label'?: ((arg: {
42981
+ tick: Tick;
42982
+ index: number;
42983
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
42883
42984
  [key: string]: any;
42884
42985
  }>[]) | undefined;
42885
- 'thumb-label'?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
42986
+ label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
42886
42987
  [key: string]: any;
42887
42988
  }>[]) | undefined;
42888
42989
  }>;
@@ -42942,9 +43043,14 @@ declare const VSlider: {
42942
43043
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42943
43044
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42944
43045
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43046
+ 'thumb-label'?: ((arg: {
43047
+ modelValue: number;
43048
+ }) => vue.VNodeChild) | undefined;
43049
+ 'tick-label'?: ((arg: {
43050
+ tick: Tick;
43051
+ index: number;
43052
+ }) => vue.VNodeChild) | undefined;
42945
43053
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42946
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
42947
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
42948
43054
  };
42949
43055
  'v-slots'?: {
42950
43056
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -42952,9 +43058,14 @@ declare const VSlider: {
42952
43058
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42953
43059
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42954
43060
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43061
+ 'thumb-label'?: false | ((arg: {
43062
+ modelValue: number;
43063
+ }) => vue.VNodeChild) | undefined;
43064
+ 'tick-label'?: false | ((arg: {
43065
+ tick: Tick;
43066
+ index: number;
43067
+ }) => vue.VNodeChild) | undefined;
42955
43068
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42956
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
42957
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
42958
43069
  } | undefined;
42959
43070
  } & {
42960
43071
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -42962,9 +43073,14 @@ declare const VSlider: {
42962
43073
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42963
43074
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42964
43075
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43076
+ "v-slot:thumb-label"?: false | ((arg: {
43077
+ modelValue: number;
43078
+ }) => vue.VNodeChild) | undefined;
43079
+ "v-slot:tick-label"?: false | ((arg: {
43080
+ tick: Tick;
43081
+ index: number;
43082
+ }) => vue.VNodeChild) | undefined;
42965
43083
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
42966
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
42967
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
42968
43084
  } & {
42969
43085
  "onUpdate:modelValue"?: ((v: number) => any) | undefined;
42970
43086
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -43017,13 +43133,18 @@ declare const VSlider: {
43017
43133
  message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43018
43134
  [key: string]: any;
43019
43135
  }>[];
43020
- label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43136
+ 'thumb-label': (arg: {
43137
+ modelValue: number;
43138
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43021
43139
  [key: string]: any;
43022
43140
  }>[];
43023
- 'tick-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
43141
+ 'tick-label': (arg: {
43142
+ tick: Tick;
43143
+ index: number;
43144
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43024
43145
  [key: string]: any;
43025
43146
  }>[];
43026
- 'thumb-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
43147
+ label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43027
43148
  [key: string]: any;
43028
43149
  }>[];
43029
43150
  }>>> & {
@@ -43098,9 +43219,14 @@ declare const VSlider: {
43098
43219
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43099
43220
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43100
43221
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43222
+ 'thumb-label'?: ((arg: {
43223
+ modelValue: number;
43224
+ }) => vue.VNodeChild) | undefined;
43225
+ 'tick-label'?: ((arg: {
43226
+ tick: Tick;
43227
+ index: number;
43228
+ }) => vue.VNodeChild) | undefined;
43101
43229
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43102
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
43103
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
43104
43230
  };
43105
43231
  'v-slots'?: {
43106
43232
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -43108,9 +43234,14 @@ declare const VSlider: {
43108
43234
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43109
43235
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43110
43236
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43237
+ 'thumb-label'?: false | ((arg: {
43238
+ modelValue: number;
43239
+ }) => vue.VNodeChild) | undefined;
43240
+ 'tick-label'?: false | ((arg: {
43241
+ tick: Tick;
43242
+ index: number;
43243
+ }) => vue.VNodeChild) | undefined;
43111
43244
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43112
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
43113
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
43114
43245
  } | undefined;
43115
43246
  } & {
43116
43247
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -43118,9 +43249,14 @@ declare const VSlider: {
43118
43249
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43119
43250
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43120
43251
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43252
+ "v-slot:thumb-label"?: false | ((arg: {
43253
+ modelValue: number;
43254
+ }) => vue.VNodeChild) | undefined;
43255
+ "v-slot:tick-label"?: false | ((arg: {
43256
+ tick: Tick;
43257
+ index: number;
43258
+ }) => vue.VNodeChild) | undefined;
43121
43259
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43122
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
43123
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
43124
43260
  } & {
43125
43261
  "onUpdate:modelValue"?: ((v: number) => any) | undefined;
43126
43262
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -43182,9 +43318,14 @@ declare const VSlider: {
43182
43318
  append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43183
43319
  details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43184
43320
  message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43321
+ 'thumb-label'?: ((arg: {
43322
+ modelValue: number;
43323
+ }) => vue.VNodeChild) | undefined;
43324
+ 'tick-label'?: ((arg: {
43325
+ tick: Tick;
43326
+ index: number;
43327
+ }) => vue.VNodeChild) | undefined;
43185
43328
  label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43186
- 'tick-label'?: (() => vue.VNodeChild) | undefined;
43187
- 'thumb-label'?: (() => vue.VNodeChild) | undefined;
43188
43329
  };
43189
43330
  'v-slots'?: {
43190
43331
  default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -43192,9 +43333,14 @@ declare const VSlider: {
43192
43333
  append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43193
43334
  details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43194
43335
  message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43336
+ 'thumb-label'?: false | ((arg: {
43337
+ modelValue: number;
43338
+ }) => vue.VNodeChild) | undefined;
43339
+ 'tick-label'?: false | ((arg: {
43340
+ tick: Tick;
43341
+ index: number;
43342
+ }) => vue.VNodeChild) | undefined;
43195
43343
  label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43196
- 'tick-label'?: false | (() => vue.VNodeChild) | undefined;
43197
- 'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
43198
43344
  } | undefined;
43199
43345
  } & {
43200
43346
  "v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
@@ -43202,9 +43348,14 @@ declare const VSlider: {
43202
43348
  "v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43203
43349
  "v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43204
43350
  "v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
43351
+ "v-slot:thumb-label"?: false | ((arg: {
43352
+ modelValue: number;
43353
+ }) => vue.VNodeChild) | undefined;
43354
+ "v-slot:tick-label"?: false | ((arg: {
43355
+ tick: Tick;
43356
+ index: number;
43357
+ }) => vue.VNodeChild) | undefined;
43205
43358
  "v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
43206
- "v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
43207
- "v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
43208
43359
  } & {
43209
43360
  "onUpdate:modelValue"?: ((v: number) => any) | undefined;
43210
43361
  "onUpdate:focused"?: ((value: boolean) => any) | undefined;
@@ -43257,13 +43408,18 @@ declare const VSlider: {
43257
43408
  message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43258
43409
  [key: string]: any;
43259
43410
  }>[];
43260
- label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43411
+ 'thumb-label': (arg: {
43412
+ modelValue: number;
43413
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43261
43414
  [key: string]: any;
43262
43415
  }>[];
43263
- 'tick-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
43416
+ 'tick-label': (arg: {
43417
+ tick: Tick;
43418
+ index: number;
43419
+ }) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43264
43420
  [key: string]: any;
43265
43421
  }>[];
43266
- 'thumb-label': () => vue.VNode<vue.RendererNode, vue.RendererElement, {
43422
+ label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
43267
43423
  [key: string]: any;
43268
43424
  }>[];
43269
43425
  }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
@@ -1,6 +1,6 @@
1
1
  // Utilities
2
2
  import { computed, isRef } from 'vue';
3
- import { destructComputed, isCssColor } from "../util/index.mjs"; // Types
3
+ import { destructComputed, getForeground, isCssColor } from "../util/index.mjs"; // Types
4
4
  // Composables
5
5
  export function useColor(colors) {
6
6
  return destructComputed(() => {
@@ -9,6 +9,11 @@ export function useColor(colors) {
9
9
  if (colors.value.background) {
10
10
  if (isCssColor(colors.value.background)) {
11
11
  styles.backgroundColor = colors.value.background;
12
+ if (!colors.value.text) {
13
+ const textColor = getForeground(styles.backgroundColor);
14
+ styles.color = textColor;
15
+ styles.caretColor = textColor;
16
+ }
12
17
  } else {
13
18
  classes.push(`bg-${colors.value.background}`);
14
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"color.mjs","names":["computed","isRef","destructComputed","isCssColor","useColor","colors","classes","styles","value","background","backgroundColor","push","text","color","caretColor","colorClasses","colorStyles","useTextColor","props","name","textColorClasses","textColorStyles","useBackgroundColor","backgroundColorClasses","backgroundColorStyles"],"sources":["../../src/composables/color.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { destructComputed, isCssColor } from '@/util'\n\n// Types\nimport type { CSSProperties, Ref } from 'vue'\n\ntype ColorValue = string | false | null | undefined\n\nexport interface TextColorData {\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n}\n\nexport interface BackgroundColorData {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n}\n\n// Composables\nexport function useColor (colors: Ref<{ background?: ColorValue, text?: ColorValue }>) {\n return destructComputed(() => {\n const classes: string[] = []\n const styles: CSSProperties = {}\n\n if (colors.value.background) {\n if (isCssColor(colors.value.background)) {\n styles.backgroundColor = colors.value.background\n } else {\n classes.push(`bg-${colors.value.background}`)\n }\n }\n\n if (colors.value.text) {\n if (isCssColor(colors.value.text)) {\n styles.color = colors.value.text\n styles.caretColor = colors.value.text\n } else {\n classes.push(`text-${colors.value.text}`)\n }\n }\n\n return { colorClasses: classes, colorStyles: styles }\n })\n}\n\nexport function useTextColor (color: Ref<ColorValue>): TextColorData\nexport function useTextColor <T extends Record<K, ColorValue>, K extends string> (props: T, name: K): TextColorData\nexport function useTextColor <T extends Record<K, ColorValue>, K extends string> (\n props: T | Ref<ColorValue>,\n name?: K\n): TextColorData {\n const colors = computed(() => ({\n text: isRef(props) ? props.value : (name ? props[name] : null),\n }))\n\n const {\n colorClasses: textColorClasses,\n colorStyles: textColorStyles,\n } = useColor(colors)\n\n return { textColorClasses, textColorStyles }\n}\n\nexport function useBackgroundColor (color: Ref<ColorValue>): BackgroundColorData\nexport function useBackgroundColor <T extends Record<K, ColorValue>, K extends string> (props: T, name: K): BackgroundColorData\nexport function useBackgroundColor <T extends Record<K, ColorValue>, K extends string> (\n props: T | Ref<ColorValue>,\n name?: K\n): BackgroundColorData {\n const colors = computed(() => ({\n background: isRef(props) ? props.value : (name ? props[name] : null),\n }))\n\n const {\n colorClasses: backgroundColorClasses,\n colorStyles: backgroundColorStyles,\n } = useColor(colors)\n\n return { backgroundColorClasses, backgroundColorStyles }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,gBAAgB,EAAEC,UAAU,6BAErC;AAeA;AACA,OAAO,SAASC,QAAQA,CAAEC,MAA2D,EAAE;EACrF,OAAOH,gBAAgB,CAAC,MAAM;IAC5B,MAAMI,OAAiB,GAAG,EAAE;IAC5B,MAAMC,MAAqB,GAAG,CAAC,CAAC;IAEhC,IAAIF,MAAM,CAACG,KAAK,CAACC,UAAU,EAAE;MAC3B,IAAIN,UAAU,CAACE,MAAM,CAACG,KAAK,CAACC,UAAU,CAAC,EAAE;QACvCF,MAAM,CAACG,eAAe,GAAGL,MAAM,CAACG,KAAK,CAACC,UAAU;MAClD,CAAC,MAAM;QACLH,OAAO,CAACK,IAAI,CAAE,MAAKN,MAAM,CAACG,KAAK,CAACC,UAAW,EAAC,CAAC;MAC/C;IACF;IAEA,IAAIJ,MAAM,CAACG,KAAK,CAACI,IAAI,EAAE;MACrB,IAAIT,UAAU,CAACE,MAAM,CAACG,KAAK,CAACI,IAAI,CAAC,EAAE;QACjCL,MAAM,CAACM,KAAK,GAAGR,MAAM,CAACG,KAAK,CAACI,IAAI;QAChCL,MAAM,CAACO,UAAU,GAAGT,MAAM,CAACG,KAAK,CAACI,IAAI;MACvC,CAAC,MAAM;QACLN,OAAO,CAACK,IAAI,CAAE,QAAON,MAAM,CAACG,KAAK,CAACI,IAAK,EAAC,CAAC;MAC3C;IACF;IAEA,OAAO;MAAEG,YAAY,EAAET,OAAO;MAAEU,WAAW,EAAET;IAAO,CAAC;EACvD,CAAC,CAAC;AACJ;AAIA,OAAO,SAASU,YAAYA,CAC1BC,KAA0B,EAC1BC,IAAQ,EACO;EACf,MAAMd,MAAM,GAAGL,QAAQ,CAAC,OAAO;IAC7BY,IAAI,EAAEX,KAAK,CAACiB,KAAK,CAAC,GAAGA,KAAK,CAACV,KAAK,GAAIW,IAAI,GAAGD,KAAK,CAACC,IAAI,CAAC,GAAG;EAC3D,CAAC,CAAC,CAAC;EAEH,MAAM;IACJJ,YAAY,EAAEK,gBAAgB;IAC9BJ,WAAW,EAAEK;EACf,CAAC,GAAGjB,QAAQ,CAACC,MAAM,CAAC;EAEpB,OAAO;IAAEe,gBAAgB;IAAEC;EAAgB,CAAC;AAC9C;AAIA,OAAO,SAASC,kBAAkBA,CAChCJ,KAA0B,EAC1BC,IAAQ,EACa;EACrB,MAAMd,MAAM,GAAGL,QAAQ,CAAC,OAAO;IAC7BS,UAAU,EAAER,KAAK,CAACiB,KAAK,CAAC,GAAGA,KAAK,CAACV,KAAK,GAAIW,IAAI,GAAGD,KAAK,CAACC,IAAI,CAAC,GAAG;EACjE,CAAC,CAAC,CAAC;EAEH,MAAM;IACJJ,YAAY,EAAEQ,sBAAsB;IACpCP,WAAW,EAAEQ;EACf,CAAC,GAAGpB,QAAQ,CAACC,MAAM,CAAC;EAEpB,OAAO;IAAEkB,sBAAsB;IAAEC;EAAsB,CAAC;AAC1D"}
1
+ {"version":3,"file":"color.mjs","names":["computed","isRef","destructComputed","getForeground","isCssColor","useColor","colors","classes","styles","value","background","backgroundColor","text","textColor","color","caretColor","push","colorClasses","colorStyles","useTextColor","props","name","textColorClasses","textColorStyles","useBackgroundColor","backgroundColorClasses","backgroundColorStyles"],"sources":["../../src/composables/color.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { destructComputed, getForeground, isCssColor } from '@/util'\n\n// Types\nimport type { CSSProperties, Ref } from 'vue'\n\ntype ColorValue = string | false | null | undefined\n\nexport interface TextColorData {\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n}\n\nexport interface BackgroundColorData {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n}\n\n// Composables\nexport function useColor (colors: Ref<{ background?: ColorValue, text?: ColorValue }>) {\n return destructComputed(() => {\n const classes: string[] = []\n const styles: CSSProperties = {}\n\n if (colors.value.background) {\n if (isCssColor(colors.value.background)) {\n styles.backgroundColor = colors.value.background\n\n if (!colors.value.text) {\n const textColor = getForeground(styles.backgroundColor)\n\n styles.color = textColor\n styles.caretColor = textColor\n }\n } else {\n classes.push(`bg-${colors.value.background}`)\n }\n }\n\n if (colors.value.text) {\n if (isCssColor(colors.value.text)) {\n styles.color = colors.value.text\n styles.caretColor = colors.value.text\n } else {\n classes.push(`text-${colors.value.text}`)\n }\n }\n\n return { colorClasses: classes, colorStyles: styles }\n })\n}\n\nexport function useTextColor (color: Ref<ColorValue>): TextColorData\nexport function useTextColor <T extends Record<K, ColorValue>, K extends string> (props: T, name: K): TextColorData\nexport function useTextColor <T extends Record<K, ColorValue>, K extends string> (\n props: T | Ref<ColorValue>,\n name?: K\n): TextColorData {\n const colors = computed(() => ({\n text: isRef(props) ? props.value : (name ? props[name] : null),\n }))\n\n const {\n colorClasses: textColorClasses,\n colorStyles: textColorStyles,\n } = useColor(colors)\n\n return { textColorClasses, textColorStyles }\n}\n\nexport function useBackgroundColor (color: Ref<ColorValue>): BackgroundColorData\nexport function useBackgroundColor <T extends Record<K, ColorValue>, K extends string> (props: T, name: K): BackgroundColorData\nexport function useBackgroundColor <T extends Record<K, ColorValue>, K extends string> (\n props: T | Ref<ColorValue>,\n name?: K\n): BackgroundColorData {\n const colors = computed(() => ({\n background: isRef(props) ? props.value : (name ? props[name] : null),\n }))\n\n const {\n colorClasses: backgroundColorClasses,\n colorStyles: backgroundColorStyles,\n } = useColor(colors)\n\n return { backgroundColorClasses, backgroundColorStyles }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,gBAAgB,EAAEC,aAAa,EAAEC,UAAU,6BAEpD;AAeA;AACA,OAAO,SAASC,QAAQA,CAAEC,MAA2D,EAAE;EACrF,OAAOJ,gBAAgB,CAAC,MAAM;IAC5B,MAAMK,OAAiB,GAAG,EAAE;IAC5B,MAAMC,MAAqB,GAAG,CAAC,CAAC;IAEhC,IAAIF,MAAM,CAACG,KAAK,CAACC,UAAU,EAAE;MAC3B,IAAIN,UAAU,CAACE,MAAM,CAACG,KAAK,CAACC,UAAU,CAAC,EAAE;QACvCF,MAAM,CAACG,eAAe,GAAGL,MAAM,CAACG,KAAK,CAACC,UAAU;QAEhD,IAAI,CAACJ,MAAM,CAACG,KAAK,CAACG,IAAI,EAAE;UACtB,MAAMC,SAAS,GAAGV,aAAa,CAACK,MAAM,CAACG,eAAe,CAAC;UAEvDH,MAAM,CAACM,KAAK,GAAGD,SAAS;UACxBL,MAAM,CAACO,UAAU,GAAGF,SAAS;QAC/B;MACF,CAAC,MAAM;QACLN,OAAO,CAACS,IAAI,CAAE,MAAKV,MAAM,CAACG,KAAK,CAACC,UAAW,EAAC,CAAC;MAC/C;IACF;IAEA,IAAIJ,MAAM,CAACG,KAAK,CAACG,IAAI,EAAE;MACrB,IAAIR,UAAU,CAACE,MAAM,CAACG,KAAK,CAACG,IAAI,CAAC,EAAE;QACjCJ,MAAM,CAACM,KAAK,GAAGR,MAAM,CAACG,KAAK,CAACG,IAAI;QAChCJ,MAAM,CAACO,UAAU,GAAGT,MAAM,CAACG,KAAK,CAACG,IAAI;MACvC,CAAC,MAAM;QACLL,OAAO,CAACS,IAAI,CAAE,QAAOV,MAAM,CAACG,KAAK,CAACG,IAAK,EAAC,CAAC;MAC3C;IACF;IAEA,OAAO;MAAEK,YAAY,EAAEV,OAAO;MAAEW,WAAW,EAAEV;IAAO,CAAC;EACvD,CAAC,CAAC;AACJ;AAIA,OAAO,SAASW,YAAYA,CAC1BC,KAA0B,EAC1BC,IAAQ,EACO;EACf,MAAMf,MAAM,GAAGN,QAAQ,CAAC,OAAO;IAC7BY,IAAI,EAAEX,KAAK,CAACmB,KAAK,CAAC,GAAGA,KAAK,CAACX,KAAK,GAAIY,IAAI,GAAGD,KAAK,CAACC,IAAI,CAAC,GAAG;EAC3D,CAAC,CAAC,CAAC;EAEH,MAAM;IACJJ,YAAY,EAAEK,gBAAgB;IAC9BJ,WAAW,EAAEK;EACf,CAAC,GAAGlB,QAAQ,CAACC,MAAM,CAAC;EAEpB,OAAO;IAAEgB,gBAAgB;IAAEC;EAAgB,CAAC;AAC9C;AAIA,OAAO,SAASC,kBAAkBA,CAChCJ,KAA0B,EAC1BC,IAAQ,EACa;EACrB,MAAMf,MAAM,GAAGN,QAAQ,CAAC,OAAO;IAC7BU,UAAU,EAAET,KAAK,CAACmB,KAAK,CAAC,GAAGA,KAAK,CAACX,KAAK,GAAIY,IAAI,GAAGD,KAAK,CAACC,IAAI,CAAC,GAAG;EACjE,CAAC,CAAC,CAAC;EAEH,MAAM;IACJJ,YAAY,EAAEQ,sBAAsB;IACpCP,WAAW,EAAEQ;EACf,CAAC,GAAGrB,QAAQ,CAACC,MAAM,CAAC;EAEpB,OAAO;IAAEmB,sBAAsB;IAAEC;EAAsB,CAAC;AAC1D"}