@ulu/frontend-vue 0.2.0-beta.6 → 0.2.0-beta.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.
@@ -93,7 +93,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
93
93
  */
94
94
  classes: {
95
95
  type: ObjectConstructor;
96
- default: () => {};
96
+ default: () => {
97
+ close: string;
98
+ };
97
99
  };
98
100
  /**
99
101
  * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
@@ -216,7 +218,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
216
218
  */
217
219
  classes: {
218
220
  type: ObjectConstructor;
219
- default: () => {};
221
+ default: () => {
222
+ close: string;
223
+ };
220
224
  };
221
225
  /**
222
226
  * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
@@ -1 +1 @@
1
- {"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"AA+DA;;IA2YM;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;IAKH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;IAlGH;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;IAKH;;OAEG"}
1
+ {"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"AAqEA;;IAmZM;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;;;IAOH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;IApGH;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;;;IAOH;;OAEG"}
@@ -1,11 +1,11 @@
1
- import { resolveComponent as v, createBlock as b, openBlock as a, Teleport as S, createElementVNode as d, withModifiers as R, normalizeStyle as _, normalizeClass as c, createElementBlock as z, createCommentVNode as u, renderSlot as h, toDisplayString as I, createVNode as g, useSlots as k, computed as f } from "vue";
1
+ import { resolveComponent as v, createBlock as b, openBlock as d, Teleport as S, createElementVNode as c, withModifiers as R, normalizeStyle as _, normalizeClass as r, createElementBlock as z, createCommentVNode as u, renderSlot as h, toDisplayString as I, createVNode as g, useSlots as k, computed as f } from "vue";
2
2
  import C from "../elements/UluIcon.vue.js";
3
3
  import { useModifiers as w } from "../../composables/useModifiers.js";
4
4
  import { preventScroll as E, wasClickOutside as B } from "@ulu/utils/browser/dom.js";
5
5
  import { Resizer as M } from "@ulu/frontend";
6
6
  import { newId as V } from "../../utils/dom.js";
7
- import p from "../../_virtual/_plugin-vue_export-helper.js";
8
- const T = {
7
+ import T from "../../_virtual/_plugin-vue_export-helper.js";
8
+ const p = {
9
9
  name: "UluModal",
10
10
  components: {
11
11
  UluIcon: C
@@ -107,7 +107,9 @@ const T = {
107
107
  */
108
108
  classes: {
109
109
  type: Object,
110
- default: () => ({})
110
+ default: () => ({
111
+ close: "button button--icon"
112
+ })
111
113
  },
112
114
  /**
113
115
  * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
@@ -124,7 +126,7 @@ const T = {
124
126
  };
125
127
  },
126
128
  setup(e) {
127
- const t = k(), l = f(() => e.title || t.title), o = f(() => {
129
+ const l = k(), t = f(() => e.title || l.title), o = f(() => {
128
130
  const { allowResize: i, position: m } = e;
129
131
  if (!i || !m) return;
130
132
  const y = ["left", "right", "center"];
@@ -133,28 +135,28 @@ const T = {
133
135
  [e.position]: e.position,
134
136
  resize: e.allowResize,
135
137
  "no-resize": !e.allowResize,
136
- "no-header": !l.value,
138
+ "no-header": !t.value,
137
139
  "body-fills": e.bodyFills,
138
140
  "no-backdrop": e.noBackdrop,
139
141
  "no-min-height": e.noMinHeight,
140
142
  "non-modal": e.nonModal,
141
143
  "resizer-active": o.value
142
- })), { resolvedModifiers: r } = w({
144
+ })), { resolvedModifiers: a } = w({
143
145
  props: e,
144
146
  baseClass: "modal",
145
147
  internal: s
146
148
  });
147
149
  return {
148
- resolvedModifiers: r,
149
- hasHeader: l,
150
+ resolvedModifiers: a,
151
+ hasHeader: t,
150
152
  resizerEnabled: o,
151
153
  resizerIconType: n
152
154
  };
153
155
  },
154
156
  computed: {
155
157
  resolvedLabelledby() {
156
- const { labelledby: e, titleId: t } = this;
157
- return e || t;
158
+ const { labelledby: e, titleId: l } = this;
159
+ return e || l;
158
160
  }
159
161
  },
160
162
  watch: {
@@ -163,8 +165,8 @@ const T = {
163
165
  immediate: !0,
164
166
  handler(e) {
165
167
  this.$nextTick(() => {
166
- const { container: t } = this.$refs;
167
- e ? (t[this.nonModal ? "show" : "showModal"](), this.$emit("open")) : t.close();
168
+ const { container: l } = this.$refs;
169
+ e ? (l[this.nonModal ? "show" : "showModal"](), this.$emit("open")) : l.close();
168
170
  });
169
171
  }
170
172
  },
@@ -177,8 +179,8 @@ const T = {
177
179
  }) : this.destroyResizer();
178
180
  }
179
181
  },
180
- position(e, t) {
181
- e !== t && (this.destroyResizer(), this.$nextTick(() => {
182
+ position(e, l) {
183
+ e !== l && (this.destroyResizer(), this.$nextTick(() => {
182
184
  this.setupResizer();
183
185
  }));
184
186
  }
@@ -192,8 +194,8 @@ const T = {
192
194
  },
193
195
  handleClick(e) {
194
196
  if (this.clickOutsideCloses && !this.isResizing) {
195
- const { target: t } = e, { container: l } = this.$refs;
196
- t === l && B(l, e) && this.close();
197
+ const { target: l } = e, { container: t } = this.$refs;
198
+ l === t && B(t, e) && this.close();
197
199
  }
198
200
  },
199
201
  setupPreventScroll() {
@@ -205,21 +207,21 @@ const T = {
205
207
  },
206
208
  handleToggle(e) {
207
209
  if (!this.nonModal && this.preventScroll) {
208
- const { preventScrollShift: t } = this;
209
- e.newState === "open" ? this.restoreScroll = E({ preventShift: t }) : this.destroyPreventScroll();
210
+ const { preventScrollShift: l } = this;
211
+ e.newState === "open" ? this.restoreScroll = E({ preventShift: l }) : this.destroyPreventScroll();
210
212
  }
211
213
  },
212
214
  setupResizer() {
213
- const { position: e, resizerEnabled: t } = this;
214
- if (t) {
215
- const { container: l, resizer: o } = this.$refs, n = e === "center" ? { fromX: "right", fromY: "bottom", multiplier: 2 } : { fromX: e === "right" ? "left" : "right" };
216
- this.resizerInstance = new M(l, o, n), this.handleResizerStart = () => {
215
+ const { position: e, resizerEnabled: l } = this;
216
+ if (l) {
217
+ const { container: t, resizer: o } = this.$refs, n = e === "center" ? { fromX: "right", fromY: "bottom", multiplier: 2 } : { fromX: e === "right" ? "left" : "right" };
218
+ this.resizerInstance = new M(t, o, n), this.handleResizerStart = () => {
217
219
  this.isResizing = !0;
218
220
  }, this.handleResizerEnd = () => {
219
221
  setTimeout(() => {
220
222
  this.isResizing = !1;
221
223
  }, 0);
222
- }, l.addEventListener("ulu:resizer:start", this.handleResizerStart), l.addEventListener("ulu:resizer:end", this.handleResizerEnd);
224
+ }, t.addEventListener("ulu:resizer:start", this.handleResizerStart), t.addEventListener("ulu:resizer:end", this.handleResizerEnd);
223
225
  }
224
226
  },
225
227
  destroyResizer() {
@@ -240,77 +242,77 @@ const T = {
240
242
  ref: "resizer",
241
243
  type: "button"
242
244
  };
243
- function H(e, t, l, o, n, s) {
244
- const r = v("UluIcon");
245
- return a(), b(S, {
246
- to: l.teleport === !1 ? null : l.teleport,
247
- disabled: l.teleport === !1
245
+ function H(e, l, t, o, n, s) {
246
+ const a = v("UluIcon");
247
+ return d(), b(S, {
248
+ to: t.teleport === !1 ? null : t.teleport,
249
+ disabled: t.teleport === !1
248
250
  }, [
249
- d("dialog", {
250
- class: c(["modal", [o.resolvedModifiers, l.classes.container]]),
251
+ c("dialog", {
252
+ class: r(["modal", [o.resolvedModifiers, t.classes.container]]),
251
253
  "aria-labelledby": s.resolvedLabelledby,
252
- "aria-describedby": l.describedby,
254
+ "aria-describedby": t.describedby,
253
255
  ref: "container",
254
256
  style: _({ width: n.containerWidth }),
255
- onCancel: t[1] || (t[1] = R((...i) => s.close && s.close(...i), ["prevent"])),
256
- onClose: t[2] || (t[2] = (...i) => s.handleDialogCloseEvent && s.handleDialogCloseEvent(...i)),
257
- onClick: t[3] || (t[3] = (...i) => s.handleClick && s.handleClick(...i)),
258
- onToggle: t[4] || (t[4] = (...i) => s.handleToggle && s.handleToggle(...i))
257
+ onCancel: l[1] || (l[1] = R((...i) => s.close && s.close(...i), ["prevent"])),
258
+ onClose: l[2] || (l[2] = (...i) => s.handleDialogCloseEvent && s.handleDialogCloseEvent(...i)),
259
+ onClick: l[3] || (l[3] = (...i) => s.handleClick && s.handleClick(...i)),
260
+ onToggle: l[4] || (l[4] = (...i) => s.handleToggle && s.handleToggle(...i))
259
261
  }, [
260
- o.hasHeader ? (a(), z("header", {
262
+ o.hasHeader ? (d(), z("header", {
261
263
  key: 0,
262
- class: c(["modal__header", l.classes.header])
264
+ class: r(["modal__header", t.classes.header])
263
265
  }, [
264
- d("h2", {
265
- class: c(["modal__title", l.classes.title]),
266
+ c("h2", {
267
+ class: r(["modal__title", t.classes.title]),
266
268
  id: n.titleId
267
269
  }, [
268
270
  h(e.$slots, "title", { close: s.close }, () => [
269
- l.titleIcon ? (a(), b(r, {
271
+ t.titleIcon ? (d(), b(a, {
270
272
  key: 0,
271
273
  class: "modal__title-icon",
272
- icon: l.titleIcon
274
+ icon: t.titleIcon
273
275
  }, null, 8, ["icon"])) : u("", !0),
274
- d("span", L, I(l.title), 1)
276
+ c("span", L, I(t.title), 1)
275
277
  ])
276
278
  ], 10, P),
277
- d("button", {
278
- class: "modal__close",
279
+ c("button", {
280
+ class: r(["modal__close", t.classes.close]),
279
281
  "aria-label": "Close modal",
280
- onClick: t[0] || (t[0] = (...i) => s.close && s.close(...i)),
282
+ onClick: l[0] || (l[0] = (...i) => s.close && s.close(...i)),
281
283
  autofocus: ""
282
284
  }, [
283
285
  h(e.$slots, "closeIcon", {}, () => [
284
- g(r, {
286
+ g(a, {
285
287
  class: "modal__close-icon",
286
- icon: l.closeIcon || "type:close"
288
+ icon: t.closeIcon || "type:close"
287
289
  }, null, 8, ["icon"])
288
290
  ])
289
- ])
291
+ ], 2)
290
292
  ], 2)) : u("", !0),
291
- d("div", {
292
- class: c(["modal__body", l.classes.body])
293
+ c("div", {
294
+ class: r(["modal__body", t.classes.body])
293
295
  }, [
294
296
  h(e.$slots, "default", { close: s.close })
295
297
  ], 2),
296
- e.$slots.footer ? (a(), z("div", {
298
+ e.$slots.footer ? (d(), z("div", {
297
299
  key: 1,
298
- class: c(["site-modal__footer", l.classes.footer])
300
+ class: r(["site-modal__footer", t.classes.footer])
299
301
  }, [
300
302
  h(e.$slots, "footer", { close: s.close })
301
303
  ], 2)) : u("", !0),
302
- o.resizerEnabled ? (a(), z("button", U, [
304
+ o.resizerEnabled ? (d(), z("button", U, [
303
305
  h(e.$slots, "resizerIcon", {}, () => [
304
- g(r, {
306
+ g(a, {
305
307
  class: "modal__resizer-icon",
306
- icon: l.resizerIcon || o.resizerIconType
308
+ icon: t.resizerIcon || o.resizerIconType
307
309
  }, null, 8, ["icon"])
308
310
  ])
309
311
  ], 512)) : u("", !0)
310
312
  ], 46, O)
311
313
  ], 8, ["to", "disabled"]);
312
314
  }
313
- const A = /* @__PURE__ */ p(T, [["render", H]]);
315
+ const A = /* @__PURE__ */ T(p, [["render", H]]);
314
316
  export {
315
317
  A as default
316
318
  };
@@ -31,7 +31,13 @@
31
31
  <span class="modal__title-text">{{ title }}</span>
32
32
  </slot>
33
33
  </h2>
34
- <button class="modal__close" aria-label="Close modal" @click="close" autofocus>
34
+ <button
35
+ class="modal__close"
36
+ :class="classes.close"
37
+ aria-label="Close modal"
38
+ @click="close"
39
+ autofocus
40
+ >
35
41
  <slot name="closeIcon">
36
42
  <UluIcon
37
43
  class="modal__close-icon"
@@ -171,7 +177,9 @@
171
177
  */
172
178
  classes: {
173
179
  type: Object,
174
- default: () => ({})
180
+ default: () => ({
181
+ close: "button button--icon"
182
+ })
175
183
  },
176
184
  /**
177
185
  * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.2.0-beta.6",
3
+ "version": "0.2.0-beta.7",
4
4
  "description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
5
5
  "type": "module",
6
6
  "files": [
@@ -32,9 +32,7 @@
32
32
  "scripts": {
33
33
  "dev": "storybook dev -p 6006",
34
34
  "docs:build": "storybook build -o docs",
35
- "build": "vite build",
36
- "types_TRASH": "vue-tsc",
37
- "deploy_TRASH": "rm -rf dist && npm run types && npm run build && npm run docs:build",
35
+ "build": "vite build --config library.vite.config.js",
38
36
  "deploy": "npm run build && npm run docs:build",
39
37
  "update-contexts": "rm -rf .ctx && mkdir -p .ctx/frontend && cp -R node_modules/@ulu/frontend/lib/scss node_modules/@ulu/frontend/lib/js .ctx/frontend/"
40
38
  },