material 0.9.24 → 0.9.26
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/.editorconfig +36 -0
- package/.zed/README.md +64 -0
- package/.zed/settings.json +42 -0
- package/CONTRIBUTING.md +125 -0
- package/bun.lock +615 -0
- package/eslint.config.js +63 -0
- package/index.d.ts +77 -0
- package/package.json +1 -1
- package/src/module/extract.js +31 -30
- package/src/module/request.js +22 -2
- package/src/skin/material/base/body.scss +83 -0
- package/src/skin/material/base/{elevation.sass → elevation.scss} +76 -50
- package/src/skin/material/base/{grid.sass → grid.scss} +44 -32
- package/src/skin/material/base/typo.scss +133 -0
- package/src/skin/material/button/action.scss +124 -0
- package/src/skin/material/button/button.scss +245 -0
- package/src/skin/material/button/file.scss +27 -0
- package/src/skin/material/button/floating.scss +160 -0
- package/src/skin/material/button/raised.scss +145 -0
- package/src/skin/material/button/stroked.scss +102 -0
- package/src/skin/material/component/component.scss +11 -0
- package/src/skin/material/component/divider.scss +22 -0
- package/src/skin/material/component/image.scss +9 -0
- package/src/skin/material/component/label.scss +4 -0
- package/src/skin/material/component/navigation.scss +15 -0
- package/src/skin/material/component/progress.scss +176 -0
- package/src/skin/material/component/subheader.scss +5 -0
- package/src/skin/material/component/text.scss +101 -0
- package/src/skin/material/container/appbar.scss +215 -0
- package/src/skin/material/container/banner.scss +44 -0
- package/src/skin/material/container/card.scss +23 -0
- package/src/skin/material/container/container.scss +2 -0
- package/src/skin/material/container/dialog.scss +196 -0
- package/src/skin/material/container/drawer.scss +185 -0
- package/src/skin/material/container/menu.scss +69 -0
- package/src/skin/material/container/snackbar.scss +21 -0
- package/src/skin/material/container/tabs.scss +94 -0
- package/src/skin/material/container/toolbar.scss +207 -0
- package/src/skin/material/control/button.scss +172 -0
- package/src/skin/material/control/checkbox.scss +134 -0
- package/src/skin/material/control/colorpicker.scss +220 -0
- package/src/skin/material/control/menu.scss +25 -0
- package/src/skin/material/control/progress.scss +174 -0
- package/src/skin/material/control/search.scss +50 -0
- package/src/skin/material/control/selecter.scss +152 -0
- package/src/skin/material/control/selector.scss +46 -0
- package/src/skin/material/control/slider.scss +221 -0
- package/src/skin/material/control/snackbar.scss +77 -0
- package/src/skin/material/control/switch.scss +349 -0
- package/src/skin/material/control/switcher.scss +48 -0
- package/src/skin/material/control/textfield.scss +159 -0
- package/src/skin/material/control/tooltip.scss +42 -0
- package/src/skin/material/layout/layout.scss +92 -0
- package/src/skin/material/layout/resizer.scss +97 -0
- package/src/skin/material/material.scss +67 -0
- package/src/skin/material/module/ripple.scss +11 -0
- package/src/skin/material/theme/{default.sass → default.scss} +18 -17
- package/src/skin/material/theme/ocean.scss +30 -0
- package/src/skin/material/theme/theme.scss +4 -0
- package/src/skin/material/view/calendar.scss +219 -0
- package/src/skin/material/view/form.scss +21 -0
- package/src/skin/material/view/grid.scss +134 -0
- package/src/skin/material/view/list.scss +107 -0
- package/src/skin/material/view/listview.scss +221 -0
- package/src/skin/material/view/map.scss +8 -0
- package/src/skin/material/view/page.scss +5 -0
- package/src/skin/material/view/tabview-bak.scss +49 -0
- package/src/skin/material/view/tabview.scss +65 -0
- package/src/skin/material/view/tree.scss +85 -0
- package/src/skin/material/view/{view.sass → view.scss} +1 -0
- package/src/skin/material/base/body.sass +0 -55
- package/src/skin/material/base/typo.sass +0 -107
- package/src/skin/material/button/action.sass +0 -89
- package/src/skin/material/button/button.sass +0 -183
- package/src/skin/material/button/file.sass +0 -24
- package/src/skin/material/button/floating.sass +0 -113
- package/src/skin/material/button/raised.sass +0 -101
- package/src/skin/material/button/stroked.sass +0 -71
- package/src/skin/material/component/component.sass +0 -7
- package/src/skin/material/component/divider.sass +0 -17
- package/src/skin/material/component/image.sass +0 -6
- package/src/skin/material/component/label.sass +0 -2
- package/src/skin/material/component/navigation.sass +0 -13
- package/src/skin/material/component/progress.sass +0 -138
- package/src/skin/material/component/subheader.sass +0 -3
- package/src/skin/material/component/text.sass +0 -85
- package/src/skin/material/container/appbar.sass +0 -167
- package/src/skin/material/container/banner.sass +0 -38
- package/src/skin/material/container/card.sass +0 -19
- package/src/skin/material/container/dialog.sass +0 -172
- package/src/skin/material/container/drawer.sass +0 -159
- package/src/skin/material/container/menu.sass +0 -58
- package/src/skin/material/container/snackbar.sass +0 -18
- package/src/skin/material/container/tabs.sass +0 -75
- package/src/skin/material/container/toolbar.sass +0 -161
- package/src/skin/material/control/button.sass +0 -135
- package/src/skin/material/control/checkbox.sass +0 -105
- package/src/skin/material/control/colorpicker.sass +0 -188
- package/src/skin/material/control/dialog.sass +0 -0
- package/src/skin/material/control/menu.sass +0 -18
- package/src/skin/material/control/progress.sass +0 -136
- package/src/skin/material/control/search.sass +0 -40
- package/src/skin/material/control/selecter.sass +0 -131
- package/src/skin/material/control/selector.sass +0 -38
- package/src/skin/material/control/slider.sass +0 -181
- package/src/skin/material/control/snackbar.sass +0 -65
- package/src/skin/material/control/switch.sass +0 -284
- package/src/skin/material/control/switcher.sass +0 -41
- package/src/skin/material/control/textfield.sass +0 -126
- package/src/skin/material/control/tooltip.sass +0 -36
- package/src/skin/material/layout/layout.sass +0 -69
- package/src/skin/material/layout/resizer.sass +0 -69
- package/src/skin/material/material.sass +0 -66
- package/src/skin/material/module/ripple.sass +0 -9
- package/src/skin/material/theme/ocean.sass +0 -29
- package/src/skin/material/theme/theme.sass +0 -3
- package/src/skin/material/view/calendar.sass +0 -193
- package/src/skin/material/view/form.sass +0 -15
- package/src/skin/material/view/grid.sass +0 -116
- package/src/skin/material/view/list.sass +0 -87
- package/src/skin/material/view/listview.sass +0 -195
- package/src/skin/material/view/map.sass +0 -6
- package/src/skin/material/view/page.sass +0 -4
- package/src/skin/material/view/tabview-bak.sass +0 -40
- package/src/skin/material/view/tabview.sass +0 -55
- package/src/skin/material/view/tree.sass +0 -73
- /package/src/skin/material/{container/container.sass → control/dialog.scss} +0 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
+
|
|
3
|
+
# top-most EditorConfig file
|
|
4
|
+
root = true
|
|
5
|
+
|
|
6
|
+
# Unix-style newlines with a newline ending every file
|
|
7
|
+
[*]
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
charset = utf-8
|
|
11
|
+
trim_trailing_whitespace = true
|
|
12
|
+
|
|
13
|
+
# JavaScript files
|
|
14
|
+
[*.js]
|
|
15
|
+
indent_style = space
|
|
16
|
+
indent_size = 2
|
|
17
|
+
quote_type = single
|
|
18
|
+
|
|
19
|
+
# JSON files
|
|
20
|
+
[*.json]
|
|
21
|
+
indent_style = space
|
|
22
|
+
indent_size = 2
|
|
23
|
+
|
|
24
|
+
# YAML files
|
|
25
|
+
[*.{yml,yaml}]
|
|
26
|
+
indent_style = space
|
|
27
|
+
indent_size = 2
|
|
28
|
+
|
|
29
|
+
# Markdown files
|
|
30
|
+
[*.md]
|
|
31
|
+
trim_trailing_whitespace = false
|
|
32
|
+
|
|
33
|
+
# Package files
|
|
34
|
+
[package.json]
|
|
35
|
+
indent_style = space
|
|
36
|
+
indent_size = 2
|
package/.zed/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Zed Editor Settings for Material Library
|
|
2
|
+
|
|
3
|
+
This directory contains project-specific settings for the [Zed Editor](https://zed.dev/).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Auto-formatting on Save
|
|
8
|
+
|
|
9
|
+
JavaScript files are automatically formatted using **ESLint with Standard JS rules** when you save them.
|
|
10
|
+
|
|
11
|
+
- **Formatter**: ESLint (`eslint --stdin --fix`)
|
|
12
|
+
- **Format on save**: Enabled
|
|
13
|
+
- **Indentation**: 2 spaces (no tabs)
|
|
14
|
+
- **Trailing whitespace**: Removed on save
|
|
15
|
+
- **Final newline**: Ensured on save
|
|
16
|
+
|
|
17
|
+
### How It Works
|
|
18
|
+
|
|
19
|
+
The `settings.json` configures Zed to:
|
|
20
|
+
1. Use ESLint as the external formatter
|
|
21
|
+
2. Apply Standard JS rules via ESLint config
|
|
22
|
+
3. Format automatically on save
|
|
23
|
+
4. Enable ESLint LSP for real-time feedback
|
|
24
|
+
|
|
25
|
+
### Manual Formatting
|
|
26
|
+
|
|
27
|
+
You can also format manually:
|
|
28
|
+
- **Command Palette**: `Format Document`
|
|
29
|
+
- **Keyboard shortcut**: Check Zed's keybindings
|
|
30
|
+
|
|
31
|
+
### Standard JS Rules
|
|
32
|
+
|
|
33
|
+
The formatter follows [Standard JS](https://standardjs.com/) rules via ESLint:
|
|
34
|
+
- No semicolons
|
|
35
|
+
- Single quotes for strings
|
|
36
|
+
- 2 space indentation
|
|
37
|
+
- Space after function name
|
|
38
|
+
- And more...
|
|
39
|
+
|
|
40
|
+
Project-specific globals are defined in both:
|
|
41
|
+
- `eslint.config.js` - for ESLint/Zed
|
|
42
|
+
- `package.json` under `standard` - for Standard CLI
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Zed Editor
|
|
47
|
+
- Node.js or Bun installed
|
|
48
|
+
- ESLint and Standard JS installed (via `bun install`)
|
|
49
|
+
|
|
50
|
+
## Troubleshooting
|
|
51
|
+
|
|
52
|
+
If formatting doesn't work:
|
|
53
|
+
1. Ensure dependencies are installed: `bun install`
|
|
54
|
+
2. Test ESLint manually: `npx eslint src/module/extract.js`
|
|
55
|
+
3. Test Standard JS manually: `npx standard src/module/extract.js`
|
|
56
|
+
4. Restart Zed Editor
|
|
57
|
+
5. Check Zed's output panel for errors
|
|
58
|
+
|
|
59
|
+
## More Info
|
|
60
|
+
|
|
61
|
+
- [Zed Editor Documentation](https://zed.dev/docs)
|
|
62
|
+
- [ESLint](https://eslint.org/)
|
|
63
|
+
- [Standard JS](https://standardjs.com/)
|
|
64
|
+
- [EditorConfig](https://editorconfig.org/)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"languages": {
|
|
3
|
+
"JavaScript": {
|
|
4
|
+
"formatter": {
|
|
5
|
+
"external": {
|
|
6
|
+
"command": "npx",
|
|
7
|
+
"arguments": [
|
|
8
|
+
"eslint",
|
|
9
|
+
"--stdin",
|
|
10
|
+
"--fix",
|
|
11
|
+
"--stdin-filename",
|
|
12
|
+
"{buffer_path}"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"code_actions_on_format": {
|
|
17
|
+
"source.fixAll.eslint": true
|
|
18
|
+
},
|
|
19
|
+
"format_on_save": "on",
|
|
20
|
+
"tab_size": 2,
|
|
21
|
+
"hard_tabs": false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"lsp": {
|
|
25
|
+
"eslint": {
|
|
26
|
+
"settings": {
|
|
27
|
+
"experimental": {
|
|
28
|
+
"useFlatConfig": true
|
|
29
|
+
},
|
|
30
|
+
"validate": "on",
|
|
31
|
+
"run": "onType",
|
|
32
|
+
"format": {
|
|
33
|
+
"enable": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"tab_size": 2,
|
|
39
|
+
"hard_tabs": false,
|
|
40
|
+
"remove_trailing_whitespace_on_save": true,
|
|
41
|
+
"ensure_final_newline_on_save": true
|
|
42
|
+
}
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Contributing to Material
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Material! This document provides guidelines and information about our development workflow.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js >= 16.14.0 or Bun
|
|
10
|
+
- Git
|
|
11
|
+
|
|
12
|
+
### Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Clone the repository
|
|
16
|
+
git clone https://gitlab.com/alkaloid/material.git
|
|
17
|
+
cd material
|
|
18
|
+
|
|
19
|
+
# Install dependencies
|
|
20
|
+
bun install
|
|
21
|
+
# or
|
|
22
|
+
npm install
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Code Style
|
|
26
|
+
|
|
27
|
+
We use [Standard JS](https://standardjs.com/) style guide with ESLint for code quality and consistency.
|
|
28
|
+
|
|
29
|
+
### Linting
|
|
30
|
+
|
|
31
|
+
Before submitting a pull request, ensure your code passes linting:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Check for linting errors
|
|
35
|
+
bun run lint
|
|
36
|
+
|
|
37
|
+
# Auto-fix linting errors (when possible)
|
|
38
|
+
bun run lint:fix
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
We use [Standard JS](https://standardjs.com/) which comes bundled with ESLint and requires no configuration.
|
|
42
|
+
|
|
43
|
+
### Code Style Rules
|
|
44
|
+
|
|
45
|
+
- **No semicolons** - Standard JS style
|
|
46
|
+
- **2 spaces** for indentation
|
|
47
|
+
- **Single quotes** for strings
|
|
48
|
+
- **Space before function parentheses** - `function foo () {}`
|
|
49
|
+
- **Object spacing** - `{ foo: 'bar' }`
|
|
50
|
+
- **No trailing whitespace**
|
|
51
|
+
- **LF line endings** (Unix style)
|
|
52
|
+
- **Final newline** in all files
|
|
53
|
+
|
|
54
|
+
### EditorConfig
|
|
55
|
+
|
|
56
|
+
We use `.editorconfig` for consistent code style across different editors. Most modern editors (including Zed, VSCode, Sublime Text) support it automatically.
|
|
57
|
+
|
|
58
|
+
### Standard JS
|
|
59
|
+
|
|
60
|
+
Standard JS is configured in `package.json` with project-specific globals. It includes ESLint internally, so no separate ESLint config is needed.
|
|
61
|
+
|
|
62
|
+
## Browser Compatibility
|
|
63
|
+
|
|
64
|
+
Material is designed for modern browsers with ES6+ support:
|
|
65
|
+
- Chrome/Edge (latest)
|
|
66
|
+
- Firefox (latest)
|
|
67
|
+
- Safari (latest)
|
|
68
|
+
|
|
69
|
+
## Testing
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Run tests (when available)
|
|
73
|
+
bun test
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Project Structure
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
material/
|
|
80
|
+
├── src/ # Source files
|
|
81
|
+
│ ├── module/ # Utility modules
|
|
82
|
+
│ ├── mixin/ # Reusable mixins
|
|
83
|
+
│ ├── class/ # Base classes
|
|
84
|
+
│ └── *.js # Component files
|
|
85
|
+
├── docs/ # Documentation
|
|
86
|
+
├── packages/ # Additional packages
|
|
87
|
+
└── scripts/ # Build scripts
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Git Workflow
|
|
91
|
+
|
|
92
|
+
1. Create a feature branch from `master`
|
|
93
|
+
2. Make your changes
|
|
94
|
+
3. Run linting: `bun run lint:fix` (Standard JS will auto-fix most issues)
|
|
95
|
+
4. Commit with descriptive messages
|
|
96
|
+
5. Push and create a merge request
|
|
97
|
+
|
|
98
|
+
### Commit Messages
|
|
99
|
+
|
|
100
|
+
Follow conventional commit format when possible:
|
|
101
|
+
- `feat: add new component`
|
|
102
|
+
- `fix: resolve issue with dialog`
|
|
103
|
+
- `refactor: simplify event handling`
|
|
104
|
+
- `docs: update README`
|
|
105
|
+
- `style: fix linting issues`
|
|
106
|
+
|
|
107
|
+
## Pull Request Guidelines
|
|
108
|
+
|
|
109
|
+
- Ensure all linting passes
|
|
110
|
+
- Update documentation if needed
|
|
111
|
+
- Keep changes focused and atomic
|
|
112
|
+
- Provide clear description of changes
|
|
113
|
+
- Reference related issues
|
|
114
|
+
|
|
115
|
+
## Questions?
|
|
116
|
+
|
|
117
|
+
Feel free to open an issue for:
|
|
118
|
+
- Bug reports
|
|
119
|
+
- Feature requests
|
|
120
|
+
- Questions about usage
|
|
121
|
+
- Suggestions for improvement
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
This project is licensed under GPL-3.0. By contributing, you agree that your contributions will be licensed under the same license.
|