@nmorph/nmorph-ui-kit 2.2.19 → 2.2.21

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 (112) hide show
  1. package/dist/assets/icons/circle-close.svg.js +4 -4
  2. package/dist/assets/icons/clock.svg.js +2 -2
  3. package/dist/assets/icons/folder-opened.svg.js +8 -8
  4. package/dist/assets/icons/forward-filled.svg.js +21 -0
  5. package/dist/assets/icons/forward.svg.js +24 -0
  6. package/dist/assets/icons/reply-filled.svg.js +21 -0
  7. package/dist/assets/icons/reply.svg.js +24 -0
  8. package/dist/assets/icons/send-filled.svg.js +21 -0
  9. package/dist/assets/icons/send.svg.js +21 -0
  10. package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
  11. package/dist/components/basic/nmorph-link/NmorphLink.vue.js +16 -15
  12. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +17 -14
  13. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  14. package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +23 -23
  15. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +27 -23
  16. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +14 -13
  17. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +68 -65
  18. package/dist/components/data/nmorph-calendar/utils.js +4 -3
  19. package/dist/components/data/nmorph-card/NmorphCard.css +1 -1
  20. package/dist/components/data/nmorph-card/NmorphCard.vue.js +27 -26
  21. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +21 -13
  22. package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +39 -42
  23. package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +25 -36
  24. package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +15 -11
  25. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.css +1 -1
  26. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.js +14 -13
  27. package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +42 -27
  28. package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -0
  29. package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +64 -0
  30. package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +43 -0
  31. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
  32. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +51 -45
  33. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +74 -62
  34. package/dist/components/data/nmorph-progress/NmorphProgress.vue.js +24 -29
  35. package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +25 -14
  36. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue.js +20 -19
  37. package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
  38. package/dist/components/data/nmorph-table/NmorphTable.vue.js +35 -31
  39. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +64 -50
  40. package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.css +1 -1
  41. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue.js +8 -8
  42. package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +26 -22
  43. package/dist/components/feedback/nmorph-callout/NmorphCallout.css +1 -1
  44. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue.js +16 -15
  45. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +11 -8
  46. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.css +1 -1
  47. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue.js +13 -13
  48. package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +33 -19
  49. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +1 -1
  50. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.css +1 -1
  51. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue.js +16 -15
  52. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +39 -32
  53. package/dist/components/form/nmorph-number-input/NmorphNumberInput.css +1 -1
  54. package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue.js +7 -7
  55. package/dist/components/form/nmorph-select/NmorphSelect.vue.js +40 -39
  56. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +53 -50
  57. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js +16 -15
  58. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -16
  59. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue.js +16 -15
  60. package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +26 -19
  61. package/dist/components/form/nmorph-slider/NmorphSlider.vue.js +4 -4
  62. package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +48 -38
  63. package/dist/components/form/nmorph-switch/NmorphSwitch.css +1 -1
  64. package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +18 -17
  65. package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +38 -27
  66. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -0
  67. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +183 -0
  68. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +111 -0
  69. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.css +1 -1
  70. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +9 -8
  71. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +14 -14
  72. package/dist/hooks/use-common-styles.js +75 -9
  73. package/dist/hooks/use-virtual-list.js +3 -1
  74. package/dist/icons.js +377 -365
  75. package/dist/index.es.js +666 -650
  76. package/dist/index.umd.js +99 -33
  77. package/dist/locales/en.js +1 -0
  78. package/dist/locales/ru.js +1 -0
  79. package/dist/locales/zh.js +1 -0
  80. package/dist/package.json.js +1 -1
  81. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +6 -0
  82. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +2 -0
  83. package/dist/src/components/data/index.d.ts +1 -0
  84. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +2 -0
  85. package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +2 -0
  86. package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +7 -5
  87. package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +1 -3
  88. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +2 -0
  89. package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +36 -0
  90. package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +10 -0
  91. package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +6 -0
  92. package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -0
  93. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +6 -0
  94. package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -0
  95. package/dist/src/components/feedback/nmorph-alert/types.d.ts +1 -0
  96. package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +2 -0
  97. package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +8 -0
  98. package/dist/src/components/form/index.d.ts +2 -0
  99. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -0
  100. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +2 -0
  101. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +2 -0
  102. package/dist/src/components/form/nmorph-select/types.d.ts +2 -0
  103. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +6 -0
  104. package/dist/src/components/form/nmorph-slider/types.d.ts +4 -0
  105. package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +8 -0
  106. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +44 -0
  107. package/dist/src/components/form/nmorph-time-picker/types.d.ts +6 -0
  108. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -3
  109. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -2
  110. package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -0
  111. package/dist/style.css +1 -1
  112. package/package.json +6 -5
@@ -1,17 +1,17 @@
1
1
  import './NmorphSelect.css';
2
- import { defineComponent as ne, computed as a, ref as d, watch as f, nextTick as L, onMounted as ue, onUnmounted as oe, provide as R } from "vue";
3
- import { NmorphComponentHeight as ie } from "../../../types/index.js";
4
- import { useModifiers as se } from "../../../utils/create-modifiers.js";
5
- import { useI18n as de } from "vue-i18n";
6
- import { useFormItemInput as ve } from "../nmorph-form/use-form-item-input.js";
7
- import { useVirtualList as ce } from "../../../hooks/use-virtual-list.js";
8
- import fe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
- import pe from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
- import me from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
- import he from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
- import ge from "../../../assets/icons/chevron-down.svg.js";
13
- import ye from "../../../assets/icons/loader.svg.js";
14
- const Ce = /* @__PURE__ */ ne({
2
+ import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as L, onMounted as oe, onUnmounted as ie, provide as R } from "vue";
3
+ import { NmorphComponentHeight as se } from "../../../types/index.js";
4
+ import { useModifiers as de } from "../../../utils/create-modifiers.js";
5
+ import { useI18n as ve } from "vue-i18n";
6
+ import { useFormItemInput as ce } from "../nmorph-form/use-form-item-input.js";
7
+ import { useVirtualList as fe } from "../../../hooks/use-virtual-list.js";
8
+ import pe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
+ import me from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
+ import he from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
+ import ge from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
+ import ye from "../../../assets/icons/chevron-down.svg.js";
13
+ import He from "../../../assets/icons/loader.svg.js";
14
+ const Pe = /* @__PURE__ */ ue({
15
15
  __name: "NmorphSelect",
16
16
  props: {
17
17
  noElementPlaceholder: { type: String, required: !1, default: "" },
@@ -29,6 +29,7 @@ const Ce = /* @__PURE__ */ ne({
29
29
  virtualMaxHeight: { type: [Number, String], required: !1, default: 240 },
30
30
  virtualOverscan: { type: Number, required: !1, default: 5 },
31
31
  virtualDynamicHeight: { type: Boolean, required: !1, default: !1 },
32
+ width: { type: [Number, String], required: !1, default: void 0 },
32
33
  id: { type: String, required: !1 },
33
34
  name: { type: String, required: !1 },
34
35
  autocomplete: { type: String, required: !1 },
@@ -39,14 +40,14 @@ const Ce = /* @__PURE__ */ ne({
39
40
  emits: ["update:model-value"],
40
41
  setup(T, { expose: C, emit: P }) {
41
42
  C();
42
- const { t: M } = de(), l = T, $ = a(
43
+ const { t: M } = ve(), l = T, $ = a(
43
44
  () => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
44
- ), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = ve(l), H = (e) => {
45
+ ), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = ce(l), H = (e) => {
45
46
  if (!v.value) {
46
47
  if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, m("update:model-value", t.value)), Array.isArray(t.value)) {
47
- const n = t.value.includes(e), S = t.value.length === 1 && n;
48
- if (l.valueRequired && S) return;
49
- n ? t.value = t.value.filter((re) => re !== e) : t.value = [...t.value, e];
48
+ const n = t.value.includes(e), w = t.value.length === 1 && n;
49
+ if (l.valueRequired && w) return;
50
+ n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
50
51
  }
51
52
  m("update:model-value", t.value);
52
53
  }
@@ -55,8 +56,8 @@ const Ce = /* @__PURE__ */ ne({
55
56
  }, F = () => {
56
57
  p.value = !1;
57
58
  }, j = a(
58
- () => se({
59
- nmorph: [ie[l.height]],
59
+ () => de({
60
+ nmorph: [se[l.height]],
60
61
  "nmorph-select": [
61
62
  `${l.disabled && "disabled"}`,
62
63
  `${l.modelValue ? "on" : "off"}`,
@@ -68,7 +69,9 @@ const Ce = /* @__PURE__ */ ne({
68
69
  `${p.value && "focus"}`
69
70
  ]
70
71
  })
71
- ), Y = () => {
72
+ ), b = (e) => typeof e == "number" ? `${e}px` : e, Y = a(() => ({
73
+ ...l.width !== void 0 && { "--base-width": b(l.width) }
74
+ })), G = () => {
72
75
  v.value || (r.value = !r.value);
73
76
  };
74
77
  f(
@@ -78,7 +81,7 @@ const Ce = /* @__PURE__ */ ne({
78
81
  },
79
82
  { immediate: !0 }
80
83
  );
81
- const b = () => {
84
+ const q = () => {
82
85
  r.value = !1;
83
86
  };
84
87
  f(
@@ -87,24 +90,24 @@ const Ce = /* @__PURE__ */ ne({
87
90
  e && (r.value = !1);
88
91
  }
89
92
  );
90
- const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), q = d(null), x = d([]), I = a(() => l.options), c = a(() => l.virtual && I.value.length > 0), w = a(() => ({
93
+ const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), x = d(null), I = d([]), N = a(() => l.options), c = a(() => l.virtual && N.value.length > 0), D = a(() => ({
91
94
  basic: 30,
92
95
  thick: 38,
93
96
  thin: 22
94
- })[l.height || "basic"]), D = a(() => l.virtualItemHeight || w.value), A = a(() => l.virtualOverscan), E = a(() => l.virtualDynamicHeight), s = ce(I, {
97
+ })[l.height || "basic"]), A = a(() => l.virtualItemHeight || D.value), E = a(() => l.virtualOverscan), V = a(() => l.virtualDynamicHeight), s = fe(N, {
95
98
  enabled: c,
96
- itemHeight: D,
97
- overscan: A,
98
- dynamic: E
99
- }), G = a(() => s.virtualItems.value), J = a(() => ({
99
+ itemHeight: A,
100
+ overscan: E,
101
+ dynamic: V
102
+ }), J = a(() => s.virtualItems.value), K = a(() => ({
100
103
  height: `${s.totalHeight.value}px`
101
- })), K = a(() => ({
104
+ })), Q = a(() => ({
102
105
  transform: `translateY(${s.offsetTop.value}px)`
103
- })), V = (e) => typeof e == "number" ? `${e}px` : e, Q = a(() => V(l.virtualMaxHeight)), O = () => {
104
- i.value.length > 0 || !q.value || (x.value = Array.from(q.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
106
+ })), X = a(() => b(l.virtualMaxHeight)), O = () => {
107
+ i.value.length > 0 || !x.value || (I.value = Array.from(x.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
105
108
  }, o = a(
106
- () => i.value.length > 0 ? i.value.map((e) => e.value) : x.value
107
- ), X = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), N = a(() => o.value[u.value] || ""), Z = a(() => `${y.value}-listbox`), ee = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
109
+ () => i.value.length > 0 ? i.value.map((e) => e.value) : I.value
110
+ ), Z = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
108
111
  f(u, (e) => {
109
112
  r.value && c.value && s.scrollToIndex(e);
110
113
  }), f(
@@ -121,26 +124,26 @@ const Ce = /* @__PURE__ */ ne({
121
124
  }
122
125
  s.refresh(), c.value && s.scrollToIndex(u.value);
123
126
  }
124
- }), ue(async () => {
125
- await L(), O(), document.addEventListener("click", b);
126
- }), oe(() => {
127
- document.removeEventListener("click", b);
127
+ }), oe(async () => {
128
+ await L(), O(), document.addEventListener("click", q);
129
+ }), ie(() => {
130
+ document.removeEventListener("click", q);
128
131
  });
129
- const te = a(() => typeof t.value == "string" ? t.value === "" ? $.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), le = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
132
+ const le = a(() => typeof t.value == "string" ? t.value === "" ? $.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
130
133
  R("select-selected-value", t), R("select-change-selected-value", H);
131
- const _ = d(null), ae = a(
134
+ const _ = d(null), re = a(
132
135
  () => h.value ? `${_.value?.clientWidth || 0}px` : void 0
133
- ), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, clickHandler: Y, closeHandler: b, optionsMap: i, optionsDOMRef: q, slotDomOptions: x, renderedOptions: I, virtualEnabled: c, defaultOptionHeight: w, virtualItemHeight: D, virtualOverscan: A, virtualDynamicHeight: E, virtualList: s, virtualOptions: G, virtualSpacerStyle: J, virtualContentStyle: K, getCssSize: V, virtualMaxHeight: Q, refreshDomOptions: O, domOptions: o, nativeOptions: X, currentIndex: u, currentFocusedEl: N, listboxId: Z, getOptionId: ee, selectedValueTitle: te, tags: le, nmorphSelectDOMRef: _, optionsMinWidth: ae, spaceHandler: () => {
136
+ ), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: D, virtualItemHeight: A, virtualOverscan: E, virtualDynamicHeight: V, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: _, optionsMinWidth: re, spaceHandler: () => {
134
137
  v.value || (r.value = !r.value);
135
138
  }, arrowDownHandler: () => {
136
139
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
137
140
  }, arrowUpHandler: () => {
138
141
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
139
142
  }, enterHandler: () => {
140
- r.value && N.value && H(N.value);
143
+ r.value && S.value && H(S.value);
141
144
  }, setVirtualOptionRef: (e, n) => {
142
- const S = e instanceof Element ? e : e?.$el;
143
- s.measureElement(n, S);
145
+ const w = e instanceof Element ? e : e?.$el;
146
+ s.measureElement(n, w);
144
147
  }, escapeHandler: () => {
145
148
  r.value = !1;
146
149
  }, homeHandler: () => {
@@ -148,21 +151,21 @@ const Ce = /* @__PURE__ */ ne({
148
151
  }, endHandler: () => {
149
152
  u.value = Math.max(o.value.length - 1, 0);
150
153
  }, get NmorphTagItem() {
151
- return he;
154
+ return ge;
152
155
  }, get NmorphIcon() {
153
- return me;
156
+ return he;
154
157
  }, get NmorphSelectOption() {
155
- return pe;
158
+ return me;
156
159
  }, get NmorphDropdown() {
157
- return fe;
160
+ return pe;
158
161
  }, get NmorphIconLoader() {
159
- return ye;
162
+ return He;
160
163
  }, get NmorphIconChevronDown() {
161
- return ge;
164
+ return ye;
162
165
  } };
163
166
  return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
164
167
  }
165
168
  });
166
169
  export {
167
- Ce as default
170
+ Pe as default
168
171
  };
@@ -1,41 +1,42 @@
1
1
  import './NmorphSelectOption.css';
2
- import t from "./NmorphSelectOption.vue2.js";
3
- import { openBlock as o, createElementBlock as l, normalizeClass as n, createElementVNode as r, toDisplayString as a, renderSlot as i, createBlock as s, withCtx as d, createVNode as p, createCommentVNode as m } from "vue";
2
+ import c from "./NmorphSelectOption.vue2.js";
3
+ import { openBlock as o, createElementBlock as l, normalizeStyle as n, normalizeClass as a, createElementVNode as r, toDisplayString as i, renderSlot as s, createBlock as d, withCtx as m, createVNode as p, createCommentVNode as _ } from "vue";
4
4
  /* empty css */
5
- import _ from "../../../../../_virtual/_plugin-vue_export-helper.js";
6
- const h = ["value", "aria-selected", "aria-disabled"], f = { class: "nmorph-select-option__content" };
7
- function k(c, v, N, e, b, u) {
5
+ import h from "../../../../../_virtual/_plugin-vue_export-helper.js";
6
+ const f = ["value", "aria-selected", "aria-disabled"], k = { class: "nmorph-select-option__content" };
7
+ function v(t, N, b, e, y, S) {
8
8
  return o(), l("div", {
9
- class: n(e.modifiers),
9
+ class: a(e.modifiers),
10
+ style: n(e.styles),
10
11
  value: e.props.value,
11
12
  role: "option",
12
13
  "aria-selected": e.checked,
13
14
  "aria-disabled": e.props.disabled,
14
15
  onClick: e.clickHandler
15
16
  }, [
16
- r("div", f, [
17
+ r("div", k, [
17
18
  r(
18
19
  "span",
19
20
  null,
20
- a(e.props.label),
21
+ i(e.props.label),
21
22
  1
22
23
  /* TEXT */
23
24
  ),
24
- i(c.$slots, "default")
25
+ s(t.$slots, "default")
25
26
  ]),
26
- e.checked ? (o(), s(e.NmorphIcon, {
27
+ e.checked ? (o(), d(e.NmorphIcon, {
27
28
  key: 0,
28
29
  class: "nmorph-select-option__checked"
29
30
  }, {
30
- default: d(() => [
31
+ default: m(() => [
31
32
  p(e.NmorphIconSuccess)
32
33
  ]),
33
34
  _: 1
34
35
  /* STABLE */
35
- })) : m("v-if", !0)
36
- ], 10, h);
36
+ })) : _("v-if", !0)
37
+ ], 14, f);
37
38
  }
38
- const B = /* @__PURE__ */ _(t, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue"]]);
39
+ const V = /* @__PURE__ */ h(c, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue"]]);
39
40
  export {
40
- B as default
41
+ V as default
41
42
  };
@@ -1,15 +1,17 @@
1
1
  import './NmorphSelectOption.css';
2
- import { defineComponent as m, inject as u, computed as s } from "vue";
3
- import { NmorphComponentHeight as h } from "../../../../../types/index.js";
2
+ import { defineComponent as h, inject as i, computed as o } from "vue";
3
+ import { NmorphComponentHeight as v } from "../../../../../types/index.js";
4
4
  import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
5
- import v from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
- import y from "../../../../../assets/icons/success.svg.js";
7
- const I = /* @__PURE__ */ m({
5
+ import y from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
+ import S from "../../../../../assets/icons/success.svg.js";
7
+ const C = /* @__PURE__ */ h({
8
8
  __name: "NmorphSelectOption",
9
9
  props: {
10
10
  value: { type: String, required: !0 },
11
11
  label: { type: String, required: !0, default: "" },
12
12
  focused: { type: Boolean, required: !1, default: !1 },
13
+ hoverBackground: { type: String, required: !1, default: void 0 },
14
+ hoverColor: { type: String, required: !1, default: void 0 },
13
15
  id: { type: String, required: !1 },
14
16
  name: { type: String, required: !1 },
15
17
  autocomplete: { type: String, required: !1 },
@@ -18,13 +20,13 @@ const I = /* @__PURE__ */ m({
18
20
  tabindex: { type: Number, required: !1 }
19
21
  },
20
22
  emits: ["change-value"],
21
- setup(i, { expose: n, emit: c }) {
22
- n();
23
- const t = u("select-selected-value"), r = u("select-change-selected-value"), e = i, l = c, d = () => {
24
- e.disabled || (l("change-value", e.value), r && r(e.value));
25
- }, a = s(() => typeof t?.value == "string" ? t.value === e.value : Array.isArray(t?.value) ? t.value.some((f) => f === e.value) : !1), p = s(
23
+ setup(n, { expose: s, emit: c }) {
24
+ s();
25
+ const r = i("select-selected-value"), t = i("select-change-selected-value"), e = n, l = c, d = () => {
26
+ e.disabled || (l("change-value", e.value), t && t(e.value));
27
+ }, a = o(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((m) => m === e.value) : !1), p = o(
26
28
  () => g({
27
- nmorph: [h[e.height]],
29
+ nmorph: [v[e.height]],
28
30
  "nmorph-select-option": [
29
31
  `${e.disabled && "disabled"}`,
30
32
  `${e.label && "with-label"}`,
@@ -32,14 +34,17 @@ const I = /* @__PURE__ */ m({
32
34
  `${e.focused && "focused"}`
33
35
  ]
34
36
  })
35
- ), o = { selectSelectedValue: t, selectChangeSelectedValue: r, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, get NmorphIcon() {
36
- return v;
37
- }, get NmorphIconSuccess() {
37
+ ), f = o(() => ({
38
+ ...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
39
+ ...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
40
+ })), u = { selectSelectedValue: r, selectChangeSelectedValue: t, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, styles: f, get NmorphIcon() {
38
41
  return y;
42
+ }, get NmorphIconSuccess() {
43
+ return S;
39
44
  } };
40
- return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
45
+ return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
41
46
  }
42
47
  });
43
48
  export {
44
- I as default
49
+ C as default
45
50
  };
@@ -1,26 +1,27 @@
1
1
  import './NmorphSelectButton.css';
2
2
  import n from "./NmorphSelectButton.vue2.js";
3
- import { openBlock as t, createElementBlock as o, normalizeClass as s, Fragment as c, renderList as m, createBlock as i, withCtx as d, createTextVNode as u, toDisplayString as f, renderSlot as p } from "vue";
3
+ import { openBlock as r, createElementBlock as l, normalizeStyle as s, normalizeClass as m, Fragment as c, renderList as i, createBlock as d, withCtx as u, createTextVNode as f, toDisplayString as p, renderSlot as _ } from "vue";
4
4
  /* empty css */
5
- import _ from "../../../_virtual/_plugin-vue_export-helper.js";
6
- function b(l, h, a, r, v, B) {
7
- return t(), o(
5
+ import b from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ function h(o, v, a, t, y, B) {
7
+ return r(), l(
8
8
  "div",
9
9
  {
10
- class: s(r.modifiers)
10
+ class: m(t.modifiers),
11
+ style: s(t.styles)
11
12
  },
12
13
  [
13
- (t(!0), o(
14
+ (r(!0), l(
14
15
  c,
15
16
  null,
16
- m(a.options, (e) => (t(), i(r.NmorphSelectButtonItem, {
17
+ i(a.options, (e) => (r(), d(t.NmorphSelectButtonItem, {
17
18
  key: e.value,
18
19
  value: e.value,
19
20
  disabled: e.disabled
20
21
  }, {
21
- default: d(() => [
22
- u(
23
- f(e.label),
22
+ default: u(() => [
23
+ f(
24
+ p(e.label),
24
25
  1
25
26
  /* TEXT */
26
27
  )
@@ -31,13 +32,13 @@ function b(l, h, a, r, v, B) {
31
32
  128
32
33
  /* KEYED_FRAGMENT */
33
34
  )),
34
- p(l.$slots, "default")
35
+ _(o.$slots, "default")
35
36
  ],
36
- 2
37
- /* CLASS */
37
+ 6
38
+ /* CLASS, STYLE */
38
39
  );
39
40
  }
40
- const y = /* @__PURE__ */ _(n, [["render", b], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select-button/NmorphSelectButton.vue"]]);
41
+ const g = /* @__PURE__ */ b(n, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select-button/NmorphSelectButton.vue"]]);
41
42
  export {
42
- y as default
43
+ g as default
43
44
  };
@@ -1,13 +1,16 @@
1
1
  import './NmorphSelectButton.css';
2
- import { defineComponent as p, ref as f, watch as m, computed as c, provide as i } from "vue";
3
- import { useModifiers as b } from "../../../utils/create-modifiers.js";
4
- import h from "./components/nmorph-select-button-item/NmorphSelectButtonItem.vue.js";
5
- const q = /* @__PURE__ */ p({
2
+ import { defineComponent as c, ref as S, watch as g, computed as o, provide as n } from "vue";
3
+ import { useModifiers as y } from "../../../utils/create-modifiers.js";
4
+ import b from "./components/nmorph-select-button-item/NmorphSelectButtonItem.vue.js";
5
+ const _ = /* @__PURE__ */ c({
6
6
  __name: "NmorphSelectButton",
7
7
  props: {
8
8
  modelValue: { type: String, required: !1, default: "" },
9
9
  options: { type: Array, required: !1, default: () => [] },
10
10
  fill: { type: Boolean, required: !1, default: !1 },
11
+ trackPadding: { type: [Number, String], required: !1, default: void 0 },
12
+ itemSize: { type: [Number, String], required: !1, default: void 0 },
13
+ itemFontSize: { type: String, required: !1, default: void 0 },
11
14
  id: { type: String, required: !1 },
12
15
  name: { type: String, required: !1 },
13
16
  autocomplete: { type: String, required: !1 },
@@ -16,29 +19,33 @@ const q = /* @__PURE__ */ p({
16
19
  tabindex: { type: Number, required: !1 }
17
20
  },
18
21
  emits: ["update:model-value"],
19
- setup(u, { expose: d, emit: n }) {
20
- d();
21
- const e = u, r = n, t = f(e.modelValue);
22
- m(
22
+ setup(u, { expose: s, emit: m }) {
23
+ s();
24
+ const e = u, l = m, i = S(e.modelValue);
25
+ g(
23
26
  () => e.modelValue,
24
- (l) => {
25
- t.value = l;
27
+ (t) => {
28
+ i.value = t;
26
29
  }
27
30
  );
28
- const s = c(
29
- () => b({
31
+ const f = o(
32
+ () => y({
30
33
  "nmorph-select-button": [`${e.disabled && "disabled"}`, `${e.fill && "fill"}`, e.height]
31
34
  })
32
- ), a = (l) => {
33
- e.disabled || (t.value = l, r("update:model-value", l));
35
+ ), r = (t) => typeof t == "number" ? `${t}px` : t, p = o(() => ({
36
+ ...e.trackPadding !== void 0 && { "--track-padding": r(e.trackPadding) },
37
+ ...e.itemSize !== void 0 && { "--item-size": r(e.itemSize) },
38
+ ...e.itemFontSize !== void 0 && { "--item-font-size": e.itemFontSize }
39
+ })), a = (t) => {
40
+ e.disabled || (i.value = t, l("update:model-value", t));
34
41
  };
35
- i("select-button-selected-value", t), i("select-button-change-handler", a);
36
- const o = { props: e, emit: r, initialValue: t, modifiers: s, changeHandler: a, get NmorphSelectButtonItem() {
37
- return h;
42
+ n("select-button-selected-value", i), n("select-button-change-handler", a);
43
+ const d = { props: e, emit: l, initialValue: i, modifiers: f, getCssSize: r, styles: p, changeHandler: a, get NmorphSelectButtonItem() {
44
+ return b;
38
45
  } };
39
- return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
46
+ return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
40
47
  }
41
48
  });
42
49
  export {
43
- q as default
50
+ _ as default
44
51
  };
@@ -4,12 +4,12 @@ import { openBlock as n, createElementBlock as l, normalizeStyle as r, normalize
4
4
  /* empty css */
5
5
  import s from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const m = { class: "nmorph-slider__content" }, c = { class: "nmorph-slider__input-wrapper" }, p = ["id", "name", "tabindex", "value", "min", "max", "step", "disabled"];
7
- function h(_, b, f, o, v, x) {
7
+ function _(h, f, b, o, v, x) {
8
8
  return n(), l(
9
9
  "div",
10
10
  {
11
11
  class: i(o.modifiers),
12
- style: r({ "--nmorph-slider-thumb-width": o.thumbWidthCss })
12
+ style: r(o.styles)
13
13
  },
14
14
  [
15
15
  e("div", m, [
@@ -67,7 +67,7 @@ function h(_, b, f, o, v, x) {
67
67
  /* CLASS, STYLE */
68
68
  );
69
69
  }
70
- const N = /* @__PURE__ */ s(t, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-slider/NmorphSlider.vue"]]);
70
+ const P = /* @__PURE__ */ s(t, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-slider/NmorphSlider.vue"]]);
71
71
  export {
72
- N as default
72
+ P as default
73
73
  };
@@ -1,16 +1,20 @@
1
1
  import './NmorphSlider.css';
2
- import { defineComponent as U, computed as I, ref as o, watch as L, onMounted as k, onUnmounted as A } from "vue";
3
- import { useModifiers as G } from "../../../utils/create-modifiers.js";
4
- import { useFormItemInput as J } from "../nmorph-form/use-form-item-input.js";
5
- import K from "../../feedback/nmorph-tooltip/NmorphTooltip.vue.js";
6
- const m = 50, re = /* @__PURE__ */ U({
2
+ import { defineComponent as k, computed as m, ref as o, watch as I, onMounted as A, onUnmounted as G } from "vue";
3
+ import { useModifiers as J } from "../../../utils/create-modifiers.js";
4
+ import { useFormItemInput as K } from "../nmorph-form/use-form-item-input.js";
5
+ import Q from "../../feedback/nmorph-tooltip/NmorphTooltip.vue.js";
6
+ const se = /* @__PURE__ */ k({
7
7
  __name: "NmorphSlider",
8
8
  props: {
9
9
  modelValue: { type: Number, required: !1, default: 0 },
10
10
  max: { type: Number, required: !1, default: 100 },
11
11
  min: { type: Number, required: !1, default: 0 },
12
12
  step: { type: Number, required: !1, default: 1 },
13
+ fill: { type: Boolean, required: !1, default: !0 },
13
14
  showTooltip: { type: Boolean, required: !1, default: !0 },
15
+ thumbWidth: { type: Number, required: !1, default: 50 },
16
+ sliderHeight: { type: [Number, String], required: !1, default: void 0 },
17
+ valueFixedContainerHeight: { type: [Number, String], required: !1, default: void 0 },
14
18
  id: { type: String, required: !1 },
15
19
  name: { type: String, required: !1 },
16
20
  autocomplete: { type: String, required: !1 },
@@ -18,66 +22,72 @@ const m = 50, re = /* @__PURE__ */ U({
18
22
  tabindex: { type: Number, required: !1 }
19
23
  },
20
24
  emits: ["update:model-value"],
21
- setup(M, { expose: T, emit: W }) {
22
- T();
23
- const e = M, { id: q, name: _, tabindex: N } = J(e), S = I(
24
- () => G({
25
+ setup(H, { expose: L, emit: M }) {
26
+ L();
27
+ const e = H, { id: N, name: T, tabindex: S } = K(e), _ = m(
28
+ () => J({
25
29
  nmorph: [],
26
30
  "nmorph-slider": [`${e.disabled && "disabled"}`]
27
31
  })
28
- ), H = `${m}px`, c = o(e.showTooltip), w = W, n = o(e.modelValue), p = o(null);
29
- L(n, () => {
30
- w("update:model-value", n.value);
31
- }), L(
32
+ ), g = m(() => `${e.thumbWidth}px`), p = o(e.showTooltip), x = M, n = o(e.modelValue), c = o(null);
33
+ I(n, () => {
34
+ x("update:model-value", n.value);
35
+ }), I(
32
36
  () => e.modelValue,
33
37
  (t) => {
34
38
  n.value = t;
35
39
  }
36
40
  );
37
- const x = o(null), O = I(() => {
38
- const t = s.value - s.value, r = e.max - e.min + t, l = (n.value - e.min) / r * 100, u = p.value?.clientWidth || 0, d = m / u * 100, $ = d / 2;
39
- let D = l - $;
40
- const y = `${Math.max(0, Math.min(100 - d, D))}%`, g = u / 100, F = m / 2 / g, E = (x.value?.tooltipBody.clientWidth ?? 24) / 2 / g, X = E === 1 / 0 ? 1.714 : E, j = `${parseFloat(y) + F - X}%`;
41
+ const y = o(null), C = m(() => {
42
+ const t = s.value - s.value, r = e.max - e.min + t, u = (n.value - e.min) / r * 100, a = c.value?.clientWidth || 0, d = e.thumbWidth / a * 100, R = d / 2;
43
+ let D = u - R;
44
+ const W = `${Math.max(0, Math.min(100 - d, D))}%`, q = a / 100, X = e.thumbWidth / 2 / q, E = (y.value?.tooltipBody.clientWidth ?? 24) / 2 / q, j = E === 1 / 0 ? 1.714 : E, U = `${parseFloat(W) + X - j}%`;
41
45
  return {
42
- thumb: y,
43
- tooltip: j
46
+ thumb: W,
47
+ tooltip: U
44
48
  };
45
49
  }), s = o(0), f = o(0), h = () => {
46
50
  s.value = window.innerWidth, f.value = window.innerHeight;
47
51
  };
48
- k(() => {
52
+ A(() => {
49
53
  typeof window < "u" && (s.value = window.innerWidth, f.value = window.innerHeight, window.addEventListener("resize", h));
50
- }), A(() => {
51
- typeof window < "u" && (document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), window.removeEventListener("resize", h));
54
+ }), G(() => {
55
+ typeof window < "u" && (document.removeEventListener("pointermove", l), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), window.removeEventListener("resize", h));
52
56
  });
53
57
  const v = (t) => {
54
58
  b.value = !1;
55
- const r = p.value?.getBoundingClientRect();
56
- let l = 0;
59
+ const r = c.value?.getBoundingClientRect();
60
+ let u = 0;
57
61
  if (r) {
58
- const u = t - r.left, d = r.width;
59
- l = Math.max(0, Math.min(1, u / d)), n.value = e.min + l * (e.max - e.min);
62
+ const a = t - r.left, d = r.width;
63
+ u = Math.max(0, Math.min(1, a / d)), n.value = e.min + u * (e.max - e.min);
60
64
  }
61
65
  n.value = Math.round(n.value / e.step) * e.step, n.value = Math.max(e.min, Math.min(e.max, n.value));
62
- }, a = (t) => {
66
+ }, l = (t) => {
63
67
  t.preventDefault(), v(t.clientX);
64
68
  }, i = () => {
65
- document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), b.value = !0;
66
- }, V = (t) => {
67
- e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove", a), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i));
68
- }, z = o(null), C = () => {
69
- e.showTooltip && (c.value = !0);
70
- }, B = () => {
71
- e.showTooltip && (c.value = !1);
72
- }, R = (t) => {
69
+ document.removeEventListener("pointermove", l), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), b.value = !0;
70
+ }, z = (t) => {
71
+ e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove", l), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i));
72
+ }, F = o(null), O = () => {
73
+ e.showTooltip && (p.value = !0);
74
+ }, V = () => {
75
+ e.showTooltip && (p.value = !1);
76
+ }, B = (t) => {
73
77
  const r = t.target;
74
78
  n.value = Number(r.value);
75
- }, b = o(!0), P = { props: e, id: q, name: _, tabindex: N, modifiers: S, thumbWidth: m, thumbWidthCss: H, tooltipVisible: c, emit: w, thumbValue: n, sliderContainer: p, tooltipRootRef: x, thumbXPercentPosition: O, windowWidth: s, windowHeight: f, resizeWindowHandler: h, updateThumbValue: v, pointerMove: a, pointerUp: i, pointerDownHandler: V, sliderFirst: z, handleMouseEnter: C, handleMouseLeave: B, nativeInputHandler: R, transitionEnabled: b, get NmorphTooltip() {
76
- return K;
79
+ }, b = o(!0), w = (t) => typeof t == "number" ? `${t}px` : t, $ = m(() => ({
80
+ "--nmorph-slider-thumb-width": g.value,
81
+ ...e.sliderHeight !== void 0 && { "--slider-height": w(e.sliderHeight) },
82
+ ...e.valueFixedContainerHeight !== void 0 && {
83
+ "--value-fixed-container-height": w(e.valueFixedContainerHeight)
84
+ }
85
+ })), P = { props: e, id: N, name: T, tabindex: S, modifiers: _, thumbWidthCss: g, tooltipVisible: p, emit: x, thumbValue: n, sliderContainer: c, tooltipRootRef: y, thumbXPercentPosition: C, windowWidth: s, windowHeight: f, resizeWindowHandler: h, updateThumbValue: v, pointerMove: l, pointerUp: i, pointerDownHandler: z, sliderFirst: F, handleMouseEnter: O, handleMouseLeave: V, nativeInputHandler: B, transitionEnabled: b, getCssSize: w, styles: $, get NmorphTooltip() {
86
+ return Q;
77
87
  } };
78
88
  return Object.defineProperty(P, "__isScriptSetup", { enumerable: !1, value: !0 }), P;
79
89
  }
80
90
  });
81
91
  export {
82
- re as default
92
+ se as default
83
93
  };
@@ -1 +1 @@
1
- .nmorph-switch{--height: 20px;--offset: 3px;--thumb-height: 14px;width:40px;height:var(--height);overflow:hidden;border-radius:var(--border-radius-999);cursor:pointer}.nmorph-switch .nmorph-switch__content{position:relative;height:100%;font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-switch .nmorph-switch__bg-content{position:absolute;top:0;left:0;display:flex;justify-content:flex-end;align-items:center;width:100%;height:100%;padding:8px}.nmorph-switch .nmorph-switch__bg-content.nmorph-switch__bg-content--enable{justify-content:flex-start;color:var(--nmorph-focus-text-color)}.nmorph-switch input{width:100%;height:var(--height);opacity:0}.nmorph-switch .nmorph-switch-thumb{position:absolute;top:var(--offset);left:var(--offset);display:flex;justify-content:center;align-items:center;width:var(--thumb-height);height:var(--thumb-height);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);transition:left ease-in-out var(--transition-02)}.nmorph-switch.nmorph-switch--disabled{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--disabled .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--on .nmorph-switch__content{background:var(--nmorph-accent-color);box-shadow:none}.nmorph-switch.nmorph-switch--on .nmorph-switch-thumb{left:calc(100% - 16px);box-shadow:none}.nmorph-switch.nmorph-switch--loading{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--loading .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-switch.nmorph-switch--focus .nmorph-switch__content{scale:.95}
1
+ .nmorph-switch{--width: 40px;--height: 20px;--offset: 3px;--thumb-height: 14px;width:var(--width);height:var(--height);overflow:hidden;border-radius:var(--border-radius-999);cursor:pointer}.nmorph-switch .nmorph-switch__content{position:relative;height:100%;font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-switch .nmorph-switch__bg-content{position:absolute;top:0;left:0;display:flex;justify-content:flex-end;align-items:center;width:100%;height:100%;padding:8px}.nmorph-switch .nmorph-switch__bg-content.nmorph-switch__bg-content--enable{justify-content:flex-start;color:var(--nmorph-focus-text-color)}.nmorph-switch input{width:100%;height:var(--height);opacity:0}.nmorph-switch .nmorph-switch-thumb{position:absolute;top:var(--offset);left:var(--offset);display:flex;justify-content:center;align-items:center;width:var(--thumb-height);height:var(--thumb-height);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);transition:left ease-in-out var(--transition-02)}.nmorph-switch.nmorph-switch--disabled{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--disabled .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--on .nmorph-switch__content{background:var(--nmorph-accent-color);box-shadow:none}.nmorph-switch.nmorph-switch--on .nmorph-switch-thumb{left:calc(100% - var(--thumb-height) - var(--offset));box-shadow:none}.nmorph-switch.nmorph-switch--loading{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--loading .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-switch.nmorph-switch--focus .nmorph-switch__content{scale:.95}