@esportsplus/ui 0.39.3 → 0.40.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.
@@ -1,3 +1,4 @@
1
+ import '@esportsplus/vite/global.d.ts';
1
2
  import { Response } from '@esportsplus/action';
2
3
  import { Attributes, Renderable } from '@esportsplus/template';
3
4
  import './scss/index.scss';
@@ -6,10 +7,6 @@ declare const _default: {
6
7
  content: (attributes: Attributes & {
7
8
  close?: Attributes;
8
9
  message?: Attributes;
9
- }, { check, close, error }: {
10
- check: string;
11
- close: string;
12
- error: string;
13
10
  }) => Node;
14
11
  deactivate: typeof deactivate;
15
12
  error: {
@@ -1,7 +1,11 @@
1
+ import '@esportsplus/vite/global.d.ts';
1
2
  import { reactive } from '@esportsplus/reactivity';
2
3
  import { html, svg } from '@esportsplus/template';
3
4
  import { omit } from '@esportsplus/utilities';
4
5
  import { icon } from '@esportsplus/ui';
6
+ import check from '~/storage/svg/check.svg';
7
+ import close from '~/storage/svg/close.svg';
8
+ import e from '~/storage/svg/error.svg';
5
9
  import './scss/index.scss';
6
10
  const OMIT = ['close', 'message'];
7
11
  let modifiers = {
@@ -69,7 +73,7 @@ error.response = (response) => {
69
73
  };
70
74
  const info = (messages, seconds = 0) => activate('info', messages, seconds);
71
75
  const success = (messages, seconds = 0) => activate('success', messages, seconds);
72
- const content = (attributes, { check, close, error }) => {
76
+ const content = (attributes) => {
73
77
  return html `
74
78
  <div
75
79
  class='alert anchor anchor--n ${() => state.active && '--active'}'
@@ -80,7 +84,7 @@ const content = (attributes, { check, close, error }) => {
80
84
  let type = state.type;
81
85
  return html `
82
86
  <div class='--flex-vertical' style='${`--color: var(--color-${modifiers[type]}-400);`}'>
83
- ${icon({ class: '--margin-right --margin-600 --size-500' }, type === 'error' ? error : check)}
87
+ ${icon({ class: '--margin-right --margin-600 --size-500' }, type === 'error' ? e : check)}
84
88
  </div>
85
89
  `;
86
90
  }}
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M9,19.5c-0.397,0-0.779-0.158-1.061-0.439l-5-5c-0.586-0.586-0.586-1.535,0-2.121s1.535-0.586,2.121,0l3.893,3.893
8
+ l9.941-10.846c0.561-0.611,1.509-0.651,2.119-0.092c0.61,0.56,0.651,1.509,0.092,2.12l-11,12c-0.277,0.302-0.665,0.478-1.073,0.486
9
+ C9.022,19.5,9.011,19.5,9,19.5z"/>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M18,19.5c-0.384,0-0.768-0.146-1.061-0.439L12,14.121l-4.939,4.939c-0.586,0.586-1.535,0.586-2.121,0s-0.586-1.535,0-2.121
8
+ L9.879,12L4.939,7.061c-0.586-0.585-0.586-1.536,0-2.121c0.586-0.586,1.535-0.586,2.121,0L12,9.879l4.939-4.939
9
+ c0.586-0.586,1.535-0.586,2.121,0c0.586,0.585,0.586,1.536,0,2.121L14.121,12l4.939,4.939c0.586,0.586,0.586,1.535,0,2.121
10
+ C18.768,19.354,18.384,19.5,18,19.5z"/>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M12.351,23h-0.702c-4.697,0-7.055,0-8.626-1.132c-1.368-0.986-2.262-2.512-2.454-4.186
8
+ c-0.22-1.925,0.932-3.981,3.227-8.079l0.352-0.628c2.386-4.26,3.583-6.398,5.383-7.211c1.57-0.708,3.369-0.708,4.939,0
9
+ c1.8,0.813,2.997,2.95,5.383,7.209l0.352,0.629l-0.873,0.488l0.881-0.474c2.29,4.09,3.439,6.143,3.219,8.064
10
+ c-0.191,1.675-1.086,3.201-2.453,4.187C19.405,23,17.048,23,12.351,23z M12,3.233c-0.562,0-1.123,0.118-1.646,0.354
11
+ c-1.2,0.542-2.358,2.61-4.46,6.364L5.542,10.58c-2.02,3.606-3.132,5.592-2.985,6.875c0.128,1.116,0.724,2.133,1.636,2.79
12
+ C5.24,21,7.516,21,11.649,21h0.702c4.132,0,6.41,0,7.457-0.755c0.912-0.657,1.509-1.674,1.637-2.791
13
+ c0.146-1.28-0.963-3.262-2.978-6.86l-0.009-0.015l-0.351-0.627c-2.103-3.755-3.261-5.823-4.461-6.365
14
+ C13.123,3.352,12.562,3.233,12,3.233z M12,18c-0.827,0-1.499-0.672-1.5-1.498c0-0.002,0-0.002,0-0.004
15
+ C10.501,15.672,11.173,15,12,15c0.826,0,1.499,0.672,1.5,1.498c0,0.002,0,0.002,0,0.004C13.499,17.328,12.826,18,12,18z M12,14
16
+ c-0.552,0-1-0.447-1-1V9c0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v4C13,13.553,12.553,14,12,14z"/>
17
+ </g>
18
+ </svg>
@@ -1,20 +1,17 @@
1
+ import { Attributes } from '@esportsplus/template';
1
2
  import './scss/index.scss';
2
3
  declare const _default: {
3
4
  (): ReturnType<(this: {
4
- attributes?: import("@esportsplus/template").Attributes | undefined;
5
- content?: import("@esportsplus/template").Renderable<any>;
6
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
7
- <T extends import("@esportsplus/template").Attributes>(attributes: T): ReturnType<(this: {
8
- attributes?: import("@esportsplus/template").Attributes | undefined;
9
- content?: import("@esportsplus/template").Renderable<any>;
10
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
5
+ attributes?: Attributes;
6
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
7
+ <T extends Attributes>(attributes: T): ReturnType<(this: {
8
+ attributes?: Attributes;
9
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
11
10
  <T extends import("@esportsplus/template").Renderable<any>>(content: T): ReturnType<(this: {
12
- attributes?: import("@esportsplus/template").Attributes | undefined;
13
- content?: import("@esportsplus/template").Renderable<any>;
14
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
15
- (attributes: import("@esportsplus/template").Attributes, content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
16
- attributes?: import("@esportsplus/template").Attributes | undefined;
17
- content?: import("@esportsplus/template").Renderable<any>;
18
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
11
+ attributes?: Attributes;
12
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
13
+ (attributes: Attributes, content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
14
+ attributes?: Attributes;
15
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
19
16
  };
20
17
  export default _default;
@@ -1,9 +1,13 @@
1
1
  import { html } from '@esportsplus/template';
2
2
  import template from '../../components/template/index.js';
3
3
  import './scss/index.scss';
4
- export default template.factory((attributes, content) => {
4
+ export default template.factory(function (attributes, content) {
5
5
  return html `
6
- <a class='back link --padding-0px --flex-vertical' ${attributes}>
6
+ <a
7
+ class='back link --padding-0px --flex-vertical'
8
+ ${this.attributes}
9
+ ${attributes}
10
+ >
7
11
  ${content}
8
12
  </a>
9
13
  `;
package/package.json CHANGED
@@ -6,16 +6,19 @@
6
6
  "@esportsplus/reactivity": "^0.18.1",
7
7
  "@esportsplus/template": "^0.26.2",
8
8
  "@esportsplus/utilities": "^0.24.0",
9
+ "@esportsplus/vite": "^0.10.5",
9
10
  "modern-normalize": "^3.0.1"
10
11
  },
11
12
  "devDependencies": {
12
13
  "@esportsplus/typescript": "^0.9.2",
13
- "@types/node": "^24.9.1",
14
+ "@types/node": "^24.9.2",
15
+ "@types/shelljs": "^0.8.17",
14
16
  "autoprefixer": "^10.4.21",
15
17
  "glob": "^11.0.3",
16
18
  "lightningcss": "^1.30.2",
17
19
  "npm-run-all": "^4.1.5",
18
20
  "sass": "^1.93.2",
21
+ "shelljs": "^0.10.0",
19
22
  "vite": "^7.1.12"
20
23
  },
21
24
  "exports": {
@@ -42,7 +45,7 @@
42
45
  "private": false,
43
46
  "sideEffects": false,
44
47
  "type": "module",
45
- "version": "0.39.3",
48
+ "version": "0.40.0",
46
49
  "scripts": {
47
50
  "build": "run-s build:vite build:ts",
48
51
  "build:ts": "tsc && tsc-alias",
@@ -1,8 +1,12 @@
1
+ import '@esportsplus/vite/global.d.ts';
1
2
  import { Response } from '@esportsplus/action';
2
3
  import { reactive } from '@esportsplus/reactivity';
3
4
  import { html, svg, Attributes, Renderable } from '@esportsplus/template';
4
5
  import { omit } from '@esportsplus/utilities';
5
6
  import { icon } from '@esportsplus/ui';
7
+ import check from '~/storage/svg/check.svg';
8
+ import close from '~/storage/svg/close.svg';
9
+ import e from '~/storage/svg/error.svg';
6
10
  import './scss/index.scss';
7
11
 
8
12
 
@@ -104,10 +108,7 @@ const info = (messages: Renderable<any>, seconds: number = 0) => activate('info'
104
108
  const success = (messages: Renderable<any>, seconds: number = 0) => activate('success', messages, seconds);
105
109
 
106
110
 
107
- const content = (
108
- attributes: Attributes & { close?: Attributes, message?: Attributes },
109
- { check, close, error }: { check: string, close: string, error: string }
110
- ) => {
111
+ const content = (attributes: Attributes & { close?: Attributes, message?: Attributes }) => {
111
112
  return html`
112
113
  <div
113
114
  class='alert anchor anchor--n ${() => state.active && '--active'}'
@@ -119,7 +120,7 @@ const content = (
119
120
 
120
121
  return html`
121
122
  <div class='--flex-vertical' style='${`--color: var(--color-${modifiers[type]}-400);`}'>
122
- ${icon({ class: '--margin-right --margin-600 --size-500' }, type === 'error' ? error : check)}
123
+ ${icon({ class: '--margin-right --margin-600 --size-500' }, type === 'error' ? e : check)}
123
124
  </div>
124
125
  `;
125
126
  }}
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M9,19.5c-0.397,0-0.779-0.158-1.061-0.439l-5-5c-0.586-0.586-0.586-1.535,0-2.121s1.535-0.586,2.121,0l3.893,3.893
8
+ l9.941-10.846c0.561-0.611,1.509-0.651,2.119-0.092c0.61,0.56,0.651,1.509,0.092,2.12l-11,12c-0.277,0.302-0.665,0.478-1.073,0.486
9
+ C9.022,19.5,9.011,19.5,9,19.5z"/>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M18,19.5c-0.384,0-0.768-0.146-1.061-0.439L12,14.121l-4.939,4.939c-0.586,0.586-1.535,0.586-2.121,0s-0.586-1.535,0-2.121
8
+ L9.879,12L4.939,7.061c-0.586-0.585-0.586-1.536,0-2.121c0.586-0.586,1.535-0.586,2.121,0L12,9.879l4.939-4.939
9
+ c0.586-0.586,1.535-0.586,2.121,0c0.586,0.585,0.586,1.536,0,2.121L14.121,12l4.939,4.939c0.586,0.586,0.586,1.535,0,2.121
10
+ C18.768,19.354,18.384,19.5,18,19.5z"/>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
6
+ <g>
7
+ <path d="M12.351,23h-0.702c-4.697,0-7.055,0-8.626-1.132c-1.368-0.986-2.262-2.512-2.454-4.186
8
+ c-0.22-1.925,0.932-3.981,3.227-8.079l0.352-0.628c2.386-4.26,3.583-6.398,5.383-7.211c1.57-0.708,3.369-0.708,4.939,0
9
+ c1.8,0.813,2.997,2.95,5.383,7.209l0.352,0.629l-0.873,0.488l0.881-0.474c2.29,4.09,3.439,6.143,3.219,8.064
10
+ c-0.191,1.675-1.086,3.201-2.453,4.187C19.405,23,17.048,23,12.351,23z M12,3.233c-0.562,0-1.123,0.118-1.646,0.354
11
+ c-1.2,0.542-2.358,2.61-4.46,6.364L5.542,10.58c-2.02,3.606-3.132,5.592-2.985,6.875c0.128,1.116,0.724,2.133,1.636,2.79
12
+ C5.24,21,7.516,21,11.649,21h0.702c4.132,0,6.41,0,7.457-0.755c0.912-0.657,1.509-1.674,1.637-2.791
13
+ c0.146-1.28-0.963-3.262-2.978-6.86l-0.009-0.015l-0.351-0.627c-2.103-3.755-3.261-5.823-4.461-6.365
14
+ C13.123,3.352,12.562,3.233,12,3.233z M12,18c-0.827,0-1.499-0.672-1.5-1.498c0-0.002,0-0.002,0-0.004
15
+ C10.501,15.672,11.173,15,12,15c0.826,0,1.499,0.672,1.5,1.498c0,0.002,0,0.002,0,0.004C13.499,17.328,12.826,18,12,18z M12,14
16
+ c-0.552,0-1-0.447-1-1V9c0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v4C13,13.553,12.553,14,12,14z"/>
17
+ </g>
18
+ </svg>
@@ -1,12 +1,16 @@
1
- import { html } from '@esportsplus/template';
1
+ import { html, Attributes } from '@esportsplus/template';
2
2
  import template from '~/components/template';
3
3
  import './scss/index.scss';
4
4
 
5
5
 
6
6
  export default template.factory(
7
- (attributes, content) => {
7
+ function (this: { attributes?: Attributes }, attributes, content) {
8
8
  return html`
9
- <a class='back link --padding-0px --flex-vertical' ${attributes}>
9
+ <a
10
+ class='back link --padding-0px --flex-vertical'
11
+ ${this.attributes}
12
+ ${attributes}
13
+ >
10
14
  ${content}
11
15
  </a>
12
16
  `;
package/vite.config.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { glob } from 'glob';
2
2
  import { defineConfig } from 'vite';
3
3
  import autoprefixer from 'autoprefixer';
4
- import path from 'path';
4
+ import { join } from 'path';
5
+ import shelljs from 'shelljs';
5
6
 
6
7
 
7
8
  export default defineConfig({
@@ -60,6 +61,16 @@ export default defineConfig({
60
61
  file.source = `@layer ${layer} {${segments.join('\n')}}\n${vite}`;
61
62
  }
62
63
  }
64
+ },
65
+ {
66
+ name: '@esportsplus/ui-svg-copy',
67
+ writeBundle() {
68
+ let directories = glob.sync('./src/components/*/svg/');
69
+
70
+ for (let dir of directories) {
71
+ shelljs.cp('-rf', dir, dir.replace('src', 'build'));
72
+ }
73
+ }
63
74
  }
64
75
  ]
65
76
  }