@onereach/ui-components 4.1.1-beta.2536.0 → 4.1.1-beta.2537.0

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.
@@ -91,23 +91,15 @@ var __vue_render__ = function () {
91
91
  }, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")]) : _vm._e()];
92
92
  })], 2), _vm._v(" "), _c('div', {
93
93
  class: _vm.contentStyles
94
- }, [_vm._t("default")], 2), _vm._v(" "), _vm.hint ? [_c('OrHint', {
94
+ }, [_vm._t("default")], 2), _vm._v(" "), _vm.hint && !_vm.error ? [_c('OrHint', {
95
95
  attrs: {
96
96
  "disabled": _vm.disabled
97
97
  }
98
- }, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e(), _vm._v(" "), _c('div', {
99
- directives: [{
100
- name: "show",
101
- rawName: "v-show",
102
- value: typeof _vm.error === 'string',
103
- expression: "typeof error === 'string'"
104
- }],
105
- class: ['contents']
106
- }, [_c('OrError', {
98
+ }, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e(), _vm._v(" "), typeof _vm.error === 'string' ? [_c('OrError', {
107
99
  attrs: {
108
100
  "disabled": _vm.disabled
109
101
  }
110
- }, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])], 1)], 2);
102
+ }, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])] : _vm._e()], 2);
111
103
  };
112
104
  var __vue_staticRenderFns__ = [];
113
105
 
@@ -7,7 +7,7 @@ import '../OrHintV3/OrHint.js';
7
7
  import { s as script$1 } from '../../OrLabel.vue_vue_type_script_lang-3e11ab8a.js';
8
8
  import { s as script$2 } from '../../OrError.vue_vue_type_script_lang-df7b5e32.js';
9
9
  import { s as script$3 } from '../../OrHint.vue_vue_type_script_lang-0f5e8377.js';
10
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, withDirectives, createVNode, vShow } from 'vue';
10
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
11
11
  import '../OrLabelV3/props.js';
12
12
  import '../OrLabelV3/styles.js';
13
13
  import '../OrErrorV3/styles.js';
@@ -67,9 +67,6 @@ var script = defineComponent({
67
67
  const _hoisted_1 = {
68
68
  class: "flex flex-row"
69
69
  };
70
- const _hoisted_2 = {
71
- class: /*#__PURE__*/normalizeClass(['contents'])
72
- };
73
70
  function render(_ctx, _cache, $props, $setup, $data, $options) {
74
71
  const _component_OrLabel = resolveComponent("OrLabel");
75
72
  const _component_OrHint = resolveComponent("OrHint");
@@ -89,20 +86,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
89
86
  _: 3 /* FORWARDED */
90
87
  }, 8 /* PROPS */, ["required", "disabled"])) : createCommentVNode("v-if", true)])]), createElementVNode("div", {
91
88
  class: normalizeClass(_ctx.contentStyles)
92
- }, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */), _ctx.hint ? (openBlock(), createBlock(_component_OrHint, {
89
+ }, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */), _ctx.hint && !_ctx.error ? (openBlock(), createBlock(_component_OrHint, {
93
90
  key: 0,
94
91
  disabled: _ctx.disabled
95
92
  }, {
96
93
  default: withCtx(() => [createTextVNode(toDisplayString(_ctx.hint), 1 /* TEXT */)]),
97
94
 
98
95
  _: 1 /* STABLE */
99
- }, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true), withDirectives(createElementVNode("div", _hoisted_2, [createVNode(_component_OrError, {
96
+ }, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true), typeof _ctx.error === 'string' ? (openBlock(), createBlock(_component_OrError, {
97
+ key: 1,
100
98
  disabled: _ctx.disabled
101
99
  }, {
102
100
  default: withCtx(() => [createTextVNode(toDisplayString(_ctx.error), 1 /* TEXT */)]),
103
101
 
104
102
  _: 1 /* STABLE */
105
- }, 8 /* PROPS */, ["disabled"])], 512 /* NEED_PATCH */), [[vShow, typeof _ctx.error === 'string']])], 2 /* CLASS */);
103
+ }, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true)], 2 /* CLASS */);
106
104
  }
107
105
 
108
106
  script.render = render;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "4.1.1-beta.2536.0",
3
+ "version": "4.1.1-beta.2537.0",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -3,6 +3,7 @@ import { ref } from 'vue-demi';
3
3
  import { Meta, StoryFn } from '@storybook/vue3';
4
4
  import { OrRadioV3 as OrRadio } from '../or-radio-v3';
5
5
  import { OrCheckboxV3 as OrCheckbox } from '../or-checkbox-v3';
6
+ import { OrSwitchV3 as OrSwitch } from '../or-switch-v3';
6
7
  import { Direction } from './props';
7
8
  export default {
8
9
  title: 'Components/Forms/Group',
@@ -31,7 +32,7 @@ const RadioTemplate: StoryFn<typeof OrFormGroup> = (args) => ({
31
32
  OrRadio,
32
33
  },
33
34
  setup() {
34
- const modelValue = ref(false);
35
+ const modelValue = ref('');
35
36
  return {
36
37
  args,
37
38
  modelValue,
@@ -82,3 +83,32 @@ CheckboxGroup.args = {
82
83
  label: 'Checkbox Group',
83
84
  hint: 'This is a hint',
84
85
  };
86
+
87
+ const SwitchTemplate: StoryFn<typeof OrFormGroup> = (args) => ({
88
+ components: {
89
+ OrFormGroup,
90
+ OrSwitch,
91
+ },
92
+ setup() {
93
+ const modelValue = ref([]);
94
+ return {
95
+ args,
96
+ modelValue,
97
+ };
98
+ },
99
+ template: `
100
+ <OrFormGroup
101
+ v-bind="args"
102
+ >
103
+ <OrSwitch :label="'Option 1'" value="1" v-model="modelValue"/>
104
+ <OrSwitch :label="'Option 2'" value="3" v-model="modelValue"/>
105
+ <OrSwitch :label="'Option 3'" value="4" v-model="modelValue"/>
106
+ </OrFormGroup>
107
+ `,
108
+ });
109
+
110
+ export const SwitchGroup = SwitchTemplate.bind({});
111
+ SwitchGroup.args = {
112
+ label: 'Switch Group',
113
+ hint: 'This is a hint',
114
+ };
@@ -24,19 +24,20 @@
24
24
  >
25
25
  <slot />
26
26
  </div>
27
- <template v-if="hint">
27
+
28
+ <template v-if="hint && !error">
28
29
  <OrHint :disabled="disabled">
29
30
  {{ hint }}
30
31
  </OrHint>
31
32
  </template>
32
- <div
33
- v-show="typeof error === 'string'"
34
- :class="['contents']"
33
+
34
+ <template
35
+ v-if="typeof error === 'string'"
35
36
  >
36
37
  <OrError :disabled="disabled">
37
38
  {{ error }}
38
39
  </OrError>
39
- </div>
40
+ </template>
40
41
  </div>
41
42
  </template>
42
43