adata-ui 4.0.20 → 4.0.21

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/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
7
  "failOnWarn": false,
8
- "version": "4.0.20",
8
+ "version": "4.0.21",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
@@ -0,0 +1,57 @@
1
+ <script setup>
2
+ import { twMerge } from "tailwind-merge";
3
+ defineOptions({ name: "ADigitBadge" });
4
+ const props = defineProps({
5
+ type: { type: String, required: false, default: "primary" },
6
+ view: { type: String, required: false, default: "default" },
7
+ size: { type: String, required: false, default: "lg" },
8
+ value: { type: [String, Number], required: true },
9
+ disabled: { type: Boolean, required: false, default: false },
10
+ customClasses: { type: String, required: false, default: "" },
11
+ prefix: { type: String, required: false, default: "" }
12
+ });
13
+ const formattedValue = computed(() => {
14
+ return Number(props.value).toLocaleString("ru-RU");
15
+ });
16
+ const classes = computed(() => [
17
+ props.disabled ? "text-gray-500 bg-deepblue-900/5" : typeSwitchValues[props.view][props.type],
18
+ "inline-flex items-center justify-center font-medium rounded-full select-none inline-flex outline-none",
19
+ sizeSwitchValues[props.size],
20
+ props.value && props.value.toString().length > 2 ? "w-auto" : ""
21
+ ]);
22
+ const typeSwitchValues = {
23
+ default: {
24
+ primary: "bg-blue-700 text-white dark:bg-blue-500 dark:text-gray-900",
25
+ success: "bg-green-500 text-white dark:bg-green-400 dark:text-gray-900",
26
+ danger: "bg-red-500 text-white dark:bg-red-400 dark:text-gray-900",
27
+ warning: "bg-yellow-400 text-white dark:text-gray-900",
28
+ gray: "bg-gray-50 text-gray-500 dark:text-gray-900",
29
+ orange: "bg-orange-600 text-white dark:bg-orange-500 dark:text-gray-900"
30
+ },
31
+ inverted: {
32
+ primary: "bg-white text-blue-700 dark:text-blue-500 dark:bg-gray-900",
33
+ success: "bg-white text-green-500 dark:text-green-400 dark:bg-gray-900",
34
+ danger: "bg-white text-red-500 dark:text-red-400 dark:bg-gray-900",
35
+ warning: "bg-white text-yellow-400 dark:bg-gray-900",
36
+ gray: "bg-white text-gray-500 dark:text-gray-200 dark:bg-gray-200/10",
37
+ orange: "bg-white text-deepblue-900 dark:text-orange-500 dark:bg-gray-900"
38
+ },
39
+ transparent: {
40
+ success: "bg-green-500/20 text-green-500",
41
+ danger: "bg-red-500/20 text-red-500 dark:text-red-400"
42
+ }
43
+ };
44
+ const sizeSwitchValues = {
45
+ sm: "w-4 h-4 px-1 text-[9.5px]",
46
+ md: "w-5 h-5 px-1 text-[10px]",
47
+ lg: "px-2 w-6 h-6 text-xs font-semibold"
48
+ };
49
+ </script>
50
+
51
+ <template>
52
+ <div
53
+ :class="twMerge(...classes, customClasses)"
54
+ >
55
+ {{ prefix }}{{ formattedValue }}
56
+ </div>
57
+ </template>
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ type?: 'primary' | 'success' | 'danger' | 'gray' | 'orange' | 'warning';
3
+ view?: 'default' | 'inverted';
4
+ size?: 'sm' | 'md' | 'lg';
5
+ value: string | number;
6
+ disabled?: boolean;
7
+ customClasses?: string;
8
+ prefix?: string;
9
+ }
10
+ export type StateType = {
11
+ [key in 'primary' | 'success' | 'danger' | 'gray' | 'orange' | 'warning']?: string;
12
+ };
13
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ size: "sm" | "md" | "lg";
15
+ type: "primary" | "success" | "danger" | "gray" | "orange" | "warning";
16
+ disabled: boolean;
17
+ view: "default" | "inverted";
18
+ customClasses: string;
19
+ prefix: string;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import ADigitBadge from "../DigitBadge.vue";
3
+ import AButton from "../button/Button.vue";
2
4
  defineOptions({ name: "APillTabs" });
3
5
  const emit = defineEmits(["selectOption", "prevent"]);
4
6
  const props = defineProps({
@@ -88,7 +90,7 @@ onMounted(() => {
88
90
  class="scroll-container overflow-auto whitespace-nowrap"
89
91
  :class="props.wrapper === 'row' ? 'flex gap-1' : 'flex flex-col gap-1'"
90
92
  >
91
- <button
93
+ <a-button
92
94
  v-for="option in options"
93
95
  :key="option.key"
94
96
  :disabled="option.disabled"
@@ -123,7 +125,7 @@ onMounted(() => {
123
125
  </template>
124
126
  </span>
125
127
  </slot>
126
- </button>
128
+ </a-button>
127
129
  </div>
128
130
  </template>
129
131
 
@@ -13,11 +13,11 @@ type __VLS_Props = Props;
13
13
  type __VLS_PublicProps = __VLS_Props & {
14
14
  modelValue?: any;
15
15
  };
16
- declare var __VLS_1: {
16
+ declare var __VLS_8: {
17
17
  option: any;
18
18
  };
19
19
  type __VLS_Slots = {} & {
20
- option?: (props: typeof __VLS_1) => any;
20
+ option?: (props: typeof __VLS_8) => any;
21
21
  };
22
22
  declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
23
23
  size: "lg" | "sm" | "xs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "4.0.20",
3
+ "version": "4.0.21",
4
4
  "description": "Adata UI",
5
5
  "repository": "your-org/my-module",
6
6
  "license": "MIT",