bonkers-ui 1.0.59 → 1.0.60

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": "bonkers-ui",
3
- "version": "v1.0.59",
3
+ "version": "v1.0.60",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "storybook": "storybook dev -p 6006",
@@ -12,7 +12,6 @@
12
12
  <ui-typography
13
13
  v-if="slots.default"
14
14
  :size="getBadgeSize"
15
- :weight="ETextWeight.SEMI_BOLD"
16
15
  class="whitespace-nowrap"
17
16
  line-height
18
17
  :class="[
@@ -12,3 +12,63 @@ export enum EInputType {
12
12
  EMAIL = "email",
13
13
  DATE = "date",
14
14
  }
15
+
16
+ export enum EAutocomplete {
17
+ OFF = "off",
18
+ ON = "on", // dont forget to add name attribute to input (custom one)
19
+ NAME = "name", // full name
20
+ GIVEN_NAME = "given-name",
21
+ ADDITIONAL_NAME = "additional-name",
22
+ FAMILY_NAME = "family-name",
23
+
24
+ HONORIFIC_PREFIX = "honorific-prefix",
25
+ NICKNAME = "nickname",
26
+
27
+ EMAIL = "email",
28
+ USERNAME = "username",
29
+ NEW_PASSWORD = "new-password",
30
+ CURRENT_PASSWORD = "current-password",
31
+ ORGANIZATION_TITLE = "organization-title",
32
+ ORGANIZATION = "organization",
33
+ STREET_ADDRESS = "street-address",
34
+ SHIPPING = "shipping",
35
+ BUILDING = "building",
36
+ ADDRESS_LINE1 = "address-line1",
37
+ ADDRESS_LINE2 = "address-line2",
38
+ ADDRESS_LINE3 = "address-line3",
39
+ ADDRESS_LEVEL4 = "address-level4",
40
+ ADDRESS_LEVEL3 = "address-level3",
41
+ ADDRESS_LEVEL2 = "address-level2",
42
+ ADDRESS_LEVEL1 = "address-level1",
43
+ COUNTRY = "country",
44
+ COUNTRY_NAME = "country-name",
45
+ POSTAL_CODE = "postal-code",
46
+ CC_NAME = "cc-name",
47
+ CC_GIVEN_NAME = "cc-given-name",
48
+ CC_ADDITIONAL_NAME = "cc-additional-name",
49
+ CC_FAMILY_NAME = "cc-family-name",
50
+ CC_NUMBER = "cc-number",
51
+ CC_EXP = "cc-exp",
52
+ CC_EXP_MONTH = "cc-exp-month",
53
+ CC_EXP_YEAR = "cc-exp-year",
54
+ CC_CSC = "cc-csc",
55
+ CC_TYPE = "cc-type",
56
+ TRANSACTION_CURRENCY = "transaction-currency",
57
+ TRANSACTION_AMOUNT = "transaction-amount",
58
+ LANGUAGE = "language",
59
+ BIRTHDAY = "bday",
60
+ BIRTHDAY_DAY = "bday-day",
61
+ BIRTHDAY_MONTH = "bday-month",
62
+ BIRTHDAY_YEAR = "bday-year",
63
+ SEX = "sex",
64
+ TEL= "tel",
65
+ TEL_COUNTRY_CODE = "tel-country-code",
66
+ TEL_NATIONAL = "tel-national",
67
+ TEL_AREA_CODE = "tel-area-code",
68
+ TEL_LOCAL = "tel-local",
69
+ TEL_EXTENSION = "tel-extension",
70
+ IMPP = "impp",
71
+ URL = "url",
72
+ PHOTO = "photo",
73
+ WEBAUTHN = "webauthn",
74
+ }
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ui-input.vue";
2
- export { EInputType, EInputKinds } from "./_typings";
2
+ export { EInputType, EInputKinds, EAutocomplete } from "./_typings";
@@ -23,7 +23,8 @@
23
23
  <slot name="prefix-icon" />
24
24
 
25
25
  <input
26
- :autocomplete="getAutoComplete()"
26
+ :autocomplete="autocomplete || getAutoComplete"
27
+ :name="name || autocomplete || getAutoComplete"
27
28
  :value="modelValue"
28
29
  :pattern="pattern"
29
30
  class="w-full border-0 bg-transparent outline-none placeholder:italic placeholder:text-secondary-alt"
@@ -32,7 +33,7 @@
32
33
  :maxlength="maxlength"
33
34
  :minlength="minlength"
34
35
  @input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
35
- @focus="focusHandler || (()=>undefined)"
36
+ @focus="focusHandler || undefined"
36
37
  >
37
38
 
38
39
  <slot name="postfix-icon" />
@@ -53,7 +54,8 @@
53
54
  </template>
54
55
 
55
56
  <script lang="ts" setup>
56
- import { EInputKinds, EInputType } from "./_typings";
57
+ import { computed } from "vue";
58
+ import { EAutocomplete, EInputKinds, EInputType } from "./_typings";
57
59
  import UiTypography, { ETypographySizes, EColors } from "../ui-typography";
58
60
 
59
61
  const props = withDefaults(defineProps<{
@@ -68,11 +70,13 @@
68
70
  maxlength?: string;
69
71
  minlength?: string;
70
72
  focusHandler?: (e:FocusEvent) => void;
71
- autocomplete?: string;
73
+ autocomplete?: EAutocomplete;
74
+ name?: string;
72
75
  }>(), {
73
76
  modelValue: "",
74
77
  placeholder: "",
75
- autocomplete: "",
78
+ autocomplete: undefined,
79
+ name: undefined,
76
80
  heading: undefined,
77
81
  subLabel: undefined,
78
82
  pattern: undefined,
@@ -85,13 +89,12 @@
85
89
 
86
90
  defineEmits(["update:modelValue"]);
87
91
 
88
- const getAutoComplete =()=> {
89
- if (props.autocomplete !== "") return props.autocomplete;
92
+ const getAutoComplete = computed(()=> {
90
93
  switch (props.type) {
91
- case EInputType.PASSWORD: return "current-password";
92
- case EInputType.EMAIL: return "email";
93
- default: return "off";
94
+ case EInputType.PASSWORD: return EAutocomplete.CURRENT_PASSWORD;
95
+ case EInputType.EMAIL: return EAutocomplete.EMAIL;
96
+ default: return undefined;
94
97
  }
95
- };
98
+ });
96
99
 
97
100
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="ui-progress">
3
3
  <div
4
- class="relative h-xs w-full overflow-hidden rounded-lg bg-primary-50"
4
+ class="relative h-xs w-full overflow-hidden rounded-lg bg-primary-200"
5
5
  >
6
6
  <div
7
7
  class="