@vollowx/seele 0.12.4 → 0.12.6
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/LICENSE +1 -1
- package/README.md +32 -23
- package/package.json +9 -9
- package/src/m3/list/list-item-styles.css.js +1 -1
- package/src/m3/list/list-styles.css.js +1 -1
- package/src/m3/list/list.js +7 -2
- package/src/m3/system/base.css +3 -0
- package/src/m3/system/defaults.css +15 -0
- package/src/m3/system/elevation.css +18 -0
- package/src/m3/system/motion.css +30 -0
- package/src/m3/system/typography.css +34 -0
- package/src/core/shared.d.ts +0 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2023-2026
|
|
189
|
+
Copyright 2023-2026 Lucas X. Zhao
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# Standard Extensible Elements
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SEELE (**S**tandard **E**xtensible **Ele**ments) is a extensible
|
|
4
4
|
[Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
|
|
5
|
-
library
|
|
6
|
-
[Material Design 3](https://m3.material.io/) guidelines out of the box, while
|
|
7
|
-
being designed for easy extension and restyling.
|
|
5
|
+
library with a focus on accessibility and keyboard-control.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
It also provides styled components in the following design guideline(s):
|
|
8
|
+
- [Material You Expressive](https://m3.material.io/)
|
|
9
|
+
|
|
10
|
+
Documentations and demos are at [seele.projects.v9.nz](https://seele.projects.v9.nz/).
|
|
10
11
|
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
13
14
|
SEELE is published on [npm](https://www.npmjs.com/package/@vollowx/seele),
|
|
14
15
|
install with your preferred package manager:
|
|
15
16
|
|
|
16
|
-
```
|
|
17
|
+
```sh
|
|
17
18
|
npm install @vollowx/seele
|
|
18
19
|
|
|
19
20
|
yarn add @vollowx/seele
|
|
@@ -21,18 +22,18 @@ yarn add @vollowx/seele
|
|
|
21
22
|
bun add @vollowx/seele
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
+
## Quickstart
|
|
25
26
|
|
|
26
27
|
### Importing
|
|
27
28
|
|
|
28
|
-
You can import the entire library or
|
|
29
|
+
You can import the entire library or import as needed.
|
|
29
30
|
|
|
30
31
|
```javascript
|
|
31
32
|
// Import all components
|
|
32
33
|
import '@vollowx/seele';
|
|
33
34
|
|
|
34
35
|
// Or import specific components (recommended)
|
|
35
|
-
// They all follow such path
|
|
36
|
+
// They all follow such path: @/catagory/group/component.js
|
|
36
37
|
import '@vollowx/seele/m3/button/common-button.js';
|
|
37
38
|
import '@vollowx/seele/m3/checkbox/checkbox.js';
|
|
38
39
|
```
|
|
@@ -53,25 +54,33 @@ Once imported, the components can be used just like standard HTML elements.
|
|
|
53
54
|
|
|
54
55
|
### Theming
|
|
55
56
|
|
|
56
|
-
SEELE components use CSS variables for styling.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
SEELE components use CSS variables for styling. To include the systems, add
|
|
58
|
+
this to your style files.
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
@import '@vollowx/seele/m3/systems/base.css';
|
|
62
|
+
/* This includes basic system variables like motion system and typography system */
|
|
63
|
+
@import '@vollowx/seele/m3/systems/defaults.css';
|
|
64
|
+
/* (Optional) This includes basic styling for body, selection and links */
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Note that there is no default color system since the way you implement theme
|
|
68
|
+
* switching and color changing varies.
|
|
69
|
+
*
|
|
70
|
+
* You can still find some references in dev/shared.css
|
|
71
|
+
*/
|
|
72
|
+
```
|
|
65
73
|
|
|
66
|
-
## Browser
|
|
74
|
+
## Browser Support
|
|
67
75
|
|
|
68
76
|
SEELE relies on modern web standards like `ElementInternals`.
|
|
77
|
+
However in 2026 you don't really need to worry about this.
|
|
69
78
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
79
|
+
- Chromium-based ones: >= 125.0
|
|
80
|
+
- Firefox-based ones: >= 126.0
|
|
72
81
|
|
|
73
|
-
##
|
|
82
|
+
## Other Information
|
|
74
83
|
|
|
75
84
|
- [Roadmap](./ROADMAP.md)
|
|
76
85
|
- [Contributing](./CONTRIBUTING.md)
|
|
77
|
-
- [License](./LICENSE)
|
|
86
|
+
- [License (Apache-2.0)](./LICENSE)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vollowx/seele",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.12.6",
|
|
4
|
+
"description": "A extensible Web Components library, with Material Design 3 components pre-provided.",
|
|
5
5
|
"author": "vollowx",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"src/**/*.js",
|
|
17
|
-
"src
|
|
17
|
+
"src/m3/system/*.css",
|
|
18
18
|
"custom-elements.json",
|
|
19
19
|
"LICENSE",
|
|
20
20
|
"README.md"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lit",
|
|
28
28
|
"ui-components"
|
|
29
29
|
],
|
|
30
|
-
"homepage": "https://seele.v9.nz",
|
|
30
|
+
"homepage": "https://seele.projects.v9.nz",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
33
|
"url": "https://github.com/vollowx/seele.git"
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
52
|
-
"@swc/core": "^1.15.
|
|
53
|
-
"@types/bun": "^1.3.
|
|
52
|
+
"@swc/core": "^1.15.30",
|
|
53
|
+
"@types/bun": "^1.3.13",
|
|
54
54
|
"@web/dev-server": "^0.4.6",
|
|
55
55
|
"@web/dev-server-esbuild": "^1.0.5",
|
|
56
56
|
"chokidar": "^5.0.0",
|
|
57
57
|
"lightningcss": "^1.32.0",
|
|
58
|
-
"postcss": "^8.5.
|
|
58
|
+
"postcss": "^8.5.10",
|
|
59
59
|
"postcss-cli": "^11.0.1",
|
|
60
60
|
"postcss-sorting": "^9.1.0",
|
|
61
|
-
"prettier": "^3.8.
|
|
61
|
+
"prettier": "^3.8.3"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@floating-ui/dom": "^1.7.6",
|
|
65
|
-
"@swc/helpers": "^0.5.
|
|
65
|
+
"@swc/helpers": "^0.5.21",
|
|
66
66
|
"lit": "^3.3.2"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const listItemStyles = css`:host{--md-focus-ring-shape:12px;--md-focus-ring-inward-offset:-3px;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;border-radius:4px;outline:0;display:flex}:host(:not([hidden]):first-of-type){border-radius:12px 12px 4px 4px}:host(:not([hidden]):last-of-type){border-radius:4px 4px 12px 12px}:host(:state(selected)){--md-item-supporting-text-color:var(--md-sys-color-on-tertiary-container);background-color:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-radius:12px}:host(:disabled){cursor:default;opacity:.3;pointer-events:none}md-item,md-item div[slot=container]{border-radius:inherit}`;
|
|
2
|
+
export const listItemStyles = css`:host{--md-focus-ring-shape:12px;--md-focus-ring-inward-offset:-3px;background-color:var(--_background,transparent);-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;border-radius:4px;outline:0;display:flex}:host(:not([hidden]):first-of-type){border-radius:12px 12px 4px 4px}:host(:not([hidden]):last-of-type){border-radius:4px 4px 12px 12px}:host(:state(selected)){--md-item-supporting-text-color:var(--md-sys-color-on-tertiary-container);background-color:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-radius:12px}:host(:disabled){cursor:default;opacity:.3;pointer-events:none}md-item,md-item div[slot=container]{border-radius:inherit}`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const listStyles = css`:host{box-sizing:border-box;-webkit-user-select:none;user-select:none;outline:0;flex-direction:column;gap:2px;min-width:112px;height:max-content;padding:4px;display:flex;position:relative;overflow-y:auto}`;
|
|
2
|
+
export const listStyles = css`:host{box-sizing:border-box;-webkit-user-select:none;user-select:none;outline:0;flex-direction:column;gap:2px;min-width:112px;height:max-content;padding:4px;display:flex;position:relative;overflow-y:auto}:host([color=segmented]) ::slotted(md-list-item){--_background:var(--md-sys-color-surface-container)}`;
|
package/src/m3/list/list.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { List } from '../../base/list.js';
|
|
4
4
|
import { listStyles } from './list-styles.css.js';
|
|
5
5
|
export class M3List extends List {
|
|
@@ -15,9 +15,14 @@ export class M3List extends List {
|
|
|
15
15
|
'md-list-item',
|
|
16
16
|
'md-list-item-checkbox',
|
|
17
17
|
'md-list-item-radio'
|
|
18
|
-
];
|
|
18
|
+
], this.color = 'standard';
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
_ts_decorate([
|
|
22
|
+
property({
|
|
23
|
+
reflect: true
|
|
24
|
+
})
|
|
25
|
+
], M3List.prototype, "color", void 0);
|
|
21
26
|
M3List = _ts_decorate([
|
|
22
27
|
customElement('md-list')
|
|
23
28
|
], M3List);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
body {
|
|
2
|
+
accent-color: var(--md-sys-color-primary);
|
|
3
|
+
background-color: var(--md-sys-color-background);
|
|
4
|
+
color: var(--md-sys-color-on-background);
|
|
5
|
+
font-family: var(--md-sys-typography-family);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
::selection {
|
|
9
|
+
background-color: var(--md-sys-color-tertiary-container);
|
|
10
|
+
color: var(--md-sys-color-on-tertiary-container);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
a {
|
|
14
|
+
color: var(--md-sys-color-primary);
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--md-sys-elevation-level-0: 0;
|
|
3
|
+
--md-sys-elevation-level-1: 1;
|
|
4
|
+
--md-sys-elevation-level-2: 3;
|
|
5
|
+
--md-sys-elevation-level-3: 6;
|
|
6
|
+
--md-sys-elevation-level-4: 8;
|
|
7
|
+
--md-sys-elevation-level-5: 12;
|
|
8
|
+
--md-sys-elevation-shadow-1:
|
|
9
|
+
0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px rgba(0, 0, 0, 0.3);
|
|
10
|
+
--md-sys-elevation-shadow-2:
|
|
11
|
+
0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px rgba(0, 0, 0, 0.3);
|
|
12
|
+
--md-sys-elevation-shadow-3:
|
|
13
|
+
0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);
|
|
14
|
+
--md-sys-elevation-shadow-4:
|
|
15
|
+
0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px rgba(0, 0, 0, 0.3);
|
|
16
|
+
--md-sys-elevation-shadow-5:
|
|
17
|
+
0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px rgba(0, 0, 0, 0.3);
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* std: standard, exp: expressive, mot: motion */
|
|
3
|
+
--md-sys-motion-exp-spatial-fast: cubic-bezier(0.42, 1.67, 0.21, 0.9);
|
|
4
|
+
--md-sys-motion-exp-spatial-fast-duration: 350ms;
|
|
5
|
+
--md-sys-motion-exp-spatial-default: cubic-bezier(0.38, 1.21, 0.22, 1);
|
|
6
|
+
--md-sys-motion-exp-spatial-default-duration: 500ms;
|
|
7
|
+
--md-sys-motion-exp-spatial-slow: cubic-bezier(0.39, 1.29, 0.35, 0.98);
|
|
8
|
+
--md-sys-motion-exp-spatial-slow-duration: 650ms;
|
|
9
|
+
|
|
10
|
+
--md-sys-motion-exp-effects-fast: cubic-bezier(0.31, 0.94, 0.34, 1);
|
|
11
|
+
--md-sys-motion-exp-effects-fast-duration: 150ms;
|
|
12
|
+
--md-sys-motion-exp-effects-default: cubic-bezier(0.34, 0.8, 0.34, 1);
|
|
13
|
+
--md-sys-motion-exp-effects-default-duration: 200ms;
|
|
14
|
+
--md-sys-motion-exp-effects-slow: cubic-bezier(0.34, 0.88, 0.34, 1);
|
|
15
|
+
--md-sys-motion-exp-effects-slow-duration: 300ms;
|
|
16
|
+
|
|
17
|
+
--md-sys-motion-std-spatial-fast: cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
18
|
+
--md-sys-motion-std-spatial-fast-duration: 350ms;
|
|
19
|
+
--md-sys-motion-std-spatial-default: cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
20
|
+
--md-sys-motion-std-spatial-default-duration: 500ms;
|
|
21
|
+
--md-sys-motion-std-spatial-slow: cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
22
|
+
--md-sys-motion-std-spatial-slow-duration: 750ms;
|
|
23
|
+
|
|
24
|
+
--md-sys-motion-std-effects-fast: cubic-bezier(0.31, 0.94, 0.34, 1);
|
|
25
|
+
--md-sys-motion-std-effects-fast-duration: 150ms;
|
|
26
|
+
--md-sys-motion-std-effects-default: cubic-bezier(0.34, 0.8, 0.34, 1);
|
|
27
|
+
--md-sys-motion-std-effects-default-duration: 200ms;
|
|
28
|
+
--md-sys-motion-std-effects-slow: cubic-bezier(0.34, 0.88, 0.34, 1);
|
|
29
|
+
--md-sys-motion-std-effects-slow-duration: 300ms;
|
|
30
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--md-sys-typography-family: sans-serif;
|
|
3
|
+
|
|
4
|
+
--md-sys-typography-display-large: 400 3.5625rem / 4rem
|
|
5
|
+
var(--md-sys-typography-family);
|
|
6
|
+
--md-sys-typography-display-medium: 400 2.8125rem / 3.5rem
|
|
7
|
+
var(--md-sys-typography-family);
|
|
8
|
+
--md-sys-typography-display-small: 400 2.25rem / 3rem
|
|
9
|
+
var(--md-sys-typography-family);
|
|
10
|
+
--md-sys-typography-headline-large: 400 2.5rem / 3.125rem
|
|
11
|
+
var(--md-sys-typography-family);
|
|
12
|
+
--md-sys-typography-headline-medium: 400 2.25rem / 2.75rem
|
|
13
|
+
var(--md-sys-typography-family);
|
|
14
|
+
--md-sys-typography-headline-small: 400 2rem / 2.5rem
|
|
15
|
+
var(--md-sys-typography-family);
|
|
16
|
+
--md-sys-typography-title-large: 400 1.375rem / 1.75rem
|
|
17
|
+
var(--md-sys-typography-family);
|
|
18
|
+
--md-sys-typography-title-medium: 500 1rem / 1.25rem
|
|
19
|
+
var(--md-sys-typography-family);
|
|
20
|
+
--md-sys-typography-title-small: 500 0.875rem / 1.125rem
|
|
21
|
+
var(--md-sys-typography-family);
|
|
22
|
+
--md-sys-typography-label-large: 500 0.875rem / 1.25rem
|
|
23
|
+
var(--md-sys-typography-family);
|
|
24
|
+
--md-sys-typography-label-medium: 500 0.75rem / 1rem
|
|
25
|
+
var(--md-sys-typography-family);
|
|
26
|
+
--md-sys-typography-label-small: 500 0.6875rem / 0.875rem
|
|
27
|
+
var(--md-sys-typography-family);
|
|
28
|
+
--md-sys-typography-body-large: 400 1rem / 1.5rem
|
|
29
|
+
var(--md-sys-typography-family);
|
|
30
|
+
--md-sys-typography-body-medium: 400 0.875rem / 1.25rem
|
|
31
|
+
var(--md-sys-typography-family);
|
|
32
|
+
--md-sys-typography-body-small: 400 0.75rem / 1rem
|
|
33
|
+
var(--md-sys-typography-family);
|
|
34
|
+
}
|
package/src/core/shared.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
type Constructor<T> = new (...args: any[]) => T;
|