@polyxd/web 0.3.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/LICENSE +202 -0
- package/NOTICE +190 -0
- package/README.md +79 -0
- package/adapters/PolyxdSurface.svelte +65 -0
- package/adapters/PolyxdSurface.vue +61 -0
- package/dist/components/action-bar.d.ts +14 -0
- package/dist/components/action-bar.js +69 -0
- package/dist/components/action-bar.js.map +1 -0
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/avatar.js +16 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/chart.d.ts +5 -0
- package/dist/components/chart.js +132 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/content.d.ts +20 -0
- package/dist/components/content.js +286 -0
- package/dist/components/content.js.map +1 -0
- package/dist/components/filter.d.ts +9 -0
- package/dist/components/filter.js +43 -0
- package/dist/components/filter.js.map +1 -0
- package/dist/components/flow.d.ts +12 -0
- package/dist/components/flow.js +188 -0
- package/dist/components/flow.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +30 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/inputs.d.ts +28 -0
- package/dist/components/inputs.js +530 -0
- package/dist/components/inputs.js.map +1 -0
- package/dist/components/marks.d.ts +32 -0
- package/dist/components/marks.js +164 -0
- package/dist/components/marks.js.map +1 -0
- package/dist/components/navigation.d.ts +11 -0
- package/dist/components/navigation.js +99 -0
- package/dist/components/navigation.js.map +1 -0
- package/dist/components/overlays.d.ts +16 -0
- package/dist/components/overlays.js +146 -0
- package/dist/components/overlays.js.map +1 -0
- package/dist/components/pickers.d.ts +6 -0
- package/dist/components/pickers.js +272 -0
- package/dist/components/pickers.js.map +1 -0
- package/dist/components/shell.d.ts +30 -0
- package/dist/components/shell.js +167 -0
- package/dist/components/shell.js.map +1 -0
- package/dist/components/split.d.ts +8 -0
- package/dist/components/split.js +76 -0
- package/dist/components/split.js.map +1 -0
- package/dist/components/structure.d.ts +12 -0
- package/dist/components/structure.js +69 -0
- package/dist/components/structure.js.map +1 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.js +142 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tree.d.ts +10 -0
- package/dist/components/tree.js +177 -0
- package/dist/components/tree.js.map +1 -0
- package/dist/dom.d.ts +25 -0
- package/dist/dom.js +211 -0
- package/dist/dom.js.map +1 -0
- package/dist/elements.d.ts +87 -0
- package/dist/elements.js +244 -0
- package/dist/elements.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives.d.ts +111 -0
- package/dist/primitives.js +361 -0
- package/dist/primitives.js.map +1 -0
- package/dist/renderer.d.ts +145 -0
- package/dist/renderer.js +244 -0
- package/dist/renderer.js.map +1 -0
- package/dist/skeleton.d.ts +14 -0
- package/dist/skeleton.js +13 -0
- package/dist/skeleton.js.map +1 -0
- package/package.json +52 -0
- package/preview/polyxd-web.css +2 -0
- package/preview/polyxd-web.js +15 -0
- package/styles.css +5012 -0
- package/themes/antd.css +300 -0
- package/themes/bootstrap.css +300 -0
- package/themes/brutalist.css +300 -0
- package/themes/carbon.css +310 -0
- package/themes/chakra.css +300 -0
- package/themes/civic.css +300 -0
- package/themes/editorial.css +300 -0
- package/themes/finance.css +300 -0
- package/themes/fluent.css +300 -0
- package/themes/glass.css +300 -0
- package/themes/govuk.css +150 -0
- package/themes/health.css +300 -0
- package/themes/mantine.css +300 -0
- package/themes/material3.css +300 -0
- package/themes/mono.css +300 -0
- package/themes/neon.css +300 -0
- package/themes/pastel.css +300 -0
- package/themes/polaris.css +300 -0
- package/themes/primer.css +300 -0
- package/themes/radix.css +300 -0
- package/themes/shadcn.css +300 -0
- package/themes/sketch.css +356 -0
- package/themes/spectrum.css +300 -0
- package/themes/terminal.css +300 -0
- package/themes/wireframe.css +328 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
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 [yyyy] [name of copyright owner]
|
|
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.
|
|
202
|
+
|
package/NOTICE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Polyxd
|
|
2
|
+
Copyright 2026 the Polyxd authors
|
|
3
|
+
|
|
4
|
+
This product includes software developed at Polyxd, licensed under the Apache
|
|
5
|
+
License, Version 2.0 (see LICENSE).
|
|
6
|
+
|
|
7
|
+
It also includes material from the projects below. Each is used under its own
|
|
8
|
+
licence, and each licence is included in full beside the material it covers.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Design-system packs
|
|
12
|
+
|
|
13
|
+
A pack reads a design system's published tokens and maps them onto Polyxd's
|
|
14
|
+
semantic token contract. The upstream token files are vendored verbatim — so a
|
|
15
|
+
pack can be regenerated and audited without a network — under that pack's
|
|
16
|
+
`scripts/sources/` directory, together with the upstream licence.
|
|
17
|
+
|
|
18
|
+
The packs are Polyxd's work, not the work of the design systems they read. The
|
|
19
|
+
names below identify whose tokens a pack reads. Polyxd is not affiliated with,
|
|
20
|
+
endorsed by, or sponsored by any of these projects or their owners, and each
|
|
21
|
+
name is the trademark of its owner.
|
|
22
|
+
|
|
23
|
+
### Ant Design (`@polyxd/ds-antd`)
|
|
24
|
+
|
|
25
|
+
Upstream: https://github.com/ant-design/ant-design
|
|
26
|
+
|
|
27
|
+
- npm:antd 6.6.4 — MIT
|
|
28
|
+
- npm:@ant-design/colors 8.0.1 — MIT
|
|
29
|
+
|
|
30
|
+
Vendored under `packages/ds-antd/scripts/sources/`, with the upstream licence file beside it.
|
|
31
|
+
|
|
32
|
+
### Bootstrap 5 (`@polyxd/ds-bootstrap`)
|
|
33
|
+
|
|
34
|
+
Upstream: https://github.com/twbs/bootstrap
|
|
35
|
+
|
|
36
|
+
- npm:bootstrap dist/css/bootstrap.css 5.3.8 — MIT
|
|
37
|
+
|
|
38
|
+
Vendored under `packages/ds-bootstrap/scripts/sources/`, with the upstream licence file beside it.
|
|
39
|
+
|
|
40
|
+
### IBM Carbon (`@polyxd/ds-carbon`)
|
|
41
|
+
|
|
42
|
+
Upstream: https://github.com/carbon-design-system/carbon
|
|
43
|
+
|
|
44
|
+
- npm:@carbon/colors 11.58.0 — Apache-2.0
|
|
45
|
+
- npm:@carbon/themes 11.81.0 — Apache-2.0
|
|
46
|
+
- npm:@carbon/layout 11.59.0 — Apache-2.0
|
|
47
|
+
- npm:@carbon/type 11.67.0 — Apache-2.0
|
|
48
|
+
- npm:@carbon/motion 11.52.0 — Apache-2.0
|
|
49
|
+
- npm:@carbon/charts scss/_color-palette.scss 1.27.20 — Apache-2.0
|
|
50
|
+
- npm:@carbon/styles scss/utilities/_box-shadow.scss and _focus-outline.scss 1.115.0 — Apache-2.0
|
|
51
|
+
|
|
52
|
+
Vendored under `packages/ds-carbon/scripts/sources/`, with the upstream licence file beside it.
|
|
53
|
+
|
|
54
|
+
### Chakra UI 3 (`@polyxd/ds-chakra`)
|
|
55
|
+
|
|
56
|
+
Upstream: https://github.com/chakra-ui/chakra-ui
|
|
57
|
+
|
|
58
|
+
- npm:@chakra-ui/react defaultSystem.getTokenCss 3.37.0 — MIT
|
|
59
|
+
|
|
60
|
+
Vendored under `packages/ds-chakra/scripts/sources/`, with the upstream licence file beside it.
|
|
61
|
+
|
|
62
|
+
### Microsoft Fluent 2 (`@polyxd/ds-fluent`)
|
|
63
|
+
|
|
64
|
+
Upstream: https://github.com/microsoft/fluentui
|
|
65
|
+
|
|
66
|
+
- npm:@fluentui/tokens 1.0.0-alpha.24 — MIT
|
|
67
|
+
|
|
68
|
+
Vendored under `packages/ds-fluent/scripts/sources/`, with the upstream licence file beside it.
|
|
69
|
+
|
|
70
|
+
### GOV.UK Frontend (`@polyxd/ds-govuk`)
|
|
71
|
+
|
|
72
|
+
Upstream: https://github.com/alphagov/govuk-frontend
|
|
73
|
+
|
|
74
|
+
- npm:govuk-frontend dist/govuk/settings 6.5.1 — MIT
|
|
75
|
+
|
|
76
|
+
Vendored under `packages/ds-govuk/scripts/sources/`, with the upstream licence file beside it.
|
|
77
|
+
|
|
78
|
+
### Mantine 8 (`@polyxd/ds-mantine`)
|
|
79
|
+
|
|
80
|
+
Upstream: https://github.com/mantinedev/mantine
|
|
81
|
+
|
|
82
|
+
- npm:@mantine/core styles.css 8.4.2 — MIT
|
|
83
|
+
|
|
84
|
+
Vendored under `packages/ds-mantine/scripts/sources/`, with the upstream licence file beside it.
|
|
85
|
+
|
|
86
|
+
### Material 3 (`@polyxd/ds-material3`)
|
|
87
|
+
|
|
88
|
+
Upstream: https://github.com/material-components/material-web
|
|
89
|
+
|
|
90
|
+
- npm:@material/material-color-utilities 0.4.0 — Apache-2.0
|
|
91
|
+
- github:material-components/material-web tokens/versions/v0_192/_md-ref-typeface.scss, _md-sys-typescale.scss, _md-sys-shape.scss, _md-sys-motion.scss, _md-sys-state.scss, _md-sys-elevation.scss v2.5.0 (commit b4de401eb665ec63474f39319a4ba8f2145974cc) — Apache-2.0
|
|
92
|
+
- github:material-components/material-web tokens/versions/v0_192/_md-comp-scrim.scss, _md-comp-filled-button.scss, _md-comp-icon-button.scss, _md-comp-outlined-text-field.scss v2.5.0 (commit b4de401eb665ec63474f39319a4ba8f2145974cc) — Apache-2.0
|
|
93
|
+
- github:material-components/material-web tokens/_md-comp-focus-ring.scss and elevation/internal/_elevation.scss v2.5.0 (commit b4de401eb665ec63474f39319a4ba8f2145974cc) — Apache-2.0
|
|
94
|
+
|
|
95
|
+
Vendored under `packages/ds-material3/scripts/sources/`, with the upstream licence file beside it.
|
|
96
|
+
|
|
97
|
+
### Shopify Polaris (`@polyxd/ds-polaris`)
|
|
98
|
+
|
|
99
|
+
Upstream: https://github.com/Shopify/polaris
|
|
100
|
+
|
|
101
|
+
- npm:@shopify/polaris-tokens dist/css/styles.css 9.4.2 — MIT
|
|
102
|
+
|
|
103
|
+
Vendored under `packages/ds-polaris/scripts/sources/`, with the upstream licence file beside it.
|
|
104
|
+
|
|
105
|
+
### GitHub Primer (`@polyxd/ds-primer`)
|
|
106
|
+
|
|
107
|
+
Upstream: https://github.com/primer/primitives
|
|
108
|
+
|
|
109
|
+
- npm:@primer/primitives dist/css 11.10.0 — MIT
|
|
110
|
+
|
|
111
|
+
Vendored under `packages/ds-primer/scripts/sources/`, with the upstream licence file beside it.
|
|
112
|
+
|
|
113
|
+
### Radix Themes 3 (`@polyxd/ds-radix`)
|
|
114
|
+
|
|
115
|
+
Upstream: https://github.com/radix-ui/themes
|
|
116
|
+
|
|
117
|
+
- npm:@radix-ui/themes styles.css 3.3.0 — MIT
|
|
118
|
+
|
|
119
|
+
Vendored under `packages/ds-radix/scripts/sources/`, with the upstream licence file beside it.
|
|
120
|
+
|
|
121
|
+
### shadcn/ui on Tailwind CSS (`@polyxd/ds-shadcn`)
|
|
122
|
+
|
|
123
|
+
Upstream: https://github.com/shadcn-ui/ui
|
|
124
|
+
|
|
125
|
+
- shadcn/ui default theme main @ 2026-09-20 — MIT
|
|
126
|
+
- npm:tailwindcss theme.css 4.3.3 — MIT
|
|
127
|
+
|
|
128
|
+
Vendored under `packages/ds-shadcn/scripts/sources/`, with the upstream licence file beside it.
|
|
129
|
+
|
|
130
|
+
### Adobe Spectrum 2 (`@polyxd/ds-spectrum`)
|
|
131
|
+
|
|
132
|
+
Upstream: https://github.com/adobe/spectrum-tokens
|
|
133
|
+
|
|
134
|
+
- npm:@adobe/spectrum-tokens dist/json/variables.json 15.4.1 — Apache-2.0
|
|
135
|
+
|
|
136
|
+
Vendored under `packages/ds-spectrum/scripts/sources/`, with the upstream licence file beside it.
|
|
137
|
+
|
|
138
|
+
## Template packs
|
|
139
|
+
|
|
140
|
+
Twelve packs are original Polyxd templates, not readings of any design system:
|
|
141
|
+
`@polyxd/ds-sketch`, `@polyxd/ds-wireframe`, `@polyxd/ds-editorial`,
|
|
142
|
+
`@polyxd/ds-brutalist`, `@polyxd/ds-glass`, `@polyxd/ds-terminal`,
|
|
143
|
+
`@polyxd/ds-pastel`, `@polyxd/ds-civic`, `@polyxd/ds-finance`,
|
|
144
|
+
`@polyxd/ds-health`, `@polyxd/ds-neon` and `@polyxd/ds-mono`. Every value in
|
|
145
|
+
them was chosen for the template, they vendor nothing, and they are Apache-2.0
|
|
146
|
+
like the rest of Polyxd. The typefaces some of them name (Caveat, Patrick Hand,
|
|
147
|
+
Fraunces, Nunito, JetBrains Mono, Space Grotesk) are under the SIL Open Font
|
|
148
|
+
License and are loaded from Google Fonts by the page that uses them, never
|
|
149
|
+
distributed here.
|
|
150
|
+
|
|
151
|
+
## Specification
|
|
152
|
+
|
|
153
|
+
### A2UI
|
|
154
|
+
|
|
155
|
+
- `packages/a2ui/vendor/a2ui/v1_0-04e6f07/` — Apache-2.0
|
|
156
|
+
|
|
157
|
+
Vendored at a pinned commit so the component catalogue can be checked against
|
|
158
|
+
A2UI's schema without a network.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## Dependencies
|
|
162
|
+
|
|
163
|
+
Everything Polyxd depends on at runtime or to build is fetched from npm rather
|
|
164
|
+
than vendored, so the licences below are recorded rather than reproduced.
|
|
165
|
+
|
|
166
|
+
Apache-2.0: playwright
|
|
167
|
+
MIT: react, react-dom, radix-ui, ajv, ajv-formats, vite, @vitejs/plugin-react,
|
|
168
|
+
marked, lenis, @types/react, @types/react-dom
|
|
169
|
+
MIT OR Apache-2.0: wrangler, @cloudflare/workers-types
|
|
170
|
+
|
|
171
|
+
Two need a word.
|
|
172
|
+
|
|
173
|
+
**axe-core** (Mozilla Public License 2.0) runs inside the verifier's rendered
|
|
174
|
+
audit. MPL-2.0 is file-level copyleft: it attaches to modified MPL files, and
|
|
175
|
+
axe-core is used unmodified, as a library. No Polyxd file is covered by it.
|
|
176
|
+
|
|
177
|
+
**GSAP** (https://gsap.com/standard-license) drives the motion on polyxd.com
|
|
178
|
+
only, and is not an OSI-approved licence. It is not used by the spec, the
|
|
179
|
+
renderer, the packs or the verifier, none of which it can reach; and no GSAP
|
|
180
|
+
file is committed to this repository — the site's build copies them out of
|
|
181
|
+
node_modules into its own output. Anyone building the site is therefore subject
|
|
182
|
+
to GSAP's licence, and anyone using the rest of Polyxd is not.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## Fonts
|
|
186
|
+
|
|
187
|
+
No font files are distributed. polyxd.com loads its typefaces from Google Fonts
|
|
188
|
+
at request time, and a design-system pack names the typeface its system
|
|
189
|
+
specifies without shipping it — a pack that asks for Adobe Clean, for example,
|
|
190
|
+
names an open metric-compatible fallback for anyone who does not have it.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @polyxd/web
|
|
2
|
+
|
|
3
|
+
Renders Polyxd UI documents as Web Components: `<polyxd-surface>` and `<polyxd-frame>`. No framework, no shadow DOM, no dependencies beyond `@polyxd/core`. The DOM, the `pxd-*` classes and the ARIA are the same as `@polyxd/react`'s, so the same stylesheet, the same themes, the verifier's checks and the agent tasks apply unchanged; the conformance suite in `@polyxd/verifier` holds the two renderers to each other.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<link rel="stylesheet" href="node_modules/@polyxd/web/styles.css" />
|
|
7
|
+
<link rel="stylesheet" href="node_modules/@polyxd/web/themes/material3.css" />
|
|
8
|
+
|
|
9
|
+
<polyxd-surface id="send" theme="material3" mode="light"></polyxd-surface>
|
|
10
|
+
|
|
11
|
+
<script type="module">
|
|
12
|
+
import { defineElements } from "@polyxd/web";
|
|
13
|
+
defineElements();
|
|
14
|
+
|
|
15
|
+
const el = document.getElementById("send");
|
|
16
|
+
el.document = doc; // a Polyxd UI document (validated with @polyxd/spec)
|
|
17
|
+
el.data = { quote }; // data comes from the host, never from the model
|
|
18
|
+
el.resolveMedia = (ref) => imageUrls[ref];
|
|
19
|
+
el.addEventListener("polyxd-action", (e) => handlers[e.detail.name]?.(e.detail.context));
|
|
20
|
+
el.addEventListener("polyxd-dismiss", () => close());
|
|
21
|
+
</script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Without a bundler, `preview/polyxd-web.js` and `preview/polyxd-web.css` are a self-contained build (the renderer, the validator that runs in browsers, and every theme) that defines the elements and puts `window.PolyxdWeb` on the page.
|
|
25
|
+
|
|
26
|
+
## `<polyxd-surface>`
|
|
27
|
+
|
|
28
|
+
| Property | Attribute | What it does |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `document` | | The UI document to render. A new document remounts. |
|
|
31
|
+
| `data` | | Host data the document binds to. Defaults to `document.data`. The surface keeps its own copy as inputs change it; `surfaceData` reads that copy. |
|
|
32
|
+
| `theme` | `theme` | Design-system pack name, matching a loaded theme CSS file. |
|
|
33
|
+
| `mode` | `mode` | `"light"` or `"dark"`. |
|
|
34
|
+
| `density` | `density` | `"compact"`, `"comfortable"` or `"spacious"`. |
|
|
35
|
+
| `locale` | `locale` | For number, currency and date formatting. Default `"en-GB"`. |
|
|
36
|
+
| `disclosure` | `disclosure` | `"show-everything"` opens every Disclosure by default. |
|
|
37
|
+
| `resolveMedia` | | `(ref) => url`: turns a media reference from host data into a URL. |
|
|
38
|
+
| `derive` | | `(data) => data`: derived data after each input change (a receipt, a total), pure. |
|
|
39
|
+
| `components` | | Renderer overrides by component name (`(node, ctx) => element`), and the host's own components a `Custom` names by a namespaced key (`"brand.logo"`: `(props) => element`). |
|
|
40
|
+
| `onAction`, `onDataChange`, `onDismiss` | | Callback properties, called before the events below. |
|
|
41
|
+
|
|
42
|
+
Events, all bubbling and composed: `polyxd-action` (`detail` is the `ActionEvent`: `{ name, context, source }`), `polyxd-datachange` (`detail` is the new data) and `polyxd-dismiss`. The renderer handles `ui.back` and `ui.next` inside `Steps`, and `ui.copy`; every other action name reaches the host.
|
|
43
|
+
|
|
44
|
+
## `<polyxd-frame>`
|
|
45
|
+
|
|
46
|
+
Renders a shell document (a `Frame` with an `Outlet`) around the host's current screen. The same properties, plus:
|
|
47
|
+
|
|
48
|
+
| Property | What it does |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `current` | `{ key, title }`: which navigation item is current; the title shows in the AppBar on compact layouts and becomes the document title. |
|
|
51
|
+
| `loading` | A screen is on its way: the Outlet shows a skeleton. |
|
|
52
|
+
| `outlet` | The element to show in the Outlet. The element's own light-DOM children at connection time are used when `outlet` is not set. |
|
|
53
|
+
|
|
54
|
+
A shell adopts each new `data` object the host passes, so a badge count changes when the host's store does.
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<polyxd-frame id="shell" theme="polaris">
|
|
58
|
+
<h1 class="pxd-surface-title">Orders</h1>
|
|
59
|
+
<!-- the current screen, or a <polyxd-surface> for a generated one -->
|
|
60
|
+
</polyxd-frame>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## `mount(el, props)`
|
|
64
|
+
|
|
65
|
+
For hosts whose DOM is owned by something else, `mount(element, { document, data, theme, onAction, … })` renders without the custom elements and returns `{ update(props), unmount(), data }`. `props` are the surface's properties above as one object, plus `outlet`, `current` and `loading` for a shell.
|
|
66
|
+
|
|
67
|
+
## Vue and Svelte
|
|
68
|
+
|
|
69
|
+
Thin wrappers to copy into a project, in `adapters/`: [`PolyxdSurface.vue`](./adapters/PolyxdSurface.vue) (Vue 3, `<script setup>`) and [`PolyxdSurface.svelte`](./adapters/PolyxdSurface.svelte) (Svelte 5 runes). Each takes the same props, forwards the element's events as `action`, `datachange` and `dismiss`, and stays a few dozen lines because the element does the work. They are documented, not published as packages.
|
|
70
|
+
|
|
71
|
+
## What the renderer decides (not the model)
|
|
72
|
+
|
|
73
|
+
The same rules as `@polyxd/react`, from `@polyxd/core`: which control a `Choice` becomes, when a `Table` stacks into rows, where a `Frame` puts its navigation at each width, what an action dispatches. Overlays are native `<dialog>` elements shown modally (focus trap, Escape, focus return) with the surface's scrim; menus, comboboxes, tabs, radios, checkboxes, switches and sliders are written for the DOM with the roles, names and keyboard handling Radix gives the React renderer.
|
|
74
|
+
|
|
75
|
+
## Tests
|
|
76
|
+
|
|
77
|
+
`demo/index.html` mounts the money-send form and the shell for a look in a browser: serve the `packages/` folder and open `web/demo/`.
|
|
78
|
+
|
|
79
|
+
`npm test -w @polyxd/web` renders every spec example through a small DOM in Node and checks the same things the React tests do. The real check is `npm run conformance -w @polyxd/verifier`: both renderers, every document, 13 packs, light and dark, phone and desktop, same fingerprint, same findings, same agent results.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A Svelte 5 wrapper around <polyxd-surface>. Copy this file into your project; the element does
|
|
4
|
+
* the work, so the wrapper only forwards props and events. Import the stylesheet and a theme once:
|
|
5
|
+
* import "@polyxd/web/styles.css"; import "@polyxd/web/themes/material3.css";
|
|
6
|
+
*/
|
|
7
|
+
import { defineElements, type PolyxdSurfaceElement } from "@polyxd/web";
|
|
8
|
+
import type { ActionEvent, Data, UIDocument } from "@polyxd/core";
|
|
9
|
+
|
|
10
|
+
defineElements();
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
document,
|
|
14
|
+
data,
|
|
15
|
+
theme,
|
|
16
|
+
mode,
|
|
17
|
+
density,
|
|
18
|
+
locale,
|
|
19
|
+
disclosure,
|
|
20
|
+
resolveMedia,
|
|
21
|
+
derive,
|
|
22
|
+
components,
|
|
23
|
+
onaction,
|
|
24
|
+
ondatachange,
|
|
25
|
+
ondismiss,
|
|
26
|
+
}: {
|
|
27
|
+
document: UIDocument;
|
|
28
|
+
data?: Data;
|
|
29
|
+
theme?: string;
|
|
30
|
+
mode?: "light" | "dark";
|
|
31
|
+
density?: "compact" | "comfortable" | "spacious";
|
|
32
|
+
locale?: string;
|
|
33
|
+
disclosure?: "progressive" | "show-everything";
|
|
34
|
+
resolveMedia?: (ref: string) => string | undefined;
|
|
35
|
+
derive?: (data: Data) => Data | void;
|
|
36
|
+
components?: PolyxdSurfaceElement["components"];
|
|
37
|
+
onaction?: (event: ActionEvent) => void;
|
|
38
|
+
ondatachange?: (data: Data) => void;
|
|
39
|
+
ondismiss?: () => void;
|
|
40
|
+
} = $props();
|
|
41
|
+
|
|
42
|
+
let el: PolyxdSurfaceElement | undefined = $state();
|
|
43
|
+
|
|
44
|
+
// Object-valued props go through properties; the string ones are attributes in the markup below.
|
|
45
|
+
$effect(() => {
|
|
46
|
+
if (!el) return;
|
|
47
|
+
el.document = document;
|
|
48
|
+
el.data = data;
|
|
49
|
+
el.resolveMedia = resolveMedia;
|
|
50
|
+
el.derive = derive;
|
|
51
|
+
el.components = components;
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<polyxd-surface
|
|
56
|
+
bind:this={el}
|
|
57
|
+
{theme}
|
|
58
|
+
{mode}
|
|
59
|
+
{density}
|
|
60
|
+
{locale}
|
|
61
|
+
{disclosure}
|
|
62
|
+
onpolyxd-action={(e: CustomEvent<ActionEvent>) => onaction?.(e.detail)}
|
|
63
|
+
onpolyxd-datachange={(e: CustomEvent<Data>) => ondatachange?.(e.detail)}
|
|
64
|
+
onpolyxd-dismiss={() => ondismiss?.()}
|
|
65
|
+
></polyxd-surface>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A Vue 3 wrapper around <polyxd-surface>. Copy this file into your project; the element does the
|
|
4
|
+
* work, so the wrapper only forwards props and events. Import the stylesheet and a theme once:
|
|
5
|
+
* import "@polyxd/web/styles.css"; import "@polyxd/web/themes/material3.css";
|
|
6
|
+
*
|
|
7
|
+
* Tell Vue the tag is a custom element (vite.config: vue({ template: { compilerOptions:
|
|
8
|
+
* { isCustomElement: (tag) => tag.startsWith("polyxd-") } } })).
|
|
9
|
+
*/
|
|
10
|
+
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
11
|
+
import { defineElements, type PolyxdSurfaceElement } from "@polyxd/web";
|
|
12
|
+
import type { ActionEvent, Data, UIDocument } from "@polyxd/core";
|
|
13
|
+
|
|
14
|
+
defineElements();
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
document: UIDocument;
|
|
18
|
+
data?: Data;
|
|
19
|
+
theme?: string;
|
|
20
|
+
mode?: "light" | "dark";
|
|
21
|
+
density?: "compact" | "comfortable" | "spacious";
|
|
22
|
+
locale?: string;
|
|
23
|
+
disclosure?: "progressive" | "show-everything";
|
|
24
|
+
resolveMedia?: (ref: string) => string | undefined;
|
|
25
|
+
derive?: (data: Data) => Data | void;
|
|
26
|
+
components?: PolyxdSurfaceElement["components"];
|
|
27
|
+
}>();
|
|
28
|
+
const emit = defineEmits<{ action: [event: ActionEvent]; datachange: [data: Data]; dismiss: [] }>();
|
|
29
|
+
|
|
30
|
+
const el = ref<PolyxdSurfaceElement | null>(null);
|
|
31
|
+
const onAction = (e: Event) => emit("action", (e as CustomEvent<ActionEvent>).detail);
|
|
32
|
+
const onDataChange = (e: Event) => emit("datachange", (e as CustomEvent<Data>).detail);
|
|
33
|
+
const onDismiss = () => emit("dismiss");
|
|
34
|
+
|
|
35
|
+
const apply = () => {
|
|
36
|
+
const s = el.value;
|
|
37
|
+
if (!s) return;
|
|
38
|
+
s.document = props.document;
|
|
39
|
+
s.data = props.data;
|
|
40
|
+
s.resolveMedia = props.resolveMedia;
|
|
41
|
+
s.derive = props.derive;
|
|
42
|
+
s.components = props.components;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
onMounted(() => {
|
|
46
|
+
apply();
|
|
47
|
+
el.value?.addEventListener("polyxd-action", onAction);
|
|
48
|
+
el.value?.addEventListener("polyxd-datachange", onDataChange);
|
|
49
|
+
el.value?.addEventListener("polyxd-dismiss", onDismiss);
|
|
50
|
+
});
|
|
51
|
+
watch(() => [props.document, props.data, props.resolveMedia, props.derive, props.components], apply);
|
|
52
|
+
onBeforeUnmount(() => {
|
|
53
|
+
el.value?.removeEventListener("polyxd-action", onAction);
|
|
54
|
+
el.value?.removeEventListener("polyxd-datachange", onDataChange);
|
|
55
|
+
el.value?.removeEventListener("polyxd-dismiss", onDismiss);
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<polyxd-surface ref="el" :theme="theme" :mode="mode" :density="density" :locale="locale" :disclosure="disclosure" />
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Node } from "@polyxd/core";
|
|
2
|
+
import { type VNode } from "../dom.ts";
|
|
3
|
+
import type { Ctx } from "../renderer.ts";
|
|
4
|
+
import { type MenuItemSpec } from "../primitives.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Children are in order of importance; CSS places the primary where each layout expects it.
|
|
7
|
+
* In the wide (row) layout, actions that would wrap onto a second line fold into a "More actions"
|
|
8
|
+
* menu, least important first (core's rule). Widths are measured from buttons as they are drawn
|
|
9
|
+
* and remembered, so a folded action is never rendered twice and folding never changes what is
|
|
10
|
+
* measured.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ActionBar(node: Node, ctx: Ctx): VNode;
|
|
13
|
+
/** Actions as menu items, the same way ActionMenu draws them: danger last, after a divider. */
|
|
14
|
+
export declare function actionItems(ctx: Ctx, ids: string[]): (MenuItemSpec | "separator")[];
|