@redseed/redseed-ui-vue3 2.9.2 → 2.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "2.9.2",
3
+ "version": "2.10.0",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,20 @@
1
+ <script setup>
2
+ import FormFieldText from './FormFieldText.vue'
3
+ </script>
4
+ <template>
5
+ <FormFieldText class="rsui-form-field-number"
6
+ type="number"
7
+ >
8
+ <template #label v-if="$slots.label">
9
+ <slot name="label"></slot>
10
+ </template>
11
+ <template #help v-if="$slots.help">
12
+ <slot name="help"></slot>
13
+ </template>
14
+ <template #error v-if="$slots.error">
15
+ <slot name="error"></slot>
16
+ </template>
17
+ </FormFieldText>
18
+ </template>
19
+ <style lang="scss" scoped>
20
+ </style>
@@ -155,15 +155,6 @@ function choose(option) {
155
155
 
156
156
  &__group {
157
157
  @apply relative;
158
-
159
- select {
160
- @apply pl-5 pr-14 truncate;
161
- @apply appearance-none rounded-full;
162
- @apply focus:ring focus:ring-highlight focus:border-highlight;
163
- option {
164
- @apply hidden;
165
- }
166
- }
167
158
  }
168
159
 
169
160
  &__options {
@@ -203,5 +194,19 @@ function choose(option) {
203
194
  @apply size-6 transform transition-transform;
204
195
  }
205
196
  }
197
+
198
+ select {
199
+ @apply block w-full border ring-0 bg-none cursor-pointer appearance-none transition;
200
+ @apply py-3 pl-5 pr-14 truncate;
201
+ @apply text-base rounded-full outline-none focus:outline-none;
202
+ @apply bg-white text-rsui-default placeholder-rsui-light border-rsui-grey-200;
203
+ @apply focus:ring focus:ring-highlight focus:border-highlight;
204
+ @apply invalid:border-danger invalid:ring-0;
205
+ @apply disabled:text-rsui-light disabled:bg-rsui-grey-200 disabled:ring-0 disabled:cursor-default;
206
+
207
+ option {
208
+ @apply hidden;
209
+ }
210
+ }
206
211
  }
207
212
  </style>
@@ -80,24 +80,4 @@ const formFieldSlotClass = computed(() => [
80
80
  @apply text-sm text-danger;
81
81
  }
82
82
  }
83
- </style>
84
- <style lang="scss">
85
- .rsui-form-field-slot {
86
- input[type='text'],
87
- input[type='email'],
88
- input[type='password']
89
- {
90
- @apply flex-1;
91
- @apply text-base text-rsui-default transition py-3 px-4 outline-none focus:outline-none;
92
- @apply bg-white placeholder-rsui-light;
93
- @apply disabled:text-rsui-light disabled:bg-rsui-grey-200 disabled:ring-0;
94
- }
95
- select {
96
- @apply block w-full border ring-0 bg-none cursor-pointer;
97
- @apply text-base text-rsui-default transition py-3 px-4 rounded-md outline-none focus:outline-none;
98
- @apply bg-white placeholder-rsui-light border-rsui-grey-200;
99
- @apply invalid:border-danger invalid:ring-0;
100
- @apply disabled:text-rsui-light disabled:bg-rsui-grey-200 disabled:ring-0 disabled:cursor-default;
101
- }
102
- }
103
83
  </style>
@@ -15,7 +15,7 @@ const inputElement = ref(null)
15
15
  <template>
16
16
  <FormFieldSlot
17
17
  :id="$attrs.id"
18
- :class="$attrs.class || 'rsui-form-field-text'"
18
+ :class="[$attrs.class, 'rsui-form-field-text']"
19
19
  :compact="$attrs.compact"
20
20
  >
21
21
  <template #label v-if="$slots.label">
@@ -60,7 +60,6 @@ const inputElement = ref(null)
60
60
  <style lang="scss" scoped>
61
61
  .rsui-form-field-text {
62
62
  @apply relative;
63
-
64
63
  &__group {
65
64
  @apply relative flex flex-nowrap overflow-hidden;
66
65
  @apply text-base transition;
@@ -78,5 +77,24 @@ const inputElement = ref(null)
78
77
  @apply flex items-center justify-center px-4 select-none;
79
78
  @apply bg-transparent;
80
79
  }
80
+
81
+ input[type='date'],
82
+ input[type='datetime-local'],
83
+ input[type='email'],
84
+ input[type='month'],
85
+ input[type='number'],
86
+ input[type='password'],
87
+ input[type='search'],
88
+ input[type='tel'],
89
+ input[type='text'],
90
+ input[type='time'],
91
+ input[type='url'],
92
+ input[type='week']
93
+ {
94
+ @apply flex-1;
95
+ @apply text-base text-rsui-default transition py-3 px-4 outline-none focus:outline-none;
96
+ @apply bg-white placeholder-rsui-light;
97
+ @apply disabled:text-rsui-light disabled:bg-rsui-grey-200 disabled:ring-0;
98
+ }
81
99
  }
82
100
  </style>
@@ -1,6 +1,7 @@
1
1
  import FormFieldCheckbox from './FormFieldCheckbox.vue'
2
2
  import FormFieldEmail from './FormFieldEmail.vue'
3
3
  import FormFieldHidden from './FormFieldHidden.vue'
4
+ import FormFieldNumber from './FormFieldNumber.vue'
4
5
  import FormFieldPassword from './FormFieldPassword.vue'
5
6
  import FormFieldPasswordToggle from './FormFieldPasswordToggle.vue'
6
7
  import FormFieldSearch from './FormFieldSearch.vue'
@@ -13,6 +14,7 @@ export {
13
14
  FormFieldCheckbox,
14
15
  FormFieldEmail,
15
16
  FormFieldHidden,
17
+ FormFieldNumber,
16
18
  FormFieldPassword,
17
19
  FormFieldPasswordToggle,
18
20
  FormFieldSearch,
@@ -1,56 +1,47 @@
1
- <script>
2
- import { ref, computed, defineComponent } from 'vue'
3
- import { useLottie } from '../../helpers/Lottie'
1
+ <script setup>
2
+ import { ref, computed } from 'vue'
4
3
  import LottieCubes from './LottieCubes.json'
4
+ import { useLottie } from '../../helpers/Lottie'
5
5
 
6
- export default defineComponent({
7
- props:{
8
- primary: {
9
- type: Boolean,
10
- default: false,
11
- },
12
- secondary: {
13
- type: Boolean,
14
- default: false,
15
- },
16
- tertiary: {
17
- type: Boolean,
18
- default: false,
19
- },
20
- danger: {
21
- type: Boolean,
22
- default: false,
23
- },
24
- white: {
25
- type: Boolean,
26
- default: false,
27
- },
6
+ const props = defineProps({
7
+ primary: {
8
+ type: Boolean,
9
+ default: false,
28
10
  },
11
+ secondary: {
12
+ type: Boolean,
13
+ default: false,
14
+ },
15
+ tertiary: {
16
+ type: Boolean,
17
+ default: false,
18
+ },
19
+ danger: {
20
+ type: Boolean,
21
+ default: false,
22
+ },
23
+ white: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
27
+ })
29
28
 
30
- setup(props) {
31
- const defaultColor = computed(() => !props.secondary && !props.tertiary && !props.danger && !props.white)
32
-
33
- const loaderClass = computed(() => [
34
- 'rsui-loader',
35
- {
36
- 'rsui-loader--primary': props.primary || defaultColor.value,
37
- 'rsui-loader--secondary': props.secondary,
38
- 'rsui-loader--tertiary': props.tertiary,
39
- 'rsui-loader--danger': props.danger,
40
- 'rsui-loader--white': props.white,
41
- }
42
- ])
29
+ const defaultColor = computed(() => !props.secondary && !props.tertiary && !props.danger && !props.white)
43
30
 
44
- const loaderElement = ref(null)
31
+ const loaderClass = computed(() => [
32
+ 'rsui-loader',
33
+ {
34
+ 'rsui-loader--primary': props.primary || defaultColor.value,
35
+ 'rsui-loader--secondary': props.secondary,
36
+ 'rsui-loader--tertiary': props.tertiary,
37
+ 'rsui-loader--danger': props.danger,
38
+ 'rsui-loader--white': props.white,
39
+ }
40
+ ])
45
41
 
46
- useLottie(loaderElement, LottieCubes)
42
+ const loaderElement = ref(null)
47
43
 
48
- return {
49
- loaderClass,
50
- loaderElement,
51
- }
52
- }
53
- })
44
+ useLottie(loaderElement, LottieCubes)
54
45
  </script>
55
46
  <template>
56
47
  <div ref="loaderElement"
@@ -1,5 +1,4 @@
1
1
  import { ref, watchEffect } from 'vue'
2
- import Lottie from 'lottie-web'
3
2
 
4
3
  export function useLottie(elementRef, animationData = null) {
5
4
 
@@ -15,13 +14,14 @@ export function useLottie(elementRef, animationData = null) {
15
14
  function loadLottie() {
16
15
  if (!elementRef.value) return
17
16
  if (!animationData) return
17
+ if (!window.lottie) return
18
18
 
19
19
  if (lottieAnimation.value) {
20
20
  lottieAnimation.value.destroy()
21
21
  lottieAnimation.value = null
22
22
  }
23
23
 
24
- lottieAnimation.value = Lottie.loadAnimation({
24
+ lottieAnimation.value = window.lottie.loadAnimation({
25
25
  container: elementRef.value,
26
26
  renderer: 'svg',
27
27
  loop: true,