@frollo/frollo-web-ui 9.0.8 → 9.0.10

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.
@@ -1,12 +1,14 @@
1
- import { defineComponent, ref, computed, useCssVars, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, renderSlot, mergeProps, Transition } from 'vue';
1
+ import { defineComponent, ref, computed, useCssVars, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, createBlock, mergeProps, Transition } from 'vue';
2
2
  import { a as Field } from './vee-validate-0dtT5GSQ.js';
3
3
  import { u as useColours } from './get-root-colours-DCCAnRF4.js';
4
+ import { FwTag as __default__$1 } from './fw-tag.js';
4
5
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
5
6
 
6
7
  var __default__ = defineComponent({
7
8
  name: 'FwInput',
8
9
  components: {
9
- InputField: Field
10
+ InputField: Field,
11
+ FwTag: __default__$1
10
12
  },
11
13
  props: {
12
14
  /**
@@ -136,11 +138,24 @@ var __default__ = defineComponent({
136
138
  invalidate: {
137
139
  type: Boolean,
138
140
  required: false
141
+ },
142
+ /**
143
+ * Enable tags within the input borders
144
+ * Defaults to false
145
+ */
146
+ enableTags: {
147
+ type: Boolean,
148
+ "default": false
149
+ },
150
+ tags: {
151
+ type: Array,
152
+ required: false
139
153
  }
140
154
  },
141
155
  emits: ['update:modelValue', /** Fired on native focus in */
142
156
  'focus', /** Fired on native input blur */
143
- 'blur'],
157
+ 'blur', /** v-model bindings for tags */
158
+ 'update:tags'],
144
159
  setup: function setup(props, ctx) {
145
160
  var inputBaseClass = ref("text-p text-body placeholder:text-p placeholder:text-grey-100 border outline-none block w-full px-2.5 py-3");
146
161
  var inputValue = computed({
@@ -151,6 +166,20 @@ var __default__ = defineComponent({
151
166
  return ctx.emit('update:modelValue', state);
152
167
  }
153
168
  });
169
+ var tagsValue = computed({
170
+ get: function get() {
171
+ return props.tags;
172
+ },
173
+ set: function set(state) {
174
+ return ctx.emit('update:tags', state);
175
+ }
176
+ });
177
+ var handleTagDismiss = function handleTagDismiss(id) {
178
+ var _tagsValue$value;
179
+ tagsValue.value = (_tagsValue$value = tagsValue.value) === null || _tagsValue$value === void 0 ? void 0 : _tagsValue$value.filter(function (tag) {
180
+ return tag.id !== id;
181
+ });
182
+ };
154
183
  var onFocus = function onFocus(e) {
155
184
  return ctx.emit('focus', e);
156
185
  };
@@ -163,18 +192,20 @@ var __default__ = defineComponent({
163
192
  return {
164
193
  inputBaseClass: inputBaseClass,
165
194
  inputValue: inputValue,
195
+ tagsValue: tagsValue,
166
196
  onFocus: onFocus,
167
197
  onBlur: onBlur,
168
198
  primaryFade5: primaryFade5,
169
- colorErrorTextFade5: colorErrorTextFade5
199
+ colorErrorTextFade5: colorErrorTextFade5,
200
+ handleTagDismiss: handleTagDismiss
170
201
  };
171
202
  }
172
203
  });
173
204
  var __injectCSSVars__ = function __injectCSSVars__() {
174
205
  useCssVars(function (_ctx) {
175
206
  return {
176
- "v13ee7f47": _ctx.primaryFade5,
177
- "f122bf92": _ctx.colorErrorTextFade5
207
+ "v221768dc": _ctx.primaryFade5,
208
+ "v0b83798c": _ctx.colorErrorTextFade5
178
209
  };
179
210
  });
180
211
  };
@@ -205,33 +236,54 @@ var _hoisted_7 = {
205
236
  "class": "relative"
206
237
  };
207
238
  var _hoisted_8 = {
239
+ key: 0,
240
+ "class": "border border-grey-100 bg-white rounded-lg p-3"
241
+ };
242
+ var _hoisted_9 = {
208
243
  key: 0,
209
244
  "class": "flex text-body absolute w-9 h-full inset-y-0 left-0 items-center pl-3 pointer-events-none"
210
245
  };
211
- var _hoisted_9 = ["id", "name", "placeholder", "type", "readonly", "tabindex", "disabled", "autocomplete", "maxlength"];
212
246
  var _hoisted_10 = {
247
+ "class": "pl-9 flex flex-row items-center flex-wrap"
248
+ };
249
+ var _hoisted_11 = ["id", "name", "type", "readonly", "tabindex", "disabled", "autocomplete", "maxlength"];
250
+ var _hoisted_12 = {
251
+ key: 1,
252
+ "class": "flex text-black absolute w-10 h-full inset-y-0 right-0 items-center pr-3"
253
+ };
254
+ var _hoisted_13 = {
255
+ key: 0,
256
+ "class": "flex text-body absolute w-9 h-full inset-y-0 left-0 items-center pl-3 pointer-events-none"
257
+ };
258
+ var _hoisted_14 = ["id", "name", "placeholder", "type", "readonly", "tabindex", "disabled", "autocomplete", "maxlength"];
259
+ var _hoisted_15 = {
213
260
  key: 1,
214
261
  "class": "flex text-black absolute w-10 h-full inset-y-0 right-0 items-center pr-3"
215
262
  };
216
- var _hoisted_11 = {
263
+ var _hoisted_16 = {
217
264
  key: 0,
218
265
  "class": "text-left text-p-small mt-2 min-h-[21px]"
219
266
  };
220
- var _hoisted_12 = {
267
+ var _hoisted_17 = {
221
268
  key: 0,
222
269
  "class": "text-brand-error-text"
223
270
  };
224
- var _hoisted_13 = {
271
+ var _hoisted_18 = {
225
272
  key: 1,
226
273
  "class": "text-brand-text2"
227
274
  };
228
275
  function render(_ctx, _cache, $props, $setup, $data, $options) {
276
+ var _component_FwTag = resolveComponent("FwTag");
229
277
  var _component_InputField = resolveComponent("InputField");
230
278
  return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_InputField, {
231
279
  modelValue: _ctx.inputValue,
232
- "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
280
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
233
281
  return _ctx.inputValue = $event;
234
282
  }),
283
+ tags: _ctx.tagsValue,
284
+ "onUpdate:tags": _cache[5] || (_cache[5] = function ($event) {
285
+ return _ctx.tagsValue = $event;
286
+ }),
235
287
  name: _ctx.name,
236
288
  rules: _ctx.rules,
237
289
  "validate-on-input": true
@@ -245,7 +297,42 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
245
297
  key: 0,
246
298
  "for": _ctx.inputId || "fw-input-".concat(_ctx.name),
247
299
  "class": normalizeClass([[(errorMessage || errors[0]) && meta.touched || _ctx.invalidate ? 'text-brand-error-text' : 'text-brand-text2'], "block mb-2 text-base"])
248
- }, [createTextVNode(toDisplayString(_ctx.label) + " ", 1), _ctx.required ? (openBlock(), createElementBlock("span", _hoisted_5, "*")) : createCommentVNode("", true)], 10, _hoisted_4)) : createCommentVNode("", true), _ctx.$slots.action ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "action")])) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_7, [_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_8, [renderSlot(_ctx.$slots, "prefix", {
300
+ }, [createTextVNode(toDisplayString(_ctx.label) + " ", 1), _ctx.required ? (openBlock(), createElementBlock("span", _hoisted_5, "*")) : createCommentVNode("", true)], 10, _hoisted_4)) : createCommentVNode("", true), _ctx.$slots.action ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "action")])) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_7, [_ctx.enableTags && _ctx.tags ? (openBlock(), createElementBlock("div", _hoisted_8, [_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_9, [renderSlot(_ctx.$slots, "prefix", {
301
+ "class": "h-full"
302
+ })])) : createCommentVNode("", true), createElementVNode("div", _hoisted_10, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tags, function (tag) {
303
+ return openBlock(), createBlock(_component_FwTag, {
304
+ key: tag.id,
305
+ label: tag.name,
306
+ dismissable: true,
307
+ rounded: false,
308
+ size: "md",
309
+ "class": "m-1",
310
+ variant: "secondary",
311
+ onDismissed: function onDismissed($event) {
312
+ return _ctx.handleTagDismiss(tag.id);
313
+ }
314
+ }, null, 8, ["label", "onDismissed"]);
315
+ }), 128)), createElementVNode("input", mergeProps(field, {
316
+ id: _ctx.inputId || "fw-input-".concat(_ctx.name),
317
+ name: _ctx.disableNamePrefix ? _ctx.name : "fw-input-".concat(_ctx.name),
318
+ type: _ctx.type,
319
+ readonly: _ctx.readonly,
320
+ tabindex: _ctx.tabindex,
321
+ disabled: _ctx.readonly,
322
+ autocomplete: _ctx.autocomplete,
323
+ maxlength: _ctx.maxLength,
324
+ "class": "border-none outline-none !bg-transparent flex-grow pl-1",
325
+ onFocus: _cache[0] || (_cache[0] = function () {
326
+ return _ctx.onFocus && _ctx.onFocus.apply(_ctx, arguments);
327
+ }),
328
+ onBlur: _cache[1] || (_cache[1] = function () {
329
+ return _ctx.onBlur && _ctx.onBlur.apply(_ctx, arguments);
330
+ })
331
+ }), null, 16, _hoisted_11)]), _ctx.$slots.suffix ? (openBlock(), createElementBlock("div", _hoisted_12, [renderSlot(_ctx.$slots, "suffix", {
332
+ "class": "h-full"
333
+ })])) : createCommentVNode("", true)])) : createCommentVNode("", true), !_ctx.enableTags ? (openBlock(), createElementBlock(Fragment, {
334
+ key: 1
335
+ }, [_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_13, [renderSlot(_ctx.$slots, "prefix", {
249
336
  "class": "h-full"
250
337
  })])) : createCommentVNode("", true), createElementVNode("input", mergeProps(field, {
251
338
  id: _ctx.inputId || "fw-input-".concat(_ctx.name),
@@ -261,30 +348,30 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
261
348
  'pl-10': !!_ctx.$slots.prefix,
262
349
  'pr-20': !!_ctx.$slots.suffix
263
350
  }, (errorMessage || errors[0]) && meta.touched || _ctx.invalidate ? 'input--error-state border-brand-error-text caret-brand-error-text' : 'caret-primary bg-white border-grey-100 hover:border-brand-text3 focus:border-brand-text3', _ctx.inputBaseClass, _ctx.rounded ? 'rounded-full' : 'rounded-lg', _ctx.inputClass],
264
- onFocus: _cache[0] || (_cache[0] = function () {
351
+ onFocus: _cache[2] || (_cache[2] = function () {
265
352
  return _ctx.onFocus && _ctx.onFocus.apply(_ctx, arguments);
266
353
  }),
267
- onBlur: _cache[1] || (_cache[1] = function () {
354
+ onBlur: _cache[3] || (_cache[3] = function () {
268
355
  return _ctx.onBlur && _ctx.onBlur.apply(_ctx, arguments);
269
356
  })
270
- }), null, 16, _hoisted_9), _ctx.$slots.suffix ? (openBlock(), createElementBlock("div", _hoisted_10, [renderSlot(_ctx.$slots, "suffix", {
357
+ }), null, 16, _hoisted_14), _ctx.$slots.suffix ? (openBlock(), createElementBlock("div", _hoisted_15, [renderSlot(_ctx.$slots, "suffix", {
271
358
  "class": "h-full"
272
- })])) : createCommentVNode("", true)]), _ctx.enableErrors ? (openBlock(), createElementBlock("div", _hoisted_11, [createVNode(Transition, {
359
+ })])) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)]), _ctx.enableErrors ? (openBlock(), createElementBlock("div", _hoisted_16, [createVNode(Transition, {
273
360
  name: "fwFadeIn",
274
361
  mode: "out-in"
275
362
  }, {
276
363
  "default": withCtx(function () {
277
- return [(errorMessage || errors[0]) && meta.touched ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(errorMessage || errors[0]), 1)) : _ctx.hint ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(_ctx.hint), 1)) : createCommentVNode("", true)];
364
+ return [(errorMessage || errors[0]) && meta.touched ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(errorMessage || errors[0]), 1)) : _ctx.hint ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(_ctx.hint), 1)) : createCommentVNode("", true)];
278
365
  }),
279
366
  _: 2
280
367
  }, 1024)])) : createCommentVNode("", true)])];
281
368
  }),
282
369
  _: 3
283
- }, 8, ["modelValue", "name", "rules"])]);
370
+ }, 8, ["modelValue", "tags", "name", "rules"])]);
284
371
  }
285
372
 
286
- var css_248z = ".fwFadeIn-enter-active,.fwFadeIn-leave-active{-webkit-transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,-webkit-transform .12s ease;-moz-transition:opacity .12s ease,transform .12s ease,-moz-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease,-moz-transform .12s ease;will-change:opacity,transform}.fwFadeIn-enter-from,.fwFadeIn-leave-to{opacity:0;-webkit-transform:translateY(-2px);-moz-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.fw-input input:focus{background-color:var(--v13ee7f47)}.fw-input input.input--error-state{background-color:var(--f122bf92)}";
287
- var stylesheet = ".fwFadeIn-enter-active,.fwFadeIn-leave-active{-webkit-transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,-webkit-transform .12s ease;-moz-transition:opacity .12s ease,transform .12s ease,-moz-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease,-moz-transform .12s ease;will-change:opacity,transform}.fwFadeIn-enter-from,.fwFadeIn-leave-to{opacity:0;-webkit-transform:translateY(-2px);-moz-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.fw-input input:focus{background-color:var(--v13ee7f47)}.fw-input input.input--error-state{background-color:var(--f122bf92)}";
373
+ var css_248z = ".fwFadeIn-enter-active,.fwFadeIn-leave-active{-webkit-transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,-webkit-transform .12s ease;-moz-transition:opacity .12s ease,transform .12s ease,-moz-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease,-moz-transform .12s ease;will-change:opacity,transform}.fwFadeIn-enter-from,.fwFadeIn-leave-to{opacity:0;-webkit-transform:translateY(-2px);-moz-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.fw-input input:focus{background-color:var(--v221768dc)}.fw-input input.input--error-state{background-color:var(--v0b83798c)}";
374
+ var stylesheet = ".fwFadeIn-enter-active,.fwFadeIn-leave-active{-webkit-transition:opacity .12s ease,-webkit-transform .12s ease;transition:opacity .12s ease,-webkit-transform .12s ease;-moz-transition:opacity .12s ease,transform .12s ease,-moz-transform .12s ease;transition:opacity .12s ease,transform .12s ease;transition:opacity .12s ease,transform .12s ease,-webkit-transform .12s ease,-moz-transform .12s ease;will-change:opacity,transform}.fwFadeIn-enter-from,.fwFadeIn-leave-to{opacity:0;-webkit-transform:translateY(-2px);-moz-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.fw-input input:focus{background-color:var(--v221768dc)}.fw-input input.input--error-state{background-color:var(--v0b83798c)}";
288
375
  styleInject(css_248z);
289
376
 
290
377
  __default__.render = render;
package/esm/fw-input.js CHANGED
@@ -1,5 +1,9 @@
1
- export { _ as FwInput } from './fw-input-Bo2gQcvM.js';
1
+ export { _ as FwInput } from './fw-input-DTYzNw81.js';
2
2
  import 'vue';
3
3
  import './vee-validate-0dtT5GSQ.js';
4
4
  import './get-root-colours-DCCAnRF4.js';
5
+ import './fw-tag.js';
6
+ import './fw-button.js';
7
+ import './fw-button-ChYejNWD.js';
8
+ import './index-v1DX6R2G.js';
5
9
  import './style-inject.es-tgCJW-Cu.js';
@@ -87,6 +87,12 @@ var script = defineComponent({
87
87
  reversedDesktopNavButton: {
88
88
  type: Boolean,
89
89
  "default": false
90
+ },
91
+ /**
92
+ * Whether to force the logo to be displayed (forced for mobile themes that don't need a menu)
93
+ */
94
+ forcedLogoSrc: {
95
+ type: String
90
96
  }
91
97
  },
92
98
  emits: ['action'],
@@ -134,26 +140,27 @@ var script = defineComponent({
134
140
  }
135
141
  });
136
142
 
137
- var _hoisted_1 = {
138
- key: 0,
143
+ var _hoisted_1 = ["src"];
144
+ var _hoisted_2 = {
145
+ key: 1,
139
146
  "class": "hidden lg:!flex flex-shrink-0 items-center"
140
147
  };
141
- var _hoisted_2 = ["src"];
142
- var _hoisted_3 = {
143
- "class": "flex space-x-1"
144
- };
148
+ var _hoisted_3 = ["src"];
145
149
  var _hoisted_4 = {
146
- key: 2,
147
- "class": "hidden lg:flex items-center justify-center lg:ml-2"
150
+ "class": "flex space-x-1 ml-auto"
148
151
  };
149
152
  var _hoisted_5 = {
150
- "class": "flex flex-col min-w-[180px] text-left"
153
+ key: 3,
154
+ "class": "hidden lg:flex items-center justify-center lg:ml-2"
151
155
  };
152
156
  var _hoisted_6 = {
153
- key: 3,
154
- "class": "flex items-center lg:hidden z-[53]"
157
+ "class": "flex flex-col min-w-[180px] text-left"
155
158
  };
156
159
  var _hoisted_7 = {
160
+ key: 4,
161
+ "class": "flex items-center lg:hidden z-[53]"
162
+ };
163
+ var _hoisted_8 = {
157
164
  "class": "block h-6 w-6",
158
165
  xmlns: "http://www.w3.org/2000/svg",
159
166
  fill: "none",
@@ -161,20 +168,20 @@ var _hoisted_7 = {
161
168
  stroke: "currentColor",
162
169
  "aria-hidden": "true"
163
170
  };
164
- var _hoisted_8 = ["d"];
165
- var _hoisted_9 = {
171
+ var _hoisted_9 = ["d"];
172
+ var _hoisted_10 = {
166
173
  key: 0,
167
174
  "class": "flex-none lg:hidden items-start flex-shrink-0 pl-4"
168
175
  };
169
- var _hoisted_10 = ["src"];
170
- var _hoisted_11 = {
176
+ var _hoisted_11 = ["src"];
177
+ var _hoisted_12 = {
171
178
  key: 1,
172
179
  "class": "w-full flex flex-col space-y-1 pt-6"
173
180
  };
174
- var _hoisted_12 = {
181
+ var _hoisted_13 = {
175
182
  "class": "flex flex-col justify-between pt-6 h-full"
176
183
  };
177
- var _hoisted_13 = {
184
+ var _hoisted_14 = {
178
185
  key: 0,
179
186
  "class": "w-full flex flex-col space-y-1"
180
187
  };
@@ -184,22 +191,26 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
184
191
  var _component_UserSvg = resolveComponent("UserSvg");
185
192
  var _component_FwPopover = resolveComponent("FwPopover");
186
193
  return openBlock(), createElementBlock("nav", {
187
- "class": normalizeClass(["fw-nav-menu z-50 h-[72px] bg-white shadow-bottom", [_ctx.transparent ? 'lg:bg-transparent lg:shadow-none' : 'lg:bg-brand-appBg lg:shadow-bottom', _ctx.isMobileMenuOpen ? 'bg-transparent' : '']])
194
+ "class": normalizeClass(["fw-nav-menu z-50 h-[72px] bg-white shadow-bottom", [_ctx.transparent ? 'lg:bg-transparent lg:shadow-none' : 'lg:bg-brand-appBg lg:shadow-bottom', _ctx.isMobileMenuOpen ? 'bg-transparent' : '', !!_ctx.forcedLogoSrc ? '!bg-transparent !shadow-none' : '']])
188
195
  }, [createElementVNode("div", {
189
196
  "class": normalizeClass(["px-6 lg:py-3 flex-1 h-full flex items-stretch justify-between mx-auto", [_ctx.containerClass, !_ctx.menuEnabled ? 'hidden lg:flex' : '']])
190
- }, [_ctx.$slots.logo || _ctx.logoSrc ? (openBlock(), createElementBlock("div", _hoisted_1, [_ctx.$slots.logo ? renderSlot(_ctx.$slots, "logo", {
197
+ }, [!!_ctx.forcedLogoSrc ? (openBlock(), createElementBlock("img", {
198
+ key: 0,
199
+ src: _ctx.forcedLogoSrc,
200
+ "class": "w-[42px]"
201
+ }, null, 8, _hoisted_1)) : _ctx.$slots.logo || _ctx.logoSrc ? (openBlock(), createElementBlock("div", _hoisted_2, [_ctx.$slots.logo ? renderSlot(_ctx.$slots, "logo", {
191
202
  key: 0
192
203
  }) : _ctx.logoSrc ? (openBlock(), createElementBlock("img", {
193
204
  key: 1,
194
205
  src: _ctx.logoSrc,
195
206
  "class": "w-[42px]"
196
- }, null, 8, _hoisted_2)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.menuEnabled && _ctx.parsedMenuItems && ((_ctx$parsedMenuItems = _ctx.parsedMenuItems) === null || _ctx$parsedMenuItems === void 0 ? void 0 : _ctx$parsedMenuItems.length) > 0 ? (openBlock(), createElementBlock("div", {
197
- key: 1,
198
- "class": normalizeClass(["container hidden lg:flex items-center justify-between", _ctx.paddingClasses])
207
+ }, null, 8, _hoisted_3)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.menuEnabled && _ctx.parsedMenuItems && ((_ctx$parsedMenuItems = _ctx.parsedMenuItems) === null || _ctx$parsedMenuItems === void 0 ? void 0 : _ctx$parsedMenuItems.length) > 0 ? (openBlock(), createElementBlock("div", {
208
+ key: 2,
209
+ "class": normalizeClass(["container items-center justify-between", [_ctx.paddingClasses, !!_ctx.forcedLogoSrc ? 'flex' : 'hidden lg:flex']])
199
210
  }, [_cache[1] || (_cache[1] = createElementVNode("div", {
200
211
  id: "menu-teleport",
201
212
  "class": "hidden lg:flex items-center gap-x-2"
202
- }, null, -1)), createElementVNode("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedMenuItems, function (item, i) {
213
+ }, null, -1)), createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedMenuItems, function (item, i) {
203
214
  return openBlock(), createBlock(_component_FwButton, {
204
215
  key: i,
205
216
  variant: "transparent",
@@ -217,13 +228,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
217
228
  }),
218
229
  _: 2
219
230
  }, 1032, ["class", "href", "to", "external", "onClick"]);
220
- }), 128))])], 2)) : createCommentVNode("", true), _ctx.menuEnabled && _ctx.actionLabel && _ctx.authenticated ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(_component_FwPopover, {
231
+ }), 128))])], 2)) : createCommentVNode("", true), _ctx.menuEnabled && _ctx.actionLabel && _ctx.authenticated ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(_component_FwPopover, {
221
232
  placement: "bottom-start",
222
233
  "show-on-top": "",
223
234
  trigger: "click"
224
235
  }, {
225
236
  content: withCtx(function () {
226
- return [createElementVNode("div", _hoisted_5, [createVNode(_component_FwButton, {
237
+ return [createElementVNode("div", _hoisted_6, [createVNode(_component_FwButton, {
227
238
  size: "lg",
228
239
  variant: "text",
229
240
  rounded: false,
@@ -253,7 +264,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
253
264
  })];
254
265
  }),
255
266
  _: 1
256
- })])) : createCommentVNode("", true), _ctx.menuEnabled ? (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_FwButton, {
267
+ })])) : createCommentVNode("", true), _ctx.menuEnabled && !_ctx.forcedLogoSrc ? (openBlock(), createElementBlock("div", _hoisted_7, [createVNode(_component_FwButton, {
257
268
  variant: _ctx.isMobileMenuOpen ? 'primary' : 'tertiary',
258
269
  size: "sm",
259
270
  rounded: false,
@@ -263,18 +274,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
263
274
  "default": withCtx(function () {
264
275
  return [_cache[2] || (_cache[2] = createElementVNode("span", {
265
276
  "class": "sr-only"
266
- }, "Open main menu", -1)), (openBlock(), createElementBlock("svg", _hoisted_7, [createElementVNode("path", {
277
+ }, "Open main menu", -1)), (openBlock(), createElementBlock("svg", _hoisted_8, [createElementVNode("path", {
267
278
  "stroke-linecap": "round",
268
279
  "stroke-linejoin": "round",
269
280
  "stroke-width": "2",
270
281
  d: _ctx.isMobileMenuOpen ? 'M6 18L18 6M6 6l12 12' : 'M4 6h16M4 12h16M4 18h16'
271
- }, null, 8, _hoisted_8)]))];
282
+ }, null, 8, _hoisted_9)]))];
272
283
  }),
273
284
  _: 1
274
285
  }, 8, ["variant", "class", "onClick"])])) : createCommentVNode("", true)], 2), _cache[4] || (_cache[4] = createElementVNode("div", {
275
286
  id: "menu-search-teleport",
276
287
  "class": "absolute top-0 left-0 w-full z-[54]"
277
- }, null, -1)), _ctx.menuEnabled ? (openBlock(), createBlock(Transition, {
288
+ }, null, -1)), _ctx.menuEnabled && !_ctx.forcedLogoSrc ? (openBlock(), createBlock(Transition, {
278
289
  key: 0,
279
290
  name: "slideInRight"
280
291
  }, {
@@ -282,13 +293,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
282
293
  return [_ctx.parsedMenuItems && _ctx.parsedMenuItems.length > 0 && _ctx.isMobileMenuOpen ? (openBlock(), createElementBlock("div", {
283
294
  key: 0,
284
295
  "class": normalizeClass(["fw-nav-menu--mobile pl-6 pb-12", _ctx.mobileMenuClass])
285
- }, [_ctx.$slots.mobileLogo || _ctx.mobileLogoSrc ? (openBlock(), createElementBlock("div", _hoisted_9, [_ctx.$slots.mobileLogo ? renderSlot(_ctx.$slots, "mobileLogo", {
296
+ }, [_ctx.$slots.mobileLogo || _ctx.mobileLogoSrc ? (openBlock(), createElementBlock("div", _hoisted_10, [_ctx.$slots.mobileLogo ? renderSlot(_ctx.$slots, "mobileLogo", {
286
297
  key: 0
287
298
  }) : _ctx.mobileLogoSrc ? (openBlock(), createElementBlock("img", {
288
299
  key: 1,
289
300
  src: _ctx.mobileLogoSrc,
290
301
  "class": "w-[42px]"
291
- }, null, 8, _hoisted_10)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.parsedAdditionalMenuItems ? (openBlock(), createElementBlock("div", _hoisted_11, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedAdditionalMenuItems, function (item, i) {
302
+ }, null, 8, _hoisted_11)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.parsedAdditionalMenuItems ? (openBlock(), createElementBlock("div", _hoisted_12, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedAdditionalMenuItems, function (item, i) {
292
303
  return openBlock(), createElementBlock(Fragment, {
293
304
  key: i
294
305
  }, [!item.disabled ? (openBlock(), createBlock(_component_FwButton, {
@@ -311,7 +322,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
311
322
  }, 1032, ["href", "to", "external", "onClick"])) : createCommentVNode("", true)], 64);
312
323
  }), 128)), _cache[3] || (_cache[3] = createElementVNode("div", {
313
324
  "class": "w-[50px] relative bg-brand-border3 h-px !mt-6 ml-2"
314
- }, null, -1))])) : createCommentVNode("", true), createElementVNode("div", _hoisted_12, [_ctx.menuEnabled ? (openBlock(), createElementBlock("div", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedMenuItems, function (item, i) {
325
+ }, null, -1))])) : createCommentVNode("", true), createElementVNode("div", _hoisted_13, [_ctx.menuEnabled ? (openBlock(), createElementBlock("div", _hoisted_14, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.parsedMenuItems, function (item, i) {
315
326
  return openBlock(), createBlock(_component_FwButton, {
316
327
  key: i,
317
328
  "class": "w-full rounded-md !text-left !pl-2",
@@ -1,8 +1,8 @@
1
1
  import { f as _createForOfIteratorHelper, e as _defineProperty, b as _toConsumableArray } from './_rollupPluginBabelHelpers-BKlDnZ7n.js';
2
2
  import { ref, watch, defineComponent, shallowRef, computed, useCssVars, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createBlock, createCommentVNode, createTextVNode } from 'vue';
3
3
  import { a as script, s as script$1, _ as __default__$4 } from './fw-table-row-Be4_T3Ai.js';
4
- import { _ as __default__$3 } from './fw-input-Bo2gQcvM.js';
5
- import { _ as __default__$1 } from './fw-tag-B0fVslEZ.js';
4
+ import { _ as __default__$3 } from './fw-input-DTYzNw81.js';
5
+ import { FwTag as __default__$1 } from './fw-tag.js';
6
6
  import { s as script$2 } from './fw-button-ChYejNWD.js';
7
7
  import { _ as __default__$2 } from './fw-dropdown-UJDWtWjF.js';
8
8
  import { l as render$1, m as render$2, n as render$3 } from './index-v1DX6R2G.js';
package/esm/fw-tag.js CHANGED
@@ -1,7 +1,206 @@
1
- export { _ as FwTag } from './fw-tag-B0fVslEZ.js';
2
- import 'vue';
1
+ import { defineComponent, ref, computed, useCssVars, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot, createVNode, createCommentVNode, vShow } from 'vue';
3
2
  import './fw-button.js';
4
- import './fw-button-ChYejNWD.js';
5
- import './index-v1DX6R2G.js';
6
- import './style-inject.es-tgCJW-Cu.js';
7
- import './get-root-colours-DCCAnRF4.js';
3
+ import { d as render$1 } from './index-v1DX6R2G.js';
4
+ import { u as useColours } from './get-root-colours-DCCAnRF4.js';
5
+ import { s as script } from './fw-button-ChYejNWD.js';
6
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
7
+
8
+ var TAG_CLASSES = {
9
+ primary: {
10
+ text: 'text-button-primary-text',
11
+ background: 'bg-button-primary-bg',
12
+ iconButtonType: 'primary'
13
+ },
14
+ secondary: {
15
+ text: 'text-primary',
16
+ background: 'fw-tag--secondary-bg',
17
+ iconButtonType: 'tertiary'
18
+ },
19
+ tertiary: {
20
+ text: 'text-body',
21
+ background: 'bg-brand-bg4',
22
+ iconButtonType: 'tertiary'
23
+ },
24
+ quaternary: {
25
+ text: 'text-body',
26
+ background: 'bg-brand-bg3',
27
+ iconButtonType: 'tertiary'
28
+ },
29
+ alert: {
30
+ text: 'text-white',
31
+ background: 'bg-brand-warning-bg',
32
+ iconButtonType: 'error'
33
+ },
34
+ success: {
35
+ text: 'text-secondary',
36
+ background: 'bg-brand-success-new',
37
+ iconButtonType: 'success'
38
+ },
39
+ error: {
40
+ text: 'text-white',
41
+ background: 'bg-brand-error-text',
42
+ iconButtonType: 'error'
43
+ }
44
+ };
45
+ var SIZES = {
46
+ xs: 'px-2 py-px text-xs',
47
+ sm: 'px-4 py-1 text-sm',
48
+ md: 'px-4 py-3 h-6 text-md'
49
+ };
50
+ var ICON_SIZES = {
51
+ xs: 'w-4 h-4',
52
+ sm: 'w-5 h-5',
53
+ md: 'w-5 h-5'
54
+ };
55
+ var baseClass = 'inline-flex items-center justify-center text-center whitespace-nowrap';
56
+ var __default__ = defineComponent({
57
+ name: 'FwTag',
58
+ components: {
59
+ FwButton: script,
60
+ XMarkSvg: render$1
61
+ },
62
+ props: {
63
+ /**
64
+ * The label text of the tag.
65
+ * Overrides the default slot content.
66
+ */
67
+ label: {
68
+ type: String
69
+ },
70
+ /**
71
+ * The size of the tag. Accepts: 'xs', 'sm' & 'md'
72
+ */
73
+ size: {
74
+ type: String,
75
+ "default": 'xs',
76
+ validator: function validator(value) {
77
+ return ['xs', 'sm', 'md'].includes(value);
78
+ }
79
+ },
80
+ /**
81
+ * The colour variant of the tag. Accepts 'primary', 'secondary', 'alert', 'error', 'success'
82
+ */
83
+ variant: {
84
+ type: String,
85
+ "default": 'primary',
86
+ validator: function validator(value) {
87
+ return ['primary', 'secondary', 'tertiary', 'quaternary', 'alert', 'error', 'success'].includes(value);
88
+ }
89
+ },
90
+ /**
91
+ * Whether the tag can be dismissed or closed.
92
+ */
93
+ dismissable: {
94
+ type: Boolean,
95
+ "default": false
96
+ },
97
+ /**
98
+ * Whether the tag has round borders or not.
99
+ */
100
+ rounded: {
101
+ type: Boolean,
102
+ "default": true
103
+ }
104
+ },
105
+ emits: [/** Fires when the tag is dismissed. */
106
+ 'dismissed'],
107
+ setup: function setup(props, ctx) {
108
+ var visible = ref(true);
109
+ var variantDef = computed(function () {
110
+ return TAG_CLASSES[props.variant];
111
+ });
112
+ var _useColours = useColours(),
113
+ primaryFade5 = _useColours.primaryFade5;
114
+ var textColorClass = computed(function () {
115
+ return variantDef.value.text;
116
+ });
117
+ var bgColorClass = computed(function () {
118
+ return variantDef.value.background;
119
+ });
120
+ var iconButtonType = computed(function () {
121
+ return variantDef.value.iconButtonType;
122
+ });
123
+ var sizeClass = computed(function () {
124
+ return SIZES[props.size];
125
+ });
126
+ var iconSizeClass = computed(function () {
127
+ return ICON_SIZES[props.size];
128
+ });
129
+ var rootClasses = computed(function () {
130
+ return [baseClass, textColorClass.value, bgColorClass.value, sizeClass.value, props.dismissable ? 'shadow font-semibold' : 'font-normal', props.rounded ? 'rounded-full' : ''];
131
+ });
132
+ var onDismiss = function onDismiss() {
133
+ visible.value = false;
134
+ ctx.emit('dismissed');
135
+ };
136
+ return {
137
+ visible: visible,
138
+ baseClass: baseClass,
139
+ textColorClass: textColorClass,
140
+ bgColorClass: bgColorClass,
141
+ sizeClass: sizeClass,
142
+ iconSizeClass: iconSizeClass,
143
+ iconButtonType: iconButtonType,
144
+ primaryFade5: primaryFade5,
145
+ onDismiss: onDismiss,
146
+ rootClasses: rootClasses
147
+ };
148
+ }
149
+ });
150
+ var __injectCSSVars__ = function __injectCSSVars__() {
151
+ useCssVars(function (_ctx) {
152
+ return {
153
+ "d012dfb6": _ctx.primaryFade5
154
+ };
155
+ });
156
+ };
157
+ var __setup__ = __default__.setup;
158
+ __default__.setup = __setup__ ? function (props, ctx) {
159
+ __injectCSSVars__();
160
+ return __setup__(props, ctx);
161
+ } : __injectCSSVars__;
162
+
163
+ var _hoisted_1 = {
164
+ key: 0
165
+ };
166
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
167
+ var _component_XMarkSvg = resolveComponent("XMarkSvg");
168
+ var _component_FwButton = resolveComponent("FwButton");
169
+ return openBlock(), createBlock(Transition, {
170
+ name: "fw-tag-fade-scale",
171
+ appear: ""
172
+ }, {
173
+ "default": withCtx(function () {
174
+ return [withDirectives(createElementVNode("span", {
175
+ "class": normalizeClass(["fw-tag", _ctx.rootClasses]),
176
+ role: "status"
177
+ }, [_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.label), 1)) : renderSlot(_ctx.$slots, "default", {
178
+ key: 1
179
+ }), _ctx.dismissable ? (openBlock(), createBlock(_component_FwButton, {
180
+ key: 2,
181
+ variant: _ctx.iconButtonType,
182
+ "class": normalizeClass([_ctx.iconSizeClass, "ml-1 !p-0 flex items-center justify-center border-none rounded-full"]),
183
+ tabindex: "0",
184
+ title: "Dismiss filter",
185
+ "aria-label": "Dismiss",
186
+ onClick: _ctx.onDismiss
187
+ }, {
188
+ "default": withCtx(function () {
189
+ return [createVNode(_component_XMarkSvg, {
190
+ "class": "w-3 h-3 font-semibold m-0"
191
+ })];
192
+ }),
193
+ _: 1
194
+ }, 8, ["variant", "class", "onClick"])) : createCommentVNode("", true)], 2), [[vShow, _ctx.visible]])];
195
+ }),
196
+ _: 3
197
+ });
198
+ }
199
+
200
+ var css_248z = ".fw-tag{line-height:normal;-webkit-transition:opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease;transition:opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease;-moz-transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease,-moz-transform .18s ease;transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease;transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease,-moz-transform .18s ease;will-change:transform,opacity}.fw-tag--secondary-bg{background:var(--d012dfb6)}.fw-tag-fade-scale-enter-active,.fw-tag-fade-scale-leave-active{-webkit-transition:opacity .18s ease,-webkit-transform .18s ease;transition:opacity .18s ease,-webkit-transform .18s ease;-moz-transition:transform .18s ease,opacity .18s ease,-moz-transform .18s ease;transition:transform .18s ease,opacity .18s ease;transition:transform .18s ease,opacity .18s ease,-webkit-transform .18s ease,-moz-transform .18s ease}.fw-tag-fade-scale-enter-from,.fw-tag-fade-scale-leave-to{opacity:0;-webkit-transform:scale(.96);-moz-transform:scale(.96);-ms-transform:scale(.96);transform:scale(.96)}";
201
+ var stylesheet = ".fw-tag{line-height:normal;-webkit-transition:opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease;transition:opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease;-moz-transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease,-moz-transform .18s ease;transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease;transition:transform .18s ease,opacity .18s ease,xw background-color .18s ease,color .18s ease,-webkit-transform .18s ease,-moz-transform .18s ease;will-change:transform,opacity}.fw-tag--secondary-bg{background:var(--d012dfb6)}.fw-tag-fade-scale-enter-active,.fw-tag-fade-scale-leave-active{-webkit-transition:opacity .18s ease,-webkit-transform .18s ease;transition:opacity .18s ease,-webkit-transform .18s ease;-moz-transition:transform .18s ease,opacity .18s ease,-moz-transform .18s ease;transition:transform .18s ease,opacity .18s ease;transition:transform .18s ease,opacity .18s ease,-webkit-transform .18s ease,-moz-transform .18s ease}.fw-tag-fade-scale-enter-from,.fw-tag-fade-scale-leave-to{opacity:0;-webkit-transform:scale(.96);-moz-transform:scale(.96);-ms-transform:scale(.96);transform:scale(.96)}";
202
+ styleInject(css_248z);
203
+
204
+ __default__.render = render;
205
+
206
+ export { __default__ as FwTag };