@quidgest/ui 0.5.13 → 0.5.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Quidgest UI
1
+ # @quidgest/ui
2
2
 
3
- Quidgest Vue 3 component framework.
3
+ Quidgest's UI framework.
4
4
 
5
5
  ## Features
6
6
 
@@ -42,7 +42,7 @@ import framework from './plugins/quidgest-ui'
42
42
  createApp(App).use(framework).mount('#app')
43
43
  ```
44
44
 
45
- Once installed, the components become globally available and can be used like so:
45
+ Once installed, components can be used like so:
46
46
 
47
47
  ```ts
48
48
  <template>
@@ -50,6 +50,8 @@ Once installed, the components become globally available and can be used like so
50
50
  </template>
51
51
 
52
52
  <script setup lang="ts">
53
+ import { QButton } from '@quidgest/ui'
54
+
53
55
  function handleClick() {
54
56
  console.log("Parallel lines have so much in common. It's a shame they'll never meet.")
55
57
  }
package/dist/ui.css CHANGED
@@ -599,8 +599,10 @@ body {
599
599
  font-style: normal;
600
600
  text-decoration: underline;
601
601
  }
602
- .q-list-item__check {
602
+ .q-list-item__check-container {
603
+ display: flex;
603
604
  margin-left: auto;
605
+ min-width: 1em;
604
606
  }
605
607
  .q-list-item + .q-list-item {
606
608
  margin-top: 1px;
@@ -616,6 +618,8 @@ body {
616
618
  .q-overlay__content {
617
619
  display: block;
618
620
  position: relative;
621
+ min-width: -moz-fit-content;
622
+ min-width: fit-content;
619
623
  width: 100%;
620
624
  background-color: var(--q-overlay-bg);
621
625
  color: var(--q-overlay-color);
@@ -746,6 +750,11 @@ body {
746
750
  .q-select:not(.q-select--readonly):not(.q-select--disabled) {
747
751
  cursor: pointer;
748
752
  }
753
+ .q-select__value, .q-select__placeholder {
754
+ white-space: nowrap;
755
+ overflow: hidden;
756
+ text-overflow: ellipsis;
757
+ }
749
758
  .q-select__placeholder {
750
759
  font-style: italic;
751
760
  color: rgb(var(--q-theme-on-background-rgb)/0.5);
@@ -759,8 +768,7 @@ body {
759
768
  }
760
769
 
761
770
  .q-select__clear,
762
- .q-select__chevron,
763
- .q-select__search-icon {
771
+ .q-select__chevron {
764
772
  opacity: 0.5;
765
773
  }
766
774
 
@@ -783,17 +791,16 @@ body {
783
791
  }
784
792
  .q-select__body .q-list-item {
785
793
  width: calc(100% - 0.5rem);
786
- }
787
-
788
- .q-select__search {
789
- width: calc(100% - 0.5rem);
790
- }
791
- .q-select__search:focus-within {
792
- outline: none;
794
+ margin-left: 0.25rem;
795
+ margin-right: 0.25rem;
793
796
  }
794
797
 
795
798
  .q-select__items {
799
+ min-width: -moz-fit-content;
800
+ min-width: fit-content;
801
+ width: 100%;
796
802
  max-height: 240px;
803
+ align-items: start;
797
804
  }
798
805
 
799
806
  .q-select__loader,
package/dist/ui.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as me, computed as y, ref as I, provide as Be, inject as he, watch as z, defineComponent as _, openBlock as r, createElementBlock as f, normalizeStyle as G, createElementVNode as Z, normalizeClass as T, withModifiers as H, createVNode as U, unref as g, createCommentVNode as b, Fragment as Q, createTextVNode as K, toDisplayString as V, renderSlot as x, toRef as P, createBlock as w, withCtx as C, renderList as te, resolveDynamicComponent as ye, h as le, mergeProps as W, normalizeProps as ve, reactive as Le, onBeforeUnmount as xe, onMounted as qe, Teleport as De, Transition as Ie, nextTick as re, createSlots as Ee, guardReactiveProps as Ce, withDirectives as Te } from "vue";
1
+ import { getCurrentInstance as me, computed as y, ref as I, provide as Be, inject as he, watch as z, defineComponent as _, openBlock as r, createElementBlock as f, normalizeStyle as G, createElementVNode as K, normalizeClass as T, withModifiers as H, createVNode as U, unref as g, createCommentVNode as b, Fragment as Q, createTextVNode as Z, toDisplayString as V, renderSlot as x, toRef as P, createBlock as w, withCtx as C, renderList as te, resolveDynamicComponent as ye, h as le, mergeProps as W, normalizeProps as ve, reactive as Le, onBeforeUnmount as xe, onMounted as qe, Teleport as De, Transition as Ie, nextTick as re, createSlots as Ee, guardReactiveProps as Ce, withDirectives as Te } from "vue";
2
2
  function ne(t) {
3
3
  return t == null ? !0 : typeof t == "string" || Array.isArray(t) ? t.length === 0 : typeof t == "object" ? Object.keys(t).length === 0 : !1;
4
4
  }
@@ -182,7 +182,7 @@ function ee(t, n, e) {
182
182
  return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? t + (n - t) * 6 * e : e < 1 / 2 ? n : e < 2 / 3 ? t + (n - t) * (2 / 3 - e) * 6 : t;
183
183
  }
184
184
  const j = "q-theme";
185
- function Zt() {
185
+ function Jt() {
186
186
  const t = he(j);
187
187
  if (!t)
188
188
  throw new Error("[Quidgest UI] Could not find theme instance");
@@ -256,7 +256,7 @@ function Re(t) {
256
256
  function de(t) {
257
257
  return t ? `--q-theme-${t.replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase()}` : "";
258
258
  }
259
- function jt(t = {}) {
259
+ function Pt(t = {}) {
260
260
  return { install: (e) => {
261
261
  const o = t.components || {};
262
262
  for (const l in o)
@@ -268,8 +268,8 @@ function jt(t = {}) {
268
268
  e.provide(oe, I(s)), Fe(e, t.themes);
269
269
  } };
270
270
  }
271
- const He = /* @__PURE__ */ Z("svg", { viewBox: "25 25 50 50" }, [
272
- /* @__PURE__ */ Z("circle", {
271
+ const He = /* @__PURE__ */ K("svg", { viewBox: "25 25 50 50" }, [
272
+ /* @__PURE__ */ K("circle", {
273
273
  class: "path",
274
274
  cx: "50",
275
275
  cy: "50",
@@ -366,13 +366,13 @@ const $e = k(Ne), We = ["disabled", "onClick"], Ge = {
366
366
  l.loading ? (r(), f("div", Ge, [
367
367
  U(g($e), { size: 23 })
368
368
  ])) : b("", !0),
369
- Z("span", Ye, [
369
+ K("span", Ye, [
370
370
  l.iconOnRight ? (r(), f(Q, { key: 0 }, [
371
- K(V(e.label), 1)
371
+ Z(V(e.label), 1)
372
372
  ], 64)) : b("", !0),
373
373
  x(l.$slots, "default"),
374
374
  l.iconOnRight ? b("", !0) : (r(), f(Q, { key: 1 }, [
375
- K(V(e.label), 1)
375
+ Z(V(e.label), 1)
376
376
  ], 64))
377
377
  ])
378
378
  ], 10, We));
@@ -458,7 +458,7 @@ const $e = k(Ne), We = ["disabled", "onClick"], Ge = {
458
458
  _: 3
459
459
  }, 8, ["disabled", "borderless", "elevated"]));
460
460
  }
461
- }), Jt = k(Pe), et = /* @__PURE__ */ _({
461
+ }), en = k(Pe), et = /* @__PURE__ */ _({
462
462
  __name: "QIcon",
463
463
  props: {
464
464
  icon: {},
@@ -694,7 +694,7 @@ const rt = /* @__PURE__ */ _({
694
694
  function gt(t, n) {
695
695
  return r(), f("div", vt);
696
696
  }
697
- const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), Pt = k(bt), _t = /* @__PURE__ */ _({
697
+ const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), tn = k(bt), _t = /* @__PURE__ */ _({
698
698
  __name: "QList",
699
699
  props: {
700
700
  modelValue: { type: [String, Number, Boolean, Symbol], default: void 0 },
@@ -778,11 +778,11 @@ const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), Pt = k(bt), _t = /* @__PURE
778
778
  onKeydown: $
779
779
  }, {
780
780
  default: C(() => [
781
- (r(!0), f(Q, null, te(l.value, (v) => (r(), w(g(Et), W({
781
+ (r(!0), f(Q, null, te(l.value, (v) => (r(), w(g(Ct), W({
782
782
  key: v.title
783
783
  }, v), {
784
784
  default: C(() => [
785
- (r(!0), f(Q, null, te(M(v.id), (D) => (r(), w(g(It), {
785
+ (r(!0), f(Q, null, te(M(v.id), (D) => (r(), w(g(Et), {
786
786
  key: D[o.itemValue],
787
787
  value: D[o.itemValue],
788
788
  label: D[o.itemLabel],
@@ -798,11 +798,11 @@ const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), Pt = k(bt), _t = /* @__PURE
798
798
  _: 1
799
799
  }, 40, ["class", "tabindex"]));
800
800
  }
801
- }), kt = ["tabindex", "aria-label", "aria-selected", "onClick"], wt = {
801
+ }), kt = ["tabindex", "aria-label", "aria-selected", "onClick"], wt = { class: "q-list-item__check-container" }, $t = {
802
802
  check: {
803
803
  icon: "check"
804
804
  }
805
- }, $t = /* @__PURE__ */ _({
805
+ }, St = /* @__PURE__ */ _({
806
806
  __name: "QListItem",
807
807
  props: {
808
808
  value: { type: [String, Number, Boolean, Symbol] },
@@ -810,7 +810,7 @@ const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), Pt = k(bt), _t = /* @__PURE
810
810
  icon: { default: void 0 },
811
811
  selected: { type: Boolean, default: !1 },
812
812
  highlighted: { type: Boolean, default: !1 },
813
- icons: { default: () => wt },
813
+ icons: { default: () => $t },
814
814
  disabled: { type: Boolean, default: !1 }
815
815
  },
816
816
  emits: ["select"],
@@ -839,19 +839,21 @@ const bt = /* @__PURE__ */ ht(yt, [["render", gt]]), Pt = k(bt), _t = /* @__PURE
839
839
  onClick: H(o, ["stop", "prevent"])
840
840
  }, [
841
841
  e.icon ? (r(), w(g(N), ve(W({ key: 0 }, e.icon)), null, 16)) : b("", !0),
842
- K(" " + V(e.label) + " ", 1),
843
- e.selected ? (r(), w(g(N), W({ key: 1 }, e.icons.check, { class: "q-list-item__check" }), null, 16)) : b("", !0)
842
+ Z(" " + V(e.label) + " ", 1),
843
+ K("div", wt, [
844
+ e.selected ? (r(), w(g(N), W({ key: 0 }, e.icons.check, { class: "q-list-item__check" }), null, 16)) : b("", !0)
845
+ ])
844
846
  ], 42, kt));
845
847
  }
846
848
  });
847
- let St = 0;
848
- function Bt() {
849
- return `uid-${++St}`;
849
+ let Bt = 0;
850
+ function Lt() {
851
+ return `uid-${++Bt}`;
850
852
  }
851
- const Lt = ["aria-labelledby"], xt = ["id"], qt = /* @__PURE__ */ _({
853
+ const xt = ["aria-labelledby"], qt = ["id"], Dt = /* @__PURE__ */ _({
852
854
  __name: "QListItemGroup",
853
855
  props: {
854
- id: { default: () => Bt() },
856
+ id: { default: () => Lt() },
855
857
  title: { default: "" },
856
858
  disabled: { type: Boolean, default: !1 }
857
859
  },
@@ -868,15 +870,15 @@ const Lt = ["aria-labelledby"], xt = ["id"], qt = /* @__PURE__ */ _({
868
870
  id: n.id,
869
871
  class: "q-list-item-group__title",
870
872
  role: "presentation"
871
- }, V(n.title), 9, xt)) : b("", !0),
873
+ }, V(n.title), 9, qt)) : b("", !0),
872
874
  x(e.$slots, "default")
873
- ], 8, Lt)) : x(e.$slots, "default", { key: 0 });
875
+ ], 8, xt)) : x(e.$slots, "default", { key: 0 });
874
876
  }
875
- }), Dt = k(_t), It = k($t), Et = k(qt);
876
- function Ct(t, n, e = "right", o) {
877
+ }), It = k(_t), Et = k(St), Ct = k(Dt);
878
+ function Tt(t, n, e = "right", o) {
877
879
  const a = t.getBoundingClientRect(), s = a.x + window.scrollX, l = a.y + window.scrollY, c = n == null ? void 0 : n.getBoundingClientRect(), i = (c == null ? void 0 : c.width) ?? 0, p = (c == null ? void 0 : c.height) ?? 0;
878
880
  let $ = e;
879
- c && !Se(a, c, $) && ($ = Tt(a, c, $));
881
+ c && !Se(a, c, $) && ($ = Vt(a, c, $));
880
882
  const m = { x: 0, y: 0, placement: $ };
881
883
  switch ($) {
882
884
  case "top":
@@ -892,7 +894,7 @@ function Ct(t, n, e = "right", o) {
892
894
  m.x = s + a.width, m.y = l + a.height / 2 - p / 2;
893
895
  break;
894
896
  }
895
- return o === "anchor" && (m.width = a.width), m;
897
+ return o === "anchor" && a.width >= i && (m.width = a.width), m;
896
898
  }
897
899
  function Se(t, n, e) {
898
900
  let o = !1, a = !1;
@@ -918,7 +920,7 @@ function fe(t, n) {
918
920
  function pe(t, n) {
919
921
  return window.innerWidth - t.left - t.width / 2 > n.width / 2 && t.left + t.width / 2 > n.width / 2;
920
922
  }
921
- function Tt(t, n, e) {
923
+ function Vt(t, n, e) {
922
924
  const o = {
923
925
  top: ["bottom", "left", "right"],
924
926
  bottom: ["top", "left", "right"],
@@ -933,10 +935,10 @@ function Tt(t, n, e) {
933
935
  function X(t) {
934
936
  return typeof t == "string" ? document.querySelector(t) : t && "$el" in t ? t.$el : t;
935
937
  }
936
- const Vt = {
938
+ const zt = {
937
939
  key: 0,
938
940
  class: "q-overlay__arrow"
939
- }, zt = /* @__PURE__ */ _({
941
+ }, Qt = /* @__PURE__ */ _({
940
942
  __name: "QOverlay",
941
943
  props: {
942
944
  modelValue: { type: Boolean },
@@ -997,7 +999,7 @@ const Vt = {
997
999
  function i() {
998
1000
  const h = X(e.anchor);
999
1001
  if (h) {
1000
- const B = Ct(h, c.value, e.placement, e.width);
1002
+ const B = Tt(h, c.value, e.placement, e.width);
1001
1003
  a.left = B.x, a.top = B.y, a.width = B.width, a.placement = B.placement;
1002
1004
  }
1003
1005
  }
@@ -1081,12 +1083,12 @@ const Vt = {
1081
1083
  class: T(o.value),
1082
1084
  style: G(l.value)
1083
1085
  }, [
1084
- Z("div", {
1086
+ K("div", {
1085
1087
  class: T(["q-overlay__content"]),
1086
1088
  ref_key: "overlay",
1087
1089
  ref: c
1088
1090
  }, [
1089
- e.arrow ? (r(), f("div", Vt)) : b("", !0),
1091
+ e.arrow ? (r(), f("div", zt)) : b("", !0),
1090
1092
  x(h.$slots, "default")
1091
1093
  ], 512)
1092
1094
  ], 6)) : b("", !0)
@@ -1096,13 +1098,13 @@ const Vt = {
1096
1098
  ], 8, ["to"]))
1097
1099
  ], 64));
1098
1100
  }
1099
- }), ae = k(zt), Qt = {
1101
+ }), ae = k(Qt), At = {
1100
1102
  key: 0,
1101
1103
  class: "q-popover__header"
1102
- }, At = {
1104
+ }, Ot = {
1103
1105
  key: 1,
1104
1106
  class: "q-popover__body"
1105
- }, Ot = ["innerHTML"], Ft = { key: 1 }, Mt = /* @__PURE__ */ _({
1107
+ }, Ft = ["innerHTML"], Mt = { key: 1 }, Rt = /* @__PURE__ */ _({
1106
1108
  __name: "QPopover",
1107
1109
  props: {
1108
1110
  modelValue: { type: Boolean },
@@ -1130,22 +1132,22 @@ const Vt = {
1130
1132
  spy: n.spy
1131
1133
  }, {
1132
1134
  default: C(() => [
1133
- n.title || e.$slots.header ? (r(), f("h3", Qt, [
1134
- K(V(n.title) + " ", 1),
1135
+ n.title || e.$slots.header ? (r(), f("h3", At, [
1136
+ Z(V(n.title) + " ", 1),
1135
1137
  x(e.$slots, "header")
1136
1138
  ])) : b("", !0),
1137
- n.text || e.$slots.body ? (r(), f("div", At, [
1139
+ n.text || e.$slots.body ? (r(), f("div", Ot, [
1138
1140
  n.html ? (r(), f("span", {
1139
1141
  key: 0,
1140
1142
  innerHTML: n.text
1141
- }, null, 8, Ot)) : (r(), f("span", Ft, V(n.text), 1)),
1143
+ }, null, 8, Ft)) : (r(), f("span", Mt, V(n.text), 1)),
1142
1144
  x(e.$slots, "body")
1143
1145
  ])) : b("", !0)
1144
1146
  ]),
1145
1147
  _: 3
1146
1148
  }, 8, ["model-value", "anchor", "arrow", "attach", "disabled", "placement", "spy"]));
1147
1149
  }
1148
- }), en = k(Mt), Rt = {
1150
+ }), nn = k(Rt), Ht = {
1149
1151
  mounted(t, n) {
1150
1152
  t.clickOutsideEvent = function(e) {
1151
1153
  const o = e.target;
@@ -1155,19 +1157,22 @@ const Vt = {
1155
1157
  unmounted(t) {
1156
1158
  document.removeEventListener("click", t.clickOutsideEvent);
1157
1159
  }
1158
- }, Ht = {
1160
+ }, Ut = {
1161
+ key: 0,
1162
+ class: "q-select__value"
1163
+ }, Nt = {
1159
1164
  key: 1,
1160
1165
  class: "q-select__placeholder"
1161
- }, Ut = {
1166
+ }, Kt = {
1162
1167
  placeholder: "Choose..."
1163
- }, Nt = {
1168
+ }, Wt = {
1164
1169
  chevron: {
1165
1170
  icon: "chevron-down"
1166
1171
  },
1167
1172
  clear: {
1168
1173
  icon: "close"
1169
1174
  }
1170
- }, Kt = /* @__PURE__ */ _({
1175
+ }, Gt = /* @__PURE__ */ _({
1171
1176
  __name: "QSelect",
1172
1177
  props: {
1173
1178
  modelValue: { type: [String, Number, Boolean, Symbol], default: void 0 },
@@ -1175,13 +1180,13 @@ const Vt = {
1175
1180
  readonly: { type: Boolean },
1176
1181
  disabled: { type: Boolean, default: !1 },
1177
1182
  loading: { type: Boolean, default: !1 },
1178
- icons: { default: () => Nt },
1183
+ icons: { default: () => Wt },
1179
1184
  items: {},
1180
1185
  groups: { default: () => [] },
1181
1186
  itemValue: { default: "key" },
1182
1187
  itemLabel: { default: "label" },
1183
1188
  size: { default: "medium" },
1184
- texts: { default: () => Ut }
1189
+ texts: { default: () => Kt }
1185
1190
  },
1186
1191
  emits: ["update:modelValue", "before-show", "before-hide", "show", "hide"],
1187
1192
  setup(t, { emit: n }) {
@@ -1282,9 +1287,7 @@ const Vt = {
1282
1287
  !e.readonly && !e.disabled ? (r(), w(g(N), W({ key: 1 }, e.icons.chevron, { class: "q-select__chevron" }), null, 16)) : b("", !0)
1283
1288
  ]),
1284
1289
  default: C(() => [
1285
- o.value ? (r(), f(Q, { key: 0 }, [
1286
- K(V($.value), 1)
1287
- ], 64)) : (r(), f("span", Ht, V(d.texts.placeholder), 1))
1290
+ o.value ? (r(), f("span", Ut, V($.value), 1)) : (r(), f("span", Nt, V(d.texts.placeholder), 1))
1288
1291
  ]),
1289
1292
  _: 2
1290
1293
  }, [
@@ -1321,7 +1324,7 @@ const Vt = {
1321
1324
  key: 0,
1322
1325
  class: "q-select__loader",
1323
1326
  size: 24
1324
- })) : (r(), w(g(Dt), {
1327
+ })) : (r(), w(g(It), {
1325
1328
  key: 1,
1326
1329
  ref_key: "listRef",
1327
1330
  ref: c,
@@ -1339,7 +1342,7 @@ const Vt = {
1339
1342
  }, null, 8, ["modelValue", "items", "groups", "item-label", "item-value", "onKeydown"])),
1340
1343
  x(d.$slots, "body.append")
1341
1344
  ])), [
1342
- [g(Rt), F]
1345
+ [g(Ht), F]
1343
1346
  ])
1344
1347
  ]),
1345
1348
  _: 3
@@ -1347,7 +1350,7 @@ const Vt = {
1347
1350
  ], 64);
1348
1351
  };
1349
1352
  }
1350
- }), tn = k(Kt), Wt = ["innerHTML"], Gt = { key: 1 }, Yt = /* @__PURE__ */ _({
1353
+ }), on = k(Gt), Yt = ["innerHTML"], Xt = { key: 1 }, Zt = /* @__PURE__ */ _({
1351
1354
  __name: "QTooltip",
1352
1355
  props: {
1353
1356
  modelValue: { type: Boolean },
@@ -1380,34 +1383,34 @@ const Vt = {
1380
1383
  n.html ? (r(), f("span", {
1381
1384
  key: 0,
1382
1385
  innerHTML: n.text
1383
- }, null, 8, Wt)) : (r(), f("span", Gt, V(n.text), 1))
1386
+ }, null, 8, Yt)) : (r(), f("span", Xt, V(n.text), 1))
1384
1387
  ]),
1385
1388
  _: 1
1386
1389
  }, 8, ["model-value", "anchor", "appearance", "arrow", "attach", "delay", "disabled", "placement", "trigger"]));
1387
1390
  }
1388
- }), nn = k(Yt);
1391
+ }), an = k(Zt);
1389
1392
  export {
1390
1393
  Ze as QButton,
1391
1394
  Je as QButtonGroup,
1392
- Jt as QButtonToggle,
1395
+ en as QButtonToggle,
1393
1396
  N as QIcon,
1394
1397
  it as QIconFont,
1395
1398
  ct as QIconImg,
1396
1399
  ut as QIconSvg,
1397
1400
  mt as QInput,
1398
- Pt as QLineLoader,
1399
- Dt as QList,
1400
- It as QListItem,
1401
- Et as QListItemGroup,
1401
+ tn as QLineLoader,
1402
+ It as QList,
1403
+ Et as QListItem,
1404
+ Ct as QListItemGroup,
1402
1405
  ae as QOverlay,
1403
- en as QPopover,
1404
- tn as QSelect,
1406
+ nn as QPopover,
1407
+ on as QSelect,
1405
1408
  $e as QSpinnerLoader,
1406
- nn as QTooltip,
1407
- Rt as clickOutside,
1408
- jt as createFramework,
1409
+ an as QTooltip,
1410
+ Ht as clickOutside,
1411
+ Pt as createFramework,
1409
1412
  Qe as defaultDarkColorScheme,
1410
1413
  ce as defaultLightColorScheme,
1411
- Zt as useTheme
1414
+ Jt as useTheme
1412
1415
  };
1413
1416
  //# sourceMappingURL=ui.esm.js.map