@enos5/enos-vue-default 1.6.0 → 1.6.2

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './styles.css';
2
- import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BWHPeYQC.js";
2
+ import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BEMDJdLp.js";
3
3
  export {
4
4
  _ as ActionCard,
5
5
  a as ActionMessage,
@@ -1,4 +1,4 @@
1
- import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BWHPeYQC.js";
1
+ import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BEMDJdLp.js";
2
2
  export {
3
3
  _ as ActionCard,
4
4
  a as ActionMessage,
@@ -1,4 +1,4 @@
1
- import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, createTextVNode, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, h, vModelText, createSlots } from "vue";
1
+ import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, createTextVNode, h, vModelText, createSlots } from "vue";
2
2
  import { LockClosedIcon, ChevronDownIcon, PhotoIcon, ExclamationCircleIcon, ExclamationTriangleIcon, ChevronUpIcon, MagnifyingGlassIcon, CheckIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
3
3
  import Editor from "@tinymce/tinymce-vue";
4
4
  import { Link } from "@inertiajs/vue3";
@@ -925,6 +925,8 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
925
925
  const triggerRef = ref(null);
926
926
  const dropdownMenuRef = ref(null);
927
927
  const dropdownStyle = ref({});
928
+ const isDarkMode = ref(false);
929
+ const isMounted = ref(false);
928
930
  const isObjectOption = (option) => typeof option === "object" && option !== null;
929
931
  const optionValue = (option) => {
930
932
  if (isObjectOption(option)) {
@@ -1070,7 +1072,17 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1070
1072
  isOpen.value = false;
1071
1073
  }
1072
1074
  };
1075
+ const syncDarkMode = () => {
1076
+ if (rootRef.value?.closest(".dark")) {
1077
+ isDarkMode.value = true;
1078
+ return;
1079
+ }
1080
+ isDarkMode.value = document.documentElement.classList.contains("dark") || document.body.classList.contains("dark");
1081
+ };
1082
+ const darkTextStyle = computed(() => isDarkMode.value ? { color: "#ffffff" } : null);
1073
1083
  onMounted(() => {
1084
+ isMounted.value = true;
1085
+ syncDarkMode();
1074
1086
  document.addEventListener("click", closeDropdown);
1075
1087
  window.addEventListener("resize", updateDropdownPosition);
1076
1088
  window.addEventListener("scroll", updateDropdownPosition, true);
@@ -1084,6 +1096,7 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1084
1096
  if (!open) {
1085
1097
  return;
1086
1098
  }
1099
+ syncDarkMode();
1087
1100
  await nextTick();
1088
1101
  updateDropdownPosition();
1089
1102
  });
@@ -1100,87 +1113,104 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1100
1113
  class: [
1101
1114
  __props.baseClass,
1102
1115
  selectedDeletedOption.value || __props.multiple && selectedMultipleOptions.value.some(optionDeleted) ? __props.deletedSelectedClass : __props.normalTextClass,
1116
+ { "text-neutral-50": isDarkMode.value && !(selectedDeletedOption.value || __props.multiple && selectedMultipleOptions.value.some(optionDeleted)) },
1103
1117
  "flex items-center justify-between cursor-pointer",
1104
1118
  unref(attrs).class
1105
1119
  ]
1106
1120
  }, unref(attrs), { tabindex: "0" }), [
1107
1121
  createElementVNode("span", {
1108
- class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null)
1109
- }, toDisplayString(displayText.value), 3),
1122
+ class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null),
1123
+ style: normalizeStyle(darkTextStyle.value)
1124
+ }, toDisplayString(displayText.value), 7),
1110
1125
  createVNode(unref(ChevronDownIcon), {
1111
1126
  class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
1112
1127
  }, null, 8, ["class"])
1113
1128
  ], 16),
1114
- createVNode(Transition, {
1115
- "enter-active-class": "transition-all duration-200 ease-out",
1116
- "enter-from-class": "opacity-0 transform scale-95 -translate-y-2",
1117
- "enter-to-class": "opacity-100 transform scale-100 translate-y-0",
1118
- "leave-active-class": "transition-all duration-150 ease-in",
1119
- "leave-from-class": "opacity-100 transform scale-100 translate-y-0",
1120
- "leave-to-class": "opacity-0 transform scale-95 -translate-y-2"
1121
- }, {
1122
- default: withCtx(() => [
1123
- (openBlock(), createBlock(Teleport, { to: "body" }, [
1129
+ isMounted.value ? (openBlock(), createBlock(Teleport, {
1130
+ key: 0,
1131
+ to: "body"
1132
+ }, [
1133
+ createVNode(Transition, {
1134
+ "enter-active-class": "transition-all duration-200 ease-out",
1135
+ "enter-from-class": "opacity-0 transform scale-95 -translate-y-2",
1136
+ "enter-to-class": "opacity-100 transform scale-100 translate-y-0",
1137
+ "leave-active-class": "transition-all duration-150 ease-in",
1138
+ "leave-from-class": "opacity-100 transform scale-100 translate-y-0",
1139
+ "leave-to-class": "opacity-0 transform scale-95 -translate-y-2"
1140
+ }, {
1141
+ default: withCtx(() => [
1124
1142
  isOpen.value ? (openBlock(), createElementBlock("div", {
1125
1143
  key: 0,
1126
1144
  ref_key: "dropdownMenuRef",
1127
1145
  ref: dropdownMenuRef,
1128
- class: normalizeClass(__props.dropdownClass),
1146
+ class: normalizeClass({ dark: isDarkMode.value }),
1129
1147
  style: normalizeStyle(dropdownStyle.value)
1130
1148
  }, [
1131
- __props.placeholder && !__props.multiple ? (openBlock(), createElementBlock("div", {
1132
- key: 0,
1133
- class: normalizeClass([
1134
- __props.dropdownOptionClass,
1135
- __props.placeholderClass,
1136
- { "text-gray-400": !__props.modelValue }
1137
- ]),
1138
- onClick: withModifiers(selectPlaceholder, ["stop"])
1139
- }, toDisplayString(__props.placeholder), 3)) : createCommentVNode("", true),
1140
- selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
1141
- key: 1,
1142
- class: normalizeClass([
1143
- __props.dropdownOptionClass,
1144
- __props.deletedOptionClass,
1145
- __props.dropdownSelectedClass
1146
- ])
1147
- }, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
1148
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.multiple ? multipleOptions.value : availableOptions.value, (option) => {
1149
- return openBlock(), createElementBlock("div", {
1150
- key: String(optionValue(option)),
1149
+ createElementVNode("div", {
1150
+ class: normalizeClass([__props.dropdownClass, { "bg-neutral-950 border-neutral-800": isDarkMode.value }])
1151
+ }, [
1152
+ __props.placeholder && !__props.multiple ? (openBlock(), createElementBlock("div", {
1153
+ key: 0,
1151
1154
  class: normalizeClass([
1152
1155
  __props.dropdownOptionClass,
1153
- optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
1154
- {
1155
- [__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
1156
- "rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
1157
- "rounded-lg": !__props.placeholder && availableOptions.value.length === 1
1158
- }
1156
+ __props.placeholderClass,
1157
+ { "text-gray-400": !__props.modelValue }
1159
1158
  ]),
1160
- onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
1159
+ onClick: withModifiers(selectPlaceholder, ["stop"])
1161
1160
  }, [
1162
- __props.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
1163
- createElementVNode("input", {
1164
- type: "checkbox",
1165
- class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
1166
- checked: optionIsSelected(option),
1167
- disabled: __props.disabled,
1168
- tabindex: "-1",
1169
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1170
- }, ["stop"])),
1171
- onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
1172
- }, null, 40, _hoisted_3$b),
1173
- createElementVNode("span", null, toDisplayString(optionText(option)), 1)
1174
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1175
- createTextVNode(toDisplayString(optionText(option)), 1)
1176
- ], 64))
1177
- ], 10, _hoisted_1$r);
1178
- }), 128))
1161
+ createElementVNode("span", {
1162
+ style: normalizeStyle(darkTextStyle.value)
1163
+ }, toDisplayString(__props.placeholder), 5)
1164
+ ], 2)) : createCommentVNode("", true),
1165
+ selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
1166
+ key: 1,
1167
+ class: normalizeClass([
1168
+ __props.dropdownOptionClass,
1169
+ __props.deletedOptionClass,
1170
+ __props.dropdownSelectedClass
1171
+ ])
1172
+ }, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
1173
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.multiple ? multipleOptions.value : availableOptions.value, (option) => {
1174
+ return openBlock(), createElementBlock("div", {
1175
+ key: String(optionValue(option)),
1176
+ class: normalizeClass([
1177
+ __props.dropdownOptionClass,
1178
+ optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
1179
+ { "text-neutral-50": isDarkMode.value && !optionDeleted(option) },
1180
+ {
1181
+ [__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
1182
+ "rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
1183
+ "rounded-lg": !__props.placeholder && availableOptions.value.length === 1
1184
+ }
1185
+ ]),
1186
+ onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
1187
+ }, [
1188
+ __props.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
1189
+ createElementVNode("input", {
1190
+ type: "checkbox",
1191
+ class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
1192
+ checked: optionIsSelected(option),
1193
+ disabled: __props.disabled,
1194
+ tabindex: "-1",
1195
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1196
+ }, ["stop"])),
1197
+ onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
1198
+ }, null, 40, _hoisted_3$b),
1199
+ createElementVNode("span", {
1200
+ style: normalizeStyle(darkTextStyle.value)
1201
+ }, toDisplayString(optionText(option)), 5)
1202
+ ])) : (openBlock(), createElementBlock("span", {
1203
+ key: 1,
1204
+ style: normalizeStyle(darkTextStyle.value)
1205
+ }, toDisplayString(optionText(option)), 5))
1206
+ ], 10, _hoisted_1$r);
1207
+ }), 128))
1208
+ ], 2)
1179
1209
  ], 6)) : createCommentVNode("", true)
1180
- ]))
1181
- ]),
1182
- _: 1
1183
- })
1210
+ ]),
1211
+ _: 1
1212
+ })
1213
+ ])) : createCommentVNode("", true)
1184
1214
  ], 512);
1185
1215
  };
1186
1216
  }
@@ -1238,39 +1268,39 @@ const _sfc_main$D = {
1238
1268
  },
1239
1269
  baseClass: {
1240
1270
  type: [String, Array, Object],
1241
- default: "block w-full rounded-lg border border-slate-300 bg-white px-4 py-3 text-sm text-slate-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
1271
+ default: "block w-full rounded-lg border border-slate-300 bg-white px-4 py-3 text-sm text-slate-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 dark:focus:border-neutral-100 dark:focus:ring-neutral-100/10"
1242
1272
  },
1243
1273
  normalTextClass: {
1244
1274
  type: [String, Array, Object],
1245
- default: "text-slate-900"
1275
+ default: "text-slate-900 dark:text-neutral-50"
1246
1276
  },
1247
1277
  deletedSelectedClass: {
1248
1278
  type: [String, Array, Object],
1249
- default: "text-red-600"
1279
+ default: "text-red-600 dark:text-neutral-100"
1250
1280
  },
1251
1281
  optionClass: {
1252
1282
  type: [String, Array, Object],
1253
- default: "text-slate-900"
1283
+ default: "text-slate-900 dark:text-neutral-50"
1254
1284
  },
1255
1285
  deletedOptionClass: {
1256
1286
  type: [String, Array, Object],
1257
- default: "text-rose-700"
1287
+ default: "text-rose-700 dark:text-neutral-100"
1258
1288
  },
1259
1289
  placeholderClass: {
1260
1290
  type: [String, Array, Object],
1261
- default: "text-slate-500"
1291
+ default: "text-slate-500 dark:text-neutral-200"
1262
1292
  },
1263
1293
  dropdownClass: {
1264
1294
  type: [String, Array, Object],
1265
- default: "bg-white/95 border border-slate-200 rounded-xl shadow-xl max-h-60 overflow-auto z-50 backdrop-blur-sm"
1295
+ default: "bg-white border border-slate-200 rounded-xl shadow-xl max-h-60 overflow-auto z-50 backdrop-blur-sm dark:bg-neutral-950 dark:border-neutral-800"
1266
1296
  },
1267
1297
  dropdownOptionClass: {
1268
1298
  type: [String, Array, Object],
1269
- default: "px-4 py-3 hover:bg-slate-100 cursor-pointer transition-colors"
1299
+ default: "px-4 py-3 hover:bg-slate-100 cursor-pointer transition-colors dark:hover:bg-neutral-900"
1270
1300
  },
1271
1301
  dropdownSelectedClass: {
1272
1302
  type: [String, Array, Object],
1273
- default: "bg-blue-50 text-blue-700 font-medium"
1303
+ default: "bg-blue-50 text-blue-700 font-medium dark:bg-neutral-900 dark:text-neutral-50"
1274
1304
  }
1275
1305
  },
1276
1306
  emits: ["update:modelValue"],
@@ -4848,4 +4878,4 @@ export {
4848
4878
  _sfc_main$z as y,
4849
4879
  _sfc_main$x as z
4850
4880
  };
4851
- //# sourceMappingURL=plugin-BWHPeYQC.js.map
4881
+ //# sourceMappingURL=plugin-BEMDJdLp.js.map