@unsource/ui 2.7.10 → 2.7.12

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.7.10",
4
+ "version": "2.7.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -52,8 +52,8 @@ const { variant = "" } = defineProps({
52
52
  });
53
53
  const variants = {
54
54
  "danger": "bg-danger/10 text-danger border-danger",
55
- "primary": "bg-primary/10 text-primary border-primary",
56
- "primary-fill": "bg-primary text-white border-transparent",
55
+ "primary": "bg-primary-500/10 bg-primary-500 border-primary",
56
+ "primary-fill": "bg-primary-500 text-white border-transparent",
57
57
  "secondary": "bg-gray-600/10 text-gray-600 border-transparent",
58
58
  "secondary-fill": "bg-gray-600 text-white border-transparent",
59
59
  "secondary-bordered": "bg-transparent border-gray-400 text-gray-400"
@@ -10,7 +10,7 @@
10
10
  >
11
11
  <div
12
12
  name="innerBox"
13
- class="bg-primary rounded h-8px w-10px transition-height duration-200"
13
+ class="bg-primary-500 rounded h-8px w-10px transition-height duration-200"
14
14
  :class="[customClass.innerBox, customClass[selected ? 'selected' : 'notSelected']?.innerBox, selected ? '!h-10px' : '!h-1px']"
15
15
  />
16
16
  </div>
@@ -19,7 +19,7 @@
19
19
  />
20
20
  <div
21
21
  class="absolute left-1/50 top-1/40 flex flex-col rounded-2xl gap-1 items-center select-none
22
- text-primary-500 children:(bg-primary w-8 h-8 p-1 flex justify-center items-center rounded-2xl cursor-pointer) z-[999999]"
22
+ text-primary-500 children:(bg-primary-500 w-8 h-8 p-1 flex justify-center items-center rounded-2xl cursor-pointer) z-[999999]"
23
23
  >
24
24
  <UnNuxtIcon
25
25
  name="solar:add-square-line-duotone"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="px-4 py-3 flex flex-row items-center gap-3 transition duration-300 hover:bg-primary/10 border-0 min-w-fit"
3
+ class="px-4 py-3 flex flex-row items-center gap-3 transition duration-300 hover:bg-primary-500/10 border-0 min-w-fit"
4
4
  @click="toggle"
5
5
  >
6
6
  <div
@@ -10,7 +10,7 @@
10
10
  >
11
11
  <div
12
12
  name="radioInside"
13
- class="bg-primary rounded-1/2 h-10px w-10px transition-opacity duration-200"
13
+ class="bg-primary-500 rounded-1/2 h-10px w-10px transition-opacity duration-200"
14
14
  :class="[customClass.radioInside, customClass[selected ? 'selected' : 'notSelected']?.radioInside, selected ? 'opacity-full' : 'opacity-0']"
15
15
  />
16
16
  </div>
@@ -6,7 +6,7 @@
6
6
  :class="[
7
7
  customClass.label,
8
8
  item?.value === value ? customClass.selectedLabel : customClass.normalLabel,
9
- item?.value === value ? 'font-semibold text-primary cursor-default border-b-primary' : 'border-b-border',
9
+ item?.value === value ? 'font-semibold bg-primary-500 cursor-default border-b-primary' : 'border-b-border',
10
10
  mini ? 'px-3' : ' px-4'
11
11
  ]"
12
12
  class="flex gap-2 justify-center items-center flex-grow basis-1 border-b-(2 solid) cursor-pointer p-3 text-sm"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <tr
3
- class="children:p-3 <md:children:p-1 text-center border-b-(2 solid border) hover:bg-primary/10"
4
- :class="[trClass?.(item, items), { '!bg-primary/20': selected?.[idKey] === item[idKey] }]"
3
+ class="children:p-3 <md:children:p-1 text-center border-b-(2 solid border) hover:bg-primary-500/10"
4
+ :class="[trClass?.(item, items), { '!bg-primary-500/20': selected?.[idKey] === item[idKey] }]"
5
5
  @click="$emit('click:row', item);
6
6
  selected = item"
7
7
  @dbclick="$emit('dbclick:row', item)"
@@ -1,11 +1,20 @@
1
+ export type CardCustomClass = Partial<Record<'label' | 'button' | 'buttonWrapper' | 'buttonLabel', string>>;
1
2
  type __VLS_Props = {
2
- label: string;
3
- disabled: boolean;
3
+ label?: string;
4
+ disabled?: boolean;
5
+ customClass?: CardCustomClass;
6
+ trueLabel?: string;
7
+ falseLabel?: string;
8
+ size?: 'sm' | 'md' | 'lg' | 'xl';
4
9
  };
5
10
  type __VLS_ModelProps = {
6
11
  modelValue?: any;
7
12
  };
8
13
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: any) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
19
  declare const _default: typeof __VLS_export;
11
20
  export default _default;
@@ -1,26 +1,53 @@
1
1
  <template>
2
2
  <div
3
- class="h-12 w-full flex flex-row gap-1 items-center cursor-pointer text-black-1 select-none"
4
- @click="!disabled && changeValue()"
3
+ class="group h-12 w-full flex flex-row gap-1 items-center cursor-pointer text-black-1 select-none"
4
+ @click="changeValue"
5
5
  >
6
- <div class="flex-grow truncate text-sm">
6
+ <div
7
+ v-if="label"
8
+ :class="customClass?.label"
9
+ class="flex-grow truncate text-sm"
10
+ >
7
11
  {{ label }}
8
12
  </div>
9
- <UnToggleButton
10
- :value="value"
11
- :disabled="disabled"
12
- />
13
+ <div
14
+ class="aspect-2/1 relative flex items-center rounded-full transition-bg duration-300 group/wrapper"
15
+ :class="[sizeClass[size], { 'opacity-50 disabled': disabled }, value ? 'true bg-primary-500' : 'false bg-border', customClass?.buttonWrapper]"
16
+ >
17
+ <div
18
+ class="group/button flex justify-center items-center absolute bg-white top-1/2 -translate-y-1/2 h-[calc(100%-4px)] aspect-square rounded-full shadow-toggle transform transition-all duration-200"
19
+ :class="[value ? 'end-[calc(100%-2px)] -translate-x-full' : 'end-0.5', customClass?.button]"
20
+ >
21
+ <small
22
+ v-if="value ? trueLabel : falseLabel"
23
+ :class="customClass?.buttonLabel"
24
+ class="px-1 text-inherit"
25
+ >
26
+ {{ value ? trueLabel : falseLabel }}
27
+ </small>
28
+ </div>
29
+ </div>
13
30
  </div>
14
31
  </template>
15
32
 
16
33
  <script setup>
17
- const emit = defineEmits(["input"]);
18
- defineProps({
19
- label: { type: String, required: true },
20
- disabled: { type: Boolean, required: true }
34
+ const { size = "xl", disabled } = defineProps({
35
+ label: { type: String, required: false },
36
+ disabled: { type: Boolean, required: false },
37
+ customClass: { type: Object, required: false },
38
+ trueLabel: { type: String, required: false },
39
+ falseLabel: { type: String, required: false },
40
+ size: { type: String, required: false }
21
41
  });
22
42
  const value = defineModel();
23
43
  const changeValue = () => {
44
+ if (disabled) return;
24
45
  value.value = !value.value;
25
46
  };
47
+ const sizeClass = {
48
+ sm: "w-8 children:(text-xs)",
49
+ md: "w-10 children:(text-sm)",
50
+ lg: "w-14 children:(text-md)",
51
+ xl: "w-18 children:(text-lg)"
52
+ };
26
53
  </script>
@@ -1,11 +1,20 @@
1
+ export type CardCustomClass = Partial<Record<'label' | 'button' | 'buttonWrapper' | 'buttonLabel', string>>;
1
2
  type __VLS_Props = {
2
- label: string;
3
- disabled: boolean;
3
+ label?: string;
4
+ disabled?: boolean;
5
+ customClass?: CardCustomClass;
6
+ trueLabel?: string;
7
+ falseLabel?: string;
8
+ size?: 'sm' | 'md' | 'lg' | 'xl';
4
9
  };
5
10
  type __VLS_ModelProps = {
6
11
  modelValue?: any;
7
12
  };
8
13
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: any) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
19
  declare const _default: typeof __VLS_export;
11
20
  export default _default;
@@ -16,6 +16,7 @@ export default defineConfig({
16
16
  "secondary": "#5e5e5e",
17
17
  "secondary-500": "#fdf037",
18
18
  "primary": "#1270da",
19
+ "primary-500": "#1270da",
19
20
  "text": {
20
21
  head: "#4D4444"
21
22
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.7.10",
3
+ "version": "2.7.12",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",
@@ -1,11 +0,0 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- value: number | boolean;
6
- disabled: boolean;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly value: number | boolean;
10
- readonly disabled: boolean;
11
- };
@@ -1,22 +0,0 @@
1
- <template>
2
- <div
3
- class="w-9 h-5 relative flex items-center rounded-full transition-bg duration-200"
4
- :class="[value && !disabled ? 'bg-primary-500' : 'bg-border']">
5
- <div
6
- class="absolute bg-white h-4 w-4 rounded-1/2 shadow-toggle transform transition-all duration-200"
7
- :class="[ value ? 'left-full -translate-x-18px ' : 'left-0 translate-x-0.5',]"/>
8
- </div>
9
- </template>
10
-
11
- <script setup>
12
- defineProps({
13
- value: {
14
- type: [Boolean, Number],
15
- default: false
16
- },
17
- disabled: {
18
- type: Boolean,
19
- default: false
20
- }
21
- });
22
- </script>
@@ -1,11 +0,0 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof __VLS_props>;
5
- value: number | boolean;
6
- disabled: boolean;
7
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
- declare const __VLS_props: {
9
- readonly value: number | boolean;
10
- readonly disabled: boolean;
11
- };