yuyeon 0.3.1-rc.4 → 0.3.1-rc.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 (230) hide show
  1. package/LICENSE +191 -191
  2. package/README.md +15 -15
  3. package/dist/yuyeon.js +1751 -1687
  4. package/dist/yuyeon.umd.cjs +3 -3
  5. package/lib/abstract/items.mjs.map +1 -1
  6. package/lib/components/alert/YAlert.mjs +2 -2
  7. package/lib/components/alert/YAlert.mjs.map +1 -1
  8. package/lib/components/alert/YAlert.scss +77 -77
  9. package/lib/components/app/YApp.mjs +2 -2
  10. package/lib/components/app/YApp.mjs.map +1 -1
  11. package/lib/components/bench/YBench.mjs +2 -2
  12. package/lib/components/bench/YBench.mjs.map +1 -1
  13. package/lib/components/button/YButton.scss +137 -137
  14. package/lib/components/card/YCard.mjs.map +1 -1
  15. package/lib/components/card/YCard.scss +45 -45
  16. package/lib/components/card/YCardBody.mjs.map +1 -1
  17. package/lib/components/card/YCardFooter.mjs.map +1 -1
  18. package/lib/components/card/YCardHeader.mjs.map +1 -1
  19. package/lib/components/checkbox/YCheckbox.mjs.map +1 -1
  20. package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -1
  21. package/lib/components/checkbox/YInputCheckbox.scss +84 -84
  22. package/lib/components/checkbox/index.mjs.map +1 -1
  23. package/lib/components/chip/YChip.scss +36 -36
  24. package/lib/components/date-picker/YDateCalendar.mjs.map +1 -1
  25. package/lib/components/date-picker/YDateCalendar.scss +84 -84
  26. package/lib/components/date-picker/YDatePicker.mjs.map +1 -1
  27. package/lib/components/date-picker/YDatePickerControl.mjs.map +1 -1
  28. package/lib/components/date-picker/YMonthPicker.mjs.map +1 -1
  29. package/lib/components/date-picker/YYearPicker.mjs.map +1 -1
  30. package/lib/components/dialog/index.mjs.map +1 -1
  31. package/lib/components/divider/YDivider.mjs.map +1 -1
  32. package/lib/components/divider/YDivider.scss +2 -2
  33. package/lib/components/draggable/YDraggable.mjs +2 -2
  34. package/lib/components/draggable/YDraggable.mjs.map +1 -1
  35. package/lib/components/dropdown/YDropdown.mjs.map +1 -1
  36. package/lib/components/dropdown/YDropdown.scss +27 -27
  37. package/lib/components/field-input/index.mjs.map +1 -1
  38. package/lib/components/form/YForm.mjs.map +1 -1
  39. package/lib/components/hover/YHover.mjs +1 -1
  40. package/lib/components/hover/YHover.mjs.map +1 -1
  41. package/lib/components/icon/YIcon.mjs.map +1 -1
  42. package/lib/components/icon/YIcon.scss +18 -18
  43. package/lib/components/icon/poly.mjs +57 -0
  44. package/lib/components/icon/poly.mjs.map +1 -0
  45. package/lib/components/icons/YIconCheckbox.mjs.map +1 -1
  46. package/lib/components/icons/YIconClear.mjs.map +1 -1
  47. package/lib/components/icons/YIconDropdown.mjs.map +1 -1
  48. package/lib/components/icons/YIconExpand.mjs.map +1 -1
  49. package/lib/components/icons/YIconPageControl.mjs.map +1 -1
  50. package/lib/components/icons/YIconSort.mjs.map +1 -1
  51. package/lib/components/icons/YIconSort.scss +24 -24
  52. package/lib/components/icons/index.mjs.map +1 -1
  53. package/lib/components/img/YImg.mjs +4 -4
  54. package/lib/components/img/YImg.mjs.map +1 -1
  55. package/lib/components/index.mjs.map +1 -1
  56. package/lib/components/input/YInput.mjs.map +1 -1
  57. package/lib/components/input/YInput.scss +258 -258
  58. package/lib/components/ip-field/YIpv4Field.mjs.map +1 -1
  59. package/lib/components/layer/YLayer.mjs.map +1 -1
  60. package/lib/components/layer/active-stack.mjs.map +1 -1
  61. package/lib/components/layer/base.mjs.map +1 -1
  62. package/lib/components/layer/content.mjs.map +1 -1
  63. package/lib/components/layer/scroll-strategies.mjs.map +1 -1
  64. package/lib/components/list/YList.mjs.map +1 -1
  65. package/lib/components/list/YListItem.mjs.map +1 -1
  66. package/lib/components/loading/YSpinnerRing.mjs.map +1 -1
  67. package/lib/components/menu/YMenu.mjs +2 -2
  68. package/lib/components/menu/YMenu.mjs.map +1 -1
  69. package/lib/components/menu/YMenu.scss +25 -25
  70. package/lib/components/navigation/YNavigation.mjs.map +1 -1
  71. package/lib/components/pagination/YPagination.mjs.map +1 -1
  72. package/lib/components/pagination/YPagination.scss +52 -52
  73. package/lib/components/panel/YDividePanel.mjs.map +1 -1
  74. package/lib/components/plate/YPlate.mjs +2 -2
  75. package/lib/components/plate/YPlate.mjs.map +1 -1
  76. package/lib/components/progress-bar/YProgressBar.mjs.map +1 -1
  77. package/lib/components/progress-bar/YProgressBar.scss +120 -120
  78. package/lib/components/progress-ring/YProgressRing.mjs +2 -2
  79. package/lib/components/progress-ring/YProgressRing.mjs.map +1 -1
  80. package/lib/components/progress-ring/YProgressRing.scss +38 -38
  81. package/lib/components/progress-ring/index.mjs.map +1 -1
  82. package/lib/components/select/YSelect.mjs.map +1 -1
  83. package/lib/components/slider/YSlider.mjs.map +1 -1
  84. package/lib/components/snackbar/YSnackbar.mjs +5 -5
  85. package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
  86. package/lib/components/switch/YSwitch.mjs.map +1 -1
  87. package/lib/components/switch/YSwitch.scss +211 -211
  88. package/lib/components/tab/YTab.mjs.map +1 -1
  89. package/lib/components/tab/YTab.scss +73 -73
  90. package/lib/components/tab/YTabs.mjs.map +1 -1
  91. package/lib/components/tab/YTabs.scss +8 -8
  92. package/lib/components/tab/index.mjs.map +1 -1
  93. package/lib/components/tab/types.mjs.map +1 -1
  94. package/lib/components/table/YDataTableBody.mjs.map +1 -1
  95. package/lib/components/table/YDataTableCell.mjs.map +1 -1
  96. package/lib/components/table/YDataTableHead.mjs.map +1 -1
  97. package/lib/components/table/YDataTableLayer.mjs.map +1 -1
  98. package/lib/components/table/YDataTableRow.mjs.map +1 -1
  99. package/lib/components/table/YTable.mjs.map +1 -1
  100. package/lib/components/table/YTable.scss +157 -157
  101. package/lib/components/table/composibles/header.mjs.map +1 -1
  102. package/lib/components/table/composibles/items.mjs.map +1 -1
  103. package/lib/components/table/composibles/options.mjs.map +1 -1
  104. package/lib/components/table/composibles/pagination.mjs.map +1 -1
  105. package/lib/components/table/composibles/selection.mjs.map +1 -1
  106. package/lib/components/table/composibles/sorted-items.mjs.map +1 -1
  107. package/lib/components/table/composibles/sorting.mjs.map +1 -1
  108. package/lib/components/table/types/header.mjs.map +1 -1
  109. package/lib/components/table/types/index.mjs.map +1 -1
  110. package/lib/components/table/types/row.mjs.map +1 -1
  111. package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +1 -1
  112. package/lib/components/text-ellipsis/YTextEllipsis.scss +43 -43
  113. package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -1
  114. package/lib/components/text-interpolation/YTi.mjs.map +1 -1
  115. package/lib/components/textarea/YTextarea.mjs.map +1 -1
  116. package/lib/components/toggle-button/YToggleButton.mjs.map +1 -1
  117. package/lib/components/tooltip/YTooltip.mjs +2 -2
  118. package/lib/components/tooltip/YTooltip.mjs.map +1 -1
  119. package/lib/components/tree-view/YTreeView.scss +81 -81
  120. package/lib/components/tree-view/types.mjs.map +1 -1
  121. package/lib/components/tree-view/util.mjs.map +1 -1
  122. package/lib/composables/choice.mjs.map +1 -1
  123. package/lib/composables/communication.mjs.map +1 -1
  124. package/lib/composables/component.mjs.map +1 -1
  125. package/lib/composables/coordinate/arrangement.mjs.map +1 -1
  126. package/lib/composables/coordinate/index.mjs.map +1 -1
  127. package/lib/composables/coordinate/levitation.mjs +2 -2
  128. package/lib/composables/coordinate/levitation.mjs.map +1 -1
  129. package/lib/composables/coordinate/types.mjs.map +1 -1
  130. package/lib/composables/coordinate/utils/point.mjs.map +1 -1
  131. package/lib/composables/date/factory.mjs.map +1 -1
  132. package/lib/composables/date/index.mjs.map +1 -1
  133. package/lib/composables/date/setting.mjs.map +1 -1
  134. package/lib/composables/date/types.mjs.map +1 -1
  135. package/lib/composables/defaults/index.mjs.map +1 -1
  136. package/lib/composables/defaults/share.mjs.map +1 -1
  137. package/lib/composables/defaults/types.mjs.map +1 -1
  138. package/lib/composables/dimension.mjs.map +1 -1
  139. package/lib/composables/focus.mjs.map +1 -1
  140. package/lib/composables/form.mjs.map +1 -1
  141. package/lib/composables/group.mjs +194 -0
  142. package/lib/composables/group.mjs.map +1 -0
  143. package/lib/composables/i18n/index.mjs.map +1 -1
  144. package/lib/composables/i18n/locale.mjs.map +1 -1
  145. package/lib/composables/i18n/rtl.mjs.map +1 -1
  146. package/lib/composables/i18n/share.mjs.map +1 -1
  147. package/lib/composables/icon.mjs.map +1 -1
  148. package/lib/composables/index.mjs.map +1 -1
  149. package/lib/composables/layer-group.mjs.map +1 -1
  150. package/lib/composables/layout.mjs.map +1 -1
  151. package/lib/composables/list-items.mjs.map +1 -1
  152. package/lib/composables/progress.mjs.map +1 -1
  153. package/lib/composables/ref.mjs.map +1 -1
  154. package/lib/composables/resize-observer.mjs.map +1 -1
  155. package/lib/composables/scope.mjs.map +1 -1
  156. package/lib/composables/theme/factory.mjs.map +1 -1
  157. package/lib/composables/theme/index.mjs.map +1 -1
  158. package/lib/composables/theme/setting.mjs.map +1 -1
  159. package/lib/composables/theme/types.mjs.map +1 -1
  160. package/lib/composables/timing.mjs.map +1 -1
  161. package/lib/composables/transition.mjs.map +1 -1
  162. package/lib/composables/validation.mjs.map +1 -1
  163. package/lib/composables/vue-router.mjs.map +1 -1
  164. package/lib/directives/plate-wave/index.mjs +2 -2
  165. package/lib/directives/plate-wave/index.mjs.map +1 -1
  166. package/lib/etc/index.mjs.map +1 -1
  167. package/lib/i18n/built-in.mjs.map +1 -1
  168. package/lib/i18n/config.mjs.map +1 -1
  169. package/lib/i18n/types.mjs.map +1 -1
  170. package/lib/index.mjs.map +1 -1
  171. package/lib/locales/en.mjs.map +1 -1
  172. package/lib/locales/index.mjs.map +1 -1
  173. package/lib/locales/ko.mjs.map +1 -1
  174. package/lib/styles/_elevation.scss +16 -16
  175. package/lib/styles/_palette.scss +1 -1
  176. package/lib/styles/base.scss +130 -130
  177. package/lib/styles/settings/_elevation.scss +20 -20
  178. package/lib/styles/settings/_variables.scss +14 -14
  179. package/lib/styles/theme/dark.scss +11 -11
  180. package/lib/styles/theme/light.scss +11 -11
  181. package/lib/styles/util/_mixin.scss +33 -33
  182. package/lib/styles/util/_var.scss +18 -18
  183. package/lib/util/anchor.mjs.map +1 -1
  184. package/lib/util/collection.mjs.map +1 -1
  185. package/lib/util/color/const.mjs.map +1 -1
  186. package/lib/util/color/index.mjs +12 -12
  187. package/lib/util/color/index.mjs.map +1 -1
  188. package/lib/util/color/types.mjs.map +1 -1
  189. package/lib/util/color/utils/math-utils.mjs +62 -62
  190. package/lib/util/color/utils/math-utils.mjs.map +1 -1
  191. package/lib/util/component/component.mjs.map +1 -1
  192. package/lib/util/component/index.mjs.map +1 -1
  193. package/lib/util/component/inject-self.mjs.map +1 -1
  194. package/lib/util/component/props.mjs.map +1 -1
  195. package/lib/util/component/types.mjs.map +1 -1
  196. package/lib/util/date/index.mjs.map +1 -1
  197. package/lib/util/date/types.mjs.map +1 -1
  198. package/lib/util/debounce.mjs.map +1 -1
  199. package/lib/util/environments.mjs.map +1 -1
  200. package/lib/util/index.mjs.map +1 -1
  201. package/lib/util/parser.mjs +31 -0
  202. package/lib/util/parser.mjs.map +1 -0
  203. package/lib/util/reactivity.mjs +3 -3
  204. package/lib/util/reactivity.mjs.map +1 -1
  205. package/lib/util/rect.mjs.map +1 -1
  206. package/lib/util/validation.mjs.map +1 -1
  207. package/lib/util/vue-component/index.mjs +63 -0
  208. package/lib/util/vue-component/index.mjs.map +1 -0
  209. package/lib/util/vue-component/props.mjs +37 -0
  210. package/lib/util/vue-component/props.mjs.map +1 -0
  211. package/lib/util/vue-component/types.mjs +2 -0
  212. package/lib/util/vue-component/types.mjs.map +1 -0
  213. package/lib/util/vue-component.mjs +102 -0
  214. package/lib/util/vue-component.mjs.map +1 -0
  215. package/package.json +120 -120
  216. package/types/components/select/YSelect.d.ts +7062 -0
  217. package/types/components/table/pagination.d.ts +78 -0
  218. package/types/components/tooltip/YTooltip.d.ts +3711 -0
  219. package/types/globals.d.ts +20 -20
  220. package/types/shims.d.ts +55 -55
  221. package/types/util/color/hct/hct_solver.d.ts +146 -0
  222. package/types/util/color/hct/viewing_conditions.d.ts +74 -0
  223. package/types/util/color/palettes/tonal_palette.d.ts +55 -0
  224. package/types/util/color/utils/math_utils.d.ts +82 -0
  225. package/types/util/parser.d.ts +4 -0
  226. package/types/util/vue-component/index.d.ts +10 -0
  227. package/types/util/vue-component/props.d.ts +31 -0
  228. package/types/util/vue-component/types.d.ts +4 -0
  229. package/types/util/vue-component.d.ts +39 -0
  230. /package/types/util/{rect.d.ts → Rect.d.ts} +0 -0
@@ -1,211 +1,211 @@
1
- @use '../../styles/variables';
2
-
3
- .y-switch {
4
- --y-switch__color: var(--y-theme-primary);
5
- --y-switch__color-rgb: var(--y-theme-primary-rgb);
6
- font-size: 1rem;
7
-
8
- &__slot {
9
- display: flex;
10
- cursor: pointer;
11
- align-items: center;
12
- color: inherit;
13
- min-height: inherit;
14
- position: relative;
15
- }
16
-
17
- &__input {
18
- width: 3em;
19
- height: 1.5em;
20
- position: relative;
21
- display: inline-flex;
22
- user-select: none;
23
- color: inherit;
24
- flex: 0 0 auto;
25
-
26
- input[role='switch'] {
27
- position: absolute;
28
- opacity: 0;
29
- width: 100%;
30
- height: 100%;
31
- cursor: pointer;
32
- user-select: none;
33
- }
34
- }
35
-
36
- &:not(&--loading) &__input:active &__thumb {
37
- transform: scaleX(0.94);
38
- transform-origin: left;
39
- }
40
-
41
- &.y-switch--active:not(&--loading) &__input:active &__thumb {
42
- transform-origin: right;
43
- }
44
-
45
- &__track {
46
- width: 100%;
47
- height: 100%;
48
- border-radius: 2em;
49
- background-color: var(--y-theme-surface-variant);
50
- position: absolute;
51
- left: 0;
52
- top: 0;
53
- transition: 300ms;
54
- }
55
-
56
- &__thumb {
57
- width: 1.1em;
58
- height: 1.1em;
59
- align-self: center;
60
- left: 0.185em;
61
- border-radius: 50%;
62
- display: flex;
63
- justify-content: center;
64
- align-items: center;
65
- background-color: var(--y-theme-surface);
66
- pointer-events: none;
67
- position: relative;
68
- transition: 180ms cubic-bezier(0.78, 0.04, 0.9, 0.18);
69
- will-change: left, transform;
70
- }
71
-
72
- &__spinner {
73
- position: relative;
74
- width: 100%;
75
- height: 100%;
76
- border-radius: 50%;
77
- animation: rotate 2s linear infinite;
78
- contain: paint;
79
-
80
- @keyframes spinner-blur {
81
- 0% {
82
- filter: blur(4px);
83
- }
84
- 50% {
85
- filter: blur(1px);
86
- }
87
- 100% {
88
- filter: blur(4px);
89
- }
90
- }
91
-
92
- &:before {
93
- content: '';
94
- position: absolute;
95
- top: 2px;
96
- left: 2px;
97
- right: 2px;
98
- bottom: 2px;
99
- border-radius: 50%;
100
- border-width: 2px 2px 0 0;
101
- border-style: solid;
102
- border-color: var(--y-switch__color) transparent;
103
- }
104
-
105
- &:after {
106
- content: '';
107
- position: absolute;
108
- left: 0;
109
- top: 0;
110
- right: 0;
111
- bottom: 0;
112
- background: linear-gradient(
113
- 0deg,
114
- transparent 60%,
115
- rgba(var(--y-switch__color), 0.4)
116
- );
117
- filter: blur(4px);
118
- animation: spinner-blur 3s infinite;
119
- }
120
- }
121
-
122
- &--active {
123
- .y-switch__track {
124
- background-color: var(--y-switch__color);
125
- }
126
-
127
- .y-switch__thumb {
128
- left: calc(100% - 1.1em - 0.24em);
129
- }
130
- }
131
-
132
- &--active:not(&--loading):active &__thumb {
133
- left: 1.8em;
134
- }
135
-
136
- &--focused {
137
- .y-switch__thumb:before {
138
- content: '';
139
- position: absolute;
140
- top: 2px;
141
- bottom: 2px;
142
- left: 2px;
143
- right: 2px;
144
- border-radius: 50%;
145
- background-color: rgba(var(--y-switch__color-rgb), 0.4);
146
- }
147
- }
148
-
149
- &--stick-out {
150
- .y-switch__thumb {
151
- box-shadow:
152
- 2px 2px 5px -2px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.54),
153
- 1px 1px 4px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.12),
154
- 0 0 0 1px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.08);
155
- }
156
-
157
- .y-switch__track {
158
- width: 80%;
159
- height: 74%;
160
- top: 50%;
161
- left: 50%;
162
- transform: translate(-50%, -50%);
163
- box-shadow: inset 0 0 4px -1px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.34);
164
- }
165
- }
166
-
167
- &--disabled {
168
- opacity: 0.8;
169
- filter: brightness(0.88);
170
-
171
- .y-switch__thumb {
172
- opacity: 0.4;
173
- }
174
- }
175
- &--disabled &__slot,
176
- &--disabled &__input input {
177
- cursor: default;
178
- }
179
-
180
- &__state {
181
- position: relative;
182
- width: 100%;
183
- height: 100%;
184
- contain: content;
185
- }
186
-
187
- &__state-label {
188
- font-size: 12px;
189
- color: var(--y-theme-on-primary);
190
- position: absolute;
191
- height: 100%;
192
- display: flex;
193
- align-items: center;
194
- transition: transform 180ms cubic-bezier(0.16, 0.85, 0.36, 0.96);
195
-
196
- &--on {
197
- left: -40px;
198
- }
199
- &--off {
200
- right: 10px;
201
- }
202
- }
203
-
204
- &--active &__state-label {
205
- transform: translateX(50px);
206
- }
207
-
208
- &--stick-out &__state-label--off {
209
- right: 7px;
210
- }
211
- }
1
+ @use '../../styles/variables';
2
+
3
+ .y-switch {
4
+ --y-switch__color: var(--y-theme-primary);
5
+ --y-switch__color-rgb: var(--y-theme-primary-rgb);
6
+ font-size: 1rem;
7
+
8
+ &__slot {
9
+ display: flex;
10
+ cursor: pointer;
11
+ align-items: center;
12
+ color: inherit;
13
+ min-height: inherit;
14
+ position: relative;
15
+ }
16
+
17
+ &__input {
18
+ width: 3em;
19
+ height: 1.5em;
20
+ position: relative;
21
+ display: inline-flex;
22
+ user-select: none;
23
+ color: inherit;
24
+ flex: 0 0 auto;
25
+
26
+ input[role='switch'] {
27
+ position: absolute;
28
+ opacity: 0;
29
+ width: 100%;
30
+ height: 100%;
31
+ cursor: pointer;
32
+ user-select: none;
33
+ }
34
+ }
35
+
36
+ &:not(&--loading) &__input:active &__thumb {
37
+ transform: scaleX(0.94);
38
+ transform-origin: left;
39
+ }
40
+
41
+ &.y-switch--active:not(&--loading) &__input:active &__thumb {
42
+ transform-origin: right;
43
+ }
44
+
45
+ &__track {
46
+ width: 100%;
47
+ height: 100%;
48
+ border-radius: 2em;
49
+ background-color: var(--y-theme-surface-variant);
50
+ position: absolute;
51
+ left: 0;
52
+ top: 0;
53
+ transition: 300ms;
54
+ }
55
+
56
+ &__thumb {
57
+ width: 1.1em;
58
+ height: 1.1em;
59
+ align-self: center;
60
+ left: 0.185em;
61
+ border-radius: 50%;
62
+ display: flex;
63
+ justify-content: center;
64
+ align-items: center;
65
+ background-color: var(--y-theme-surface);
66
+ pointer-events: none;
67
+ position: relative;
68
+ transition: 180ms cubic-bezier(0.78, 0.04, 0.9, 0.18);
69
+ will-change: left, transform;
70
+ }
71
+
72
+ &__spinner {
73
+ position: relative;
74
+ width: 100%;
75
+ height: 100%;
76
+ border-radius: 50%;
77
+ animation: rotate 2s linear infinite;
78
+ contain: paint;
79
+
80
+ @keyframes spinner-blur {
81
+ 0% {
82
+ filter: blur(4px);
83
+ }
84
+ 50% {
85
+ filter: blur(1px);
86
+ }
87
+ 100% {
88
+ filter: blur(4px);
89
+ }
90
+ }
91
+
92
+ &:before {
93
+ content: '';
94
+ position: absolute;
95
+ top: 2px;
96
+ left: 2px;
97
+ right: 2px;
98
+ bottom: 2px;
99
+ border-radius: 50%;
100
+ border-width: 2px 2px 0 0;
101
+ border-style: solid;
102
+ border-color: var(--y-switch__color) transparent;
103
+ }
104
+
105
+ &:after {
106
+ content: '';
107
+ position: absolute;
108
+ left: 0;
109
+ top: 0;
110
+ right: 0;
111
+ bottom: 0;
112
+ background: linear-gradient(
113
+ 0deg,
114
+ transparent 60%,
115
+ rgba(var(--y-switch__color), 0.4)
116
+ );
117
+ filter: blur(4px);
118
+ animation: spinner-blur 3s infinite;
119
+ }
120
+ }
121
+
122
+ &--active {
123
+ .y-switch__track {
124
+ background-color: var(--y-switch__color);
125
+ }
126
+
127
+ .y-switch__thumb {
128
+ left: calc(100% - 1.1em - 0.24em);
129
+ }
130
+ }
131
+
132
+ &--active:not(&--loading):active &__thumb {
133
+ left: 1.8em;
134
+ }
135
+
136
+ &--focused {
137
+ .y-switch__thumb:before {
138
+ content: '';
139
+ position: absolute;
140
+ top: 2px;
141
+ bottom: 2px;
142
+ left: 2px;
143
+ right: 2px;
144
+ border-radius: 50%;
145
+ background-color: rgba(var(--y-switch__color-rgb), 0.4);
146
+ }
147
+ }
148
+
149
+ &--stick-out {
150
+ .y-switch__thumb {
151
+ box-shadow:
152
+ 2px 2px 5px -2px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.54),
153
+ 1px 1px 4px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.12),
154
+ 0 0 0 1px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.08);
155
+ }
156
+
157
+ .y-switch__track {
158
+ width: 80%;
159
+ height: 74%;
160
+ top: 50%;
161
+ left: 50%;
162
+ transform: translate(-50%, -50%);
163
+ box-shadow: inset 0 0 4px -1px rgba(var(--y-theme-shadow-rgb, 0, 0, 0), 0.34);
164
+ }
165
+ }
166
+
167
+ &--disabled {
168
+ opacity: 0.8;
169
+ filter: brightness(0.88);
170
+
171
+ .y-switch__thumb {
172
+ opacity: 0.4;
173
+ }
174
+ }
175
+ &--disabled &__slot,
176
+ &--disabled &__input input {
177
+ cursor: default;
178
+ }
179
+
180
+ &__state {
181
+ position: relative;
182
+ width: 100%;
183
+ height: 100%;
184
+ contain: content;
185
+ }
186
+
187
+ &__state-label {
188
+ font-size: 12px;
189
+ color: var(--y-theme-on-primary);
190
+ position: absolute;
191
+ height: 100%;
192
+ display: flex;
193
+ align-items: center;
194
+ transition: transform 180ms cubic-bezier(0.16, 0.85, 0.36, 0.96);
195
+
196
+ &--on {
197
+ left: -40px;
198
+ }
199
+ &--off {
200
+ right: 10px;
201
+ }
202
+ }
203
+
204
+ &--active &__state-label {
205
+ transform: translateX(50px);
206
+ }
207
+
208
+ &--stick-out &__state-label--off {
209
+ right: 7px;
210
+ }
211
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"YTab.mjs","names":["computed","ref","shallowRef","useRender","chooseProps","defineComponent","propsFactory","YButton","pressYButtonProps","Y_TABS_KEY","pressYTabPropsOptions","text","String","hideIndicator","Boolean","indicatorColor","selectedClass","noWave","YTab","name","props","slots","Object","setup","_ref","attrs","selected","indicator$","indicatorStyles","attrsProps","role","value","tabindex","onChoice","_ref2","yButtonProps","_createVNode","_mergeProps","default","append"],"sources":["../../../src/components/tab/YTab.tsx"],"sourcesContent":["import { type PropType, type SlotsType, computed, ref, shallowRef } from 'vue';\n\nimport { useRender } from '@/composables/component';\nimport { chooseProps, defineComponent, propsFactory } from '@/util/component';\n\nimport { YButton, pressYButtonProps } from '../button';\nimport { Y_TABS_KEY } from './shared';\n\nimport './YTab.scss';\n\nexport const pressYTabPropsOptions = propsFactory(\n {\n text: String as PropType<string>,\n hideIndicator: Boolean as PropType<boolean>,\n indicatorColor: String as PropType<string>,\n ...pressYButtonProps({\n selectedClass: 'y-tab--selected',\n noWave: true,\n }),\n },\n 'YTab',\n);\n\nexport const YTab = defineComponent({\n name: 'YTab',\n props: pressYTabPropsOptions(),\n slots: Object as SlotsType<{\n default?: any;\n }>,\n setup(props, { slots, attrs }) {\n const selected = shallowRef(false);\n\n const indicator$ = ref();\n const indicatorStyles = computed(() => {\n return {};\n });\n const attrsProps = computed(() => {\n return {\n role: 'tab',\n 'aria-selected': `${String(selected.value)}`,\n tabindex: selected.value ? 0 : -1,\n };\n });\n\n function onChoice({ value }: { value: boolean }) {\n selected.value = value;\n }\n\n useRender(() => {\n const yButtonProps = chooseProps(props, YButton.props);\n return (\n <YButton\n class={['y-tab']}\n active={false}\n {...attrsProps.value}\n {...attrs}\n {...yButtonProps}\n injectSymbol={Y_TABS_KEY}\n onChoice:selected={onChoice}\n >\n {{\n default: () => slots.default?.() ?? props.text,\n append: () =>\n !props.hideIndicator && (\n <div\n ref={indicator$}\n class={['y-tab__indicator']}\n style={indicatorStyles.value}\n ></div>\n ),\n }}\n </YButton>\n );\n });\n\n return {};\n },\n});\n\nexport type YTab = InstanceType<typeof YTab>;\n"],"mappings":";AAAA,SAAwCA,QAAQ,EAAEC,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAEtEC,SAAS;AAAA,SACTC,WAAW,EAAEC,eAAe,EAAEC,YAAY;AAAA,SAE1CC,OAAO,EAAEC,iBAAiB;AAAA,SAC1BC,UAAU;AAEnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGJ,YAAY,CAC/C;EACEK,IAAI,EAAEC,MAA0B;EAChCC,aAAa,EAAEC,OAA4B;EAC3CC,cAAc,EAAEH,MAA0B;EAC1C,GAAGJ,iBAAiB,CAAC;IACnBQ,aAAa,EAAE,iBAAiB;IAChCC,MAAM,EAAE;EACV,CAAC;AACH,CAAC,EACD,MACF,CAAC;AAED,OAAO,MAAMC,IAAI,GAAGb,eAAe,CAAC;EAClCc,IAAI,EAAE,MAAM;EACZC,KAAK,EAAEV,qBAAqB,CAAC,CAAC;EAC9BW,KAAK,EAAEC,MAEL;EACFC,KAAKA,CAACH,KAAK,EAAAI,IAAA,EAAoB;IAAA,IAAlB;MAAEH,KAAK;MAAEI;IAAM,CAAC,GAAAD,IAAA;IAC3B,MAAME,QAAQ,GAAGxB,UAAU,CAAC,KAAK,CAAC;IAElC,MAAMyB,UAAU,GAAG1B,GAAG,CAAC,CAAC;IACxB,MAAM2B,eAAe,GAAG5B,QAAQ,CAAC,MAAM;MACrC,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACF,MAAM6B,UAAU,GAAG7B,QAAQ,CAAC,MAAM;MAChC,OAAO;QACL8B,IAAI,EAAE,KAAK;QACX,eAAe,EAAG,GAAElB,MAAM,CAACc,QAAQ,CAACK,KAAK,CAAE,EAAC;QAC5CC,QAAQ,EAAEN,QAAQ,CAACK,KAAK,GAAG,CAAC,GAAG,CAAC;MAClC,CAAC;IACH,CAAC,CAAC;IAEF,SAASE,QAAQA,CAAAC,KAAA,EAAgC;MAAA,IAA/B;QAAEH;MAA0B,CAAC,GAAAG,KAAA;MAC7CR,QAAQ,CAACK,KAAK,GAAGA,KAAK;IACxB;IAEA5B,SAAS,CAAC,MAAM;MACd,MAAMgC,YAAY,GAAG/B,WAAW,CAACgB,KAAK,EAAEb,OAAO,CAACa,KAAK,CAAC;MACtD,OAAAgB,YAAA,CAAA7B,OAAA,EAAA8B,WAAA;QAAA,SAEW,CAAC,OAAO,CAAC;QAAA,UACR;MAAK,GACTR,UAAU,CAACE,KAAK,EAChBN,KAAK,EACLU,YAAY;QAAA,gBACF1B,UAAU;QAAA,qBACLwB;MAAQ;QAGzBK,OAAO,EAAEA,CAAA,KAAMjB,KAAK,CAACiB,OAAO,GAAG,CAAC,IAAIlB,KAAK,CAACT,IAAI;QAC9C4B,MAAM,EAAEA,CAAA,KACN,CAACnB,KAAK,CAACP,aAAa,IAAAuB,YAAA;UAAA,OAEXT,UAAU;UAAA,SACR,CAAC,kBAAkB,CAAC;UAAA,SACpBC,eAAe,CAACG;QAAK;MAE/B;IAIX,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YTab.mjs","names":["computed","ref","shallowRef","useRender","chooseProps","defineComponent","propsFactory","YButton","pressYButtonProps","Y_TABS_KEY","pressYTabPropsOptions","text","String","hideIndicator","Boolean","indicatorColor","selectedClass","noWave","YTab","name","props","slots","Object","setup","_ref","attrs","selected","indicator$","indicatorStyles","attrsProps","role","value","tabindex","onChoice","_ref2","yButtonProps","_createVNode","_mergeProps","default","append"],"sources":["../../../src/components/tab/YTab.tsx"],"sourcesContent":["import { type PropType, type SlotsType, computed, ref, shallowRef } from 'vue';\r\n\r\nimport { useRender } from '@/composables/component';\r\nimport { chooseProps, defineComponent, propsFactory } from '@/util/component';\r\n\r\nimport { YButton, pressYButtonProps } from '../button';\r\nimport { Y_TABS_KEY } from './shared';\r\n\r\nimport './YTab.scss';\r\n\r\nexport const pressYTabPropsOptions = propsFactory(\r\n {\r\n text: String as PropType<string>,\r\n hideIndicator: Boolean as PropType<boolean>,\r\n indicatorColor: String as PropType<string>,\r\n ...pressYButtonProps({\r\n selectedClass: 'y-tab--selected',\r\n noWave: true,\r\n }),\r\n },\r\n 'YTab',\r\n);\r\n\r\nexport const YTab = defineComponent({\r\n name: 'YTab',\r\n props: pressYTabPropsOptions(),\r\n slots: Object as SlotsType<{\r\n default?: any;\r\n }>,\r\n setup(props, { slots, attrs }) {\r\n const selected = shallowRef(false);\r\n\r\n const indicator$ = ref();\r\n const indicatorStyles = computed(() => {\r\n return {};\r\n });\r\n const attrsProps = computed(() => {\r\n return {\r\n role: 'tab',\r\n 'aria-selected': `${String(selected.value)}`,\r\n tabindex: selected.value ? 0 : -1,\r\n };\r\n });\r\n\r\n function onChoice({ value }: { value: boolean }) {\r\n selected.value = value;\r\n }\r\n\r\n useRender(() => {\r\n const yButtonProps = chooseProps(props, YButton.props);\r\n return (\r\n <YButton\r\n class={['y-tab']}\r\n active={false}\r\n {...attrsProps.value}\r\n {...attrs}\r\n {...yButtonProps}\r\n injectSymbol={Y_TABS_KEY}\r\n onChoice:selected={onChoice}\r\n >\r\n {{\r\n default: () => slots.default?.() ?? props.text,\r\n append: () =>\r\n !props.hideIndicator && (\r\n <div\r\n ref={indicator$}\r\n class={['y-tab__indicator']}\r\n style={indicatorStyles.value}\r\n ></div>\r\n ),\r\n }}\r\n </YButton>\r\n );\r\n });\r\n\r\n return {};\r\n },\r\n});\r\n\r\nexport type YTab = InstanceType<typeof YTab>;\r\n"],"mappings":";AAAA,SAAwCA,QAAQ,EAAEC,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAC,SAEtEC,SAAS;AAAA,SACTC,WAAW,EAAEC,eAAe,EAAEC,YAAY;AAAA,SAE1CC,OAAO,EAAEC,iBAAiB;AAAA,SAC1BC,UAAU;AAEnB;AAEA,OAAO,MAAMC,qBAAqB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GACTR,UAAU,CAACE,KAAK,EAChBN,KAAK,EACLU,YAAY;QAAA,gBACF1B,UAAU;QAAA,qBACLwB;MAAQ;QAGzBK,OAAO,EAAEA,CAAA,KAAMjB,KAAK,CAACiB,OAAO,GAAG,CAAC,IAAIlB,KAAK,CAACT,IAAI;QAC9C4B,MAAM,EAAEA,CAAA,KACN,CAACnB,KAAK,CAACP,aAAa,IAAAuB,YAAA;UAAA,OAEXT,UAAU;UAAA,SACR,CAAC,kBAAkB,CAAC;UAAA,SACpBC,eAAe,CAACG;QAAK;MAE/B;IAIX,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
@@ -1,73 +1,73 @@
1
- @use '../../styles/variables';
2
-
3
- .y-tab {
4
- --y-tab-color: var(--y-theme-on-surface);
5
- --y-tab-active-color: var(--y-theme-primary);
6
-
7
- --y-tab-indicator-width: 2.7px;
8
- --y-tab-indicator-color: inherit;
9
- --y-tab-active-indicator-color: var(--y-theme-primary);
10
- --y-tab-hover-indicator-color: var(--y-theme-outline-variant);
11
- --y-tab-indicator-side-offset: 4px;
12
-
13
- border-radius: 0;
14
- color: var(--y-tab-color);
15
-
16
- &.y-button {
17
- font-size: 1rem;
18
- padding: 4px 8px 12px;
19
- box-shadow: none;
20
-
21
- &:before {
22
- left: var(--y-tab-indicator-side-offset);
23
- right: var(--y-tab-indicator-side-offset);
24
- background: radial-gradient(currentColor, transparent 80%),
25
- linear-gradient(0deg, currentColor, transparent 70%);
26
- }
27
- }
28
-
29
- &__indicator {
30
- height: var(--y-tab-indicator-width);
31
- position: absolute;
32
- left: var(--y-tab-indicator-side-offset);
33
- right: var(--y-tab-indicator-side-offset);
34
- bottom: 0;
35
- background-color: currentColor;
36
- border-top-left-radius: 4444px;
37
- border-top-right-radius: 4444px;
38
- transform: scaleY(0);
39
- transform-origin: bottom center;
40
- transition-timing-function: variables.$basic-transition-timing-function;
41
- transition-duration: 200ms;
42
- transition-property: all;
43
- will-change: transform;
44
- }
45
-
46
- .y-button {
47
- &__content {
48
- padding: 0;
49
- }
50
- }
51
-
52
- &--active,
53
- .y-button--active {
54
- font-weight: 700;
55
- color: var(--y-tab-active-color);
56
-
57
- &:before {
58
- opacity: 0.04;
59
- }
60
- }
61
-
62
- &:hover:not(&--active) &__indicator,
63
- &:hover:not(.y-button--active) &__indicator {
64
- transform: scaleY(1);
65
- color: var(--y-tab-hover-indicator-color);
66
- }
67
-
68
- &--active &__indicator,
69
- .y-button--active &__indicator {
70
- color: var(--y-tab-active-indicator-color);
71
- transform: scaleY(1);
72
- }
73
- }
1
+ @use '../../styles/variables';
2
+
3
+ .y-tab {
4
+ --y-tab-color: var(--y-theme-on-surface);
5
+ --y-tab-active-color: var(--y-theme-primary);
6
+
7
+ --y-tab-indicator-width: 2.7px;
8
+ --y-tab-indicator-color: inherit;
9
+ --y-tab-active-indicator-color: var(--y-theme-primary);
10
+ --y-tab-hover-indicator-color: var(--y-theme-outline-variant);
11
+ --y-tab-indicator-side-offset: 4px;
12
+
13
+ border-radius: 0;
14
+ color: var(--y-tab-color);
15
+
16
+ &.y-button {
17
+ font-size: 1rem;
18
+ padding: 4px 8px 12px;
19
+ box-shadow: none;
20
+
21
+ &:before {
22
+ left: var(--y-tab-indicator-side-offset);
23
+ right: var(--y-tab-indicator-side-offset);
24
+ background: radial-gradient(currentColor, transparent 80%),
25
+ linear-gradient(0deg, currentColor, transparent 70%);
26
+ }
27
+ }
28
+
29
+ &__indicator {
30
+ height: var(--y-tab-indicator-width);
31
+ position: absolute;
32
+ left: var(--y-tab-indicator-side-offset);
33
+ right: var(--y-tab-indicator-side-offset);
34
+ bottom: 0;
35
+ background-color: currentColor;
36
+ border-top-left-radius: 4444px;
37
+ border-top-right-radius: 4444px;
38
+ transform: scaleY(0);
39
+ transform-origin: bottom center;
40
+ transition-timing-function: variables.$basic-transition-timing-function;
41
+ transition-duration: 200ms;
42
+ transition-property: all;
43
+ will-change: transform;
44
+ }
45
+
46
+ .y-button {
47
+ &__content {
48
+ padding: 0;
49
+ }
50
+ }
51
+
52
+ &--active,
53
+ .y-button--active {
54
+ font-weight: 700;
55
+ color: var(--y-tab-active-color);
56
+
57
+ &:before {
58
+ opacity: 0.04;
59
+ }
60
+ }
61
+
62
+ &:hover:not(&--active) &__indicator,
63
+ &:hover:not(.y-button--active) &__indicator {
64
+ transform: scaleY(1);
65
+ color: var(--y-tab-hover-indicator-color);
66
+ }
67
+
68
+ &--active &__indicator,
69
+ .y-button--active &__indicator {
70
+ color: var(--y-tab-active-indicator-color);
71
+ transform: scaleY(1);
72
+ }
73
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"YTabs.mjs","names":["computed","pressChoicePropsOptions","useChoice","useRender","useResizeObserver","defineComponent","propsFactory","YTab","Y_TABS_KEY","pressYTabsPropOptions","items","type","Array","selectedClass","mandatory","YTabs","name","props","tag","String","default","emits","value","setup","_ref","slots","resizeObservedRef","container$","contentRect","containerRect","content$","choiceState","slotProps","next","prev","select","isSelected","tabItems","map","item","text","_createVNode","tabItem","_mergeProps","selected"],"sources":["../../../src/components/tab/YTabs.tsx"],"sourcesContent":["import { type PropType, computed } from 'vue';\n\nimport { pressChoicePropsOptions, useChoice } from '@/composables/choice';\nimport { useRender } from '@/composables/component';\nimport { useResizeObserver } from '@/composables/resize-observer';\nimport { defineComponent, propsFactory } from '@/util/component';\n\nimport { YTab } from './YTab';\nimport { Y_TABS_KEY } from './shared';\nimport { YTabPropItem } from './types';\n\nimport './YTabs.scss';\n\nexport const pressYTabsPropOptions = propsFactory(\n {\n items: {\n type: Array as PropType<YTabPropItem[]>,\n },\n ...pressChoicePropsOptions({\n selectedClass: 'y-tab--active',\n mandatory: 'force' as const,\n }),\n },\n 'YTabs',\n);\n\nexport const YTabs = defineComponent({\n name: 'YTabs',\n props: {\n tag: {\n type: String as PropType<'div' | 'nav' | 'ol' | 'ul'>,\n default: 'div',\n },\n ...pressYTabsPropOptions(),\n },\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n setup(props, { slots }) {\n const { resizeObservedRef: container$, contentRect: containerRect } =\n useResizeObserver();\n const { resizeObservedRef: content$, contentRect } = useResizeObserver();\n\n const choiceState = useChoice(props, Y_TABS_KEY);\n\n const slotProps = computed(() => {\n return {\n next: choiceState.next,\n prev: choiceState.prev,\n select: choiceState.select,\n isSelected: choiceState.isSelected,\n };\n });\n\n const tabItems = computed(() => {\n return (\n props.items?.map((item) => {\n if (typeof item !== 'object') {\n return {\n text: item,\n value: item,\n };\n }\n return item;\n }) ?? []\n );\n });\n\n useRender(() => {\n return (\n <props.tag class={['y-tabs']} role=\"tablist\">\n <div key=\"container\" ref={container$} class={['y-tabs__container']}>\n <div key=\"content\" ref={content$} class={['y-tabs__content']}>\n {slots.default\n ? slots.default(slotProps.value)\n : tabItems.value.map((tabItem) => (\n <YTab {...tabItem} key={tabItem.text}></YTab>\n ))}\n </div>\n </div>\n </props.tag>\n );\n });\n\n return {\n selected: choiceState.selected,\n };\n },\n});\n\nexport type YTabs = InstanceType<typeof YTabs>;\n"],"mappings":";AAAA,SAAwBA,QAAQ,QAAQ,KAAK;AAAC,SAErCC,uBAAuB,EAAEC,SAAS;AAAA,SAClCC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,eAAe,EAAEC,YAAY;AAAA,SAE7BC,IAAI;AAAA,SACJC,UAAU;AAGnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGH,YAAY,CAC/C;EACEI,KAAK,EAAE;IACLC,IAAI,EAAEC;EACR,CAAC;EACD,GAAGX,uBAAuB,CAAC;IACzBY,aAAa,EAAE,eAAe;IAC9BC,SAAS,EAAE;EACb,CAAC;AACH,CAAC,EACD,OACF,CAAC;AAED,OAAO,MAAMC,KAAK,GAAGV,eAAe,CAAC;EACnCW,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE;IACLC,GAAG,EAAE;MACHP,IAAI,EAAEQ,MAA+C;MACrDC,OAAO,EAAE;IACX,CAAC;IACD,GAAGX,qBAAqB,CAAC;EAC3B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iBAAiB;QAAC,IACzDL,KAAK,CAACL,OAAO,GACVK,KAAK,CAACL,OAAO,CAACY,SAAS,CAACV,KAAK,CAAC,GAC9Be,QAAQ,CAACf,KAAK,CAACgB,GAAG,CAAEI,OAAO,IAAAD,YAAA,CAAAlC,IAAA,EAAAoC,WAAA,CACfD,OAAO;UAAA,OAAOA,OAAO,CAACF;QAAI,SACrC,CAAC;MAAA;IAKhB,CAAC,CAAC;IAEF,OAAO;MACLI,QAAQ,EAAEb,WAAW,CAACa;IACxB,CAAC;EACH;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"YTabs.mjs","names":["computed","pressChoicePropsOptions","useChoice","useRender","useResizeObserver","defineComponent","propsFactory","YTab","Y_TABS_KEY","pressYTabsPropOptions","items","type","Array","selectedClass","mandatory","YTabs","name","props","tag","String","default","emits","value","setup","_ref","slots","resizeObservedRef","container$","contentRect","containerRect","content$","choiceState","slotProps","next","prev","select","isSelected","tabItems","map","item","text","_createVNode","tabItem","_mergeProps","selected"],"sources":["../../../src/components/tab/YTabs.tsx"],"sourcesContent":["import { type PropType, computed } from 'vue';\r\n\r\nimport { pressChoicePropsOptions, useChoice } from '@/composables/choice';\r\nimport { useRender } from '@/composables/component';\r\nimport { useResizeObserver } from '@/composables/resize-observer';\r\nimport { defineComponent, propsFactory } from '@/util/component';\r\n\r\nimport { YTab } from './YTab';\r\nimport { Y_TABS_KEY } from './shared';\r\nimport { YTabPropItem } from './types';\r\n\r\nimport './YTabs.scss';\r\n\r\nexport const pressYTabsPropOptions = propsFactory(\r\n {\r\n items: {\r\n type: Array as PropType<YTabPropItem[]>,\r\n },\r\n ...pressChoicePropsOptions({\r\n selectedClass: 'y-tab--active',\r\n mandatory: 'force' as const,\r\n }),\r\n },\r\n 'YTabs',\r\n);\r\n\r\nexport const YTabs = defineComponent({\r\n name: 'YTabs',\r\n props: {\r\n tag: {\r\n type: String as PropType<'div' | 'nav' | 'ol' | 'ul'>,\r\n default: 'div',\r\n },\r\n ...pressYTabsPropOptions(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: any) => true,\r\n },\r\n setup(props, { slots }) {\r\n const { resizeObservedRef: container$, contentRect: containerRect } =\r\n useResizeObserver();\r\n const { resizeObservedRef: content$, contentRect } = useResizeObserver();\r\n\r\n const choiceState = useChoice(props, Y_TABS_KEY);\r\n\r\n const slotProps = computed(() => {\r\n return {\r\n next: choiceState.next,\r\n prev: choiceState.prev,\r\n select: choiceState.select,\r\n isSelected: choiceState.isSelected,\r\n };\r\n });\r\n\r\n const tabItems = computed(() => {\r\n return (\r\n props.items?.map((item) => {\r\n if (typeof item !== 'object') {\r\n return {\r\n text: item,\r\n value: item,\r\n };\r\n }\r\n return item;\r\n }) ?? []\r\n );\r\n });\r\n\r\n useRender(() => {\r\n return (\r\n <props.tag class={['y-tabs']} role=\"tablist\">\r\n <div key=\"container\" ref={container$} class={['y-tabs__container']}>\r\n <div key=\"content\" ref={content$} class={['y-tabs__content']}>\r\n {slots.default\r\n ? slots.default(slotProps.value)\r\n : tabItems.value.map((tabItem) => (\r\n <YTab {...tabItem} key={tabItem.text}></YTab>\r\n ))}\r\n </div>\r\n </div>\r\n </props.tag>\r\n );\r\n });\r\n\r\n return {\r\n selected: choiceState.selected,\r\n };\r\n },\r\n});\r\n\r\nexport type YTabs = InstanceType<typeof YTabs>;\r\n"],"mappings":";AAAA,SAAwBA,QAAQ,QAAQ,KAAK;AAAC,SAErCC,uBAAuB,EAAEC,SAAS;AAAA,SAClCC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,eAAe,EAAEC,YAAY;AAAA,SAE7BC,IAAI;AAAA,SACJC,UAAU;AAGnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGH,YAAY,CAC/C;EACEI,KAAK,EAAE;IACLC,IAAI,EAAEC;EACR,CAAC;EACD,GAAGX,uBAAuB,CAAC;IACzBY,aAAa,EAAE,eAAe;IAC9BC,SAAS,EAAE;EACb,CAAC;AACH,CAAC,EACD,OACF,CAAC;AAED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ACoB,CAAC,QAAQ,CAAC;QAAA;MAAA;QAAAE,OAAA,EAAAA,CAAA,MAAAqB,YAAA;UAAA;UAAA,OACAd,UAAU;UAAA,SAAS,CAAC,mBAAmB;QAAC,IAAAc,YAAA;UAAA;UAAA,OACxCX,QAAQ;UAAA,SAAS,CAAC,iBAAiB;QAAC,IACzDL,KAAK,CAACL,OAAO,GACVK,KAAK,CAACL,OAAO,CAACY,SAAS,CAACV,KAAK,CAAC,GAC9Be,QAAQ,CAACf,KAAK,CAACgB,GAAG,CAAEI,OAAO,IAAAD,YAAA,CAAAlC,IAAA,EAAAoC,WAAA,CACfD,OAAO;UAAA,OAAOA,OAAO,CAACF;QAAI,SACrC,CAAC;MAAA;IAKhB,CAAC,CAAC;IAEF,OAAO;MACLI,QAAQ,EAAEb,WAAW,CAACa;IACxB,CAAC;EACH;AACF,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
- .y-tabs {
2
- --y-tabs-gap: 16px;
3
-
4
- &__content {
5
- display: flex;
6
- gap: var(--y-tabs-gap);
7
- }
8
- }
1
+ .y-tabs {
2
+ --y-tabs-gap: 16px;
3
+
4
+ &__content {
5
+ display: flex;
6
+ gap: var(--y-tabs-gap);
7
+ }
8
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Y_TABS_KEY"],"sources":["../../../src/components/tab/index.ts"],"sourcesContent":["export * from './YTabs';\nexport * from './YTab';\nexport { Y_TABS_KEY } from './shared';\n"],"mappings":";;SAESA,UAAU"}
1
+ {"version":3,"file":"index.mjs","names":["Y_TABS_KEY"],"sources":["../../../src/components/tab/index.ts"],"sourcesContent":["export * from './YTabs';\r\nexport * from './YTab';\r\nexport { Y_TABS_KEY } from './shared';\r\n"],"mappings":";;SAESA,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../../src/components/tab/types.ts"],"sourcesContent":["export interface YTabPropItem {\n text: string;\n value?: string;\n [Key: string]: any;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../../src/components/tab/types.ts"],"sourcesContent":["export interface YTabPropItem {\r\n text: string;\r\n value?: string;\r\n [Key: string]: any;\r\n}\r\n"],"mappings":""}