@esportsplus/ui 0.51.7 → 0.53.0

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 (150) hide show
  1. package/README.md +2 -3
  2. package/build/components/accordion/index.d.ts +15 -10
  3. package/build/components/accordion/index.js +8 -34
  4. package/build/components/accordion/scss/index.scss +1 -1
  5. package/build/components/back/index.d.ts +14 -11
  6. package/build/components/back/index.js +3 -3
  7. package/build/components/button/index.js +2 -2
  8. package/build/components/checkbox/index.js +7 -3
  9. package/build/components/clipboard/index.d.ts +23 -20
  10. package/build/components/clipboard/index.js +1 -0
  11. package/build/components/clipboard/onclick.js +3 -3
  12. package/build/components/form/input.js +3 -3
  13. package/build/components/frame/index.d.ts +16 -15
  14. package/build/components/frame/index.js +11 -5
  15. package/build/components/highlight/index.js +2 -2
  16. package/build/components/icon/index.js +2 -2
  17. package/build/components/index.d.ts +1 -4
  18. package/build/components/index.js +1 -4
  19. package/build/components/loader/index.js +4 -4
  20. package/build/components/loader/scss/index.scss +1 -1
  21. package/build/components/overlay/index.d.ts +16 -15
  22. package/build/components/overlay/index.js +11 -5
  23. package/build/components/overlay/scss/index.scss +1 -1
  24. package/build/components/page/scss/index.scss +1 -1
  25. package/build/components/root/scss/index.scss +1 -1
  26. package/build/components/select/index.d.ts +3 -6
  27. package/build/components/select/index.js +72 -78
  28. package/build/components/sidebar/index.d.ts +16 -15
  29. package/build/components/sidebar/index.js +11 -5
  30. package/build/components/sidebar/scss/index.scss +1 -1
  31. package/build/components/toast/index.d.ts +9 -0
  32. package/build/components/toast/index.js +157 -0
  33. package/build/components/toast/manager.d.ts +60 -0
  34. package/build/components/toast/manager.js +203 -0
  35. package/build/components/toast/scss/index.scss +2 -0
  36. package/build/components/toast/svg/check.svg +1 -0
  37. package/build/components/toast/svg/chevron.svg +1 -0
  38. package/build/components/toast/svg/close.svg +1 -0
  39. package/build/components/toast/svg/copy.svg +1 -0
  40. package/build/components/toast/svg/error.svg +1 -0
  41. package/build/components/toast/svg/info.svg +1 -0
  42. package/build/components/toast/svg/loading.svg +1 -0
  43. package/build/components/toast/svg/success.svg +1 -0
  44. package/build/components/toast/svg/warning.svg +1 -0
  45. package/build/components/tooltip/index.d.ts +40 -40
  46. package/build/components/tooltip/menu.js +37 -23
  47. package/build/components/tooltip/onclick.d.ts +20 -20
  48. package/build/components/tooltip/onclick.js +2 -2
  49. package/build/components/tooltip/onhover.js +2 -2
  50. package/build/components/typewriter/index.js +2 -2
  51. package/build/css-utilities/index.scss +1 -1
  52. package/build/css-utilities/scroll-fade/scss/index.scss +2 -0
  53. package/build/css-utilities/scrollbar/scss/index.scss +2 -0
  54. package/build/themes/dark/back.d.ts +8 -4
  55. package/build/themes/dark/index.d.ts +0 -1
  56. package/build/themes/dark/index.js +0 -1
  57. package/build/themes/dark/input.d.ts +2 -2
  58. package/build/themes/dark/select.d.ts +60 -110
  59. package/build/themes/dark/textarea.d.ts +2 -2
  60. package/package.json +15 -15
  61. package/pnpm-workspace.yaml +11 -8
  62. package/src/components/accordion/index.ts +7 -30
  63. package/src/components/accordion/scss/index.scss +9 -12
  64. package/src/components/back/index.ts +4 -5
  65. package/src/components/button/index.ts +2 -3
  66. package/src/components/checkbox/index.ts +7 -2
  67. package/src/components/clipboard/index.ts +2 -1
  68. package/src/components/clipboard/onclick.ts +3 -4
  69. package/src/components/form/input.ts +4 -4
  70. package/src/components/frame/index.ts +9 -5
  71. package/src/components/highlight/index.ts +2 -3
  72. package/src/components/icon/index.ts +2 -3
  73. package/src/components/index.ts +1 -4
  74. package/src/components/loader/index.ts +5 -6
  75. package/src/components/loader/scss/index.scss +1 -1
  76. package/src/components/overlay/index.ts +9 -5
  77. package/src/components/overlay/scss/index.scss +0 -1
  78. package/src/components/page/scss/index.scss +1 -1
  79. package/src/components/root/scss/index.scss +35 -4
  80. package/src/components/root/scss/variables.scss +1 -2
  81. package/src/components/select/index.ts +71 -83
  82. package/src/components/sidebar/index.ts +9 -5
  83. package/src/components/sidebar/scss/index.scss +0 -1
  84. package/src/components/toast/index.ts +188 -0
  85. package/src/components/toast/manager.ts +312 -0
  86. package/src/components/toast/scss/index.scss +276 -0
  87. package/src/components/toast/scss/variables.scss +19 -0
  88. package/src/components/toast/svg/check.svg +1 -0
  89. package/src/components/toast/svg/chevron.svg +1 -0
  90. package/src/components/toast/svg/close.svg +1 -0
  91. package/src/components/toast/svg/copy.svg +1 -0
  92. package/src/components/toast/svg/error.svg +1 -0
  93. package/src/components/toast/svg/info.svg +1 -0
  94. package/src/components/toast/svg/loading.svg +1 -0
  95. package/src/components/toast/svg/success.svg +1 -0
  96. package/src/components/toast/svg/warning.svg +1 -0
  97. package/src/components/tooltip/menu.ts +8 -4
  98. package/src/components/tooltip/onclick.ts +2 -3
  99. package/src/components/tooltip/onhover.ts +2 -3
  100. package/src/components/typewriter/index.ts +2 -3
  101. package/src/css-utilities/index.scss +3 -2
  102. package/src/css-utilities/scroll-fade/scss/index.scss +47 -0
  103. package/src/css-utilities/scroll-fade/scss/variables.scss +3 -0
  104. package/src/css-utilities/scrollbar/scss/index.scss +53 -0
  105. package/src/css-utilities/scrollbar/scss/variables.scss +5 -0
  106. package/src/themes/dark/index.ts +0 -1
  107. package/src/tokens/scss/color.scss +14 -14
  108. package/src/tokens/scss/font-size.scss +12 -11
  109. package/src/tokens/scss/line-height.scss +7 -4
  110. package/src/tokens/scss/scale.scss +22 -0
  111. package/src/tokens/scss/size.scss +12 -9
  112. package/src/tokens/scss/spacer.scss +9 -9
  113. package/storage/svg/bolt.svg +1 -0
  114. package/storage/svg/star.svg +1 -0
  115. package/tsconfig.json +6 -2
  116. package/vite-env.d.ts +1 -0
  117. package/vite.config.ts +73 -72
  118. package/build/components/alert/index.d.ts +0 -19
  119. package/build/components/alert/index.js +0 -151
  120. package/build/components/alert/scss/index.scss +0 -2
  121. package/build/components/alert/svg/check.svg +0 -11
  122. package/build/components/alert/svg/close.svg +0 -12
  123. package/build/components/alert/svg/error.svg +0 -18
  124. package/build/components/scrollbar/index.d.ts +0 -27
  125. package/build/components/scrollbar/index.js +0 -56
  126. package/build/components/scrollbar/scss/index.scss +0 -2
  127. package/build/components/site/index.d.ts +0 -20
  128. package/build/components/site/index.js +0 -9
  129. package/build/components/site/scss/index.scss +0 -2
  130. package/build/components/template/index.d.ts +0 -14
  131. package/build/components/template/index.js +0 -21
  132. package/build/css-utilities/scroller/scss/index.scss +0 -2
  133. package/build/themes/dark/alert.d.ts +0 -11
  134. package/build/themes/dark/alert.js +0 -20
  135. package/src/components/accordion/scss/variables.scss +0 -9
  136. package/src/components/alert/index.ts +0 -165
  137. package/src/components/alert/scss/index.scss +0 -25
  138. package/src/components/alert/scss/variables.scss +0 -3
  139. package/src/components/alert/svg/check.svg +0 -11
  140. package/src/components/alert/svg/close.svg +0 -12
  141. package/src/components/alert/svg/error.svg +0 -18
  142. package/src/components/scrollbar/index.ts +0 -70
  143. package/src/components/scrollbar/scss/index.scss +0 -82
  144. package/src/components/scrollbar/scss/variables.scss +0 -6
  145. package/src/components/site/index.ts +0 -11
  146. package/src/components/site/scss/index.scss +0 -3
  147. package/src/components/template/index.ts +0 -40
  148. package/src/css-utilities/scroller/scss/index.scss +0 -8
  149. package/src/css-utilities/scroller/scss/variables.scss +0 -4
  150. package/src/themes/dark/alert.ts +0 -23
@@ -0,0 +1,276 @@
1
+ @use '/lib';
2
+ @use '/tokens';
3
+ @use 'variables';
4
+
5
+ .toaster {
6
+ bottom: auto;
7
+ left: auto;
8
+ position: fixed;
9
+ right: auto;
10
+ top: auto;
11
+ width: min(360px, calc(100% - (var(--toast-inset) * 2)));
12
+ z-index: 9999;
13
+
14
+ &[data-position^='top'] {
15
+ top: var(--toast-inset);
16
+ }
17
+
18
+ &[data-position^='bottom'] {
19
+ bottom: var(--toast-inset);
20
+ }
21
+
22
+ &[data-position$='left'] {
23
+ left: var(--toast-inset);
24
+ }
25
+
26
+ &[data-position$='right'] {
27
+ right: var(--toast-inset);
28
+ }
29
+
30
+ &[data-position$='center'] {
31
+ left: 50%;
32
+ transform: translateX(-50%);
33
+ }
34
+ }
35
+
36
+
37
+ .toast {
38
+ background: var(--background);
39
+ border: 1px solid var(--color-border-400);
40
+ border-radius: var(--border-radius-500);
41
+ box-shadow: var(--box-shadow-300);
42
+ color: var(--color-text-400);
43
+ left: 0;
44
+ overflow: visible;
45
+ position: absolute;
46
+ right: 0;
47
+ transform: translateX(var(--toast-swipe-x)) translateY(calc(var(--toast-swipe-y) + (var(--toast-index) * var(--toast-peek)) + (var(--toast-shrink) * var(--toast-calc-height)))) scale(var(--toast-scale));
48
+ transition:
49
+ transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
50
+ opacity 0.3s,
51
+ height 0.2s;
52
+ user-select: none;
53
+ width: 100%;
54
+ z-index: calc(9999 - var(--toast-index, 0));
55
+
56
+
57
+ [data-position*='top'] & {
58
+ bottom: auto;
59
+ top: 0;
60
+ transform-origin: top;
61
+ }
62
+
63
+ [data-position*='bottom'] & {
64
+ --toast-calc-offset-y: calc((var(--toast-offset-y, 0px) * -1) + (var(--toast-index, 0) * var(--toast-gap) * -1) + var(--toast-swipe-y, 0px));
65
+ bottom: 0;
66
+ top: auto;
67
+ transform: translateX(var(--toast-swipe-x)) translateY(calc(var(--toast-swipe-y) - (var(--toast-index) * var(--toast-peek)) - (var(--toast-shrink) * var(--toast-calc-height)))) scale(var(--toast-scale));
68
+ transform-origin: bottom;
69
+ }
70
+
71
+
72
+ // Invisible hit-area bridging the gap between stacked toasts while collapsed.
73
+ &::after {
74
+ content: '';
75
+ height: calc(var(--toast-gap) + 1px);
76
+ left: 0;
77
+ position: absolute;
78
+ width: 100%;
79
+ }
80
+
81
+ [data-position*='top'] &::after {
82
+ top: 100%;
83
+ }
84
+
85
+ [data-position*='bottom'] &::after {
86
+ bottom: 100%;
87
+ }
88
+
89
+
90
+ &-action {
91
+ flex-shrink: 0;
92
+ }
93
+
94
+ &-close {
95
+ align-items: center;
96
+ background: var(--background);
97
+ border: 1px solid var(--color-border-400);
98
+ border-radius: var(--border-radius-circle);
99
+ color: var(--color-text-500);
100
+ display: flex;
101
+ height: var(--size-500);
102
+ justify-content: center;
103
+ position: absolute;
104
+ right: calc(var(--size-200) * -1);
105
+ top: calc(var(--size-200) * -1);
106
+ width: var(--size-500);
107
+ z-index: 1;
108
+ }
109
+
110
+ &-content {
111
+ align-items: center;
112
+ display: flex;
113
+ gap: var(--size-300);
114
+ justify-content: space-between;
115
+ min-height: 0;
116
+ opacity: max(0, 1 - var(--toast-index, 0));
117
+ overflow-x: clip;
118
+ overflow-y: visible;
119
+ padding: var(--size-400);
120
+ transition: opacity 0.3s;
121
+ }
122
+
123
+ &-copy {
124
+ align-items: center;
125
+ display: inline-flex;
126
+ justify-content: center;
127
+ }
128
+
129
+ &-description {
130
+ color: var(--color-text-300);
131
+ overflow-wrap: anywhere;
132
+
133
+ &--clamp {
134
+ -webkit-box-orient: vertical;
135
+ -webkit-line-clamp: 4;
136
+ display: -webkit-box;
137
+ line-clamp: 4;
138
+ overflow: hidden;
139
+ }
140
+ }
141
+
142
+ &-details {
143
+ margin-top: var(--size-200);
144
+ max-height: 160px;
145
+ overflow-y: auto;
146
+ }
147
+
148
+ &-details-toggle {
149
+ align-items: center;
150
+ cursor: pointer;
151
+ display: flex;
152
+ gap: var(--size-200);
153
+ }
154
+
155
+ &-icon {
156
+ color: var(--toast-color);
157
+ flex-shrink: 0;
158
+ height: 18px;
159
+ width: 18px;
160
+ }
161
+
162
+ &-title {
163
+ font-weight: var(--font-weight-400);
164
+ overflow-wrap: anywhere;
165
+ }
166
+
167
+
168
+ &--error {
169
+ --toast-color: var(--color-red-400);
170
+
171
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
172
+ }
173
+
174
+ &--warning {
175
+ --toast-color: var(--color-yellow-400);
176
+
177
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
178
+ }
179
+
180
+ &--success {
181
+ --toast-color: var(--color-green-400);
182
+
183
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
184
+ }
185
+
186
+ &--info {
187
+ --toast-color: var(--color-blue-400);
188
+
189
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
190
+ }
191
+
192
+ &--loading {
193
+ --toast-color: var(--color-grey-500);
194
+
195
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
196
+
197
+ .toast-icon {
198
+ animation: toast-spin 1s linear infinite;
199
+ }
200
+ }
201
+
202
+ &--message {
203
+ --toast-color: var(--color-text-300);
204
+
205
+ border-color: color-mix(in oklab, var(--toast-color) 30%, var(--color-border-400));
206
+ }
207
+ }
208
+
209
+
210
+ // active (viewport hovered): everything fans out to its own measured offset.
211
+ .toaster.--active .toast {
212
+ height: auto;
213
+ transform: translateX(var(--toast-swipe-x)) translateY(var(--toast-calc-offset-y));
214
+ }
215
+
216
+ .toaster.--active .toast-content {
217
+ opacity: 1;
218
+ }
219
+
220
+
221
+ // Entering: start off-screen (faded) and let the base transform animate in.
222
+ .toaster .toast.toast--starting {
223
+ opacity: 0;
224
+ }
225
+
226
+ .toaster[data-position*='top'] .toast.toast--starting {
227
+ transform: translateY(-120%);
228
+ }
229
+
230
+ .toaster[data-position*='bottom'] .toast.toast--starting {
231
+ transform: translateY(120%);
232
+ }
233
+
234
+
235
+ // Leaving: fade, then slide toward the matching viewport edge (or the swipe
236
+ // direction the gesture reported).
237
+ .toaster .toast.toast--ending {
238
+ opacity: 0;
239
+ }
240
+
241
+ .toaster[data-position*='top'] .toast.toast--ending {
242
+ transform: translateY(calc(-100% - var(--toast-inset)));
243
+ }
244
+
245
+ .toaster[data-position*='bottom'] .toast.toast--ending {
246
+ transform: translateY(calc(100% + var(--toast-inset)));
247
+ }
248
+
249
+ .toaster .toast.toast--ending[data-swipe-direction='left'] {
250
+ transform: translateX(calc(var(--toast-swipe-x) - 100% - var(--toast-inset))) translateY(var(--toast-calc-offset-y));
251
+ }
252
+
253
+ .toaster .toast.toast--ending[data-swipe-direction='right'] {
254
+ transform: translateX(calc(var(--toast-swipe-x) + 100% + var(--toast-inset))) translateY(var(--toast-calc-offset-y));
255
+ }
256
+
257
+ .toaster .toast.toast--ending[data-swipe-direction='up'] {
258
+ transform: translateY(calc(var(--toast-swipe-y) - 100% - var(--toast-inset)));
259
+ }
260
+
261
+ .toaster .toast.toast--ending[data-swipe-direction='down'] {
262
+ transform: translateY(calc(var(--toast-swipe-y) + 100% + var(--toast-inset)));
263
+ }
264
+
265
+
266
+ // Following the finger: never ease the transform during a swipe.
267
+ .toast--swiping {
268
+ transition: none;
269
+ }
270
+
271
+
272
+ @keyframes toast-spin {
273
+ to {
274
+ transform: rotate(360deg);
275
+ }
276
+ }
@@ -0,0 +1,19 @@
1
+ .toaster {
2
+ --toast-gap: var(--size-300);
3
+ --toast-inset: var(--size-500);
4
+ --toast-peek: var(--size-300);
5
+ }
6
+
7
+
8
+ .toast {
9
+ --toast-calc-height: max(var(--toast-frontmost-height, var(--toast-height, 0px)), var(--toast-height, 0px));
10
+ --toast-calc-offset-y: calc(var(--toast-offset-y, 0px) + (var(--toast-index, 0) * var(--toast-gap)) + var(--toast-swipe-y, 0px));
11
+ --toast-color: var(--color-text-300);
12
+ --toast-height: 0px;
13
+ --toast-index: 0;
14
+ --toast-offset-y: 0px;
15
+ --toast-scale: max(0, 1 - (var(--toast-index, 0) * 0.06));
16
+ --toast-shrink: calc(1 - var(--toast-scale));
17
+ --toast-swipe-x: 0px;
18
+ --toast-swipe-y: 0px;
19
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>
@@ -1,6 +1,6 @@
1
- import { html, type Attributes, type Renderable } from '@esportsplus/template';
1
+ import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
2
+ import { reactive } from '@esportsplus/reactivity';
2
3
  import { omit } from '@esportsplus/utilities';
3
- import template from '~/components/template';
4
4
  import onclick from './onclick';
5
5
 
6
6
 
@@ -20,21 +20,25 @@ const OMIT_OPTION = ['content'];
20
20
  const OMIT_TOOLTIP_CONTENT = ['direction'];
21
21
 
22
22
 
23
- export default template.factory<A>(
23
+ export default component<A>(
24
24
  (attributes, content) => {
25
25
  let options = attributes.options,
26
26
  option = attributes.option,
27
+ state = attributes.state || reactive({ active: false }),
27
28
  tooltipContent = attributes?.['tooltip-content'],
28
29
  tooltipContentDirection = tooltipContent?.direction || 'nw';
29
30
 
30
31
  return onclick(
31
- omit(attributes, OMIT),
32
+ { ...omit(attributes, OMIT), state },
32
33
  html`
33
34
  ${content}
34
35
 
35
36
  <div
36
37
  class='tooltip-content ${`tooltip-content--${tooltipContentDirection}`}'
37
38
  ${tooltipContent && omit(tooltipContent, OMIT_TOOLTIP_CONTENT)}
39
+ ${{
40
+ inert: () => !state.active
41
+ }}
38
42
  >
39
43
  ${options.map((o) => {
40
44
  if (o.href) {
@@ -1,8 +1,7 @@
1
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { component, html, type Attributes } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { omit } from '@esportsplus/utilities';
4
4
  import root from '~/components/root';
5
- import template from '~/components/template';
6
5
 
7
6
 
8
7
  const OMIT = ['state', 'toggle'];
@@ -41,7 +40,7 @@ function frame() {
41
40
  }
42
41
 
43
42
 
44
- export default template.factory<Attributes & { state?: { active: boolean }, toggle?: boolean }>(
43
+ export default component<Attributes & { state?: { active: boolean }, toggle?: boolean }>(
45
44
  (attributes, content) => {
46
45
  let state = attributes.state || reactive({ active: false }),
47
46
  toggle = attributes.toggle || false;
@@ -1,7 +1,6 @@
1
- import { html, Attributes } from '@esportsplus/template';
1
+ import { component, html, Attributes } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { omit } from '@esportsplus/utilities';
4
- import template from '~/components/template';
5
4
 
6
5
 
7
6
  type A = Attributes & { state?: { active: boolean } };
@@ -10,7 +9,7 @@ type A = Attributes & { state?: { active: boolean } };
10
9
  const OMIT = ['state'];
11
10
 
12
11
 
13
- export default template.factory(
12
+ export default component(
14
13
  (attributes: A, content) => {
15
14
  let state = attributes.state || reactive({ active: false });
16
15
 
@@ -1,6 +1,5 @@
1
- import { html } from '@esportsplus/template';
1
+ import { component, html } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
- import template from '~/components/template';
4
3
  import './scss/index.scss';
5
4
 
6
5
 
@@ -8,7 +7,7 @@ import './scss/index.scss';
8
7
  const EMPTY_NODE = html` `;
9
8
 
10
9
 
11
- export default template.factory(
10
+ export default component(
12
11
  function(_, content: string[]) {
13
12
  let state = reactive({ text: '' });
14
13
 
@@ -15,9 +15,10 @@
15
15
  @forward './line-height/scss/index.scss';
16
16
  @forward './not-allowed/scss/index.scss';
17
17
  @forward './pointer/scss/index.scss';
18
- @forward './scroller/scss/index.scss';
19
- @forward './skeleton/scss/index.scss';
18
+ @forward './scroll-fade/scss/index.scss';
19
+ @forward './scrollbar/scss/index.scss';
20
20
  @forward './size/scss/index.scss';
21
+ @forward './skeleton/scss/index.scss';
21
22
  @forward './text/scss/index.scss';
22
23
  @forward './viewport/scss/index.scss';
23
24
  @forward './width/scss/index.scss';
@@ -0,0 +1,47 @@
1
+ @use 'variables';
2
+
3
+ // Registered so the length custom properties can be interpolated by the
4
+ // scroll-driven animation below.
5
+ @property --scroll-fade-bottom {
6
+ inherits: false;
7
+ initial-value: 0px;
8
+ syntax: '<length>';
9
+ }
10
+
11
+ @property --scroll-fade-top {
12
+ inherits: false;
13
+ initial-value: 0px;
14
+ syntax: '<length>';
15
+ }
16
+
17
+ // A vertical scroll container that fades an edge only while there is content
18
+ // past it: no top fade at the very top, no bottom fade at the very end. Driven
19
+ // by the element's own scroll position (scroll-driven animations), so the fade
20
+ // is direction-aware rather than a static gradient that clips the ends.
21
+ .--scroll-fade {
22
+ overflow-y: auto;
23
+
24
+ @supports (animation-timeline: scroll()) {
25
+ animation: scroll-fade linear both;
26
+ animation-timeline: scroll(self);
27
+ -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent);
28
+ mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent);
29
+ }
30
+ }
31
+
32
+ @keyframes scroll-fade {
33
+ 0% {
34
+ --scroll-fade-bottom: var(--scroll-fade-size);
35
+ --scroll-fade-top: 0px;
36
+ }
37
+
38
+ 5%, 95% {
39
+ --scroll-fade-bottom: var(--scroll-fade-size);
40
+ --scroll-fade-top: var(--scroll-fade-size);
41
+ }
42
+
43
+ 100% {
44
+ --scroll-fade-bottom: 0px;
45
+ --scroll-fade-top: var(--scroll-fade-size);
46
+ }
47
+ }
@@ -0,0 +1,3 @@
1
+ .--scroll-fade {
2
+ --scroll-fade-size: 2.5rem;
3
+ }
@@ -0,0 +1,53 @@
1
+ @use 'variables';
2
+
3
+ .--scrollbar {
4
+ overflow: auto;
5
+ overscroll-behavior: contain;
6
+ scroll-behavior: smooth;
7
+ scrollbar-color: var(--scrollbar-color) transparent;
8
+ scrollbar-gutter: stable;
9
+
10
+ @supports selector(::-webkit-scrollbar) {
11
+ scrollbar-color: auto;
12
+ scrollbar-width: auto;
13
+
14
+ &::-webkit-scrollbar {
15
+ width: var(--scrollbar-width);
16
+ }
17
+ &::-webkit-scrollbar-button {
18
+ display: none;
19
+ height: 0;
20
+ width: 0;
21
+ }
22
+ &::-webkit-scrollbar-thumb {
23
+ background: var(--scrollbar-color);
24
+ border-radius: var(--scrollbar-border-width);
25
+ }
26
+ }
27
+
28
+ &.--flex-column {
29
+ overflow-x: hidden;
30
+ }
31
+ &.--flex-row {
32
+ overflow-y: hidden;
33
+ }
34
+
35
+ &-hidden {
36
+ scrollbar-width: none;
37
+
38
+ &::-webkit-scrollbar {
39
+ display: none;
40
+ }
41
+ }
42
+
43
+ &-snap {
44
+ overflow: auto;
45
+ overscroll-behavior-x: contain;
46
+ scroll-snap-type: both mandatory;
47
+
48
+ > * {
49
+ scroll-snap-align: center;
50
+ scroll-snap-stop: normal;
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,5 @@
1
+ .--scrollbar {
2
+ --scrollbar-border-width: 1px;
3
+ --scrollbar-color: var(--color-black-300);
4
+ --scrollbar-width: 4px;
5
+ }
@@ -1,4 +1,3 @@
1
- export { default as alert } from './alert';
2
1
  export { default as back } from './back';
3
2
  export { default as input } from './input';
4
3
  export { default as select } from './select';
@@ -13,9 +13,9 @@ $color: (
13
13
  500: oklch(48.45% 0.2617 266.3)
14
14
  ),
15
15
  'border': (
16
- 300: oklch(82.15% 0.0368 276.9),
17
- 400: oklch(78.98% 0.0358 276.6),
18
- 500: oklch(73.98% 0.0362 278.3)
16
+ 300: oklch(0.9683 0.0069 247.9),
17
+ 400: oklch(0.9288 0.0126 255.51),
18
+ 500: oklch(0.869 0.0198 252.89)
19
19
  ),
20
20
  'green': (
21
21
  300: oklch(87.03% 0.2708 144.9),
@@ -23,9 +23,9 @@ $color: (
23
23
  500: oklch(78.97% 0.2560 144.0)
24
24
  ),
25
25
  'grey': (
26
- 300: oklch(98.01% 0.0096 252.8),
27
- 400: oklch(95.33% 0.0162 245.1),
28
- 500: oklch(89.33% 0.0157 248.0)
26
+ 300: oklch(0.9842 0.0034 247.86),
27
+ 400: oklch(0.9683 0.0069 247.9),
28
+ 500: oklch(0.9288 0.0126 255.51)
29
29
  ),
30
30
  'purple': (
31
31
  300: oklch(53.29% 0.2877 292.5),
@@ -38,19 +38,19 @@ $color: (
38
38
  500: oklch(59.10% 0.2413 27.6)
39
39
  ),
40
40
  'text': (
41
- 300: oklch(26.89% 0.0510 273.0),
42
- 400: oklch(24.11% 0.0541 272.6),
43
- 500: oklch(21.88% 0.0516 271.8)
41
+ 300: oklch(55.1% 0.027 264.364),
42
+ 400: oklch(37.3% 0.034 259.733),
43
+ 500: oklch(21% 0.034 264.665)
44
44
  ),
45
45
  'white': (
46
46
  300: oklch(100% 0 0),
47
- 400: oklch(100% 0 0),
48
- 500: oklch(100% 0 0)
47
+ 400: oklch(99.2% 0 0),
48
+ 500: oklch(98.5% 0 0)
49
49
  ),
50
50
  'yellow': (
51
- 300: oklch(96.85% 0.1779 110.7),
52
- 400: oklch(96.32% 0.2125 111.5),
53
- 500: oklch(90.35% 0.2004 112.3)
51
+ 300: oklch(90.5% 0.182 98.1),
52
+ 400: oklch(85.2% 0.199 91.9),
53
+ 500: oklch(79.5% 0.184 86.0)
54
54
  )
55
55
  );
56
56
 
@@ -1,14 +1,15 @@
1
- // https://www.fluid-type-scale.com/calculate?minFontSize=12&minWidth=200&minRatio=1.04&maxFontSize=14&maxWidth=800&maxRatio=1.28&steps=100%2C200%2C300%2C400%2C500%2C600%2C700%2C800%2C900&baseStep=400&prefix=font-size&useContainerWidth=false&includeFallbacks=false&useRems=true&remValue=16&decimals=2&previewFont=Montserrat&previewText=Almost+before+we+knew+it%2C+we+had+left+the+ground&previewWidth=800
1
+ // Golden-ratio type scale: 400 = 1rem body, each key one φ half-step (×1.272).
2
+ @use 'scale';
3
+
2
4
  $font-size: (
3
- 100: clamp(0.67rem, -0.67vi + 0.75rem, 0.42rem),
4
- 200: clamp(0.69rem, -0.42vi + 0.75rem, 0.53rem),
5
- 300: clamp(0.72rem, -0.1vi + 0.73rem, 0.68rem),
6
- 400: clamp(0.75rem, 0.33vi + 0.71rem, 0.88rem),
7
- 500: clamp(0.78rem, 0.91vi + 0.67rem, 1.12rem),
8
- 600: clamp(0.81rem, 1.66vi + 0.6rem, 1.43rem),
9
- 700: clamp(0.84rem, 2.64vi + 0.51rem, 1.84rem),
10
- 800: clamp(0.88rem, 3.92vi + 0.39rem, 2.35rem),
11
- 900: clamp(0.91rem, 5.58vi + 0.21rem, 3.01rem),
5
+ 100: scale.rem(scale.step(-1.5)),
6
+ 200: scale.rem(scale.step(-1)),
7
+ 300: scale.rem(scale.step(-0.5)),
8
+ 400: scale.rem(scale.step(0)),
9
+ 500: scale.rem(scale.step(0.5)),
10
+ 600: scale.rem(scale.step(1)),
11
+ 700: scale.rem(scale.step(1.5)),
12
+ 800: scale.rem(scale.step(2)),
13
+ 900: scale.rem(scale.step(2.5)),
12
14
  );
13
15
 
14
-
@@ -1,6 +1,9 @@
1
+ // LiftKit line-height steps: the φ-root constants themselves (unitless).
2
+ @use 'scale';
3
+
1
4
  $line-height: (
2
- 100: 1,
3
- 200: 1.2,
4
- 300: 1.4,
5
- 400: 1.6
5
+ 100: scale.$eighth,
6
+ 200: scale.$quarter,
7
+ 300: scale.$half,
8
+ 400: scale.$whole
6
9
  );
@@ -0,0 +1,22 @@
1
+ // LiftKit golden-ratio scale engine (github.com/Chainlift/liftkit)
2
+ // One factor drives every ratio scale: type, size, spacer, line-height.
3
+ @use 'sass:math';
4
+
5
+ $factor: 1.618;
6
+
7
+ $eighth: math.pow($factor, 0.125);
8
+ $half: math.pow($factor, 0.5);
9
+ $quarter: math.pow($factor, 0.25);
10
+ $whole: $factor;
11
+
12
+ @function step($n) {
13
+ @return math.pow($factor, $n);
14
+ }
15
+
16
+ @function px($n, $base: 16) {
17
+ @return math.div(math.round($n * $base * 100), 100) * 1px;
18
+ }
19
+
20
+ @function rem($n) {
21
+ @return math.div(math.round($n * 1000), 1000) * 1rem;
22
+ }