@toife/vue 3.1.3 → 3.1.5

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.
Files changed (157) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/components/action/action.scss +1 -1
  4. package/src/components/action/action.vue +5 -5
  5. package/src/components/app/app.scss +2 -2
  6. package/src/components/app/app.type.ts +6 -0
  7. package/src/components/app/app.vue +8 -2
  8. package/src/components/avatar/avatar.scss +6 -4
  9. package/src/components/avatar/avatar.vue +6 -6
  10. package/src/components/button/button.scss +19 -16
  11. package/src/components/button/button.type.ts +3 -1
  12. package/src/components/button/button.vue +7 -7
  13. package/src/components/cable/cable.vue +2 -2
  14. package/src/components/card/card/card.scss +5 -3
  15. package/src/components/card/card/card.vue +5 -5
  16. package/src/components/card/card-body/card-body.scss +2 -2
  17. package/src/components/card/card-body/card-body.vue +2 -2
  18. package/src/components/card/card-footer/card-footer.scss +3 -3
  19. package/src/components/card/card-footer/card-footer.vue +2 -2
  20. package/src/components/card/card-header/card-header.scss +3 -3
  21. package/src/components/card/card-header/card-header.vue +2 -2
  22. package/src/components/checkbox/checkbox.html +1 -1
  23. package/src/components/checkbox/checkbox.scss +27 -27
  24. package/src/components/checkbox/checkbox.type.ts +4 -0
  25. package/src/components/checkbox/checkbox.vue +8 -6
  26. package/src/components/collapse/collapse.html +1 -1
  27. package/src/components/collapse/collapse.scss +2 -2
  28. package/src/components/collapse/collapse.vue +9 -9
  29. package/src/components/container/container.vue +2 -2
  30. package/src/components/decision-modal/decision-modal.scss +12 -10
  31. package/src/components/decision-modal/decision-modal.vue +8 -8
  32. package/src/components/divider/divider.scss +2 -2
  33. package/src/components/divider/divider.vue +4 -4
  34. package/src/components/dropdown/dropdown.scss +8 -5
  35. package/src/components/dropdown/dropdown.type.ts +4 -1
  36. package/src/components/dropdown/dropdown.vue +8 -6
  37. package/src/components/field/field.type.ts +4 -4
  38. package/src/components/field/outline/outline.scss +24 -21
  39. package/src/components/field/outline/outline.vue +26 -18
  40. package/src/components/form-group/form-group.vue +2 -2
  41. package/src/components/gesture-indicator/gesture-indicator.scss +4 -2
  42. package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
  43. package/src/components/image/image.vue +12 -5
  44. package/src/components/index.ts +1 -0
  45. package/src/components/layout/flex/flex.scss +0 -2
  46. package/src/components/layout/flex/flex.vue +8 -8
  47. package/src/components/layout/flex-item/flex-item.html +1 -0
  48. package/src/components/layout/flex-item/flex-item.scss +48 -0
  49. package/src/components/layout/flex-item/flex-item.type.ts +11 -0
  50. package/src/components/layout/flex-item/flex-item.vue +27 -0
  51. package/src/components/layout/flex-item/index.ts +2 -0
  52. package/src/components/layout/grid/grid.scss +0 -2
  53. package/src/components/layout/grid/grid.vue +6 -6
  54. package/src/components/layout/grid-item/grid-item.html +1 -0
  55. package/src/components/layout/grid-item/grid-item.scss +49 -0
  56. package/src/components/layout/grid-item/grid-item.type.ts +14 -0
  57. package/src/components/layout/grid-item/grid-item.vue +27 -0
  58. package/src/components/layout/grid-item/index.ts +2 -0
  59. package/src/components/layout/index.ts +2 -1
  60. package/src/components/modal/modal.scss +4 -2
  61. package/src/components/modal/modal.vue +68 -5
  62. package/src/components/page/page.vue +2 -2
  63. package/src/components/present/present.scss +3 -3
  64. package/src/components/present/present.vue +14 -14
  65. package/src/components/radio/radio/radio.html +1 -1
  66. package/src/components/radio/radio/radio.scss +25 -18
  67. package/src/components/radio/radio/radio.type.ts +4 -0
  68. package/src/components/radio/radio/radio.vue +7 -5
  69. package/src/components/radio/radio-group/radio-group.vue +2 -2
  70. package/src/components/refresher/refresher.html +1 -4
  71. package/src/components/refresher/refresher.scss +8 -26
  72. package/src/components/refresher/refresher.vue +2 -16
  73. package/src/components/route/route-navigator/route-navigator.scss +2 -2
  74. package/src/components/route/route-navigator/route-navigator.vue +10 -13
  75. package/src/components/route/route-wrapper/route-wrapper.composable.ts +5 -15
  76. package/src/components/route/route-wrapper/route-wrapper.type.ts +0 -4
  77. package/src/components/route/route-wrapper/route-wrapper.vue +4 -12
  78. package/src/components/route/route.type.ts +0 -1
  79. package/src/components/segmented-field/segmented-field.html +1 -1
  80. package/src/components/segmented-field/segmented-field.scss +2 -2
  81. package/src/components/segmented-field/segmented-field.vue +8 -8
  82. package/src/components/select/select.html +2 -2
  83. package/src/components/select/select.scss +10 -10
  84. package/src/components/select/select.vue +10 -10
  85. package/src/components/skeleton/skeleton.scss +3 -1
  86. package/src/components/skeleton/skeleton.vue +7 -7
  87. package/src/components/slide-range/index.ts +2 -0
  88. package/src/components/slide-range/slide-range.html +19 -0
  89. package/src/components/slide-range/slide-range.scss +161 -0
  90. package/src/components/slide-range/slide-range.type.ts +16 -0
  91. package/src/components/slide-range/slide-range.vue +229 -0
  92. package/src/components/switch/switch.html +1 -1
  93. package/src/components/switch/switch.scss +29 -38
  94. package/src/components/switch/switch.type.ts +6 -0
  95. package/src/components/switch/switch.vue +24 -8
  96. package/src/components/tabs/tab/tab.html +1 -1
  97. package/src/components/tabs/tab/tab.scss +13 -0
  98. package/src/components/tabs/tab/tab.vue +4 -2
  99. package/src/components/tabs/tabs/index.ts +1 -0
  100. package/src/components/tabs/tabs/tabs.scss +194 -122
  101. package/src/components/tabs/tabs/tabs.type.ts +5 -2
  102. package/src/components/tabs/tabs/tabs.vue +47 -27
  103. package/src/components/toast/toast/toast.vue +2 -2
  104. package/src/components/toast/toast-content/toast-content.scss +6 -5
  105. package/src/components/toast/toast-content/toast-content.vue +5 -5
  106. package/src/components/toolbar/toolbar.scss +4 -4
  107. package/src/components/toolbar/toolbar.type.ts +1 -1
  108. package/src/components/toolbar/toolbar.vue +7 -7
  109. package/src/factory.ts +108 -50
  110. package/src/index.ts +1 -1
  111. package/src/type.ts +2 -1
  112. package/src/utils/style/index.ts +9 -9
  113. package/src/utils/style.md +9 -9
  114. package/src/components/action/action.md +0 -115
  115. package/src/components/app/app.md +0 -77
  116. package/src/components/avatar/avatar.md +0 -64
  117. package/src/components/button/button.md +0 -66
  118. package/src/components/cable/cable.md +0 -57
  119. package/src/components/card/card/card.md +0 -57
  120. package/src/components/card/card-body/card-body.md +0 -34
  121. package/src/components/card/card-footer/card-footer.md +0 -42
  122. package/src/components/card/card-header/card-header.md +0 -44
  123. package/src/components/checkbox/checkbox.md +0 -60
  124. package/src/components/collapse/collapse.md +0 -59
  125. package/src/components/container/container.md +0 -38
  126. package/src/components/decision-modal/decision-modal.md +0 -79
  127. package/src/components/divider/divider.md +0 -42
  128. package/src/components/field/field.md +0 -68
  129. package/src/components/field/outline/outline-field.md +0 -44
  130. package/src/components/form-group/form-group.md +0 -41
  131. package/src/components/gesture-indicator/gesture-indicator.md +0 -42
  132. package/src/components/image/image.md +0 -41
  133. package/src/components/layout/cell/cell.html +0 -1
  134. package/src/components/layout/cell/cell.md +0 -47
  135. package/src/components/layout/cell/cell.scss +0 -54
  136. package/src/components/layout/cell/cell.type.ts +0 -19
  137. package/src/components/layout/cell/cell.vue +0 -35
  138. package/src/components/layout/cell/index.ts +0 -2
  139. package/src/components/layout/grid/grid.md +0 -50
  140. package/src/components/modal/modal.md +0 -65
  141. package/src/components/page/page.md +0 -39
  142. package/src/components/present/present.md +0 -60
  143. package/src/components/radio/radio/radio.md +0 -53
  144. package/src/components/radio/radio-group/radio-group.md +0 -62
  145. package/src/components/refresher/refresher.md +0 -53
  146. package/src/components/route/route-navigator/route-navigator.md +0 -50
  147. package/src/components/route/route-outlet/route-outlet.md +0 -30
  148. package/src/components/route/route-provider/route-provider.md +0 -46
  149. package/src/components/route/route-wrapper/route-wrapper.md +0 -45
  150. package/src/components/segmented-field/segmented-field.md +0 -58
  151. package/src/components/skeleton/skeleton.md +0 -47
  152. package/src/components/switch/switch.md +0 -57
  153. package/src/components/tabs/tab/tab.md +0 -52
  154. package/src/components/tabs/tabs/tabs.md +0 -59
  155. package/src/components/toast/toast/toast.md +0 -56
  156. package/src/components/toast/toast-content/toast-content.md +0 -41
  157. package/src/components/toolbar/toolbar.md +0 -54
@@ -1,11 +1,17 @@
1
+ import { AppSize } from "../app";
2
+
3
+ export type SwitchSize = AppSize;
4
+
1
5
  // Type definitions
2
6
  export type SwitchProps = {
3
7
  modelValue?: boolean;
4
8
  role?: string;
9
+ size?: SwitchSize;
5
10
  shape?: string;
6
11
  disabled?: boolean;
7
12
  readonly?: boolean;
8
13
  shadow?: boolean;
14
+ bounce?: number | string;
9
15
  };
10
16
 
11
17
  export type SwitchEmit = {
@@ -1,17 +1,19 @@
1
1
  <style lang="scss" src="./switch.scss" scoped></style>
2
2
  <template src="./switch.html"></template>
3
3
  <script lang="ts" setup>
4
- import { computed, inject, ref } from "vue";
4
+ import { computed, inject, ref, onMounted } from "vue";
5
5
  import type { SwitchProps, SwitchEmit } from "./switch.type";
6
- import { withPrefix } from "../../utils";
6
+ import { cssPrefix, cssProperty } from "../../utils";
7
7
  import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
8
8
 
9
9
  // Component setup (props, emits, injects)
10
10
  // ----------------------------------------------------------------------------
11
11
  const props = withDefaults(defineProps<SwitchProps>(), {
12
12
  modelValue: false,
13
+ size: "standard",
13
14
  readonly: false,
14
15
  shadow: undefined,
16
+ bounce: 1.5,
15
17
  });
16
18
  const emit = defineEmits<SwitchEmit>();
17
19
  const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
@@ -19,6 +21,7 @@ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
19
21
  // Reactive state
20
22
  // ----------------------------------------------------------------------------
21
23
  const isFocused = ref(false);
24
+ const isFirstRender = ref(true);
22
25
 
23
26
  // Computed properties
24
27
  // ----------------------------------------------------------------------------
@@ -26,7 +29,7 @@ const switchWrapperAttrs = computed(() => {
26
29
  const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
27
30
  return {
28
31
  class: [
29
- withPrefix("switch-wrapper"),
32
+ cssPrefix("switch-wrapper"),
30
33
  {
31
34
  disabled: props.disabled,
32
35
  readonly: props.readonly,
@@ -34,7 +37,13 @@ const switchWrapperAttrs = computed(() => {
34
37
  focus: isFocused.value,
35
38
  on: props.modelValue,
36
39
  },
40
+ {
41
+ transition: isFirstRender.value ? false : true,
42
+ },
37
43
  ],
44
+ style: {
45
+ [cssProperty(["switch", "bounce", "ratio"])]: props.bounce,
46
+ },
38
47
  };
39
48
  });
40
49
 
@@ -44,16 +53,17 @@ const switchAttrs = computed(() => {
44
53
  const role = props.role || baseRole;
45
54
  return {
46
55
  class: [
47
- withPrefix(["layer", "switch"]),
48
- withPrefix(["role", role]),
49
- withPrefix(["shape", shape]),
50
- withPrefix("switch"),
56
+ cssPrefix(["layer", "switch"]),
57
+ cssPrefix(["role", role]),
58
+ cssPrefix(["shape", shape]),
59
+ cssPrefix(["size", props.size]),
60
+ cssPrefix("switch"),
51
61
  ],
52
62
  };
53
63
  });
54
64
 
55
65
  const switchIconAttrs = {
56
- class: [withPrefix("switch-icon")],
66
+ class: [cssPrefix("switch-icon")],
57
67
  } as const;
58
68
 
59
69
  // Methods
@@ -78,4 +88,10 @@ const onKeydown = (e: KeyboardEvent) => {
78
88
  e.preventDefault();
79
89
  onSwitch();
80
90
  };
91
+
92
+ onMounted(() => {
93
+ setTimeout(() => {
94
+ isFirstRender.value = false;
95
+ }, 500);
96
+ });
81
97
  </script>
@@ -1,5 +1,5 @@
1
1
  <li v-bind="tabAttrs">
2
- <CustomButton block :role="role" :shape="shape" @click="handleClick">
2
+ <CustomButton block :role="role" :shape="shape" :size="size" @click="handleClick">
3
3
  <slot />
4
4
  </CustomButton>
5
5
  </li>
@@ -0,0 +1,13 @@
1
+ @use "@toife/sass-layer" as sass;
2
+
3
+ $button: sass.fn-naming-prefix("button");
4
+
5
+ .#{$button} {
6
+ background-color: none;
7
+ border: none;
8
+
9
+ &:focus,
10
+ &:active {
11
+ outline: none;
12
+ }
13
+ }
@@ -1,9 +1,10 @@
1
1
  <template src="./tab.html"></template>
2
+ <style lang="scss" src="./tab.scss" scoped></style>
2
3
  <script lang="ts" setup>
3
4
  import { computed, inject } from "vue";
4
5
  import { Button as CustomButton } from "../../button";
5
6
  import { type TabProps } from "./tab.type";
6
- import { withPrefix } from "../../../utils";
7
+ import { cssPrefix } from "../../../utils";
7
8
  import { type TabsProviderState, TABS_PROVIDER_STATE_KEY } from "../tabs";
8
9
 
9
10
  // Component setup (props, emits, injects)
@@ -17,11 +18,12 @@ const tabsState = inject<TabsProviderState>(TABS_PROVIDER_STATE_KEY);
17
18
  // ----------------------------------------------------------------------------
18
19
  const role = computed(() => tabsState?.role.value || "");
19
20
  const shape = computed(() => tabsState?.shape.value || "");
21
+ const size = computed(() => tabsState?.size.value || "standard");
20
22
  const isActive = computed(() => tabsState?.activeValue.value === props.value);
21
23
  const tabAttrs = computed(() => {
22
24
  return {
23
25
  class: [
24
- withPrefix("tab"),
26
+ cssPrefix("tab"),
25
27
  {
26
28
  active: isActive.value,
27
29
  },
@@ -5,5 +5,6 @@ export type {
5
5
  TabsProviderState,
6
6
  TabsVariant,
7
7
  TabsPlacement,
8
+ TabsSize,
8
9
  } from "./tabs.type";
9
10
  export { TABS_PROVIDER_STATE_KEY } from "./tabs.constants";
@@ -6,23 +6,83 @@ $tab: sass.fn-naming-prefix("tab");
6
6
  $button: sass.fn-naming-prefix("button");
7
7
 
8
8
  // Property name - layer: tabs
9
- $tabs-color: sass.fn-naming-var("tabs", "color");
10
- $tabs-background-color: sass.fn-naming-var("tabs", "background-color");
11
- $tabs-border-color: sass.fn-naming-var("tabs", "border-color");
12
-
13
- $space-x: sass.fn-naming-var("spacing", "x");
14
- $space-y: sass.fn-naming-var("spacing", "y");
15
- $border-radius: sass.fn-naming-var("border-radius");
9
+ // Underline
10
+ $tabs-underline-color: sass.fn-naming-var("tabs", "underline", "color");
11
+ $tabs-underline-color-active: sass.fn-naming-var("tabs", "underline", "color", "active");
12
+ $tabs-underline-color-hover: sass.fn-naming-var("tabs", "underline", "color", "hover");
13
+ $tabs-underline-color-focus: sass.fn-naming-var("tabs", "underline", "color", "focus");
14
+ $tabs-underline-color-disabled: sass.fn-naming-var("tabs", "underline", "color", "disabled");
15
+ $tabs-underline-border-color: sass.fn-naming-var("tabs", "underline", "border-color");
16
+ $tabs-underline-border-color-active: sass.fn-naming-var(
17
+ "tabs",
18
+ "underline",
19
+ "border-color",
20
+ "active"
21
+ );
22
+ $tabs-underline-border-color-hover: sass.fn-naming-var(
23
+ "tabs",
24
+ "underline",
25
+ "border-color",
26
+ "hover"
27
+ );
28
+ $tabs-underline-border-color-focus: sass.fn-naming-var(
29
+ "tabs",
30
+ "underline",
31
+ "border-color",
32
+ "focus"
33
+ );
34
+ $tabs-underline-border-color-disabled: sass.fn-naming-var(
35
+ "tabs",
36
+ "underline",
37
+ "border-color",
38
+ "disabled"
39
+ );
40
+
41
+ // Fill
42
+ $tabs-fill-color: sass.fn-naming-var("tabs", "fill", "color");
43
+ $tabs-fill-color-active: sass.fn-naming-var("tabs", "fill", "color", "active");
44
+ $tabs-fill-color-hover: sass.fn-naming-var("tabs", "fill", "color", "hover");
45
+ $tabs-fill-color-focus: sass.fn-naming-var("tabs", "fill", "color", "focus");
46
+ $tabs-fill-color-disabled: sass.fn-naming-var("tabs", "fill", "color", "disabled");
47
+ $tabs-fill-background-color: sass.fn-naming-var("tabs", "fill", "background-color");
48
+ $tabs-fill-background-color-active: sass.fn-naming-var(
49
+ "tabs",
50
+ "fill",
51
+ "background-color",
52
+ "active"
53
+ );
54
+ $tabs-fill-background-color-hover: sass.fn-naming-var("tabs", "fill", "background-color", "hover");
55
+ $tabs-fill-background-color-focus: sass.fn-naming-var("tabs", "fill", "background-color", "focus");
56
+ $tabs-fill-background-color-disabled: sass.fn-naming-var(
57
+ "tabs",
58
+ "fill",
59
+ "background-color",
60
+ "disabled"
61
+ );
62
+ $tabs-fill-border-color: sass.fn-naming-var("tabs", "fill", "border-color");
63
+ $tabs-fill-border-color-active: sass.fn-naming-var("tabs", "fill", "border-color", "active");
64
+ $tabs-fill-border-color-hover: sass.fn-naming-var("tabs", "fill", "border-color", "hover");
65
+ $tabs-fill-border-color-focus: sass.fn-naming-var("tabs", "fill", "border-color", "focus");
66
+ $tabs-fill-border-color-disabled: sass.fn-naming-var("tabs", "fill", "border-color", "disabled");
67
+
68
+ // Text
69
+ $tabs-text-color: sass.fn-naming-var("tabs", "text", "color");
70
+ $tabs-text-color-active: sass.fn-naming-var("tabs", "text", "color", "active");
71
+ $tabs-text-color-hover: sass.fn-naming-var("tabs", "text", "color", "hover");
72
+ $tabs-text-color-focus: sass.fn-naming-var("tabs", "text", "color", "focus");
73
+ $tabs-text-color-disabled: sass.fn-naming-var("tabs", "text", "color", "disabled");
74
+
75
+ $radius-ratio: sass.fn-naming-var("radius-ratio");
16
76
  $border-width: sass.fn-naming-var("stroke", "width");
17
77
  $transition-duration: sass.fn-naming-var("motion", "duration");
18
-
78
+ $radius-size: sass.fn-naming-var("radius-size");
19
79
  // layer: highlight (indicator geometry)
20
- $highlight-top: sass.fn-naming-var("highlight", "top");
21
- $highlight-left: sass.fn-naming-var("highlight", "left");
22
- $highlight-width: sass.fn-naming-var("highlight", "width");
23
- $highlight-height: sass.fn-naming-var("highlight", "height");
24
- $highlight-space-x: sass.fn-naming-var("highlight", "space-x");
25
- $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
80
+ $highlight-top: sass.fn-naming-var("tabs", "highlight", "top");
81
+ $highlight-left: sass.fn-naming-var("tabs", "highlight", "left");
82
+ $highlight-width: sass.fn-naming-var("tabs", "highlight", "width");
83
+ $highlight-height: sass.fn-naming-var("tabs", "highlight", "height");
84
+ $highlight-space-x: sass.fn-naming-var("tabs", "highlight", "space-x");
85
+ $highlight-space-y: sass.fn-naming-var("tabs", "highlight", "space-y");
26
86
 
27
87
  .#{$tabs} {
28
88
  display: flex;
@@ -31,30 +91,29 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
31
91
  margin: 0;
32
92
  list-style: none;
33
93
  border: none;
34
- transition:
35
- box-shadow #{$transition-duration} ease,
36
- border-color #{$transition-duration} ease,
37
- background-color #{$transition-duration} ease,
38
- color #{$transition-duration} ease,
39
- border-radius #{$transition-duration} ease;
94
+ overflow-y: hidden;
95
+ overflow-x: hidden;
40
96
 
41
97
  > * {
42
98
  z-index: 1;
43
99
  }
44
100
 
45
- &::before {
46
- content: "";
47
- z-index: 1;
48
- display: block;
49
- position: absolute;
50
- top: 0;
51
- left: 0;
52
- width: #{$highlight-width};
53
- height: #{$highlight-height};
54
- transform: translate(#{$highlight-left}, #{$highlight-top});
55
- box-sizing: border-box;
56
- background-color: rgb(#{$tabs-background-color});
57
- border-radius: #{$border-radius};
101
+ &:not(.text) {
102
+ &::before {
103
+ content: "";
104
+ z-index: 1;
105
+ display: block;
106
+ position: absolute;
107
+ top: 0;
108
+ left: 0;
109
+ width: #{$highlight-width};
110
+ height: #{$highlight-height};
111
+ transform: translate(#{$highlight-left}, #{$highlight-top});
112
+ box-sizing: border-box;
113
+ border-radius: calc(
114
+ min(#{$highlight-width}, #{$highlight-height}, #{$radius-size}) * #{$radius-ratio}
115
+ );
116
+ }
58
117
  }
59
118
 
60
119
  &.top-start,
@@ -88,6 +147,9 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
88
147
  flex-direction: row;
89
148
  height: fit-content;
90
149
  width: 100%;
150
+ padding-top: #{$highlight-space-y};
151
+ padding-bottom: #{$highlight-space-y};
152
+ overflow-x: auto;
91
153
 
92
154
  > * {
93
155
  height: 100%;
@@ -100,129 +162,146 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
100
162
  &.right-start,
101
163
  &.right-center,
102
164
  &.right-end {
165
+ padding-left: #{$highlight-space-x};
166
+ padding-right: #{$highlight-space-x};
103
167
  flex-direction: column;
104
168
  width: fit-content;
105
169
  height: 100%;
170
+ overflow-y: auto;
106
171
 
107
172
  > * {
108
173
  width: 100%;
109
174
  }
110
175
  }
111
176
 
112
- &.divider {
113
- &.top-start,
114
- &.top-center,
115
- &.top-end {
116
- border-bottom: #{$border-width} solid rgb(#{$tabs-border-color});
177
+ &.underline {
178
+ &::before {
179
+ background-color: rgba(#{$tabs-underline-border-color-active});
117
180
  }
118
181
 
119
- &.bottom-start,
120
- &.bottom-center,
121
- &.bottom-end {
122
- border-top: #{$border-width} solid rgb(#{$tabs-border-color});
123
- }
182
+ :deep(.#{$tab}) {
183
+ .#{$button} {
184
+ color: rgba(#{$tabs-underline-color});
185
+ background-color: transparent !important;
186
+ }
124
187
 
125
- &.left-start,
126
- &.left-center,
127
- &.left-end {
128
- border-right: #{$border-width} solid rgb(#{$tabs-border-color});
129
- }
188
+ &.active {
189
+ .#{$button} {
190
+ color: rgba(#{$tabs-underline-color-active});
191
+ }
192
+ }
130
193
 
131
- &.right-start,
132
- &.right-center,
133
- &.right-end {
134
- border-left: #{$border-width} solid rgb(#{$tabs-border-color});
135
- }
136
- }
194
+ &:hover,
195
+ &.hover {
196
+ .#{$button} {
197
+ color: rgba(#{$tabs-underline-color-hover});
198
+ }
199
+ }
137
200
 
138
- &.underline {
139
- &.top-start,
140
- &.top-center,
141
- &.top-end,
142
- &.bottom-start,
143
- &.bottom-center,
144
- &.bottom-end {
145
- padding-top: #{$highlight-space-y};
146
- padding-bottom: #{$highlight-space-y};
147
- }
201
+ &:focus,
202
+ &.focus {
203
+ .#{$button} {
204
+ color: rgba(#{$tabs-underline-color-focus});
205
+ }
206
+ }
148
207
 
149
- &.left-start,
150
- &.left-center,
151
- &.left-end,
152
- &.right-start,
153
- &.right-center,
154
- &.right-end {
155
- padding-left: #{$highlight-space-x};
156
- padding-right: #{$highlight-space-x};
208
+ &:disabled,
209
+ &.disabled {
210
+ .#{$button} {
211
+ color: rgba(#{$tabs-underline-color-disabled});
212
+ }
213
+ }
157
214
  }
158
215
  }
159
216
 
160
217
  &.fill {
218
+ &::before {
219
+ background-color: rgba(#{$tabs-fill-background-color-active});
220
+ }
221
+
161
222
  :deep(.#{$tab}) {
223
+ .#{$button} {
224
+ color: rgba(#{$tabs-fill-color});
225
+ background-color: rgba(#{$tabs-fill-background-color});
226
+ }
227
+
162
228
  &.active {
163
229
  .#{$button} {
164
- color: rgb(#{$tabs-color}) !important;
230
+ color: rgba(#{$tabs-fill-color-active});
231
+ background-color: transparent !important;
165
232
  }
166
233
  }
167
- }
168
234
 
169
- &.top-start,
170
- &.top-center,
171
- &.top-end,
172
- &.bottom-start,
173
- &.bottom-center,
174
- &.bottom-end {
175
- padding-top: calc(#{$highlight-space-y} + #{$space-y});
176
- padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
177
- }
235
+ &:hover,
236
+ &.hover {
237
+ .#{$button} {
238
+ color: rgba(#{$tabs-fill-color-hover});
239
+ background-color: rgba(#{$tabs-fill-background-color-hover});
240
+ }
241
+ }
178
242
 
179
- &.left-start,
180
- &.left-center,
181
- &.left-end,
182
- &.right-start,
183
- &.right-center,
184
- &.right-end {
185
- padding-left: calc(#{$highlight-space-x} + #{$space-x});
186
- padding-right: calc(#{$highlight-space-x} + #{$space-x});
243
+ &:focus,
244
+ &.focus {
245
+ .#{$button} {
246
+ color: rgba(#{$tabs-fill-color-focus});
247
+ background-color: rgba(#{$tabs-fill-background-color-focus});
248
+ }
249
+ }
250
+
251
+ &:disabled,
252
+ &.disabled {
253
+ .#{$button} {
254
+ color: rgba(#{$tabs-fill-color-disabled});
255
+ background-color: rgba(#{$tabs-fill-background-color-disabled});
256
+ }
257
+ }
187
258
  }
188
259
  }
189
260
 
190
261
  &.text {
191
- &::before {
192
- display: none;
193
- }
194
-
195
262
  :deep(.#{$tab}) {
263
+ .#{$button} {
264
+ color: rgba(#{$tabs-text-color});
265
+ background-color: transparent;
266
+ }
267
+
196
268
  &.active {
197
269
  .#{$button} {
198
- color: rgb(#{$tabs-background-color});
199
- text-shadow: 0 0 rgb(#{$tabs-background-color});
270
+ color: rgba(#{$tabs-text-color-active});
200
271
  }
201
272
  }
202
- }
203
273
 
204
- &.top-start,
205
- &.top-center,
206
- &.top-end,
207
- &.bottom-start,
208
- &.bottom-center,
209
- &.bottom-end {
210
- padding-top: calc(#{$highlight-space-y} + #{$space-y});
211
- padding-bottom: calc(#{$highlight-space-y} + #{$space-y});
212
- }
274
+ &:hover,
275
+ &.hover {
276
+ .#{$button} {
277
+ color: rgba(#{$tabs-text-color-hover});
278
+ }
279
+ }
213
280
 
214
- &.left-start,
215
- &.left-center,
216
- &.left-end,
217
- &.right-start,
218
- &.right-center,
219
- &.right-end {
220
- padding-left: calc(#{$highlight-space-x} + #{$space-x});
221
- padding-right: calc(#{$highlight-space-x} + #{$space-x});
281
+ &:focus,
282
+ &.focus {
283
+ .#{$button} {
284
+ color: rgba(#{$tabs-text-color-focus});
285
+ }
286
+ }
287
+
288
+ &:disabled,
289
+ &.disabled {
290
+ .#{$button} {
291
+ color: rgba(#{$tabs-text-color-disabled});
292
+ }
293
+ }
222
294
  }
223
295
  }
224
296
 
225
297
  &.transition {
298
+ transition:
299
+ box-shadow #{$transition-duration} ease,
300
+ border-color #{$transition-duration} ease,
301
+ background-color #{$transition-duration} ease,
302
+ color #{$transition-duration} ease,
303
+ border-radius #{$transition-duration} ease;
304
+
226
305
  &::before {
227
306
  transition:
228
307
  background-color #{$transition-duration} ease,
@@ -256,14 +335,7 @@ $highlight-space-y: sass.fn-naming-var("highlight", "space-y");
256
335
  align-items: center;
257
336
 
258
337
  .#{$button} {
259
- padding: #{$space-y} calc(#{$space-x} * 4);
260
- color: unset;
261
338
  cursor: pointer;
262
- background-color: transparent !important;
263
- border: none !important;
264
- box-shadow: none !important;
265
- border-radius: 0 !important;
266
- transition: none;
267
339
  }
268
340
  }
269
341
  }
@@ -1,6 +1,8 @@
1
1
  import { ComputedRef } from "vue";
2
+ import { AppSize } from "../../app";
2
3
 
3
4
  export type TabsVariant = "fill" | "underline" | "text";
5
+ export type TabsSize = AppSize;
4
6
  export type TabsPlacement =
5
7
  | "top-start"
6
8
  | "top-end"
@@ -17,11 +19,11 @@ export type TabsProps = {
17
19
  variant?: TabsVariant;
18
20
  role?: string;
19
21
  modelValue?: string;
20
- border?: number;
22
+ border?: number[];
21
23
  margin?: number[];
22
24
  shape?: string;
23
- divider?: boolean;
24
25
  transition?: boolean;
26
+ size?: TabsSize;
25
27
  };
26
28
 
27
29
  export type TabsEmit = {
@@ -32,5 +34,6 @@ export type TabsProviderState = {
32
34
  activeValue: ComputedRef<string>;
33
35
  role: ComputedRef<string>;
34
36
  shape: ComputedRef<string>;
37
+ size: ComputedRef<TabsSize>;
35
38
  setValue: (val: string) => void;
36
39
  };