@robuust-digital/vue-components 2.0.0-rc.6 → 2.0.0-rc.7

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.
@@ -7,6 +7,8 @@
7
7
  --rvc-input-box-shadow: var(--rvc-base-box-shadow);
8
8
  --rvc-input-color: var(--rvc-base-input-color);
9
9
  --rvc-input-bg-color: var(--rvc-base-input-bg-color);
10
+ --rvc-input-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
11
+ --rvc-input-disabled-opacity: var(--rvc-base-input-disabled-opacity);
10
12
  --rvc-input-icon-size: var(--rvc-base-input-icon-size);
11
13
  --rvc-input-icon-color: var(--rvc-base-input-icon-color);
12
14
  --rvc-input-padding-x: var(--rvc-base-input-padding-x);
@@ -51,12 +53,20 @@
51
53
  &::placeholder {
52
54
  color: var(--rvc-input-placeholder-color);
53
55
  }
56
+
57
+ &:disabled {
58
+ background-color: var(--rvc-input-bg-color-disabled);
59
+ }
54
60
  }
55
61
 
56
62
  &:has(svg:last-child) input {
57
63
  padding-right: calc(var(--rvc-input-padding-x) + var(--rvc-input-icon-size) + 0.25rem);
58
64
  }
59
65
 
66
+ &:has(:disabled) {
67
+ opacity: var(--rvc-input-disabled-opacity);
68
+ }
69
+
60
70
  .rvc-input-prefix, svg {
61
71
  position: relative;
62
72
  z-index: 1;
@@ -5,6 +5,9 @@
5
5
  --rvc-radio-font-size: var(--text-base);
6
6
  --rvc-radio-font-weight: var(--font-weight-medium);
7
7
  --rvc-radio-color: var(--color-slate-950);
8
+ --rvc-radio-input-bg-color: var(--rvc-base-input-bg-color);
9
+ --rvc-radio-input-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
10
+ --rvc-radio-input-disabled-opacity: var(--rvc-base-input-disabled-opacity);
8
11
  --rvc-radio-input-size: calc(var(--spacing) * 4);
9
12
  --rvc-radio-input-border-radius: calc(infinity * 1px);
10
13
  --rvc-radio-input-border-width: 1px;
@@ -37,6 +40,7 @@
37
40
  border-width: var(--rvc-radio-input-border-width);
38
41
  border-radius: var(--rvc-radio-input-border-radius);
39
42
  border-color: var(--rvc-radio-input-border-color);
43
+ background-color: var(--rvc-radio-input-bg-color);
40
44
  box-shadow: var(--rvc-radio-input-box-shadow);
41
45
 
42
46
  &::before {
@@ -49,6 +53,17 @@
49
53
  }
50
54
  }
51
55
 
56
+ input {
57
+ position: absolute;
58
+ opacity: 0;
59
+ inset: 0;
60
+ cursor: pointer;
61
+
62
+ &:disabled {
63
+ cursor: default;
64
+ }
65
+ }
66
+
52
67
  input:checked + .rvc-radio-input {
53
68
  border-color: var(--rvc-radio-input-checked-border-color);
54
69
  background-color: var(--rvc-radio-input-checked-bg-color);
@@ -58,6 +73,12 @@
58
73
  }
59
74
  }
60
75
 
76
+ input:disabled + .rvc-radio-input {
77
+ opacity: var(--rvc-radio-input-disabled-opacity);
78
+ background-color: var(--rvc-radio-input-bg-color-disabled);
79
+ cursor: default;
80
+ }
81
+
61
82
  input:focus + .rvc-radio-input {
62
83
  @apply rvc-focus;
63
84
  }
@@ -7,6 +7,8 @@
7
7
  --rvc-select-box-shadow: var(--rvc-base-box-shadow);
8
8
  --rvc-select-color: var(--rvc-base-input-color);
9
9
  --rvc-select-bg-color: var(--rvc-base-input-bg-color);
10
+ --rvc-select-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
11
+ --rvc-select-disabled-opacity: var(--rvc-base-input-disabled-opacity);
10
12
  --rvc-select-icon-size: var(--rvc-base-input-icon-size);
11
13
  --rvc-select-icon-color: var(--rvc-base-input-icon-color);
12
14
  --rvc-select-padding-x: var(--rvc-base-input-padding-x);
@@ -47,6 +49,14 @@
47
49
  &:nth-child(2) {
48
50
  padding-left: calc(var(--rvc-select-padding-x) + var(--rvc-select-icon-size) + 0.25rem);
49
51
  }
52
+
53
+ &:disabled {
54
+ background-color: var(--rvc-select-bg-color-disabled);
55
+ }
56
+ }
57
+
58
+ &:has(:disabled) {
59
+ opacity: var(--rvc-select-disabled-opacity);
50
60
  }
51
61
 
52
62
  svg {
@@ -36,6 +36,8 @@
36
36
  /* Input Variables */
37
37
  --rvc-base-input-color: var(--color-slate-600);
38
38
  --rvc-base-input-bg-color: var(--color-white);
39
+ --rvc-base-input-bg-color-disabled: var(--color-slate-100);
40
+ --rvc-base-input-disabled-opacity: 0.7;
39
41
  --rvc-base-input-icon-color: var(--color-slate-400);
40
42
  --rvc-base-input-icon-size: calc(var(--spacing) * 5);
41
43
  --rvc-base-input-padding-x: calc(var(--spacing) * 3);
@@ -7,6 +7,8 @@
7
7
  --rvc-textarea-box-shadow: var(--rvc-base-box-shadow);
8
8
  --rvc-textarea-color: var(--rvc-base-input-color);
9
9
  --rvc-textarea-bg-color: var(--rvc-base-input-bg-color);
10
+ --rvc-textarea-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
11
+ --rvc-textarea-disabled-opacity: var(--rvc-base-input-disabled-opacity);
10
12
  --rvc-textarea-padding-x: var(--rvc-base-input-padding-x);
11
13
  --rvc-textarea-padding-y: calc(var(--spacing) * 1.5);
12
14
  --rvc-textarea-height: var(--rvc-base-input-height);
@@ -38,6 +40,11 @@
38
40
  font-weight: var(--rvc-textarea-font-weight);
39
41
  appearance: none;
40
42
 
43
+ &:disabled {
44
+ opacity: var(--rvc-textarea-disabled-opacity);
45
+ background-color: var(--rvc-textarea-bg-color-disabled);
46
+ }
47
+
41
48
  &.rvc-textarea-sm {
42
49
  --rvc-textarea-font-size: var(--rvc-textarea-font-size-sm);
43
50
  --rvc-textarea-padding-x: var(--rvc-textarea-padding-x-sm);
@@ -25,7 +25,7 @@
25
25
  @layer components {
26
26
  .rvc-drawer {
27
27
  position: relative;
28
- z-index: 500;
28
+ z-index: 997;
29
29
 
30
30
  .rvc-drawer-backdrop {
31
31
  position: fixed;
@@ -1,8 +1,8 @@
1
1
  import { createBlock as f, openBlock as m, unref as e, withCtx as s, createVNode as i, withModifiers as B, createElementVNode as a, normalizeClass as w, renderSlot as d, createCommentVNode as b, createTextVNode as L, toDisplayString as T } from "vue";
2
2
  import { TransitionRoot as E, Dialog as N, TransitionChild as p, DialogPanel as V, DialogTitle as y } from "@headlessui/vue";
3
3
  import { _ as g } from "../_shared/ButtonBase-DfkwHIhN.js";
4
- import { u as R } from "../_shared/Modal-BXOR8t7c.js";
5
- import { _ as W } from "../_shared/Modal-BXOR8t7c.js";
4
+ import { u as R } from "../_shared/Modal-BztsrTZC.js";
5
+ import { _ as W } from "../_shared/Modal-BztsrTZC.js";
6
6
  import { r as k } from "../_shared/XMarkIcon-90mcPzBs.js";
7
7
  const q = {
8
8
  class: "rvc-drawer-presentation",
@@ -26,7 +26,7 @@
26
26
  @layer components {
27
27
  .rvc-modal {
28
28
  position: relative;
29
- z-index: 600;
29
+ z-index: 998;
30
30
 
31
31
  .rvc-modal-backdrop {
32
32
  position: fixed;
@@ -72,6 +72,12 @@
72
72
  border-color: var(--rvc-modal-border-color);
73
73
  box-shadow: var(--rvc-modal-box-shadow);
74
74
  text-align: left;
75
+
76
+ &.rvc-modal-panel-max-width {
77
+ @media (width >= theme(--breakpoint-sm)) {
78
+ max-width: 32rem;
79
+ }
80
+ }
75
81
  }
76
82
 
77
83
  .rvc-modal-header {
@@ -8,6 +8,8 @@
8
8
  --rvc-lightswitch-width: 3.125rem;
9
9
  --rvc-lightswitch-bg-color: var(--color-slate-200);
10
10
  --rvc-lightswitch-bg-color-enabled: var(--color-green-400);
11
+ --rvc-lightswitch-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
12
+ --rvc-lightswitch-disabled-opacity: var(--rvc-base-input-disabled-opacity);
11
13
  --rvc-lightswitch-transition-property: colors;
12
14
  --rvc-lightswitch-label-offset: 0.5rem;
13
15
  --rvc-lightswitch-toggle-offset: 0.1875rem;
@@ -25,6 +27,15 @@
25
27
  align-items: center;
26
28
  }
27
29
 
30
+ &:has(:disabled) .rvc-lightswitch {
31
+ opacity: var(--rvc-lightswitch-disabled-opacity);
32
+ cursor: default;
33
+
34
+ .rvc-lightswitch-toggle {
35
+ background-color: var(--rvc-lightswitch-bg-color-disabled);
36
+ }
37
+ }
38
+
28
39
  label {
29
40
  padding-left: var(--rvc-lightswitch-label-offset);
30
41
  cursor: pointer;
@@ -1,11 +1,11 @@
1
- import { createElementBlock as r, openBlock as s, createElementVNode as n, ref as p, useAttrs as H, computed as x, watch as L, Fragment as A, createVNode as v, renderSlot as C, withCtx as _, normalizeClass as M, createCommentVNode as $, unref as f, renderList as B, createBlock as E, resolveDynamicComponent as S } from "vue";
1
+ import { createElementBlock as r, openBlock as s, createElementVNode as n, ref as p, useAttrs as H, computed as x, watch as L, Fragment as A, createVNode as v, renderSlot as C, withCtx as M, normalizeClass as _, createCommentVNode as $, unref as f, renderList as B, createBlock as E, resolveDynamicComponent as S } from "vue";
2
2
  import { useEditor as O, EditorContent as T } from "@tiptap/vue-3";
3
3
  import N from "@tiptap/extension-link";
4
4
  import U from "@tiptap/starter-kit";
5
5
  import { _ as q } from "../_shared/Tooltip-B93ZF7IF.js";
6
6
  import { _ as z } from "../_shared/FormInput-abFMz_J4.js";
7
- import { _ as D } from "../_shared/Modal-BXOR8t7c.js";
8
- function I(a, c) {
7
+ import { _ as D } from "../_shared/Modal-BztsrTZC.js";
8
+ function I(i, d) {
9
9
  return s(), r("svg", {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  viewBox: "0 0 16 16",
@@ -20,7 +20,7 @@ function I(a, c) {
20
20
  })
21
21
  ]);
22
22
  }
23
- function R(a, c) {
23
+ function R(i, d) {
24
24
  return s(), r("svg", {
25
25
  xmlns: "http://www.w3.org/2000/svg",
26
26
  viewBox: "0 0 16 16",
@@ -35,7 +35,7 @@ function R(a, c) {
35
35
  })
36
36
  ]);
37
37
  }
38
- function j(a, c) {
38
+ function j(i, d) {
39
39
  return s(), r("svg", {
40
40
  xmlns: "http://www.w3.org/2000/svg",
41
41
  viewBox: "0 0 16 16",
@@ -55,7 +55,7 @@ function j(a, c) {
55
55
  })
56
56
  ]);
57
57
  }
58
- function F(a, c) {
58
+ function F(i, d) {
59
59
  return s(), r("svg", {
60
60
  xmlns: "http://www.w3.org/2000/svg",
61
61
  viewBox: "0 0 16 16",
@@ -66,7 +66,7 @@ function F(a, c) {
66
66
  n("path", { d: "M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" })
67
67
  ]);
68
68
  }
69
- function K(a, c) {
69
+ function K(i, d) {
70
70
  return s(), r("svg", {
71
71
  xmlns: "http://www.w3.org/2000/svg",
72
72
  viewBox: "0 0 16 16",
@@ -95,7 +95,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
95
95
  config: {
96
96
  type: String,
97
97
  default: "default",
98
- validator: (a) => ["default", "simple"].includes(a)
98
+ validator: (i) => ["default", "simple"].includes(i)
99
99
  },
100
100
  customExtensions: {
101
101
  type: Array,
@@ -104,22 +104,25 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
104
104
  customCommands: {
105
105
  type: Array,
106
106
  default: () => []
107
+ },
108
+ disabled: {
109
+ type: Boolean
107
110
  }
108
111
  },
109
112
  emits: ["update:modelValue", "tiptap:onCreate"],
110
- setup(a, { emit: c }) {
111
- const i = a, h = c, g = p(!1), u = p(!1), d = p(""), m = H(), k = m.class ? `${m.class} ` : "", V = [
113
+ setup(i, { emit: d }) {
114
+ const a = i, h = d, b = p(!1), u = p(!1), c = p(""), m = H(), k = m.class ? `${m.class} ` : "", y = [
112
115
  U,
113
116
  N.configure({
114
117
  openOnClick: !1
115
118
  })
116
119
  ], t = O({
117
- extensions: [...V, ...i.customExtensions],
118
- content: i.modelValue,
120
+ extensions: [...y, ...a.customExtensions],
121
+ content: a.modelValue,
119
122
  editorProps: {
120
123
  attributes: {
121
124
  ...m,
122
- id: i.id,
125
+ id: a.id,
123
126
  class: `${k}rvc-textarea rvc-rich-text-textarea`
124
127
  }
125
128
  },
@@ -131,9 +134,9 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
131
134
  h("update:modelValue", o);
132
135
  },
133
136
  onSelectionUpdate({ editor: l }) {
134
- g.value = !l.view.state.selection.empty;
137
+ b.value = !l.view.state.selection.empty;
135
138
  }
136
- }), y = x(() => [
139
+ }), V = x(() => [
137
140
  {
138
141
  name: "bold",
139
142
  icon: I,
@@ -154,7 +157,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
154
157
  name: "bulletList",
155
158
  icon: F,
156
159
  title: "Bullet List",
157
- isVisible: i.config === "default",
160
+ isVisible: a.config === "default",
158
161
  isActive: () => t.value.isActive("bulletList"),
159
162
  action: () => t.value.commands.toggleBulletList()
160
163
  },
@@ -162,7 +165,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
162
165
  name: "orderedList",
163
166
  icon: K,
164
167
  title: "Ordered List",
165
- isVisible: i.config === "default",
168
+ isVisible: a.config === "default",
166
169
  isActive: () => t.value.isActive("orderedList"),
167
170
  action: () => t.value.commands.toggleOrderedList()
168
171
  },
@@ -170,15 +173,15 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
170
173
  name: "link",
171
174
  icon: j,
172
175
  title: "Hyperlink",
173
- isVisible: i.config === "default",
174
- disabled: !g.value && !t.value.isActive("link"),
176
+ isVisible: a.config === "default",
177
+ disabled: !b.value && !t.value.isActive("link"),
175
178
  isActive: () => t.value.isActive("link"),
176
179
  action: () => {
177
- d.value = t.value.getAttributes("link").href, u.value = !0;
180
+ c.value = t.value.getAttributes("link").href, u.value = !0;
178
181
  }
179
182
  }
180
- ]), b = x(() => {
181
- const l = y.value.filter((e) => i.config === "default" || ["bold", "italic"].includes(e.name)), o = i.customCommands.map((e) => ({
183
+ ]), g = x(() => {
184
+ const l = V.value.filter((e) => a.config === "default" || ["bold", "italic"].includes(e.name)), o = a.customCommands.map((e) => ({
182
185
  ...e,
183
186
  isVisible: e.isVisible ?? !0,
184
187
  disabled: typeof e.disabled == "function" ? e.disabled(t.value) : e.disabled ?? !1,
@@ -190,25 +193,25 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
190
193
  }));
191
194
  return [...l, ...o];
192
195
  });
193
- L(() => i.modelValue, (l) => {
196
+ L(() => a.modelValue, (l) => {
194
197
  t.value.getHTML() === l || t.value.commands.setContent(l, !1);
195
198
  });
196
199
  const Z = () => {
197
- t.value.commands.setLink({ href: d.value }), u.value = !1, d.value = null;
200
+ t.value.commands.setLink({ href: c.value }), u.value = !1, c.value = null;
198
201
  };
199
202
  return (l, o) => (s(), r(A, null, [
200
203
  v(D, {
201
- id: `${i.id}-modal-add-hyperlink`,
204
+ id: `${a.id}-modal-add-hyperlink`,
202
205
  title: "Add Hyperlink",
203
206
  as: "form",
204
207
  show: u.value,
205
208
  "onModal:close": o[1] || (o[1] = (e) => u.value = !1),
206
209
  "onModal:save": Z
207
210
  }, {
208
- default: _(() => [
211
+ default: M(() => [
209
212
  v(z, {
210
- modelValue: d.value,
211
- "onUpdate:modelValue": o[0] || (o[0] = (e) => d.value = e),
213
+ modelValue: c.value,
214
+ "onUpdate:modelValue": o[0] || (o[0] = (e) => c.value = e),
212
215
  placeholder: "https://www.example.com",
213
216
  type: "url",
214
217
  required: ""
@@ -218,15 +221,15 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
218
221
  }, 8, ["id", "show"]),
219
222
  C(l.$slots, "default"),
220
223
  n("div", {
221
- class: M(["rvc-rich-text", a.rootClass])
224
+ class: _(["rvc-rich-text", i.rootClass, { "rvc-rich-text-disabled": i.disabled }])
222
225
  }, [
223
226
  f(t) ? C(l.$slots, "toolbar", {
224
227
  key: 0,
225
- commands: b.value,
228
+ commands: g.value,
226
229
  tiptap: f(t)
227
230
  }, () => [
228
231
  n("ul", P, [
229
- (s(!0), r(A, null, B(b.value.filter((e) => e.isVisible), (e) => (s(), r("li", {
232
+ (s(!0), r(A, null, B(g.value.filter((e) => e.isVisible), (e) => (s(), r("li", {
230
233
  key: `toolbar-item-command-${e.name}`
231
234
  }, [
232
235
  v(q, {
@@ -235,12 +238,12 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
235
238
  size: "sm",
236
239
  class: "rvc-rich-text-tooltip"
237
240
  }, {
238
- default: _(() => [
241
+ default: M(() => [
239
242
  n("button", {
240
243
  disabled: e.disabled,
241
244
  type: "button",
242
245
  "aria-label": e.title,
243
- class: M([{ "rvc-rich-text-button-active": e.isActive() }, "rvc-rich-text-button"]),
246
+ class: _([{ "rvc-rich-text-button-active": e.isActive() }, "rvc-rich-text-button"]),
244
247
  onClick: e.action
245
248
  }, [
246
249
  (s(), E(S(e.icon)))
@@ -46,6 +46,19 @@
46
46
  }
47
47
  }
48
48
 
49
+ &.rvc-rich-text-disabled {
50
+ opacity: var(--rvc-textarea-disabled-opacity);
51
+ pointer-events: none;
52
+
53
+ .rvc-rich-text-button {
54
+ pointer-events: none;
55
+ }
56
+
57
+ .rvc-rich-text-textarea {
58
+ background-color: var(--rvc-textarea-bg-color-disabled);
59
+ }
60
+ }
61
+
49
62
  .rvc-rich-text-toolbar {
50
63
  display: flex;
51
64
  position: absolute;
@@ -61,7 +61,7 @@
61
61
  .rvc-toast {
62
62
  display: flex;
63
63
  position: fixed;
64
- z-index: 99;
64
+ z-index: 999;
65
65
  left: 50%;
66
66
  width: var(--rvc-toast-width);
67
67
  max-width: var(--rvc-toast-max-width);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robuust-digital/vue-components",
3
- "version": "2.0.0-rc.6",
3
+ "version": "2.0.0-rc.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,7 +19,8 @@
19
19
  "files": [
20
20
  "dist",
21
21
  "LICENSE",
22
- "README.md"
22
+ "README.md",
23
+ "CHANGELOG.md"
23
24
  ],
24
25
  "main": "./dist/core/index.js",
25
26
  "module": "./dist/core/index.js",