spaday-spectrum 0.3.0__tar.gz

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 (58) hide show
  1. spaday_spectrum-0.3.0/.gitignore +162 -0
  2. spaday_spectrum-0.3.0/LICENSE +201 -0
  3. spaday_spectrum-0.3.0/PKG-INFO +167 -0
  4. spaday_spectrum-0.3.0/README.md +117 -0
  5. spaday_spectrum-0.3.0/js/.oxfmtrc.json +5 -0
  6. spaday_spectrum-0.3.0/js/.oxlintrc.json +11 -0
  7. spaday_spectrum-0.3.0/js/build.mjs +67 -0
  8. spaday_spectrum-0.3.0/js/examples/build_pyodide_example.py +51 -0
  9. spaday_spectrum-0.3.0/js/examples/pyodide-worker.js +128 -0
  10. spaday_spectrum-0.3.0/js/examples/pyodide.html +152 -0
  11. spaday_spectrum-0.3.0/js/package.json +64 -0
  12. spaday_spectrum-0.3.0/js/playwright.config.js +50 -0
  13. spaday_spectrum-0.3.0/js/pnpm-lock.yaml +3300 -0
  14. spaday_spectrum-0.3.0/js/pnpm-workspace.yaml +2 -0
  15. spaday_spectrum-0.3.0/js/src/css/index.css +0 -0
  16. spaday_spectrum-0.3.0/js/src/html/index.html +13 -0
  17. spaday_spectrum-0.3.0/js/src/ts/css.d.ts +4 -0
  18. spaday_spectrum-0.3.0/js/src/ts/define-guard.ts +48 -0
  19. spaday_spectrum-0.3.0/js/src/ts/index.ts +32 -0
  20. spaday_spectrum-0.3.0/js/tests/example.spec.js +73 -0
  21. spaday_spectrum-0.3.0/js/tests/index.spec.js +40 -0
  22. spaday_spectrum-0.3.0/js/tests/pyodide.spec.js +103 -0
  23. spaday_spectrum-0.3.0/js/tests/ui.spec.js +56 -0
  24. spaday_spectrum-0.3.0/js/tools/bundle.mjs +59 -0
  25. spaday_spectrum-0.3.0/js/tools/css.mjs +55 -0
  26. spaday_spectrum-0.3.0/js/tools/externals.mjs +18 -0
  27. spaday_spectrum-0.3.0/js/tools/getarg.mjs +23 -0
  28. spaday_spectrum-0.3.0/js/tools/html.mjs +0 -0
  29. spaday_spectrum-0.3.0/js/tools/manifests.mjs +137 -0
  30. spaday_spectrum-0.3.0/js/tools/unpublished.json +131 -0
  31. spaday_spectrum-0.3.0/js/tsconfig.json +24 -0
  32. spaday_spectrum-0.3.0/pyproject.toml +191 -0
  33. spaday_spectrum-0.3.0/spaday_spectrum/__init__.py +29 -0
  34. spaday_spectrum-0.3.0/spaday_spectrum/button.py +375 -0
  35. spaday_spectrum-0.3.0/spaday_spectrum/checkbox.py +65 -0
  36. spaday_spectrum-0.3.0/spaday_spectrum/design.py +82 -0
  37. spaday_spectrum-0.3.0/spaday_spectrum/example.py +409 -0
  38. spaday_spectrum-0.3.0/spaday_spectrum/extension/cdn/index.js +952 -0
  39. spaday_spectrum-0.3.0/spaday_spectrum/extension/cdn/index.js.map +7 -0
  40. spaday_spectrum-0.3.0/spaday_spectrum/extension/css/index.css +0 -0
  41. spaday_spectrum-0.3.0/spaday_spectrum/extension/index.html +13 -0
  42. spaday_spectrum-0.3.0/spaday_spectrum/extension/versions.json +8 -0
  43. spaday_spectrum-0.3.0/spaday_spectrum/gallery.py +301 -0
  44. spaday_spectrum-0.3.0/spaday_spectrum/manifests/button.json +1624 -0
  45. spaday_spectrum-0.3.0/spaday_spectrum/manifests/checkbox.json +279 -0
  46. spaday_spectrum-0.3.0/spaday_spectrum/manifests/switch.json +142 -0
  47. spaday_spectrum-0.3.0/spaday_spectrum/manifests/tabs.json +915 -0
  48. spaday_spectrum-0.3.0/spaday_spectrum/manifests/textfield.json +952 -0
  49. spaday_spectrum-0.3.0/spaday_spectrum/manifests/theme.json +340 -0
  50. spaday_spectrum-0.3.0/spaday_spectrum/switch.py +60 -0
  51. spaday_spectrum-0.3.0/spaday_spectrum/tabs.py +200 -0
  52. spaday_spectrum-0.3.0/spaday_spectrum/tests/test_all.py +49 -0
  53. spaday_spectrum-0.3.0/spaday_spectrum/tests/test_design.py +71 -0
  54. spaday_spectrum-0.3.0/spaday_spectrum/tests/test_example.py +66 -0
  55. spaday_spectrum-0.3.0/spaday_spectrum/tests/test_gallery.py +45 -0
  56. spaday_spectrum-0.3.0/spaday_spectrum/tests/test_versions.py +18 -0
  57. spaday_spectrum-0.3.0/spaday_spectrum/textfield.py +186 -0
  58. spaday_spectrum-0.3.0/spaday_spectrum/theme.py +73 -0
@@ -0,0 +1,162 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.a
8
+ *.o
9
+ *.dSYM
10
+ *.so
11
+ *.obj
12
+ *.dll
13
+ *.exp
14
+ *.lib
15
+
16
+ # vcpkg
17
+ vcpkg/
18
+ vcpkg_installed/
19
+
20
+ # Rust
21
+ target
22
+ target-capi
23
+
24
+ # Distribution / packaging
25
+ .Python
26
+ build/
27
+ develop-eggs/
28
+ dist/
29
+ downloads/
30
+ eggs/
31
+ .eggs/
32
+ lib/
33
+ lib64/
34
+ parts/
35
+ sdist/
36
+ var/
37
+ wheels/
38
+ pip-wheel-metadata/
39
+ share/python-wheels/
40
+ *.egg-info/
41
+ .installed.cfg
42
+ *.egg
43
+ MANIFEST
44
+
45
+ # PyInstaller
46
+ *.manifest
47
+ *.spec
48
+
49
+ # Installer logs
50
+ pip-log.txt
51
+ pip-delete-this-directory.txt
52
+
53
+ # Unit test / coverage reports
54
+ htmlcov/
55
+ .tox/
56
+ .nox/
57
+ .coverage
58
+ .coverage.*
59
+ .cache
60
+ nosetests.xml
61
+ coverage.xml
62
+ junit.xml
63
+ *.cover
64
+ *.py,cover
65
+ .hypothesis/
66
+ .pytest_cache/
67
+
68
+ # Django
69
+ *.log
70
+ local_settings.py
71
+ db.sqlite3
72
+ db.sqlite3-journal
73
+
74
+ # IPython
75
+ profile_default/
76
+ ipython_config.py
77
+
78
+ # pyenv
79
+ .python-version
80
+
81
+ # pipenv
82
+ Pipfile.lock
83
+
84
+ # Celery
85
+ celerybeat-schedule
86
+ celerybeat.pid
87
+
88
+ # Airspeed Velocity
89
+ .asv
90
+
91
+ # Environments
92
+ .env
93
+ .venv
94
+ env/
95
+ venv/
96
+ ENV/
97
+ env.bak/
98
+ venv.bak/
99
+
100
+ # Spyder project settings
101
+ .spyderproject
102
+ .spyproject
103
+
104
+ # Rope project settings
105
+ .ropeproject
106
+
107
+ # mkdocs documentation
108
+ /site
109
+
110
+ # mypy
111
+ .mypy_cache/
112
+ .dmypy.json
113
+ dmypy.json
114
+
115
+ # Pyre type checker
116
+ .pyre/
117
+
118
+ # Documentation
119
+ /site
120
+ index.md
121
+ docs/_build/
122
+ docs/api
123
+ docs/html
124
+ docs/index.md
125
+ docs/jupyter_execute
126
+ docs/src/_build/
127
+ docs/superpowers
128
+ index.md
129
+
130
+ # JS
131
+ js/coverage
132
+ js/dist
133
+ js/lib
134
+ js/node_modules
135
+ js/test-results
136
+ js/playwright-report
137
+ js/*.tgz
138
+
139
+ # Jupyter
140
+ .ipynb_checkpoints
141
+ .autoversion
142
+ Untitled*.ipynb
143
+ spaday_spectrum/extension
144
+ spaday_spectrum/nbextension
145
+ spaday_spectrum/labextension
146
+
147
+ # Emscripten SDK (locally installed)
148
+ emsdk
149
+ .pyodide_build/
150
+
151
+ # Mac
152
+ .DS_Store
153
+
154
+ # Hydra
155
+ /outputs/
156
+ /multirun/
157
+
158
+ # AI
159
+ ROADMAP.md
160
+ AGENTS.md
161
+ .github/hooks/sdlc.json
162
+ .superpowers
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 1kbgz
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,167 @@
1
+ Metadata-Version: 2.5
2
+ Name: spaday-spectrum
3
+ Version: 0.3.0
4
+ Summary: Spectrum for spaday
5
+ Project-URL: Repository, https://github.com/1kbgz/spaday-spectrum
6
+ Project-URL: Homepage, https://github.com/1kbgz/spaday-spectrum
7
+ Author-email: 1kbgz <dev@1kbgz.com>
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: spaday<1.0,>=0.10.0
21
+ Provides-Extra: develop
22
+ Requires-Dist: build; extra == 'develop'
23
+ Requires-Dist: bump-my-version; extra == 'develop'
24
+ Requires-Dist: check-dist; extra == 'develop'
25
+ Requires-Dist: codespell; extra == 'develop'
26
+ Requires-Dist: hatch-js; extra == 'develop'
27
+ Requires-Dist: hatchling; extra == 'develop'
28
+ Requires-Dist: httpx; extra == 'develop'
29
+ Requires-Dist: mdformat; extra == 'develop'
30
+ Requires-Dist: mdformat-tables>=1; extra == 'develop'
31
+ Requires-Dist: pydantic>=2; extra == 'develop'
32
+ Requires-Dist: pytest; extra == 'develop'
33
+ Requires-Dist: pytest-cov; extra == 'develop'
34
+ Requires-Dist: ruff; extra == 'develop'
35
+ Requires-Dist: starlette; extra == 'develop'
36
+ Requires-Dist: transports; extra == 'develop'
37
+ Requires-Dist: twine; extra == 'develop'
38
+ Requires-Dist: ty; extra == 'develop'
39
+ Requires-Dist: uv; extra == 'develop'
40
+ Requires-Dist: uvicorn; extra == 'develop'
41
+ Requires-Dist: websockets; extra == 'develop'
42
+ Requires-Dist: wheel; extra == 'develop'
43
+ Provides-Extra: examples
44
+ Requires-Dist: pydantic>=2; extra == 'examples'
45
+ Requires-Dist: starlette; extra == 'examples'
46
+ Requires-Dist: transports; extra == 'examples'
47
+ Requires-Dist: uvicorn; extra == 'examples'
48
+ Requires-Dist: websockets; extra == 'examples'
49
+ Description-Content-Type: text/markdown
50
+
51
+ <a href="https://github.com/1kbgz/spaday-spectrum">
52
+ <picture>
53
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/1kbgz/spaday-spectrum/raw/main/docs/img/logo-dark.webp?raw=true">
54
+ <img alt="spaday-spectrum logo, a prism splitting light inside a browser window" src="https://github.com/1kbgz/spaday-spectrum/raw/main/docs/img/logo-light.webp?raw=true" width="1200">
55
+ </picture>
56
+ </a>
57
+
58
+ [Spectrum](https://opensource.adobe.com/spectrum-web-components/) for [spaday](https://1kbgz.github.io/spaday/)
59
+
60
+ [![Build Status](https://github.com/1kbgz/spaday-spectrum/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/1kbgz/spaday-spectrum/actions/workflows/build.yaml)
61
+ [![codecov](https://codecov.io/gh/1kbgz/spaday-spectrum/branch/main/graph/badge.svg)](https://codecov.io/gh/1kbgz/spaday-spectrum)
62
+ [![License](https://img.shields.io/github/license/1kbgz/spaday-spectrum)](https://github.com/1kbgz/spaday-spectrum)
63
+ [![PyPI](https://img.shields.io/pypi/v/spaday-spectrum.svg)](https://pypi.python.org/pypi/spaday-spectrum)
64
+
65
+ [![Preview of Spectrum components in spaday rendering a review board](https://raw.githubusercontent.com/1kbgz/spaday-spectrum/main/docs/img/preview.webp)](https://1kbgz.github.io/spaday-spectrum/lite/)
66
+
67
+ ## Overview
68
+
69
+ `spaday-spectrum` provides generated Python bindings and a self-contained registration bundle for a
70
+ focused first slice of Adobe Spectrum Web Components:
71
+
72
+ - Theme
73
+ - Button, clear button, and close button
74
+ - Textfield
75
+ - Checkbox and switch
76
+ - Tabs, tab panels, and tabs overflow
77
+
78
+ ## Generic controls
79
+
80
+ Select the `spectrum` design to render spaday's generic button, text input, text area, checkbox, and
81
+ switch as Spectrum elements:
82
+
83
+ ```python
84
+ from spaday import Button, Column, TextInput
85
+ from spaday.backends.starlette import serve
86
+
87
+ page = Column(
88
+ TextInput(label="Name").bind("value", "name", mode="two-way"),
89
+ Button(label="Save", intent="primary"),
90
+ )
91
+ app = serve(page, packages=["spectrum"], design="spectrum", store={"name": ""})
92
+ ```
93
+
94
+ Controls outside this focused Spectrum package use spaday's marked native fallback. The package's
95
+ shared conformance test covers both the Spectrum controls and those substitutions.
96
+
97
+ ## Interactive example
98
+
99
+ The textfield updates the greeting immediately, the checkbox switches Spectrum themes, and the button
100
+ resets state. All three interactions run in the browser through spaday's reactive store.
101
+
102
+ ```python
103
+ from spaday import SetField, cond, element, field
104
+ from spaday.backends.starlette import serve
105
+ from spaday_spectrum import SpButton, SpCheckbox, SpTextfield, SpTheme
106
+
107
+ page = (
108
+ SpTheme(scale="medium")
109
+ .compute("color", cond(field("dark"), "dark", "light"))
110
+ .style(display="block", max_width="32rem", margin="2rem auto", padding="1.5rem")
111
+ .child(element("h1").text("Spectrum profile"))
112
+ .child(SpTextfield(label="Display name", placeholder="Your name").bind("value", "name", mode="two-way"))
113
+ .child(SpCheckbox().text("Dark theme").bind("checked", "dark", mode="two-way"))
114
+ .child(
115
+ element("p")
116
+ .child("Hello, ")
117
+ .child(element("strong").bind("textContent", "name"))
118
+ )
119
+ .child(SpButton(treatment="fill").text("Reset name").on("click", SetField("name", "Ada")))
120
+ )
121
+
122
+ app = serve(page, packages=["spectrum"], store={"name": "Ada", "dark": False})
123
+ ```
124
+
125
+ Save this as `app.py`, then run `pip install spaday-spectrum starlette uvicorn` and
126
+ `uvicorn app:app`. Open <http://127.0.0.1:8000>.
127
+
128
+ Installing this project registers the `spectrum` entry point with spaday. The equivalent explicit
129
+ forms are `packages=[spaday_spectrum.package]` and `packages=["spaday_spectrum:package"]`.
130
+
131
+ The package pins six individual Spectrum packages to `1.12.2`. It deliberately avoids the full
132
+ `@spectrum-web-components/bundle`; more components should be added from concrete application needs.
133
+
134
+ The typed classes are generated from those packages' Custom Elements Manifests with `make catalog`.
135
+ Spectrum publishes one package per component, and a published manifest leaves out what an element
136
+ inherits from another package — `size`, `disabled`, `href`, and on `sp-switch` even `checked`.
137
+ `js/tools/manifests.mjs` resolves each element's superclass and mixins through the manifests of the
138
+ packages that declare them and writes the result to `spaday_spectrum/manifests/`, which the classes
139
+ are generated from. `base` and `shared` publish no manifest at all, so the few declarations needed
140
+ from them are transcribed in `js/tools/unpublished.json`; the tool fails on any class neither covers.
141
+
142
+ ## Browser examples
143
+
144
+ - [Open the standard app](https://1kbgz.github.io/spaday-spectrum/lite/) ([source](spaday_spectrum/example.py)).
145
+ - [Open the complete component gallery](https://1kbgz.github.io/spaday-spectrum/lite/?example=gallery) ([source](spaday_spectrum/gallery.py)).
146
+
147
+ Both run Python locally through Pyodide; no install or server is required.
148
+
149
+ ## Run examples locally
150
+
151
+ ```bash
152
+ python -m pip install -e ".[examples]"
153
+ python -m spaday_spectrum.example
154
+ python -m spaday_spectrum.gallery
155
+ ```
156
+
157
+ Open `http://127.0.0.1:8028` for the standard creative-review app or `http://127.0.0.1:8029` for the
158
+ component gallery. The standard app includes streamed assets, endpoint-backed review decisions and brief
159
+ submission, an activity feed, bound fields and switches, tabs, dismissible feedback, and shared Spectrum
160
+ color and scale state. The gallery includes every generated component in this focused package and a
161
+ highlighted Python snippet for each family.
162
+
163
+ Both pass the local package descriptor directly, so they do not install or resolve the integration from
164
+ GitHub.
165
+
166
+ > [!NOTE]
167
+ > This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
@@ -0,0 +1,117 @@
1
+ <a href="https://github.com/1kbgz/spaday-spectrum">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/1kbgz/spaday-spectrum/raw/main/docs/img/logo-dark.webp?raw=true">
4
+ <img alt="spaday-spectrum logo, a prism splitting light inside a browser window" src="https://github.com/1kbgz/spaday-spectrum/raw/main/docs/img/logo-light.webp?raw=true" width="1200">
5
+ </picture>
6
+ </a>
7
+
8
+ [Spectrum](https://opensource.adobe.com/spectrum-web-components/) for [spaday](https://1kbgz.github.io/spaday/)
9
+
10
+ [![Build Status](https://github.com/1kbgz/spaday-spectrum/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/1kbgz/spaday-spectrum/actions/workflows/build.yaml)
11
+ [![codecov](https://codecov.io/gh/1kbgz/spaday-spectrum/branch/main/graph/badge.svg)](https://codecov.io/gh/1kbgz/spaday-spectrum)
12
+ [![License](https://img.shields.io/github/license/1kbgz/spaday-spectrum)](https://github.com/1kbgz/spaday-spectrum)
13
+ [![PyPI](https://img.shields.io/pypi/v/spaday-spectrum.svg)](https://pypi.python.org/pypi/spaday-spectrum)
14
+
15
+ [![Preview of Spectrum components in spaday rendering a review board](https://raw.githubusercontent.com/1kbgz/spaday-spectrum/main/docs/img/preview.webp)](https://1kbgz.github.io/spaday-spectrum/lite/)
16
+
17
+ ## Overview
18
+
19
+ `spaday-spectrum` provides generated Python bindings and a self-contained registration bundle for a
20
+ focused first slice of Adobe Spectrum Web Components:
21
+
22
+ - Theme
23
+ - Button, clear button, and close button
24
+ - Textfield
25
+ - Checkbox and switch
26
+ - Tabs, tab panels, and tabs overflow
27
+
28
+ ## Generic controls
29
+
30
+ Select the `spectrum` design to render spaday's generic button, text input, text area, checkbox, and
31
+ switch as Spectrum elements:
32
+
33
+ ```python
34
+ from spaday import Button, Column, TextInput
35
+ from spaday.backends.starlette import serve
36
+
37
+ page = Column(
38
+ TextInput(label="Name").bind("value", "name", mode="two-way"),
39
+ Button(label="Save", intent="primary"),
40
+ )
41
+ app = serve(page, packages=["spectrum"], design="spectrum", store={"name": ""})
42
+ ```
43
+
44
+ Controls outside this focused Spectrum package use spaday's marked native fallback. The package's
45
+ shared conformance test covers both the Spectrum controls and those substitutions.
46
+
47
+ ## Interactive example
48
+
49
+ The textfield updates the greeting immediately, the checkbox switches Spectrum themes, and the button
50
+ resets state. All three interactions run in the browser through spaday's reactive store.
51
+
52
+ ```python
53
+ from spaday import SetField, cond, element, field
54
+ from spaday.backends.starlette import serve
55
+ from spaday_spectrum import SpButton, SpCheckbox, SpTextfield, SpTheme
56
+
57
+ page = (
58
+ SpTheme(scale="medium")
59
+ .compute("color", cond(field("dark"), "dark", "light"))
60
+ .style(display="block", max_width="32rem", margin="2rem auto", padding="1.5rem")
61
+ .child(element("h1").text("Spectrum profile"))
62
+ .child(SpTextfield(label="Display name", placeholder="Your name").bind("value", "name", mode="two-way"))
63
+ .child(SpCheckbox().text("Dark theme").bind("checked", "dark", mode="two-way"))
64
+ .child(
65
+ element("p")
66
+ .child("Hello, ")
67
+ .child(element("strong").bind("textContent", "name"))
68
+ )
69
+ .child(SpButton(treatment="fill").text("Reset name").on("click", SetField("name", "Ada")))
70
+ )
71
+
72
+ app = serve(page, packages=["spectrum"], store={"name": "Ada", "dark": False})
73
+ ```
74
+
75
+ Save this as `app.py`, then run `pip install spaday-spectrum starlette uvicorn` and
76
+ `uvicorn app:app`. Open <http://127.0.0.1:8000>.
77
+
78
+ Installing this project registers the `spectrum` entry point with spaday. The equivalent explicit
79
+ forms are `packages=[spaday_spectrum.package]` and `packages=["spaday_spectrum:package"]`.
80
+
81
+ The package pins six individual Spectrum packages to `1.12.2`. It deliberately avoids the full
82
+ `@spectrum-web-components/bundle`; more components should be added from concrete application needs.
83
+
84
+ The typed classes are generated from those packages' Custom Elements Manifests with `make catalog`.
85
+ Spectrum publishes one package per component, and a published manifest leaves out what an element
86
+ inherits from another package — `size`, `disabled`, `href`, and on `sp-switch` even `checked`.
87
+ `js/tools/manifests.mjs` resolves each element's superclass and mixins through the manifests of the
88
+ packages that declare them and writes the result to `spaday_spectrum/manifests/`, which the classes
89
+ are generated from. `base` and `shared` publish no manifest at all, so the few declarations needed
90
+ from them are transcribed in `js/tools/unpublished.json`; the tool fails on any class neither covers.
91
+
92
+ ## Browser examples
93
+
94
+ - [Open the standard app](https://1kbgz.github.io/spaday-spectrum/lite/) ([source](spaday_spectrum/example.py)).
95
+ - [Open the complete component gallery](https://1kbgz.github.io/spaday-spectrum/lite/?example=gallery) ([source](spaday_spectrum/gallery.py)).
96
+
97
+ Both run Python locally through Pyodide; no install or server is required.
98
+
99
+ ## Run examples locally
100
+
101
+ ```bash
102
+ python -m pip install -e ".[examples]"
103
+ python -m spaday_spectrum.example
104
+ python -m spaday_spectrum.gallery
105
+ ```
106
+
107
+ Open `http://127.0.0.1:8028` for the standard creative-review app or `http://127.0.0.1:8029` for the
108
+ component gallery. The standard app includes streamed assets, endpoint-backed review decisions and brief
109
+ submission, an activity feed, bound fields and switches, tabs, dismissible feedback, and shared Spectrum
110
+ color and scale state. The gallery includes every generated component in this focused package and a
111
+ highlighted Python snippet for each family.
112
+
113
+ Both pass the local package descriptor directly, so they do not install or resolve the integration from
114
+ GitHub.
115
+
116
+ > [!NOTE]
117
+ > This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
+ "printWidth": 80,
4
+ "sortPackageJson": false
5
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "env": {
4
+ "browser": true,
5
+ "es6": true,
6
+ "node": true
7
+ },
8
+ "rules": {
9
+ "unicorn/no-empty-file": "off"
10
+ }
11
+ }