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

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/CHANGELOG.md ADDED
@@ -0,0 +1,243 @@
1
+ ## 2.0.0-rc.8 (21-03-2025)
2
+
3
+ ### Added
4
+
5
+ * `Radio` and `Checkbox` `modelValue` now allows `Number` and `Object` type
6
+ * `wrapperClass` prop to `DataTable` component
7
+ * Introduced `--rvc-table-wrapper-border-radius` variable for `DataTable` component
8
+ * `Radio`: background color is now customizable with `--rvc-radio-bg-color` CSS variable
9
+ * `Checkbox`: background color is now customizable with `--rvc-checkbox-input-bg-color` CSS variable
10
+ * `Drawer`: Added `drawer:opened` event that triggers after drawer open transition is finished
11
+
12
+ ### Changed
13
+
14
+ * `Toast`: `open` prop is now `show`
15
+ * `DataTable`: `items` slot is renamed to `item` and added a parent `items` slot to customize the whole row
16
+ * `DataTable`: `headers` slot is renamed to `header` and added a parent `headers` slot to customize the whole row
17
+
18
+ ### Updated
19
+
20
+ * Upgraded to **Tailwind v4.0.0** 🚀
21
+ * Customize RVC components with CSS variables
22
+ * Improved `Drawer` and `Modal` slots: Added `title` and `close` slots
23
+ * `FormSelect`: `modelValue` now allows `Boolean` type
24
+ * Improved zIndex order for Dialogs and Toast
25
+
26
+ ### Deprecated
27
+
28
+ * ⚠️ **Nuxt 3** module support. You can manually integrate the components into your Nuxt 3 project now.
29
+
30
+ ## 1.3.2 (24-01-2025)
31
+
32
+ ### Updated
33
+
34
+ * Fixed `FormInput` modelValue type to allow `Number` type
35
+
36
+ ## 1.3.1 (17-01-2025)
37
+
38
+ ### Added
39
+
40
+ * Introduced `peerDependenciesMeta` to the `package.json` file to prevent installation issues
41
+
42
+ ## 1.3.0 (16-01-2025)
43
+
44
+ ### Added
45
+
46
+ * `RichTextEditor` component
47
+ * `--rvc-base-input-font-weight` to inputs
48
+ * `Tooltip` `size` prop. `sm` is now supported
49
+ * Added a `fullWidth` prop to the `Dropdown` Component
50
+
51
+ ### Changed
52
+
53
+ * `@floating-ui/vue`, `@headlessui/vue`, and `vue` are now peer dependencies
54
+
55
+ ### Updated
56
+
57
+ * This library only supports ES format builds now
58
+
59
+ ## 1.2.10 (13-01-2025)
60
+
61
+ ### Updated
62
+
63
+ * Fixed `Combobox` `searchOnly`: prevent firing the request if no value is present
64
+ * Respect the `Combobox` `minLength` prop
65
+ * Combobox `onSearch` params order: `searchValue` first, `params` second and last `endpoint`
66
+
67
+ ## 1.2.9 (10-01-2025)
68
+
69
+ ### Changed
70
+
71
+ * For `Combobox`, `FormInput`, `FormSelect` renamed `iconLeft` prop to `prefixIcon`
72
+
73
+ ## 1.2.8 (10-01-2025)
74
+
75
+ ### Added
76
+
77
+ * `FormTextarea` component
78
+ * `Combobox` component
79
+ * `rvc-radio` to Tailwind safelist
80
+
81
+ ### Updated
82
+
83
+ * `Drawer` fixed docs slots section
84
+
85
+ ## 1.2.7 (08-01-2025)
86
+
87
+ ### Added
88
+
89
+ * `FormInput` component
90
+
91
+ ### Changed
92
+
93
+ * Renamed `--rvc-input-*` CSS variables to `--rvc-base-input-*`
94
+
95
+ ## 1.2.6 (07-01-2025)
96
+
97
+ ### Updated
98
+
99
+ * Bugfix for nesting in tabs.js, empty-state.js and dropdown.js
100
+ * Refactor `Dropdown` component
101
+ * Added the icon-left prop to the `FormSelect` component
102
+
103
+ ## 1.2.5 (06-01-2025)
104
+
105
+ ### Added
106
+
107
+ * `Dropdown` component
108
+ * `EmptyState` component
109
+ * `Toast` component
110
+ * `Pagination` component
111
+ * `Tabs` component
112
+
113
+ ## 1.2.4 (21-12-2024)
114
+
115
+ ### Added
116
+
117
+ * Bind `header` data to `DataTable` `<th>` element
118
+ * `FormSelect` component
119
+ * `Checkbox`: introduced `rootClass` prop
120
+ * Do not map `id` from `DataTable` component items
121
+
122
+ ### Updated
123
+
124
+ * Improved `DataTable` `headers` prop validators
125
+ * `Checkbox`: `id` prop is not required anymore
126
+
127
+ ## 1.2.3 (18-12-2024)
128
+
129
+ ### Added
130
+
131
+ * Global CSS variables and Tailwind config. See the [docs](https://robuust.github.io/vue-components/base/) for more information.
132
+
133
+ ## 1.2.2 (17-12-2024)
134
+
135
+ ### Added
136
+
137
+ * Added `loading` prop to Modal footer slot
138
+
139
+ ## 1.2.1 (12-12-2024)
140
+
141
+ ### Added
142
+
143
+ * `Modal` component
144
+ * `Tooltip` component
145
+ * `Accordion` component
146
+ * `@drawer:closed` event to `Drawer` component
147
+ * `@modal:closed` event to `Modal` component
148
+ * `Checkbox` component
149
+ * `Radio` component
150
+ * `Lightswitch` component
151
+ * Added crucial safelisting for component library
152
+
153
+ ### Updated
154
+
155
+ * Improved customizability for all components
156
+
157
+ ## 1.2.0 (11-12-2024)
158
+
159
+ ### Added
160
+
161
+ * Introduced CSS variables for component customization
162
+ * `Modal` component
163
+ * `Tooltip` component
164
+ * `Accordion` component
165
+ * `Checkbox` component
166
+ * `Lightswitch` component
167
+ * `DataTable` component
168
+ * `@drawer:closed` event to `Drawer` component
169
+ * `@modal:closed` event to `Modal` component
170
+ * Added hover color for the `Alert` component
171
+
172
+ ### Changed
173
+
174
+ * `rvc-` prefix for all components
175
+ * Changed the colors of the `Badge` component
176
+ * `fontSize` `base` to 15px and `sm` to 13px
177
+ * `xs` and `lg` from `size` prop in `Badge` component
178
+ * `ButtonBase` default color variants
179
+
180
+ ## 1.1.1 (27-11-2024)
181
+
182
+ ### Added
183
+
184
+ * `Alert` component
185
+ * `iconOnly` prop to `ButtonBase` component for icon-only button variant
186
+ * a11y attributes to `ButtonBase` component
187
+
188
+ ### Updated
189
+
190
+ * Added slot bindings to `ButtonBase` component:
191
+ * Default slot: Access to `label` prop
192
+ * Icon slot: Access to `icon` prop
193
+ * Spinner slot: Access to `spinning` state
194
+
195
+ ### Deprecated
196
+
197
+ * `xs` and `lg` from `size` prop in `ButtonBase` component
198
+
199
+ ## 1.1.0-rc.0 (25-11-2024)
200
+
201
+ ### Added
202
+
203
+ * `Badge` component
204
+ * `Drawer` component
205
+ * Export component library utilities CSS
206
+ * Library Tailwind `prefix: 'rvc-'` so it doesn't conflict with the consuming application
207
+ * `bindAs` prop to `ButtonBase` component to have more flexible component rendering [#30](https://github.com/robuust/vue-components/issues/30)
208
+
209
+ ### Changed
210
+
211
+ * Removed `@apply` style classes from `./tailwind/components/button` to prevent conflicts with the consuming application. Added native CSS props instead.
212
+
213
+ ### Updated
214
+
215
+ * Added CSS section to docs guide
216
+ * Added docs for `ButtonBase` slots
217
+
218
+ ## 1.0.1-rc.3 (15-11-2024)
219
+
220
+ ### Added
221
+
222
+ * `disabled` and `icon` customizations for `custom` `ButtonBase` component
223
+
224
+ ### Changed
225
+
226
+ * Improved `custom` button Tailwind CSS configuration see [#22](https://github.com/robuust/vue-components/issues/22)
227
+
228
+ ### Deprecated
229
+
230
+ * `hoverBackgroundColor`, `hoverColor`, `styles`, and `hoverStyles` properties for `custom` `ButtonBase` component
231
+
232
+ ## 1.0.1-rc.2 (14-11-2024)
233
+
234
+ ### Changed
235
+
236
+ * `ButtonBase` component improvements
237
+ * Updated docs
238
+
239
+ ## 1.0.1-rc.1 (12-11-2024)
240
+
241
+ ### Added
242
+
243
+ * `ButtonBase` component
@@ -1,25 +1,25 @@
1
- import { ref as g, computed as f, createBlock as B, openBlock as D, unref as t, withCtx as d, createVNode as i, withModifiers as E, createElementVNode as l, normalizeClass as L, renderSlot as c, createCommentVNode as T, createTextVNode as F, toDisplayString as I } from "vue";
1
+ import { ref as g, computed as f, createBlock as B, openBlock as E, unref as t, withCtx as d, createVNode as r, withModifiers as D, createElementVNode as a, normalizeClass as L, renderSlot as c, createCommentVNode as T, createTextVNode as F, toDisplayString as I } from "vue";
2
2
  import { TransitionRoot as N, Dialog as R, TransitionChild as $, DialogPanel as V, DialogTitle as C } from "@headlessui/vue";
3
3
  import { _ as k } from "./ButtonBase-DfkwHIhN.js";
4
4
  import { r as S } from "./XMarkIcon-90mcPzBs.js";
5
- function h(o) {
6
- const v = g(null), r = g(!1), b = f(() => o.as === "form"), p = f(() => `${o.id}-title`), m = f(() => `${o.id}-content`), u = f(() => {
5
+ function q(o) {
6
+ const v = g(null), n = g(!1), b = f(() => o.as === "form"), p = f(() => `${o.id}-title`), m = f(() => `${o.id}-content`), u = f(() => {
7
7
  var s;
8
8
  return (s = v.value) == null ? void 0 : s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
9
9
  });
10
10
  return {
11
11
  contentRef: v,
12
- ready: r,
12
+ ready: n,
13
13
  isForm: b,
14
14
  titleId: p,
15
15
  descriptionId: m,
16
16
  initialFocusElement: u
17
17
  };
18
18
  }
19
- const q = {
19
+ const h = {
20
20
  role: "presentation",
21
21
  class: "rvc-modal-presentation"
22
- }, M = { class: "rvc-modal-container" }, x = { class: "rvc-modal-header" }, z = { class: "rvc-modal-header-inner" }, A = { class: "rvc-modal-close-wrapper" }, P = ["id"], j = { class: "rvc-modal-footer" }, O = {
22
+ }, A = { class: "rvc-modal-container" }, M = { class: "rvc-modal-header" }, x = { class: "rvc-modal-header-inner" }, z = { class: "rvc-modal-close-wrapper" }, P = ["id"], j = { class: "rvc-modal-footer" }, O = {
23
23
  __name: "Modal",
24
24
  props: {
25
25
  as: {
@@ -50,22 +50,22 @@ const q = {
50
50
  },
51
51
  panelClass: {
52
52
  type: String,
53
- default: "sm:max-w-lg"
53
+ default: "rvc-modal-panel-max-width"
54
54
  }
55
55
  },
56
- emits: ["modal:open", "modal:close", "modal:save", "modal:closed"],
56
+ emits: ["modal:open", "modal:opened", "modal:close", "modal:save", "modal:closed"],
57
57
  setup(o, { emit: v }) {
58
- const r = v, b = o, {
58
+ const n = v, b = o, {
59
59
  contentRef: p,
60
60
  ready: m,
61
61
  isForm: u,
62
62
  titleId: s,
63
63
  descriptionId: y,
64
64
  initialFocusElement: w
65
- } = h(b);
66
- return (a, e) => (D(), B(t(N), { as: "template" }, {
65
+ } = q(b);
66
+ return (i, e) => (E(), B(t(N), { as: "template" }, {
67
67
  default: d(() => [
68
- i(t(R), {
68
+ r(t(R), {
69
69
  as: o.as,
70
70
  class: "rvc-modal",
71
71
  static: "",
@@ -73,11 +73,11 @@ const q = {
73
73
  role: "dialog",
74
74
  "initial-focus": t(w),
75
75
  "aria-labelledby": t(s),
76
- onClose: e[6] || (e[6] = (n) => a.$emit("modal:close")),
77
- onSubmit: e[7] || (e[7] = E((n) => r("modal:save", n), ["prevent"]))
76
+ onClose: e[7] || (e[7] = (l) => i.$emit("modal:close")),
77
+ onSubmit: e[8] || (e[8] = D((l) => n("modal:save", l), ["prevent"]))
78
78
  }, {
79
79
  default: d(() => [
80
- i(t($), {
80
+ r(t($), {
81
81
  as: "template",
82
82
  enter: "rvc-modal-backdrop-transition-enter",
83
83
  "enter-from": "rvc-modal-backdrop-transition-enter-from",
@@ -85,19 +85,20 @@ const q = {
85
85
  leave: "rvc-modal-backdrop-transition-leave",
86
86
  "leave-from": "rvc-modal-backdrop-transition-leave-from",
87
87
  "leave-to": "rvc-modal-backdrop-transition-leave-to",
88
- onBeforeEnter: e[0] || (e[0] = (n) => r("modal:open"))
88
+ onBeforeEnter: e[0] || (e[0] = (l) => n("modal:open")),
89
+ onAfterEnter: e[1] || (e[1] = (l) => n("modal:opened"))
89
90
  }, {
90
- default: d(() => e[8] || (e[8] = [
91
- l("div", {
91
+ default: d(() => e[9] || (e[9] = [
92
+ a("div", {
92
93
  "aria-hidden": "true",
93
94
  class: "rvc-modal-backdrop"
94
95
  }, null, -1)
95
96
  ])),
96
97
  _: 1
97
98
  }),
98
- l("div", q, [
99
- l("div", M, [
100
- i(t($), {
99
+ a("div", h, [
100
+ a("div", A, [
101
+ r(t($), {
101
102
  as: "template",
102
103
  enter: "rvc-modal-transition-enter",
103
104
  "enter-from": "rvc-modal-transition-enter-from",
@@ -105,25 +106,25 @@ const q = {
105
106
  leave: "rvc-modal-transition-leave",
106
107
  "leave-from": "rvc-modal-transition-leave-from",
107
108
  "leave-to": "rvc-modal-transition-leave-to",
108
- onBeforeEnter: e[4] || (e[4] = (n) => m.value = !0),
109
- onAfterLeave: e[5] || (e[5] = (n) => (m.value = !1, r("modal:closed")))
109
+ onBeforeEnter: e[5] || (e[5] = (l) => m.value = !0),
110
+ onAfterLeave: e[6] || (e[6] = (l) => (m.value = !1, n("modal:closed")))
110
111
  }, {
111
112
  default: d(() => [
112
- i(t(V), {
113
+ r(t(V), {
113
114
  class: L(["rvc-modal-panel", o.panelClass]),
114
115
  "aria-busy": o.spinning,
115
116
  "aria-describedby": t(y)
116
117
  }, {
117
118
  default: d(() => [
118
- l("header", x, [
119
- c(a.$slots, "header", { title: o.title }, () => [
120
- l("div", z, [
121
- c(a.$slots, "title", {
119
+ a("header", M, [
120
+ c(i.$slots, "header", { title: o.title }, () => [
121
+ a("div", x, [
122
+ c(i.$slots, "title", {
122
123
  id: t(s),
123
124
  dialogTitle: t(C),
124
125
  title: o.title
125
126
  }, () => [
126
- i(t(C), {
127
+ r(t(C), {
127
128
  id: t(s),
128
129
  class: "rvc-modal-title"
129
130
  }, {
@@ -133,47 +134,47 @@ const q = {
133
134
  _: 1
134
135
  }, 8, ["id"])
135
136
  ]),
136
- o.showClose ? c(a.$slots, "close", {
137
+ o.showClose ? c(i.$slots, "close", {
137
138
  key: 0,
138
139
  icon: t(S),
139
- emitClose: () => r("drawer:close")
140
+ emitClose: () => n("drawer:close")
140
141
  }, () => [
141
- l("div", A, [
142
- l("button", {
142
+ a("div", z, [
143
+ a("button", {
143
144
  type: "button",
144
145
  class: "rvc-modal-close",
145
146
  "aria-label": "Close panel",
146
- onClick: e[1] || (e[1] = (n) => r("modal:close"))
147
+ onClick: e[2] || (e[2] = (l) => n("modal:close"))
147
148
  }, [
148
- i(t(S), { "aria-hidden": "true" })
149
+ r(t(S), { "aria-hidden": "true" })
149
150
  ])
150
151
  ])
151
152
  ]) : T("", !0)
152
153
  ])
153
154
  ])
154
155
  ]),
155
- l("div", {
156
+ a("div", {
156
157
  id: t(y),
157
158
  ref_key: "contentRef",
158
159
  ref: p,
159
160
  class: "rvc-modal-content"
160
161
  }, [
161
- c(a.$slots, "default", { ready: t(m) })
162
+ c(i.$slots, "default", { ready: t(m) })
162
163
  ], 8, P),
163
- l("footer", j, [
164
- c(a.$slots, "footer", { loading: o.spinning }, () => [
165
- i(k, {
164
+ a("footer", j, [
165
+ c(i.$slots, "footer", { loading: o.spinning }, () => [
166
+ r(k, {
166
167
  type: t(u) ? "submit" : "button",
167
168
  label: o.submitLabel,
168
169
  spinning: o.spinning,
169
170
  disabled: o.spinning,
170
- onClick: e[2] || (e[2] = (n) => !t(u) && a.$emit("modal:save"))
171
+ onClick: e[3] || (e[3] = (l) => !t(u) && i.$emit("modal:save"))
171
172
  }, null, 8, ["type", "label", "spinning", "disabled"]),
172
- i(k, {
173
+ r(k, {
173
174
  type: "button",
174
175
  color: "light",
175
176
  label: o.cancelLabel,
176
- onClick: e[3] || (e[3] = (n) => a.$emit("modal:close"))
177
+ onClick: e[4] || (e[4] = (l) => i.$emit("modal:close"))
177
178
  }, null, 8, ["label"])
178
179
  ])
179
180
  ])
@@ -195,5 +196,5 @@ const q = {
195
196
  };
196
197
  export {
197
198
  O as _,
198
- h as u
199
+ q as u
199
200
  };
@@ -7,6 +7,8 @@
7
7
  --rvc-combobox-box-shadow: var(--rvc-base-box-shadow);
8
8
  --rvc-combobox-color: var(--rvc-base-input-color);
9
9
  --rvc-combobox-bg-color: var(--rvc-base-input-bg-color);
10
+ --rvc-combobox-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
11
+ --rvc-combobox-disabled-opacity: var(--rvc-base-input-disabled-opacity);
10
12
  --rvc-combobox-padding-x: var(--rvc-base-input-padding-x);
11
13
  --rvc-combobox-height: var(--rvc-base-input-height);
12
14
  --rvc-combobox-icon-size: var(--rvc-base-input-icon-size);
@@ -49,6 +51,11 @@
49
51
  .rvc-combobox-wrapper {
50
52
  display: flex;
51
53
  column-gap: calc(var(--spacing) * 1);
54
+
55
+ &:has(:disabled) {
56
+ opacity: var(--rvc-combobox-disabled-opacity);
57
+ pointer-events: none;
58
+ }
52
59
  }
53
60
 
54
61
  .rvc-combobox-field {
@@ -96,6 +103,10 @@
96
103
  &::placeholder {
97
104
  color: var(--rvc-combobox-placeholder-color);
98
105
  }
106
+
107
+ &:disabled {
108
+ background-color: var(--rvc-combobox-bg-color-disabled);
109
+ }
99
110
  }
100
111
 
101
112
  .rvc-combobox-button, .rvc-combobox-field > svg {
@@ -6,6 +6,9 @@
6
6
  --rvc-checkbox-font-size: var(--text-base);
7
7
  --rvc-checkbox-font-weight: var(--font-weight-medium);
8
8
  --rvc-checkbox-color: var(--color-slate-950);
9
+ --rvc-checkbox-input-bg-color: var(--rvc-base-input-bg-color);
10
+ --rvc-checkbox-input-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
11
+ --rvc-checkbox-input-disabled-opacity: var(--rvc-base-input-disabled-opacity);
9
12
  --rvc-checkbox-input-size: calc(var(--spacing) * 4);
10
13
  --rvc-checkbox-input-border-radius: var(--radius-sm);
11
14
  --rvc-checkbox-input-border-width: 1px;
@@ -39,6 +42,7 @@
39
42
  border-width: var(--rvc-checkbox-input-border-width);
40
43
  border-radius: var(--rvc-checkbox-input-border-radius);
41
44
  border-color: var(--rvc-checkbox-input-border-color);
45
+ background-color: var(--rvc-checkbox-input-bg-color);
42
46
  box-shadow: var(--rvc-checkbox-input-box-shadow);
43
47
 
44
48
  svg {
@@ -48,6 +52,17 @@
48
52
  }
49
53
  }
50
54
 
55
+ input {
56
+ position: absolute;
57
+ opacity: 0;
58
+ inset: 0;
59
+ cursor: pointer;
60
+
61
+ &:disabled {
62
+ cursor: default;
63
+ }
64
+ }
65
+
51
66
  input:checked + .rvc-checkbox-input {
52
67
  border-color: var(--rvc-checkbox-input-checked-border-color);
53
68
  background-color: var(--rvc-checkbox-input-checked-bg-color);
@@ -57,6 +72,12 @@
57
72
  }
58
73
  }
59
74
 
75
+ input:disabled + .rvc-checkbox-input {
76
+ opacity: var(--rvc-checkbox-input-disabled-opacity);
77
+ background-color: var(--rvc-checkbox-input-bg-color-disabled);
78
+ cursor: default;
79
+ }
80
+
60
81
  input:focus + .rvc-checkbox-input {
61
82
  @apply rvc-focus;
62
83
  }