@esportsplus/ui 0.46.0 → 0.48.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.
- package/.github/workflows/bump.yml +2 -2
- package/.github/workflows/dependabot.yml +1 -1
- package/.github/workflows/publish.yml +3 -3
- package/README.md +287 -0
- package/build/components/accordion/index.d.ts +16 -16
- package/build/components/accordion/index.js +15 -17
- package/build/components/alert/index.d.ts +1 -1
- package/build/components/alert/index.js +45 -51
- package/build/components/back/index.d.ts +8 -7
- package/build/components/back/index.js +11 -11
- package/build/components/button/index.d.ts +21 -20
- package/build/components/button/index.js +32 -23
- package/build/components/checkbox/index.d.ts +3 -3
- package/build/components/checkbox/index.js +18 -21
- package/build/components/clipboard/index.d.ts +90 -70
- package/build/components/clipboard/onclick.d.ts +1 -1
- package/build/components/clipboard/onclick.js +18 -18
- package/build/components/counter/index.d.ts +2 -2
- package/build/components/counter/index.js +37 -32
- package/build/components/ellipsis/index.d.ts +1 -1
- package/build/components/ellipsis/index.js +7 -8
- package/build/components/form/action.d.ts +1 -1
- package/build/components/form/action.js +13 -15
- package/build/components/form/index.d.ts +1 -1
- package/build/components/highlight/index.d.ts +16 -16
- package/build/components/highlight/index.js +13 -15
- package/build/components/icon/index.d.ts +11 -10
- package/build/components/icon/index.js +9 -6
- package/build/components/input/index.d.ts +2 -2
- package/build/components/input/index.js +18 -18
- package/build/components/loader/index.d.ts +16 -16
- package/build/components/loader/index.js +41 -45
- package/build/components/loading/index.d.ts +1 -1
- package/build/components/loading/index.js +9 -9
- package/build/components/radio/index.d.ts +1 -1
- package/build/components/range/index.d.ts +2 -2
- package/build/components/range/index.js +22 -22
- package/build/components/scrollbar/index.d.ts +12 -11
- package/build/components/scrollbar/index.js +22 -33
- package/build/components/select/index.d.ts +1 -1
- package/build/components/select/index.js +86 -80
- package/build/components/switch/index.d.ts +1 -1
- package/build/components/textarea/index.d.ts +2 -2
- package/build/components/textarea/index.js +17 -18
- package/build/components/tooltip/index.d.ts +180 -140
- package/build/components/tooltip/menu.d.ts +12 -11
- package/build/components/tooltip/menu.js +33 -33
- package/build/components/tooltip/onclick.d.ts +1121 -1100
- package/build/components/tooltip/onclick.js +13 -15
- package/build/components/tooltip/onhover.d.ts +16 -16
- package/build/components/tooltip/onhover.js +15 -17
- package/build/components/typewriter/index.d.ts +11 -10
- package/build/components/typewriter/index.js +12 -11
- package/build/themes/dark/alert.d.ts +1 -1
- package/build/themes/dark/input.d.ts +10 -8
- package/build/themes/dark/select.d.ts +90 -70
- package/build/themes/dark/textarea.d.ts +10 -8
- package/package.json +17 -14
- package/src/components/accordion/index.ts +1 -2
- package/src/components/alert/index.ts +1 -2
- package/src/components/button/index.ts +22 -15
- package/src/components/checkbox/index.ts +1 -2
- package/src/components/clipboard/onclick.ts +1 -2
- package/src/components/counter/index.ts +7 -8
- package/src/components/highlight/index.ts +1 -2
- package/src/components/input/index.ts +1 -2
- package/src/components/loader/index.ts +1 -2
- package/src/components/range/index.ts +1 -2
- package/src/components/scrollbar/index.ts +1 -2
- package/src/components/select/index.ts +14 -3
- package/src/components/textarea/index.ts +1 -2
- package/src/components/tooltip/onclick.ts +1 -2
- package/src/components/tooltip/onhover.ts +1 -2
- package/src/components/typewriter/index.ts +1 -2
- package/tsconfig.json +6 -1
|
@@ -5,12 +5,12 @@ on:
|
|
|
5
5
|
types: [published]
|
|
6
6
|
workflow_dispatch:
|
|
7
7
|
workflow_run:
|
|
8
|
-
workflows: [bump]
|
|
8
|
+
workflows: [bump version]
|
|
9
9
|
types:
|
|
10
10
|
- completed
|
|
11
11
|
|
|
12
12
|
jobs:
|
|
13
13
|
publish:
|
|
14
14
|
secrets:
|
|
15
|
-
|
|
16
|
-
uses: esportsplus/
|
|
15
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
16
|
+
uses: esportsplus/typescript/.github/workflows/publish.yml@main
|
package/README.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# @esportsplus/ui
|
|
2
|
+
|
|
3
|
+
A reactive component library built on compile-time template transformations. Provides typed, tree-shakeable UI components with integrated SCSS theming.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @esportsplus/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Dependencies
|
|
12
|
+
|
|
13
|
+
- `@esportsplus/template` - Tagged template literals with compile-time transforms and reactive state management
|
|
14
|
+
- `@esportsplus/action` - Response/error handling
|
|
15
|
+
- `@esportsplus/utilities` - Core utilities
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { button, form, input, select } from '@esportsplus/ui';
|
|
21
|
+
import { html } from '@esportsplus/template';
|
|
22
|
+
|
|
23
|
+
// Simple component
|
|
24
|
+
html`${button({}, 'Click Me')}`;
|
|
25
|
+
|
|
26
|
+
// Form with validation
|
|
27
|
+
html`
|
|
28
|
+
${form.action({
|
|
29
|
+
action: async ({ input: data }) => {
|
|
30
|
+
const result = await api.submit(data);
|
|
31
|
+
return result.ok ? { errors: [] } : { errors: result.errors };
|
|
32
|
+
}
|
|
33
|
+
}, html`
|
|
34
|
+
${input({ name: 'email', type: 'email' })}
|
|
35
|
+
${button({}, 'Submit')}
|
|
36
|
+
`)}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
// Select with reactive state
|
|
40
|
+
html`
|
|
41
|
+
${select({
|
|
42
|
+
options: { a: 'Option A', b: 'Option B' },
|
|
43
|
+
selected: 'a'
|
|
44
|
+
}, (state) => html`Selected: ${state.selected}`)}
|
|
45
|
+
`;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Components
|
|
49
|
+
|
|
50
|
+
### Form Controls
|
|
51
|
+
| Component | Description | Variants |
|
|
52
|
+
|-----------|-------------|----------|
|
|
53
|
+
| `input` | Text input with validation state | - |
|
|
54
|
+
| `textarea` | Multi-line text input | - |
|
|
55
|
+
| `checkbox` | Checkbox with label | - |
|
|
56
|
+
| `radio` | Radio button group | - |
|
|
57
|
+
| `range` | Range slider | - |
|
|
58
|
+
| `select` | Dropdown with custom options | - |
|
|
59
|
+
| `switch` | Toggle switch | - |
|
|
60
|
+
| `form` | Form wrapper | `form.action`, `form.input` |
|
|
61
|
+
|
|
62
|
+
### Interactive
|
|
63
|
+
| Component | Description | Variants |
|
|
64
|
+
|-----------|-------------|----------|
|
|
65
|
+
| `button` | Standard button | `button.hold` |
|
|
66
|
+
| `tooltip` | Popup content | `tooltip.menu`, `tooltip.onclick`, `tooltip.onhover` |
|
|
67
|
+
| `accordion` | Collapsible sections | - |
|
|
68
|
+
| `clipboard` | Copy to clipboard | `clipboard.onclick`, `clipboard.write` |
|
|
69
|
+
| `alert` | Notifications | error, info, success types |
|
|
70
|
+
|
|
71
|
+
### Display
|
|
72
|
+
| Component | Description |
|
|
73
|
+
|-----------|-------------|
|
|
74
|
+
| `counter` | Animated number with currency formatting |
|
|
75
|
+
| `loader` | Loading spinner |
|
|
76
|
+
| `loading` | Border loading indicator |
|
|
77
|
+
| `typewriter` | Animated typing effect |
|
|
78
|
+
| `highlight` | Viewport intersection highlight |
|
|
79
|
+
| `ellipsis` | Animated dots |
|
|
80
|
+
| `icon` | SVG sprite wrapper |
|
|
81
|
+
| `number` | Number formatting |
|
|
82
|
+
| `truncate` | Text truncation |
|
|
83
|
+
| `json` | JSON display |
|
|
84
|
+
|
|
85
|
+
### Layout
|
|
86
|
+
| Component | Description |
|
|
87
|
+
|-----------|-------------|
|
|
88
|
+
| `scrollbar` | Custom scrollbar container |
|
|
89
|
+
| `frame` | Scrollable frame |
|
|
90
|
+
| `sidebar` | Side navigation |
|
|
91
|
+
| `site` | Site wrapper |
|
|
92
|
+
| `overlay` | Modal/overlay container |
|
|
93
|
+
|
|
94
|
+
### Utility
|
|
95
|
+
| Component | Description |
|
|
96
|
+
|-----------|-------------|
|
|
97
|
+
| `back` | Back navigation link |
|
|
98
|
+
| `root` | Global event coordination (`root.onclick`) |
|
|
99
|
+
| `template` | Template factory helper |
|
|
100
|
+
|
|
101
|
+
## Component Patterns
|
|
102
|
+
|
|
103
|
+
### Factory Pattern
|
|
104
|
+
|
|
105
|
+
Components use `template.factory()` supporting flexible call signatures:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// No arguments
|
|
109
|
+
component()
|
|
110
|
+
|
|
111
|
+
// Attributes only
|
|
112
|
+
component({ class: 'custom' })
|
|
113
|
+
|
|
114
|
+
// Content only
|
|
115
|
+
component(html`<span>Content</span>`)
|
|
116
|
+
|
|
117
|
+
// Both
|
|
118
|
+
component({ class: 'custom' }, html`<span>Content</span>`)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Reactive State
|
|
122
|
+
|
|
123
|
+
Components can accept and return reactive state:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { reactive } from '@esportsplus/template';
|
|
127
|
+
|
|
128
|
+
let state = reactive({ active: false });
|
|
129
|
+
|
|
130
|
+
accordion({ state }, html`
|
|
131
|
+
${() => state.active ? 'Open' : 'Closed'}
|
|
132
|
+
`);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Form Integration
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
form.action({
|
|
139
|
+
action: async ({ input, response }) => {
|
|
140
|
+
// input: parsed FormData with dot-notation support
|
|
141
|
+
// response: error handling utilities
|
|
142
|
+
return { errors: [] };
|
|
143
|
+
}
|
|
144
|
+
}, content);
|
|
145
|
+
|
|
146
|
+
// Input with error state
|
|
147
|
+
form.input(element, { error: 'Required field' });
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Styling
|
|
151
|
+
|
|
152
|
+
### CSS Layers
|
|
153
|
+
|
|
154
|
+
Styles are organized into layers for proper cascade:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
@layer normalize
|
|
158
|
+
@layer components
|
|
159
|
+
@layer themes
|
|
160
|
+
@layer css-utilities
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Importing Styles
|
|
164
|
+
|
|
165
|
+
```scss
|
|
166
|
+
// All component styles
|
|
167
|
+
@use '@esportsplus/ui/*.scss';
|
|
168
|
+
|
|
169
|
+
// Specific component
|
|
170
|
+
@use '@esportsplus/ui/button.scss';
|
|
171
|
+
|
|
172
|
+
// CSS utilities
|
|
173
|
+
@use '@esportsplus/ui/css-utilities.scss';
|
|
174
|
+
|
|
175
|
+
// Design tokens
|
|
176
|
+
@use '@esportsplus/ui/tokens.scss';
|
|
177
|
+
|
|
178
|
+
// Theme
|
|
179
|
+
@use '@esportsplus/ui/themes/dark/*.scss';
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Design Tokens
|
|
183
|
+
|
|
184
|
+
Located in `tokens.scss`:
|
|
185
|
+
|
|
186
|
+
- **Colors**: `--color-{name}-{300|400|500}` (black, white, red, green, blue, purple, yellow, grey)
|
|
187
|
+
- **Sizing**: `--size-{300-800}` (12px-80px)
|
|
188
|
+
- **Spacing**: `--spacing-{0-600}`
|
|
189
|
+
- **Border**: `--border-radius-{100-900}`, `--border-width-{100-700}`
|
|
190
|
+
- **Typography**: `--font-size-*`, `--font-weight-*`, `--line-height-*`
|
|
191
|
+
|
|
192
|
+
### CSS Utilities
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<!-- Layout -->
|
|
196
|
+
<div class="--flex --flex-center --gap-200">
|
|
197
|
+
|
|
198
|
+
<!-- Spacing -->
|
|
199
|
+
<div class="--margin-400 --padding-200">
|
|
200
|
+
|
|
201
|
+
<!-- Typography -->
|
|
202
|
+
<p class="--text-uppercase --color-grey-400">
|
|
203
|
+
|
|
204
|
+
<!-- States -->
|
|
205
|
+
<div class="--skeleton --disabled --hidden">
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Component Variables
|
|
209
|
+
|
|
210
|
+
Each component exposes CSS custom properties:
|
|
211
|
+
|
|
212
|
+
```scss
|
|
213
|
+
.ui-button {
|
|
214
|
+
--background: var(--color-blue-400);
|
|
215
|
+
--color: var(--color-white);
|
|
216
|
+
--border-radius: var(--border-radius-300);
|
|
217
|
+
--padding-horizontal: 16px;
|
|
218
|
+
--padding-vertical: 8px;
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Theming
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
// JavaScript
|
|
226
|
+
import '@esportsplus/ui/themes/dark';
|
|
227
|
+
|
|
228
|
+
// SCSS
|
|
229
|
+
@use '@esportsplus/ui/themes/dark/*.scss';
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Themes override component variables. Create custom themes by overriding CSS custom properties.
|
|
233
|
+
|
|
234
|
+
## Build
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
pnpm build # Full build (SCSS + TypeScript)
|
|
238
|
+
pnpm build:vite # SCSS compilation only
|
|
239
|
+
pnpm build:ts # TypeScript compilation only
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Output Structure
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
build/
|
|
246
|
+
├── components/
|
|
247
|
+
│ ├── {component}/
|
|
248
|
+
│ │ ├── index.js
|
|
249
|
+
│ │ ├── index.d.ts
|
|
250
|
+
│ │ └── scss/index.scss
|
|
251
|
+
│ └── index.js
|
|
252
|
+
├── css-utilities/
|
|
253
|
+
├── themes/
|
|
254
|
+
│ ├── dark/
|
|
255
|
+
│ └── light/
|
|
256
|
+
└── fonts/
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## TypeScript
|
|
260
|
+
|
|
261
|
+
Full type safety with zero `any` types:
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
import type { Attributes } from '@esportsplus/template';
|
|
265
|
+
|
|
266
|
+
// Components are generic
|
|
267
|
+
template.factory<A extends Attributes, C>(fn);
|
|
268
|
+
|
|
269
|
+
// State types are explicit
|
|
270
|
+
type State = {
|
|
271
|
+
active: boolean;
|
|
272
|
+
error: string;
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Performance
|
|
277
|
+
|
|
278
|
+
- **Compile-time transforms**: Template expressions optimized at build
|
|
279
|
+
- **Tree-shakeable**: Import only what you use
|
|
280
|
+
- **WeakMap caching**: Memoized formatters and icons
|
|
281
|
+
- **Object pooling**: Reused queue structures
|
|
282
|
+
- **RAF batching**: Coalesced DOM updates
|
|
283
|
+
- **CSS layers**: Efficient cascade resolution
|
|
284
|
+
|
|
285
|
+
## License
|
|
286
|
+
|
|
287
|
+
MIT
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as template_ed8f776bb07a460eadcbcfe445975fdf1 from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
(): ReturnType<(this: {
|
|
5
|
-
attributes?: Attributes | undefined;
|
|
6
|
-
content?:
|
|
7
|
-
}, attributes: Readonly<Attributes>, content:
|
|
8
|
-
<T extends Attributes>(attributes: T): ReturnType<(this: {
|
|
9
|
-
attributes?: Attributes | undefined;
|
|
10
|
-
content?:
|
|
11
|
-
}, attributes: Readonly<Attributes>, content:
|
|
12
|
-
<T extends
|
|
13
|
-
attributes?: Attributes | undefined;
|
|
14
|
-
content?:
|
|
15
|
-
}, attributes: Readonly<Attributes>, content:
|
|
16
|
-
(attributes: Attributes, content:
|
|
17
|
-
attributes?: Attributes | undefined;
|
|
18
|
-
content?:
|
|
19
|
-
}, attributes: Readonly<Attributes>, content:
|
|
5
|
+
attributes?: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes | undefined;
|
|
6
|
+
content?: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>;
|
|
7
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
8
|
+
<T extends template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>(attributes: T): ReturnType<(this: {
|
|
9
|
+
attributes?: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes | undefined;
|
|
10
|
+
content?: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>;
|
|
11
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
12
|
+
<T extends template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>(content: T): ReturnType<(this: {
|
|
13
|
+
attributes?: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes | undefined;
|
|
14
|
+
content?: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>;
|
|
15
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
16
|
+
(attributes: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>): ReturnType<(this: {
|
|
17
|
+
attributes?: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes | undefined;
|
|
18
|
+
content?: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>;
|
|
19
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as template_ed8f776bb07a460eadcbcfe445975fdf1 from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import template from '../../components/template/index.js';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
+
const template_ed8f776bb07a460eadcbcfe445975fdf3 = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<div><!--$--></div>`);
|
|
6
7
|
const OMIT = ['state'];
|
|
7
8
|
let key = Symbol();
|
|
8
9
|
export default template.factory(function (attributes, content) {
|
|
9
10
|
let ref, state = attributes.state || reactive({
|
|
10
11
|
active: 0
|
|
11
12
|
});
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class: () => {
|
|
13
|
+
return (() => {
|
|
14
|
+
let root_ed8f776bb07a460eadcbcfe445975fdf2 = template_ed8f776bb07a460eadcbcfe445975fdf3(), element_ed8f776bb07a460eadcbcfe445975fdf4 = root_ed8f776bb07a460eadcbcfe445975fdf2.firstChild, element_ed8f776bb07a460eadcbcfe445975fdf5 = element_ed8f776bb07a460eadcbcfe445975fdf4.firstChild;
|
|
15
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdf4, omit(attributes, OMIT));
|
|
16
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setClass(element_ed8f776bb07a460eadcbcfe445975fdf4, '', () => {
|
|
17
17
|
return state.active && '--active';
|
|
18
|
-
}
|
|
19
|
-
onrender
|
|
18
|
+
});
|
|
19
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.onrender(element_ed8f776bb07a460eadcbcfe445975fdf4, (element) => {
|
|
20
20
|
(ref = element)[key] = state;
|
|
21
|
-
}
|
|
22
|
-
|
|
21
|
+
});
|
|
22
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setStyle(element_ed8f776bb07a460eadcbcfe445975fdf4, '', () => {
|
|
23
23
|
let parent = ref.closest('accordion');
|
|
24
24
|
if (parent && key in parent) {
|
|
25
25
|
parent[key].active = (+parent[key].active) + 1;
|
|
26
26
|
}
|
|
27
27
|
return state.active && `--max-height: ${ref.scrollHeight}`;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
`;
|
|
28
|
+
});
|
|
29
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdf5, content);
|
|
30
|
+
return root_ed8f776bb07a460eadcbcfe445975fdf2;
|
|
31
|
+
})();
|
|
34
32
|
});
|
|
@@ -7,7 +7,7 @@ declare const _default: (attributes: Attributes & {
|
|
|
7
7
|
"alert-messages"?: Attributes;
|
|
8
8
|
"alert-message"?: Attributes;
|
|
9
9
|
}) => {
|
|
10
|
-
content:
|
|
10
|
+
content: DocumentFragment;
|
|
11
11
|
deactivate: () => void;
|
|
12
12
|
error: {
|
|
13
13
|
(messages: Renderable<any>, seconds?: number): void;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import '@esportsplus/vite/global.d.ts';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import * as template_ed8f776bb07a460eadcbcfe445975fdf1 from '@esportsplus/template';
|
|
3
|
+
import { reactive, svg } from '@esportsplus/template';
|
|
4
4
|
import { omit } from '@esportsplus/utilities';
|
|
5
5
|
import { icon } from '@esportsplus/ui';
|
|
6
6
|
import check from './svg/check.svg';
|
|
7
7
|
import close from './svg/close.svg';
|
|
8
8
|
import e from './svg/error.svg';
|
|
9
9
|
import './scss/index.scss';
|
|
10
|
+
const template_ed8f776bb07a460eadcbcfe445975fdf7 = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<div class='--flex-vertical'><!--$--></div>`);
|
|
11
|
+
const template_ed8f776bb07a460eadcbcfe445975fdfb = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<p><!--$--></p>`);
|
|
12
|
+
const template_ed8f776bb07a460eadcbcfe445975fdff = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<div class='--flex-start'><!--$--></div>`);
|
|
13
|
+
const template_ed8f776bb07a460eadcbcfe445975fdfi = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<div
|
|
14
|
+
class='alert anchor anchor--n --flex-row'><!--$--><div
|
|
15
|
+
class='alert-messages --flex-column --flex-fill'><!--$--></div><div class="--flex-vertical"><div
|
|
16
|
+
class='alert-close button --padding-300'><div class="icon" style='--size: 14px;'><!--$--></div></div></div></div>`);
|
|
10
17
|
const OMIT = ['alert-close', 'alert-messages', 'alert-message'];
|
|
11
18
|
let modifiers = {
|
|
12
19
|
error: 'red',
|
|
@@ -72,56 +79,43 @@ export default (attributes) => {
|
|
|
72
79
|
}), 5);
|
|
73
80
|
};
|
|
74
81
|
return {
|
|
75
|
-
content:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}}
|
|
88
|
-
|
|
89
|
-
<div
|
|
90
|
-
class='alert-messages --flex-column --flex-fill'
|
|
91
|
-
${attributes['alert-messages']}
|
|
92
|
-
>
|
|
93
|
-
${() => {
|
|
94
|
-
let message = attributes['alert-message'];
|
|
95
|
-
return state.rerender && [...state.messages].map((content) => {
|
|
96
|
-
if (typeof content === 'string') {
|
|
97
|
-
return html `
|
|
98
|
-
<p ${message}>
|
|
99
|
-
${content}
|
|
100
|
-
</p>
|
|
101
|
-
`;
|
|
102
|
-
}
|
|
103
|
-
return html `
|
|
104
|
-
<div class='--flex-start'>
|
|
105
|
-
${content}
|
|
106
|
-
</div>
|
|
107
|
-
`;
|
|
82
|
+
content: (() => {
|
|
83
|
+
let root_ed8f776bb07a460eadcbcfe445975fdfh = template_ed8f776bb07a460eadcbcfe445975fdfi(), element_ed8f776bb07a460eadcbcfe445975fdfj = root_ed8f776bb07a460eadcbcfe445975fdfh.firstChild, element_ed8f776bb07a460eadcbcfe445975fdfk = element_ed8f776bb07a460eadcbcfe445975fdfj.firstChild, element_ed8f776bb07a460eadcbcfe445975fdfl = element_ed8f776bb07a460eadcbcfe445975fdfj.firstElementChild, element_ed8f776bb07a460eadcbcfe445975fdfm = element_ed8f776bb07a460eadcbcfe445975fdfl.firstChild, element_ed8f776bb07a460eadcbcfe445975fdfn = element_ed8f776bb07a460eadcbcfe445975fdfl.nextElementSibling.firstElementChild, element_ed8f776bb07a460eadcbcfe445975fdfo = element_ed8f776bb07a460eadcbcfe445975fdfn.firstElementChild.firstChild;
|
|
84
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setClass(element_ed8f776bb07a460eadcbcfe445975fdfj, ' --flex-row', () => state.active && '--active');
|
|
85
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfj, omit(attributes, OMIT));
|
|
86
|
+
new template_ed8f776bb07a460eadcbcfe445975fdf1.EffectSlot(element_ed8f776bb07a460eadcbcfe445975fdfk, () => {
|
|
87
|
+
let type = state.type;
|
|
88
|
+
return (() => {
|
|
89
|
+
let root_ed8f776bb07a460eadcbcfe445975fdf6 = template_ed8f776bb07a460eadcbcfe445975fdf7(), element_ed8f776bb07a460eadcbcfe445975fdf8 = root_ed8f776bb07a460eadcbcfe445975fdf6.firstChild, element_ed8f776bb07a460eadcbcfe445975fdf9 = element_ed8f776bb07a460eadcbcfe445975fdf8.firstChild;
|
|
90
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setStyle(element_ed8f776bb07a460eadcbcfe445975fdf8, ';', `--color: var(--color-${modifiers[type]}-400);`);
|
|
91
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdf9, icon({ class: '--size-500' }, type === 'error' ? e : check));
|
|
92
|
+
return root_ed8f776bb07a460eadcbcfe445975fdf6;
|
|
93
|
+
})();
|
|
108
94
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfl, attributes['alert-messages']);
|
|
96
|
+
new template_ed8f776bb07a460eadcbcfe445975fdf1.EffectSlot(element_ed8f776bb07a460eadcbcfe445975fdfm, () => {
|
|
97
|
+
let message = attributes['alert-message'];
|
|
98
|
+
return state.rerender && [...state.messages].map((content) => {
|
|
99
|
+
if (typeof content === 'string') {
|
|
100
|
+
return (() => {
|
|
101
|
+
let root_ed8f776bb07a460eadcbcfe445975fdfa = template_ed8f776bb07a460eadcbcfe445975fdfb(), element_ed8f776bb07a460eadcbcfe445975fdfc = root_ed8f776bb07a460eadcbcfe445975fdfa.firstChild, element_ed8f776bb07a460eadcbcfe445975fdfd = element_ed8f776bb07a460eadcbcfe445975fdfc.firstChild;
|
|
102
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfc, message);
|
|
103
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdfd, content);
|
|
104
|
+
return root_ed8f776bb07a460eadcbcfe445975fdfa;
|
|
105
|
+
})();
|
|
106
|
+
}
|
|
107
|
+
return (() => {
|
|
108
|
+
let root_ed8f776bb07a460eadcbcfe445975fdfe = template_ed8f776bb07a460eadcbcfe445975fdff(), element_ed8f776bb07a460eadcbcfe445975fdfg = root_ed8f776bb07a460eadcbcfe445975fdfe.firstChild.firstChild;
|
|
109
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdfg, content);
|
|
110
|
+
return root_ed8f776bb07a460eadcbcfe445975fdfe;
|
|
111
|
+
})();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.delegate(element_ed8f776bb07a460eadcbcfe445975fdfn, 'click', () => deactivate(state));
|
|
115
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfn, attributes['alert-close']);
|
|
116
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdfo, svg.sprite(close));
|
|
117
|
+
return root_ed8f776bb07a460eadcbcfe445975fdfh;
|
|
118
|
+
})(),
|
|
125
119
|
deactivate: () => deactivate(state),
|
|
126
120
|
error,
|
|
127
121
|
info: (messages, seconds = 0) => activate('info', messages, seconds, state),
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import * as template_ed8f776bb07a460eadcbcfe445975fdf1 from '@esportsplus/template';
|
|
1
2
|
import { Attributes } from '@esportsplus/template';
|
|
2
3
|
import './scss/index.scss';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
(): ReturnType<(this: {
|
|
5
6
|
attributes?: Attributes;
|
|
6
|
-
}, attributes: Readonly<Attributes>, content:
|
|
7
|
-
<T extends Attributes>(attributes: T): ReturnType<(this: {
|
|
7
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
8
|
+
<T extends template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>(attributes: T): ReturnType<(this: {
|
|
8
9
|
attributes?: Attributes;
|
|
9
|
-
}, attributes: Readonly<Attributes>, content:
|
|
10
|
-
<T extends
|
|
10
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
11
|
+
<T extends template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>(content: T): ReturnType<(this: {
|
|
11
12
|
attributes?: Attributes;
|
|
12
|
-
}, attributes: Readonly<Attributes>, content:
|
|
13
|
-
(attributes: Attributes, content:
|
|
13
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
14
|
+
(attributes: template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>): ReturnType<(this: {
|
|
14
15
|
attributes?: Attributes;
|
|
15
|
-
}, attributes: Readonly<Attributes>, content:
|
|
16
|
+
}, attributes: Readonly<template_ed8f776bb07a460eadcbcfe445975fdf1.Attributes>, content: template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>) => template_ed8f776bb07a460eadcbcfe445975fdf1.Renderable<any>>;
|
|
16
17
|
};
|
|
17
18
|
export default _default;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as template_ed8f776bb07a460eadcbcfe445975fdf1 from '@esportsplus/template';
|
|
2
2
|
import icon from '../../components/icon/index.js';
|
|
3
3
|
import template from '../../components/template/index.js';
|
|
4
4
|
import arrow from './svg/arrow.svg';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
+
const template_ed8f776bb07a460eadcbcfe445975fdfq = template_ed8f776bb07a460eadcbcfe445975fdf1.template(`<a
|
|
7
|
+
class='back link --padding-0px --flex-vertical'><!--$--><!--$--></a>`);
|
|
6
8
|
export default template.factory(function (attributes, content) {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</a>
|
|
16
|
-
`;
|
|
9
|
+
return (() => {
|
|
10
|
+
let root_ed8f776bb07a460eadcbcfe445975fdfp = template_ed8f776bb07a460eadcbcfe445975fdfq(), element_ed8f776bb07a460eadcbcfe445975fdfr = root_ed8f776bb07a460eadcbcfe445975fdfp.firstChild, element_ed8f776bb07a460eadcbcfe445975fdfs = element_ed8f776bb07a460eadcbcfe445975fdfr.firstChild, element_ed8f776bb07a460eadcbcfe445975fdft = element_ed8f776bb07a460eadcbcfe445975fdfs.nextSibling;
|
|
11
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfr, this.attributes);
|
|
12
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.setProperties(element_ed8f776bb07a460eadcbcfe445975fdfr, attributes);
|
|
13
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdfs, icon({ class: 'back-arrow --margin-right --margin-200' }, arrow));
|
|
14
|
+
template_ed8f776bb07a460eadcbcfe445975fdf1.slot(element_ed8f776bb07a460eadcbcfe445975fdft, content);
|
|
15
|
+
return root_ed8f776bb07a460eadcbcfe445975fdfp;
|
|
16
|
+
})();
|
|
17
17
|
});
|