@cyclone-ui/theme-builder 0.0.0-stage → 0.0.4
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/CHANGELOG.md +15 -0
- package/LICENSE +187 -0
- package/README.md +305 -2
- package/dist/generate.cjs +1 -0
- package/dist/generate.d.cts +5 -0
- package/dist/generate.d.cts.map +1 -0
- package/dist/generate.d.mts +6 -0
- package/dist/generate.d.mts.map +1 -0
- package/dist/generate.mjs +2 -0
- package/dist/generate.mjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +1 -0
- package/dist/preprocessor.cjs +1 -0
- package/dist/preprocessor.d.cts +4 -0
- package/dist/preprocessor.d.cts.map +1 -0
- package/dist/preprocessor.d.mts +5 -0
- package/dist/preprocessor.d.mts.map +1 -0
- package/dist/preprocessor.mjs +2 -0
- package/dist/preprocessor.mjs.map +1 -0
- package/package.json +70 -3
- package/powerlines.config.ts +28 -0
- package/project.json +8 -0
- package/src/generate.ts +66 -0
- package/src/index.ts +22 -0
- package/src/preprocessor.ts +1524 -0
- package/test/preprocessor.spec.ts +518 -0
- package/test/shiki-theme-mapping.spec.ts +160 -0
- package/test/storybook-theme-mapping.spec.ts +118 -0
- package/tsconfig.json +13 -0
- package/tsconfig.spec.json +16 -0
- package/vitest.config.mts +24 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Changelog for Cyclone UI - Theme Builder
|
|
4
|
+
|
|
5
|
+
## [0.0.4](https://github.com/storm-software/cyclone-ui/releases/tag/theme-builder%400.0.4) (10/12/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Clean up component display issues ([aec421b0](https://github.com/storm-software/cyclone-ui/commit/aec421b0))
|
|
10
|
+
|
|
11
|
+
## [0.0.2](https://github.com/storm-software/cyclone-ui/releases/tag/theme-builder%400.0.2) (10/11/2026)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **cli:** Added a `create-tokens` command ([0c2dde08](https://github.com/storm-software/cyclone-ui/commit/0c2dde08))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
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, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
13
|
+
copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
16
|
+
entities that control, are controlled by, or are under common control with
|
|
17
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
18
|
+
power, direct or indirect, to cause the direction or management of such
|
|
19
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
20
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
|
|
21
|
+
such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
24
|
+
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 source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
31
|
+
translation of a Source form, including but not limited to compiled object
|
|
32
|
+
code, generated documentation, and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
35
|
+
made available under the License, as indicated by a copyright notice that is
|
|
36
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
37
|
+
below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object form,
|
|
40
|
+
that is based on (or derived from) the Work and for which the editorial
|
|
41
|
+
revisions, annotations, elaborations, or other modifications represent, as a
|
|
42
|
+
whole, an original work of authorship. For the purposes of this License,
|
|
43
|
+
Derivative Works shall not include works that remain separable from, or
|
|
44
|
+
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
|
45
|
+
Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
48
|
+
version of the Work and any modifications or additions to that Work or
|
|
49
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
50
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
51
|
+
Entity authorized to submit on behalf of the copyright owner. For the
|
|
52
|
+
purposes of this definition, "submitted" means any form of electronic,
|
|
53
|
+
verbal, or written communication sent to the Licensor or its representatives,
|
|
54
|
+
including but not limited to communication on electronic mailing lists,
|
|
55
|
+
source code control systems, and issue tracking systems that are managed by,
|
|
56
|
+
or on behalf of, the Licensor for the purpose of discussing and improving the
|
|
57
|
+
Work, but excluding communication that is conspicuously marked or otherwise
|
|
58
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
59
|
+
|
|
60
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
61
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
62
|
+
incorporated within the Work.
|
|
63
|
+
|
|
64
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
65
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
66
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
67
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
68
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
69
|
+
Object form.
|
|
70
|
+
|
|
71
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
72
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
73
|
+
no-charge, royalty-free, irrevocable (except as stated in this section)
|
|
74
|
+
patent license to make, have made, use, offer to sell, sell, import, and
|
|
75
|
+
otherwise transfer the Work, where such license applies only to those patent
|
|
76
|
+
claims licensable by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by combination of their Contribution(s) with the
|
|
78
|
+
Work to which such Contribution(s) was submitted. If You institute patent
|
|
79
|
+
litigation against any entity (including a cross-claim or counterclaim in a
|
|
80
|
+
lawsuit) alleging that the Work or a Contribution incorporated within the
|
|
81
|
+
Work constitutes direct or contributory patent infringement, then any patent
|
|
82
|
+
licenses granted to You under this License for that Work shall terminate as
|
|
83
|
+
of the date such litigation is filed.
|
|
84
|
+
|
|
85
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
86
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
87
|
+
Source or Object form, provided that You meet the following conditions:
|
|
88
|
+
|
|
89
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy
|
|
90
|
+
of this License; and
|
|
91
|
+
|
|
92
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
93
|
+
You changed the files; and
|
|
94
|
+
|
|
95
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
96
|
+
distribute, all copyright, patent, trademark, and attribution notices from
|
|
97
|
+
the Source form of the Work, excluding those notices that do not pertain to
|
|
98
|
+
any part of the Derivative Works; and
|
|
99
|
+
|
|
100
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
|
101
|
+
then any Derivative Works that You distribute must include a readable copy of
|
|
102
|
+
the attribution notices contained within such NOTICE file, excluding those
|
|
103
|
+
notices that do not pertain to any part of the Derivative Works, in at least
|
|
104
|
+
one of the following places: within a NOTICE text file distributed as part of
|
|
105
|
+
the Derivative Works; within the Source form or documentation, if provided
|
|
106
|
+
along with the Derivative Works; or, within a display generated by the
|
|
107
|
+
Derivative Works, if and wherever such third-party notices normally appear.
|
|
108
|
+
The contents of the NOTICE file are for informational purposes only and do
|
|
109
|
+
not modify the License. You may add Your own attribution notices within
|
|
110
|
+
Derivative Works that You distribute, alongside or as an addendum to the
|
|
111
|
+
NOTICE text from the Work, provided that such additional attribution notices
|
|
112
|
+
cannot be construed as modifying the License.
|
|
113
|
+
|
|
114
|
+
You may add Your own copyright statement to Your modifications and may
|
|
115
|
+
provide additional or different license terms and conditions for use,
|
|
116
|
+
reproduction, or distribution of Your modifications, or for any such
|
|
117
|
+
Derivative Works as a whole, provided Your use, reproduction, and
|
|
118
|
+
distribution of the Work otherwise complies with the conditions stated in
|
|
119
|
+
this License.
|
|
120
|
+
|
|
121
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
122
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
123
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
124
|
+
additional terms or conditions. Notwithstanding the above, nothing herein
|
|
125
|
+
shall supersede or modify the terms of any separate license agreement you may
|
|
126
|
+
have executed with Licensor regarding such Contributions.
|
|
127
|
+
|
|
128
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
129
|
+
trademarks, service marks, or product names of the Licensor, except as
|
|
130
|
+
required for reasonable and customary use in describing the origin of the
|
|
131
|
+
Work and reproducing the content of the NOTICE file.
|
|
132
|
+
|
|
133
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
134
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
135
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
136
|
+
KIND, either express or implied, including, without limitation, any
|
|
137
|
+
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
|
|
138
|
+
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
|
|
139
|
+
the appropriateness of using or redistributing the Work and assume any risks
|
|
140
|
+
associated with Your exercise of permissions under this License.
|
|
141
|
+
|
|
142
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
143
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
144
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to
|
|
145
|
+
in writing, shall any Contributor be liable to You for damages, including any
|
|
146
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
147
|
+
character arising as a result of this License or out of the use or inability
|
|
148
|
+
to use the Work (including but not limited to damages for loss of goodwill,
|
|
149
|
+
work stoppage, computer failure or malfunction, or any and all other
|
|
150
|
+
commercial damages or losses), even if such Contributor has been advised of
|
|
151
|
+
the possibility of such damages.
|
|
152
|
+
|
|
153
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
154
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
155
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
156
|
+
and/or rights consistent with this License. However, in accepting such
|
|
157
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
158
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
159
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
160
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
161
|
+
accepting any such warranty or additional liability.
|
|
162
|
+
|
|
163
|
+
END OF TERMS AND CONDITIONS
|
|
164
|
+
|
|
165
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
166
|
+
|
|
167
|
+
To apply the Apache License to your work, attach the following
|
|
168
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
169
|
+
replaced with your own identifying information. (Don't include
|
|
170
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
171
|
+
comment syntax for the file format. We also recommend that a
|
|
172
|
+
file or class name and description of purpose be included on the
|
|
173
|
+
same "printed page" as the copyright notice for easier
|
|
174
|
+
identification within third-party archives.
|
|
175
|
+
|
|
176
|
+
Copyright [yyyy] [name of copyright owner]
|
|
177
|
+
|
|
178
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
179
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
180
|
+
License at
|
|
181
|
+
|
|
182
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
183
|
+
|
|
184
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
185
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
186
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
187
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,306 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- START header -->
|
|
2
|
+
<!-- prettier-ignore-start -->
|
|
3
|
+
<!-- markdownlint-disable -->
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
|
|
6
|
+
<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/storm-banner.gif" width="100%" alt="Storm Software" /></div>
|
|
7
|
+
<br />
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<b>
|
|
11
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> •
|
|
12
|
+
<a href="https://github.com/storm-software/cyclone-ui" target="_blank">GitHub</a> •
|
|
13
|
+
<a href="https://discord.gg/MQ6YVzakM5">Discord</a> • <a href="https://docs.stormsoftware.com/cyclone-ui" target="_blank">Docs</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> •
|
|
14
|
+
<a href="https://github.com/storm-software/cyclone-ui/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a>
|
|
15
|
+
</b>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<br />
|
|
19
|
+
This package is part of the <b>🌀 Cyclone UI</b> monorepo. The repository contains <a href="https://tamagui.dev" target="_blank">Tamagui</a> based design components used by Storm Software. Like <a href="https://ui.shadcn.com" target="_blank">Shadcn UI</a>, the components are copied into other repositories via the Cyclone CLI.
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
### 💻 Visit [stormsoftware.com](https://stormsoftware.com) to stay up to date with this developer<br />
|
|
23
|
+
|
|
24
|
+
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://docusaurus.io/) 
|
|
25
|
+
|
|
26
|
+
<!-- prettier-ignore-start -->
|
|
27
|
+
<!-- markdownlint-disable -->
|
|
28
|
+
|
|
29
|
+
> [!IMPORTANT]
|
|
30
|
+
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
31
|
+
|
|
32
|
+
<!-- markdownlint-restore -->
|
|
33
|
+
<!-- prettier-ignore-end -->
|
|
34
|
+
|
|
35
|
+
<br />
|
|
36
|
+
|
|
37
|
+
<!-- markdownlint-restore -->
|
|
38
|
+
<!-- prettier-ignore-end -->
|
|
39
|
+
|
|
40
|
+
<!-- END header -->
|
|
41
|
+
|
|
42
|
+
# Cyclone UI - Theme Builder
|
|
43
|
+
|
|
44
|
+
A package containing the theme building utilities and shared code used by the Cyclone UI project
|
|
45
|
+
|
|
46
|
+
<!-- START doctoc -->
|
|
47
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
48
|
+
|
|
49
|
+
## Table of Contents
|
|
50
|
+
|
|
51
|
+
- [Cyclone UI - Theme Builder](#cyclone-ui---theme-builder)
|
|
52
|
+
- [Table of Contents](#table-of-contents)
|
|
53
|
+
- [Installing](#installing)
|
|
54
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
55
|
+
- [Development](#development)
|
|
56
|
+
- [Building](#building)
|
|
57
|
+
- [Running unit tests](#running-unit-tests)
|
|
58
|
+
- [Linting](#linting)
|
|
59
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
60
|
+
- [Roadmap](#roadmap)
|
|
61
|
+
- [Support](#support)
|
|
62
|
+
- [License](#license)
|
|
63
|
+
- [Documentation](#documentation)
|
|
64
|
+
- [Changelog](#changelog)
|
|
65
|
+
- [Contributing](#contributing)
|
|
66
|
+
- [Contributors](#contributors)
|
|
67
|
+
- [💻 Visit stormsoftware.com to stay up to date with this developer](#-visit-stormsoftwarecom-to-stay-up-to-date-with-this-developer-1)
|
|
68
|
+
|
|
69
|
+
<!-- END doctoc -->
|
|
70
|
+
|
|
71
|
+
## Installing
|
|
72
|
+
|
|
73
|
+
Using [pnpm](http://pnpm.io):
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm add -D @cyclone-ui/theme-builder
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary>Using npm</summary>
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install -D @cyclone-ui/theme-builder
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
</details>
|
|
87
|
+
|
|
88
|
+
<details>
|
|
89
|
+
<summary>Using yarn</summary>
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
yarn add -D @cyclone-ui/theme-builder
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</details>
|
|
96
|
+
|
|
97
|
+
## Reduced Package Size
|
|
98
|
+
|
|
99
|
+
This project uses [tsup](https://tsup.egoist.dev/) to package the source code
|
|
100
|
+
due to its ability to remove unused code and ship smaller javascript files
|
|
101
|
+
thanks to code splitting. This helps to greatly reduce the size of the package
|
|
102
|
+
and to make it easier to use in other projects.
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
This project is built using [Nx](https://nx.dev). As a result, many of the usual
|
|
107
|
+
commands are available to assist in development.
|
|
108
|
+
|
|
109
|
+
### Building
|
|
110
|
+
|
|
111
|
+
Run `nx build theme-builder` to build the library.
|
|
112
|
+
|
|
113
|
+
### Running unit tests
|
|
114
|
+
|
|
115
|
+
Run `nx test theme-builder` to execute the unit tests via
|
|
116
|
+
[Vitest](https://vitest.dev).
|
|
117
|
+
|
|
118
|
+
### Linting
|
|
119
|
+
|
|
120
|
+
Run `nx lint theme-builder` to run [ESLint](https://eslint.org/) on the package.
|
|
121
|
+
|
|
122
|
+
<!-- START footer -->
|
|
123
|
+
<!-- prettier-ignore-start -->
|
|
124
|
+
<!-- markdownlint-disable -->
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## Storm Workspaces
|
|
128
|
+
|
|
129
|
+
Storm workspaces are built using
|
|
130
|
+
<a href="https://nx.dev/" target="_blank">Nx</a>, a set of extensible dev tools
|
|
131
|
+
for monorepos, which helps you develop like Google, Facebook, and Microsoft.
|
|
132
|
+
Building on top of Nx, the Open System provides a set of tools and patterns that
|
|
133
|
+
help you scale your monorepo to many teams while keeping the codebase
|
|
134
|
+
maintainable.
|
|
135
|
+
|
|
136
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
137
|
+
<br />
|
|
138
|
+
|
|
139
|
+
## Roadmap
|
|
140
|
+
|
|
141
|
+
See the [open issues](https://github.com/storm-software/cyclone-ui/issues) for a
|
|
142
|
+
list of proposed features (and known issues).
|
|
143
|
+
|
|
144
|
+
- [Top Feature Requests](https://github.com/storm-software/cyclone-ui/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc)
|
|
145
|
+
(Add your votes using the 👍 reaction)
|
|
146
|
+
- [Top Bugs](https://github.com/storm-software/cyclone-ui/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc)
|
|
147
|
+
(Add your votes using the 👍 reaction)
|
|
148
|
+
- [Newest Bugs](https://github.com/storm-software/cyclone-ui/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
|
|
149
|
+
|
|
150
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
151
|
+
<br />
|
|
152
|
+
|
|
153
|
+
## Support
|
|
154
|
+
|
|
155
|
+
Reach out to the maintainer at one of the following places:
|
|
156
|
+
|
|
157
|
+
- [Contact](https://stormsoftware.com/contact)
|
|
158
|
+
- [GitHub discussions](https://github.com/storm-software/cyclone-ui/discussions)
|
|
159
|
+
- <support@stormsoftware.com>
|
|
160
|
+
|
|
161
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
162
|
+
<br />
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
This project is licensed under the **Apache License, Version 2.0**. Feel free to
|
|
167
|
+
edit and distribute this template as you like.
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
Copyright (C) 2023 - 2024 Storm Software
|
|
171
|
+
|
|
172
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
173
|
+
you may not use this file except in compliance with the License.
|
|
174
|
+
You may obtain a copy of the License at
|
|
175
|
+
|
|
176
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
177
|
+
|
|
178
|
+
Unless required by applicable law or agreed to in writing, software
|
|
179
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
180
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
181
|
+
See the License for the specific language governing permissions and
|
|
182
|
+
limitations under the License.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
See [LICENSE](LICENSE) for more information.
|
|
186
|
+
|
|
187
|
+
### Documentation
|
|
188
|
+
|
|
189
|
+
All documentation is licensed under the
|
|
190
|
+
[Creative Commons](http://creativecommons.org/licenses/by/4.0/) (attribute)
|
|
191
|
+
license.
|
|
192
|
+
|
|
193
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
194
|
+
<br />
|
|
195
|
+
|
|
196
|
+
## Changelog
|
|
197
|
+
|
|
198
|
+
This project adheres to
|
|
199
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). Every release, along
|
|
200
|
+
with the migration instructions, is documented in the [CHANGELOG](CHANGELOG.md)
|
|
201
|
+
file
|
|
202
|
+
|
|
203
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
204
|
+
<br />
|
|
205
|
+
|
|
206
|
+
## Contributing
|
|
207
|
+
|
|
208
|
+
First off, thanks for taking the time to contribute! Contributions are what
|
|
209
|
+
makes the open-source community such an amazing place to learn, inspire, and
|
|
210
|
+
create. Any contributions you make will benefit everybody else and are **greatly
|
|
211
|
+
appreciated**.
|
|
212
|
+
|
|
213
|
+
Please try to create bug reports that are:
|
|
214
|
+
|
|
215
|
+
- _Reproducible._ Include steps to reproduce the problem.
|
|
216
|
+
- _Specific._ Include as much detail as possible: which version, what
|
|
217
|
+
environment, etc.
|
|
218
|
+
- _Unique._ Do not duplicate existing opened issues.
|
|
219
|
+
- _Scoped to a Single Bug._ One bug per report.
|
|
220
|
+
|
|
221
|
+
Please adhere to this project's [code of conduct](.github/CODE_OF_CONDUCT.md).
|
|
222
|
+
|
|
223
|
+
You can use
|
|
224
|
+
[markdownlint-cli](https://github.com/storm-software/cyclone-ui/markdownlint-cli)
|
|
225
|
+
to check for common markdown style inconsistency.
|
|
226
|
+
|
|
227
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
228
|
+
<br />
|
|
229
|
+
|
|
230
|
+
## Contributors
|
|
231
|
+
|
|
232
|
+
Thanks goes to these wonderful people
|
|
233
|
+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
234
|
+
|
|
235
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
236
|
+
|
|
237
|
+
<table>
|
|
238
|
+
<tbody>
|
|
239
|
+
<tr>
|
|
240
|
+
<td align="center" valign="top" width="14.28%"><a href="https://patsullivan.org"><img src="https://avatars.githubusercontent.com/u/99053093?v=4?s=100" width="100px;" alt="Patrick Sullivan"/><br /><sub><b>Patrick Sullivan</b></sub></a><br /><a href="#design-sullivanpj" title="Design">🎨</a> <a href="https://github.com/storm-software/cyclone-ui/commits?author=sullivanpj" title="Code">💻</a> <a href="#tool-sullivanpj" title="Tools">🔧</a> <a href="https://github.com/storm-software/cyclone-ui/commits?author=sullivanpj" title="Documentation">📖</a> <a href="https://github.com/storm-software/cyclone-ui/commits?author=sullivanpj" title="Tests">⚠️</a></td>
|
|
241
|
+
<td align="center" valign="top" width="14.28%"><a href="https://tylerbenning.com/"><img src="https://avatars.githubusercontent.com/u/7265547?v=4?s=100" width="100px;" alt="Tyler Benning"/><br /><sub><b>Tyler Benning</b></sub></a><br /><a href="#design-tbenning" title="Design">🎨</a></td>
|
|
242
|
+
<td align="center" valign="top" width="14.28%"><a href="http://stormsoftware.com"><img src="https://avatars.githubusercontent.com/u/149802440?v=4?s=100" width="100px;" alt="Stormie"/><br /><sub><b>Stormie</b></sub></a><br /><a href="#maintenance-stormie-bot" title="Maintenance">🚧</a></td>
|
|
243
|
+
</tr>
|
|
244
|
+
</tbody>
|
|
245
|
+
<tfoot>
|
|
246
|
+
<tr>
|
|
247
|
+
<td align="center" size="13px" colspan="7">
|
|
248
|
+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg" alt="All Contributors">
|
|
249
|
+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
|
|
250
|
+
</img>
|
|
251
|
+
</td>
|
|
252
|
+
</tr>
|
|
253
|
+
</tfoot>
|
|
254
|
+
</table>
|
|
255
|
+
|
|
256
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
257
|
+
|
|
258
|
+
This project follows the
|
|
259
|
+
[all-contributors](https://github.com/all-contributors/all-contributors)
|
|
260
|
+
specification. Contributions of any kind welcome!
|
|
261
|
+
|
|
262
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
263
|
+
<br />
|
|
264
|
+
|
|
265
|
+
<hr />
|
|
266
|
+
<br />
|
|
267
|
+
|
|
268
|
+
<div align="center">
|
|
269
|
+
<img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-banner.png" width="100%" alt="Storm Software" />
|
|
270
|
+
</div>
|
|
271
|
+
<br />
|
|
272
|
+
|
|
273
|
+
<div align="center">
|
|
274
|
+
<b>
|
|
275
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> • <a href="https://discord.gg/MQ6YVzakM5">Discord</a> • <a href="https://linkedin.com/in/pat-sullivan-dev" target="_blank">LinkedIn</a> • <a href="https://medium.com/@pat.joseph.sullivan" target="_blank">Medium</a> • <a href="https://github.com/storm-software" target="_blank">GitHub</a> • <a href="https://keybase.io/sullivanp" target="_blank">OpenPGP Key</a>
|
|
276
|
+
</b>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div align="center">
|
|
280
|
+
<b>Fingerprint:</b> 1BD2 7192 7770 2549 F4C9 F238 E6AD C420 DA5C 4C2D
|
|
281
|
+
</div>
|
|
282
|
+
<br />
|
|
283
|
+
|
|
284
|
+
Storm Software is an open source software development organization and creator
|
|
285
|
+
of Acidic, StormStack and StormCloud.
|
|
286
|
+
|
|
287
|
+
Our mission is to make software development more accessible. Our ideal future is
|
|
288
|
+
one where anyone can create software without years of prior development
|
|
289
|
+
experience serving as a barrier to entry. We hope to achieve this via LLMs,
|
|
290
|
+
Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
291
|
+
|
|
292
|
+
If this sounds interesting, and you would like to help us in creating the next
|
|
293
|
+
generation of development tools, please reach out on our website!
|
|
294
|
+
|
|
295
|
+
<br />
|
|
296
|
+
### 💻 Visit [stormsoftware.com](https://stormsoftware.com) to stay up to date with this developer
|
|
297
|
+
|
|
298
|
+
<br />
|
|
299
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
300
|
+
<br />
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
<!-- markdownlint-restore -->
|
|
304
|
+
<!-- prettier-ignore-end -->
|
|
305
|
+
|
|
306
|
+
<!-- END footer -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@razorwind/core/plugin"),l=require("@razorwind/tamagui/generate");l=s(l);var u=(0,c.definePlugin)((e={})=>{let t=(0,l.default)({animations:`motion`,defaultFont:`body-md`,target:`v3`,...e}),n=t.generate;return{...t,name:`cyclone-ui:tamagui-generate`,generate:async(...[e,t])=>{if(!n||!e.fonts)return n?.(e,t)??{};let r=Object.fromEntries(Object.entries(e.fonts).map(([e,t])=>t.source!==`local`||!t.files?[e,t]:[e,{...t,files:t.files.filter(e=>typeof e.weight!=`string`||/^\d+(?:\.\d+)?$/u.test(e.weight.trim()))}]));return n({...e,fonts:r},t)}}});module.exports=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.cts","names":[],"sources":["../src/generate.ts"],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TamaguiPluginOptions } from "@razorwind/tamagui";
|
|
2
|
+
//#region src/generate.d.ts
|
|
3
|
+
declare const _default: (options?: TamaguiPluginOptions | undefined) => import("@razorwind/core/plugin").Plugin;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { _default as default };
|
|
6
|
+
//# sourceMappingURL=generate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.mts","names":[],"sources":["../src/generate.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{definePlugin as e}from"@razorwind/core/plugin";import t from"@razorwind/tamagui/generate";var n=e((e={})=>{let n=t({animations:`motion`,defaultFont:`body-md`,target:`v3`,...e}),r=n.generate;return{...n,name:`cyclone-ui:tamagui-generate`,generate:async(...[e,t])=>{if(!r||!e.fonts)return r?.(e,t)??{};let n=Object.fromEntries(Object.entries(e.fonts).map(([e,t])=>t.source!==`local`||!t.files?[e,t]:[e,{...t,files:t.files.filter(e=>typeof e.weight!=`string`||/^\d+(?:\.\d+)?$/u.test(e.weight.trim()))}]));return r({...e,fonts:n},t)}}});export{n as default};
|
|
2
|
+
//# sourceMappingURL=generate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.mjs","names":["tamagui","generate_default","definePlugin","tamaguiPlugin","options","generateTamagui","spec","config","fonts","name","font","file"],"sources":[],"mappings":""}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./preprocessor.cjs"),t=require("./generate.cjs");exports.generate=t,exports.preprocessor=e;
|
package/dist/index.d.cts
ADDED
package/dist/index.d.mts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./preprocessor.mjs";import t from"./generate.mjs";export{t as generate,e as preprocessor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("@razorwind/core/plugin");const t=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,n=/^oklch\(\s*([0-9.]+%?|none)\s+([0-9.]+|none)\s+([0-9.]+|none)(?:\s*\/\s*([0-9.%]+))?\s*\)$/i,r=/* @__PURE__ */ new Set([`$schema`,`$type`,`$description`,`$extensions`,`$extends`,`$deprecated`,`$root`,`$value`,`$ref`,`theme`,`palette`,`primitive`]);function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e){return i(e)&&(`$value`in e||`$ref`in e)}function o(e){let t=e.trim();return t.startsWith(`{`)||t.startsWith(`var(`)}function s(e){return Math.min(1,Math.max(0,e))}function c(e){let t=s(e);return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function l(e){let t=s(e);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function u(e){return Math.round(c(e)*255).toString(16).padStart(2,`0`)}function d(e){return Math.round(s(e)*255).toString(16).padStart(2,`0`)}function f(e){return Math.round(s(e)*255).toString(16).padStart(2,`0`)}function p(e){let t=e.startsWith(`#`)?e.slice(1):e;return t.length===3||t.length===4?`#${[...t].map(e=>e+e).join(``)}`:`#${t}`}function m(e){if(typeof e==`string`){let n=e.trim();if(!t.test(n))return;let r=p(n).toLowerCase();return r.length===9&&r.endsWith(`ff`)?r.slice(0,7):r}if(i(e)){if(typeof e.hex==`string`&&t.test(e.hex)){let t=p(e.hex).toLowerCase().slice(0,7),n=v(e.alpha);return n!==void 0&&n<1?`${t}${f(n)}`:t}if(e.colorSpace===`srgb`&&Array.isArray(e.components)&&e.components.length>=3){let t=_(e.components[0]),n=_(e.components[1]),r=_(e.components[2]);if(t===void 0||n===void 0||r===void 0)return;let i=`#${d(t)}${d(n)}${d(r)}`,a=v(e.alpha);return a!==void 0&&a<1?`${i}${f(a)}`:i}}}function h(e,t,n){let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=e+.3963377774*i+.2158037573*a,s=e-.1055613458*i-.0638541728*a,c=e-.0894841775*i-1.291485548*a,l=o**3,u=s**3,d=c**3;return{red:4.0767416621*l-3.3077115913*u+.2309699292*d,green:-1.2684380046*l+2.6097574011*u-.3413193965*d,blue:-.0041960863*l-.7034186147*u+1.707614701*d}}function g(e,t,n,r){let{red:i,green:a,blue:o}=h(e,t,n),s=`#${u(i)}${u(a)}${u(o)}`;return r===void 0||r>=1?s:`${s}${f(r)}`}function _(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e!=`string`||e===`none`)return;let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}function v(e){if(typeof e==`number`&&Number.isFinite(e))return e>1?e/100:e;if(typeof e!=`string`)return;let t=Number.parseFloat(e);if(Number.isFinite(t))return e.includes(`%`)||t>1?t/100:t}function ee(e){let t=n.exec(e.trim());if(!t)return;let r=_(t[1]),i=_(t[2]),a=_(t[3]);if(r!==void 0&&i!==void 0&&a!==void 0)return t[1]?.includes(`%`)&&(r/=100),g(r,i,a,v(t[4]))}function te(e){if(!Array.isArray(e.components)||e.components.length<3)return;let t=_(e.components[0]),n=_(e.components[1]),r=_(e.components[2]);if(t!==void 0&&n!==void 0&&r!==void 0)return t>1&&(t/=100),g(t,n,r,v(e.alpha))}function y(e){if(typeof e==`string`)return o(e)?void 0:ee(e)??m(e)??void 0;if(i(e))return typeof e.colorSpace==`string`&&e.colorSpace.toLowerCase()===`oklch`?te(e):m(e)??void 0}function b(e){if(Array.isArray(e))return e.map(e=>b(e));if(!i(e)||!(`color`in e))return e;let t=y(e.color);return t?{...e,color:t}:e}function ne(e,t){if(t===`shadow`)return b(e);if(t===`border`&&i(e)&&`color`in e){let t=y(e.color);return t?{...e,color:t}:e}return t===`color`||t===void 0?y(e)??e:e}function x(e,t){return typeof e.$type==`string`?e.$type:typeof e.type==`string`?e.type:t}function re(e,t){if(`$ref`in e&&!(`$value`in e))return{...e};let n=x(e,t);return`$value`in e?{...e,$value:ne(e.$value,n)}:{...e}}function S(e,t){if(Array.isArray(e))return e.map(e=>S(e,t));if(!i(e))return e;if(a(e))return re(e,t);let n=typeof e.$type==`string`?e.$type:t,o={};for(let[t,i]of Object.entries(e))o[t]=r.has(t)||t.startsWith(`$`)?i:S(i,n);return o}const ie={dark:`#ffffff`,light:`#0c0c0d`};function C(e){if(typeof e!=`string`)return;let t=/\b(dark|light)[\s-]+theme\b/i.exec(e)?.[1];return t?.toLowerCase()===`dark`?`dark`:t?.toLowerCase()===`light`?`light`:void 0}function ae(e){if(i(e)&&i(e.color))return C(e.color.$description)}const oe={name:`active`,brightness:1.45,useContrastPrimitive:!0},se={name:`active`,brightness:1.25},ce={name:`active`,brightness:1.075},le={name:`active`,brightness:1.125},ue={name:`active`,brightness:1.4},de={name:`active`,brightness:1.8,useContrastPrimitive:!0},w={name:`inactive`,brightness:.8},T={name:`inactive`,brightness:.6,useContrastPrimitive:!0},E={name:`disabled`,opacity:.35,saturation:.85,fadeOver:`oklch(0.3839 0.0045 286.26)`},D={lowSaturation:[oe,T,E],saturated:[se,w,E]},fe={lowSaturation:[le,T,E],saturated:D.saturated},pe={lowSaturation:[ce,w,E],saturated:D.saturated},me=[`danger`,`warning`,`info`,`discovery`,`success`],he={primary:`base`,tertiary:`base-subtle`},O=[`base`,...me],ge={border:{lowSaturation:[de,T,E],saturated:[ue,w,E]},...Object.fromEntries(O.flatMap(e=>[[e,D],[`${e}-subtle`,fe]]))},k=7.25,A=.01;function _e(e){return e.toLowerCase().endsWith(`-active`)||e.toLowerCase().endsWith(`-inactive`)||e.toLowerCase().endsWith(`-disabled`)}function ve(e,t){let n=e;for(let e of t.split(`.`).filter(Boolean)){if(!i(n)||!(e in n))return;n=n[e]}return a(n)?n:void 0}function j(e,t,n=/* @__PURE__ */ new Set){let r=y(e);if(r)return r;if(typeof e!=`string`)return;let i=/^\{([^{}]+)\}$/.exec(e.trim());if(!i?.[1]||n.has(i[1]))return;n.add(i[1]);let a=ve(t,i[1]);if(a&&`$value`in a)return j(a.$value,t,n)}function M(e,t){let n=p(e).toLowerCase(),r=n.slice(0,7),i=s((n.length===9?Number.parseInt(n.slice(7,9),16)/255:1)*t);return i>=1?r:`${r}${f(i)}`}function ye(e,t,n){let r=p(e).toLowerCase(),i=p(y(t)??t).toLowerCase(),a=s((r.length===9?Number.parseInt(r.slice(7,9),16)/255:1)*n),o=e=>d((Number.parseInt(r.slice(e,e+2),16)*a+Number.parseInt(i.slice(e,e+2),16)*(1-a))/255);return`#${o(1)}${o(3)}${o(5)}`}function N(e,t,n=!1){if(Array.isArray(e))return e.map(e=>N(e,t,n));if(!i(e))return e;if(n&&a(e)&&x(e)===`shadow`){let n=e.$value,r=e=>{if(!i(e)||!(`color`in e))return e;let n=j(e.color,t);return n?{...e,color:M(n,F(n)?.2:.15)}:e};return{...e,$value:Array.isArray(n)?n.map((e,t)=>t===n.length-1?r(e):e):r(n)}}let r={};for(let[i,a]of Object.entries(e))r[i]=N(a,t,n||i.toLowerCase()===`ring`);return r}function P(e,t){let n={value:0,unit:`px`};return{color:e,offsetX:n,offsetY:n,blur:n,spread:{value:t,unit:`px`}}}function be(e){if(!i(e)||!i(e.color))return e;let t=e.color,n=i(e.ring)?{...e.ring}:{},r=!1;for(let e of O){if(!a(t[e]))continue;let i=`{color.${e}}`,o=P(`{color.surface-elevated}`,3),s={[e]:[`${e} 3px focus ring with no gap`,[P(i,3)]],[`${e}-subtle`]:[`${e} 1px hairline focus ring with no gap`,[P(i,1)]],[`${e}-offset`]:[`${e} 3px focus ring with a 3px gap`,[o,P(i,6)]],[`${e}-subtle-offset`]:[`${e} 1px focus ring with a 3px gap`,[o,P(i,4)]]};for(let[t,[i,a]]of Object.entries(s))t in n||(n[t]={$description:`Generated ${i}`,$type:`shadow`,$value:a,theme:Z(e)},r=!0)}return r?{...e,ring:n}:e}function F(e){return L(e).chroma<.02}function I(e){let t=p(e).toLowerCase();return t.slice(1,3)===t.slice(3,5)&&t.slice(3,5)===t.slice(5,7)}function L(e){let t=p(e).toLowerCase(),n=l(Number.parseInt(t.slice(1,3),16)/255),r=l(Number.parseInt(t.slice(3,5),16)/255),i=l(Number.parseInt(t.slice(5,7),16)/255),a=t.length===9?Number.parseInt(t.slice(7,9),16)/255:void 0,o=.4122214708*n+.5363325363*r+.0514459929*i,s=.2119034982*n+.6806995451*r+.1073969566*i,c=.0883024619*n+.2817188376*r+.6299787005*i,u=Math.cbrt(o),d=Math.cbrt(s),f=Math.cbrt(c),m=.2104542553*u+.793617785*d-.0040720468*f,h=1.9779984951*u-2.428592205*d+.4505937099*f,g=.0259040371*u+.7827717662*d-.808675766*f,_=Math.hypot(h,g),v=Math.atan2(g,h)*180/Math.PI;return v<0&&(v+=360),{lightness:m,chroma:_,hue:v,alpha:a}}function R({red:e,green:t,blue:n}){return e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1}function z(e,t,n,r){if(R(h(e,t,n)))return g(e,t,n,r);let i=0,a=t;for(let t=0;t<32;t+=1){let t=(i+a)/2;R(h(e,t,n))?i=t:a=t}return g(e,i,n,r)}function B(e,t){let{lightness:n,chroma:r,hue:i,alpha:a}=L(e);return g(s(n*t),r,i,a)}function xe(e,t){let{lightness:n,chroma:r,hue:i,alpha:a}=L(e);return g(s(n+t),r,i,a)}function Se(e,t){let{lightness:n,chroma:r,hue:i,alpha:a}=L(e);return g(n,r*s(t),i,a)}function V(e){let t=p(e).toLowerCase(),n=e=>{let n=Number.parseInt(t.slice(e,e+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(1)+.7152*n(3)+.0722*n(5)}function H(e,t){let n=V(e),r=V(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function U(e){let t=H(e,`#FAFAFA`);return t>=2?`#FAFAFA`:H(e,`#151518`)*.5>t?`#151518`:`#FAFAFA`}function Ce(e,t){let{lightness:n,chroma:r,hue:i,alpha:a}=L(e),o=t===`light`?1:-1,c=-o,l=n,u=n,d=e,f=e;for(let t=0;t<100;t+=1){if(l=s(l+o*A),d=z(l,r,i,a),H(d,f)>=k)return f===e?{subtle:d}:{subtle:d,onMuted:f};if(u=s(u+c*A),f=z(u,r,i,a),H(d,f)>=k)return{subtle:d,onMuted:f};if((l===0||l===1)&&(u===0||u===1))break}throw Error(`Unable to generate an accessible subtle pair for ${e}`)}function we(e,t){return t===`dark`?W(e):t===`light`?!G(e):L(e).lightness>=.5}function Te(e,t){return!we(e,t)}function W(e){return L(e).lightness>=.75}function G(e){return L(e).lightness<=.25}function Ee(e,t,n){return Te(e,n)?t:2-t}function K(e,t){return e.useContrastPrimitive&&t?ie[t]:void 0}function q(e,t,n){if(t.name===`active`&&K(t,n)){if(n===`dark`&&W(e))return-.1;if(n===`light`&&G(e))return .1}}function J(e,t,n){return t.brightness===void 0?1:K(t,n)?t.name===`active`?1:t.brightness:Ee(e,t.brightness,n)}function De(e,t,n){let r=q(e,t,n),i=r===void 0?K(t,n):void 0,a=i??e;return r===void 0?t.brightness!==void 0&&!(i&&t.name===`active`)&&(a=B(a,J(a,t,n))):a=xe(e,r),t.saturation!==void 0&&!I(e)&&(a=Se(a,t.saturation),t.fadeOver===void 0)?a:t.fadeOver===void 0?t.opacity===void 0?a:M(a,t.opacity):ye(a,t.fadeOver,t.opacity??1)}function Oe(e,t,n){let r=[],i=q(t,e,n),a=K(e,n);if(i!==void 0)r.push(`${Math.round(Math.abs(i)*100)}% ${i<0?`darker`:`lighter`}`);else if(a&&e.name===`active`)r.push(`${n} contrast primitive`);else if(e.brightness!==void 0){let i=J(t,e,n),a=Math.round((i-1)*100);r.push(a>=0?`${a}% brighter`:`${Math.abs(a)}% darker`)}return e.saturation!==void 0&&!I(t)&&r.push(`${Math.round(e.saturation*100)}% saturation`),e.fadeOver===void 0?e.opacity!==void 0&&(e.saturation===void 0||I(t))&&r.push(`${Math.round(e.opacity*100)}% opacity`):r.push(`${Math.round((e.opacity??1)*100)}% over ${e.fadeOver}`),r.join(`, `)||e.name}function ke(e,t,n,r){let i=Oe(n,t,r),a=De(t,n,r);return{...e,$type:`color`,$value:a,$description:typeof e.$description==`string`?`${e.$description} (${n.name}, ${i})`:`${n.name} state at ${i}`}}function Y(e,t,n,r,i){let o={...e},s=r?[r]:Object.keys(e);for(let r of s){if(r.startsWith(`$`)||_e(r))continue;let s=e[r];if(!a(s))continue;let c=x(s);if(c&&c!==`color`)continue;let l=j(s.$value,t);if(!l)continue;let u=F(l)?n.lowSaturation:n.saturated,d=C(s.$description)??i;for(let e of u){let t=`${r}-${e.name}`;t in o||(o[t]=ke(s,l,e,d))}}return o}function Ae(e,t,n){let r={...e};for(let i of O){let o=e[i];if(!a(o))continue;let s=x(o),c=j(o.$value,t);if(s&&s!==`color`||!c)continue;let l=e[`on-${i}`];delete r[`on-${i}`],r[`on-${i}-accent`]??=a(l)?{...l,theme:i,group:i}:{...o,$type:`color`,$value:U(c),$description:`Generated text and icon color on ${i} backgrounds`,theme:i,group:i},r[`${i}-accent`]??={$type:`color`,$value:`{color.${i}}`,$description:`Alias of ${i} for the ${i} theme`,theme:i,group:i};let u;if(n&&!(`${i}-subtle`in e)){let e=Ce(c,n);r[`${i}-subtle`]={...o,$type:`color`,$value:e.subtle,$description:`Generated low-emphasis ${i} background for the ${n} theme`},u=e.onMuted??c}else if(a(e[`${i}-subtle`])){let n=j(e[`${i}-subtle`].$value,t);u=n&&U(n)}u&&!(`on-${i}-subtle`in e)&&(r[`on-${i}-subtle`]={...o,$type:`color`,$value:u,$description:`Generated text and icon color on ${i}-subtle backgrounds`})}return r}function X(e){return e.replace(/^on-/,``).replace(/-(?:active|inactive|disabled)$/i,``).replace(/-subtle$/,``)}function Z(e){let t=X(e);return O.includes(t)?t:void 0}function je(e){let t={...e};for(let[n,r]of Object.entries(e)){let e=X(n),i=he[e];i&&a(r)&&(t[n.replace(e,i)]??={...r,theme:`base`,group:`base`})}return t}function Me(e){let t={...e};for(let[n,r]of Object.entries(e)){let e=Z(n);e&&a(r)&&!(`theme`in r)&&(t[n]={...r,theme:e})}return t}function Q(e){let t={...e};for(let[n,r]of Object.entries(e)){let e=X(n);e!==n&&a(r)&&!(`group`in r)&&(t[n]={...r,group:e})}return t}function $(e,t,n,o){if(Array.isArray(e))return e.map(e=>$(e,t,void 0,o));if(!i(e)||a(e))return e;let s={};for(let[n,i]of Object.entries(e))s[n]=r.has(n)||n.startsWith(`$`)?i:$(i,t,n,n===`dark`||n===`light`?n:o);if(n?.startsWith(`surface-`))return Q(Y(s,t,pe,void 0,o));let c=n===`color`?Ae(je(s),t,o):s;for(let[e,n]of Object.entries(ge))a(c[e])&&(c=Y(c,t,n,e,o));return n===`color`?Q(Me(c)):c}function Ne(e){let t=S(e),n=be($(t,t,void 0,ae(t)));return N(n,n)}var Pe=(0,e.definePlugin)(()=>({name:`cyclone-ui:tamagui-preprocessor`,preprocessors:[{name:`tamagui-preprocessor`,preprocessor:Ne}]}));module.exports=Pe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preprocessor.d.cts","names":[],"sources":["../src/preprocessor.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preprocessor.d.mts","names":[],"sources":["../src/preprocessor.ts"],"mappings":""}
|