@precisa-saude/themes 1.0.1
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 +201 -0
- package/README.md +117 -0
- package/animations.css +43 -0
- package/base.css +60 -0
- package/colors.css +123 -0
- package/grid.css +29 -0
- package/index.css +16 -0
- package/package.json +44 -0
- package/status.css +55 -0
package/LICENSE
ADDED
|
@@ -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 [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.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# @precisa-saude/themes
|
|
2
|
+
|
|
3
|
+
Shared CSS design tokens for Precisa Saúde repositories. Ships OKLCh color palettes, a responsive 14/16-column grid, typography scaffolding, status semantics, and shared animations — all as CSS custom properties.
|
|
4
|
+
|
|
5
|
+
No JavaScript. No bundler needed. Works with Tailwind v3, Tailwind v4, vanilla CSS, or anything that honors `@import`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @precisa-saude/themes
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
**Everything at once** (recommended for most sites):
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
/* your-app/src/index.css */
|
|
19
|
+
@import 'tailwindcss';
|
|
20
|
+
@import '@precisa-saude/themes';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Cherry-pick modules**:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import '@precisa-saude/themes/base.css'; /* typography scaffolding + spacing + shadows */
|
|
27
|
+
@import '@precisa-saude/themes/colors.css'; /* palette + shadcn semantic tokens */
|
|
28
|
+
@import '@precisa-saude/themes/grid.css'; /* 14/16-col responsive grid */
|
|
29
|
+
@import '@precisa-saude/themes/status.css'; /* success/warning/elevated/critical/info */
|
|
30
|
+
@import '@precisa-saude/themes/animations.css'; /* marquee + reduced-motion */
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What's inside
|
|
34
|
+
|
|
35
|
+
### `base.css`
|
|
36
|
+
|
|
37
|
+
- `--font-sans`, `--font-serif`, `--font-mono` — default fallback chains (system UI fonts). Override on `:root` to inject custom fonts.
|
|
38
|
+
- `--spacing`, `--radius`, `--tracking-*` — spacing unit, border radius, letter-spacing scale
|
|
39
|
+
- `--shadow-*` — shadow ramp (2xs → 2xl), light + dark variants
|
|
40
|
+
|
|
41
|
+
### `colors.css`
|
|
42
|
+
|
|
43
|
+
- **Brand palette**: `--ps-violet`, `--ps-mint`, `--ps-amber`, `--ps-green` (plus dark variants)
|
|
44
|
+
- **Surface**: `--background`, `--foreground`, `--card`, `--popover`
|
|
45
|
+
- **Semantic**: `--primary`, `--secondary`, `--muted`, `--accent`, `--destructive` (each with `-foreground`)
|
|
46
|
+
- **Borders / focus**: `--border`, `--input`, `--ring`
|
|
47
|
+
- **Charts**: `--chart-1` through `--chart-5`
|
|
48
|
+
- **Sidebar**: `--sidebar`, `--sidebar-*` (for app shells with a sidebar)
|
|
49
|
+
- **Gradient**: `--gradient-from`, `--gradient-to` (defaults: primary → ps-mint)
|
|
50
|
+
|
|
51
|
+
All values in OKLCh. Dark mode triggers under `.dark` — add `class="dark"` on `<html>` or use a theme toggle.
|
|
52
|
+
|
|
53
|
+
### `grid.css`
|
|
54
|
+
|
|
55
|
+
- 14 columns below 1440px, 16 columns above
|
|
56
|
+
- `--grid-cols`, `--grid-gaps`, `--grid-max-w`, `--col-w`
|
|
57
|
+
- Use with Tailwind's arbitrary-grid syntax: `grid grid-cols-[repeat(var(--grid-cols),1fr)] gap-4`
|
|
58
|
+
|
|
59
|
+
### `status.css`
|
|
60
|
+
|
|
61
|
+
Generic status palette (success / warning / elevated / critical / info). Each exposes a base color, foreground, and tint. Light + dark variants.
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
.pill-success {
|
|
65
|
+
background: var(--status-success-tint);
|
|
66
|
+
color: var(--status-success);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `animations.css`
|
|
71
|
+
|
|
72
|
+
- `.animate-marquee-left` / `.animate-marquee-right` — horizontal scroll keyframes
|
|
73
|
+
- `--marquee-duration` — override per element (default `300s`)
|
|
74
|
+
- Honors `prefers-reduced-motion`
|
|
75
|
+
|
|
76
|
+
## Custom fonts
|
|
77
|
+
|
|
78
|
+
The default `--font-sans` / `--font-serif` / `--font-mono` chains use system fonts so sites render without any extra setup. To swap in custom fonts:
|
|
79
|
+
|
|
80
|
+
```css
|
|
81
|
+
@import '@precisa-saude/themes';
|
|
82
|
+
|
|
83
|
+
@font-face {
|
|
84
|
+
font-family: 'YourFont';
|
|
85
|
+
src: url('/fonts/YourFont.woff2') format('woff2');
|
|
86
|
+
font-weight: 100 900;
|
|
87
|
+
font-display: swap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:root {
|
|
91
|
+
--font-sans: 'YourFont', system-ui, sans-serif;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Dark mode
|
|
96
|
+
|
|
97
|
+
Toggle by adding `class="dark"` on `<html>` (or any parent element). All token values cascade automatically.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
document.documentElement.classList.toggle('dark');
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Tailwind v4
|
|
104
|
+
|
|
105
|
+
The tokens are designed for Tailwind v4's `@theme` extraction. In your Tailwind config:
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
@theme {
|
|
109
|
+
--color-primary: var(--primary);
|
|
110
|
+
--color-background: var(--background);
|
|
111
|
+
/* ...or use @theme inline to map directly */
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
Apache-2.0
|
package/animations.css
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared keyframe animations + utility classes.
|
|
3
|
+
*
|
|
4
|
+
* Respect `prefers-reduced-motion` by overriding the animation to none:
|
|
5
|
+
* @media (prefers-reduced-motion: reduce) {
|
|
6
|
+
* .animate-marquee-left, .animate-marquee-right { animation: none; }
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@layer base {
|
|
11
|
+
.animate-marquee-left {
|
|
12
|
+
animation: marquee-left var(--marquee-duration, 300s) linear infinite;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.animate-marquee-right {
|
|
16
|
+
animation: marquee-right var(--marquee-duration, 300s) linear infinite;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes marquee-left {
|
|
20
|
+
from {
|
|
21
|
+
transform: translateX(0);
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
transform: translateX(-50%);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes marquee-right {
|
|
29
|
+
from {
|
|
30
|
+
transform: translateX(-50%);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
transform: translateX(0);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (prefers-reduced-motion: reduce) {
|
|
38
|
+
.animate-marquee-left,
|
|
39
|
+
.animate-marquee-right {
|
|
40
|
+
animation: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/base.css
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base typography, spacing, radius, shadows, tracking.
|
|
3
|
+
*
|
|
4
|
+
* No @font-face declarations — consumers import their own fonts and
|
|
5
|
+
* override --font-sans / --font-serif / --font-mono on :root. The default
|
|
6
|
+
* chains fall back to system UI fonts so sites work without any extra setup.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@layer base {
|
|
10
|
+
:root {
|
|
11
|
+
/* Typography — override on :root to inject custom fonts */
|
|
12
|
+
--font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
13
|
+
--font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
|
|
14
|
+
--font-mono:
|
|
15
|
+
'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', ui-monospace, monospace;
|
|
16
|
+
|
|
17
|
+
/* Spacing unit — used by Tailwind's spacing scale when multiplied */
|
|
18
|
+
--spacing: 0.25rem;
|
|
19
|
+
|
|
20
|
+
/* Letter-spacing / tracking scale */
|
|
21
|
+
--letter-spacing: 0em;
|
|
22
|
+
--tracking-normal: 0em;
|
|
23
|
+
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
|
|
24
|
+
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
|
25
|
+
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
|
26
|
+
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
|
27
|
+
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
|
28
|
+
|
|
29
|
+
/* Border radius */
|
|
30
|
+
--radius: 0.625rem;
|
|
31
|
+
|
|
32
|
+
/* Shadows — neutral, work in light mode */
|
|
33
|
+
--shadow-color: hsl(0 0% 20%);
|
|
34
|
+
--shadow-opacity: 0.12;
|
|
35
|
+
--shadow-blur: 10px;
|
|
36
|
+
--shadow-spread: 0px;
|
|
37
|
+
--shadow-offset-x: 0px;
|
|
38
|
+
--shadow-offset-y: 4px;
|
|
39
|
+
--shadow-2xs: 0px 4px 10px 0px hsl(0 0% 20% / 0.06);
|
|
40
|
+
--shadow-xs: 0px 4px 10px 0px hsl(0 0% 20% / 0.06);
|
|
41
|
+
--shadow-sm: 0px 4px 10px 0px hsl(0 0% 20% / 0.12), 0px 1px 2px -1px hsl(0 0% 20% / 0.12);
|
|
42
|
+
--shadow: 0px 4px 10px 0px hsl(0 0% 20% / 0.12), 0px 1px 2px -1px hsl(0 0% 20% / 0.12);
|
|
43
|
+
--shadow-md: 0px 4px 10px 0px hsl(0 0% 20% / 0.12), 0px 2px 4px -1px hsl(0 0% 20% / 0.12);
|
|
44
|
+
--shadow-lg: 0px 4px 10px 0px hsl(0 0% 20% / 0.12), 0px 4px 6px -1px hsl(0 0% 20% / 0.12);
|
|
45
|
+
--shadow-xl: 0px 4px 10px 0px hsl(0 0% 20% / 0.12), 0px 8px 10px -1px hsl(0 0% 20% / 0.12);
|
|
46
|
+
--shadow-2xl: 0px 4px 10px 0px hsl(0 0% 20% / 0.3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--shadow-color: hsl(0 0% 0%);
|
|
51
|
+
--shadow-2xs: 0px 4px 10px 0px hsl(0 0% 0% / 0.15);
|
|
52
|
+
--shadow-xs: 0px 4px 10px 0px hsl(0 0% 0% / 0.15);
|
|
53
|
+
--shadow-sm: 0px 4px 10px 0px hsl(0 0% 0% / 0.2), 0px 1px 2px -1px hsl(0 0% 0% / 0.2);
|
|
54
|
+
--shadow: 0px 4px 10px 0px hsl(0 0% 0% / 0.2), 0px 1px 2px -1px hsl(0 0% 0% / 0.2);
|
|
55
|
+
--shadow-md: 0px 4px 10px 0px hsl(0 0% 0% / 0.2), 0px 2px 4px -1px hsl(0 0% 0% / 0.2);
|
|
56
|
+
--shadow-lg: 0px 4px 10px 0px hsl(0 0% 0% / 0.2), 0px 4px 6px -1px hsl(0 0% 0% / 0.2);
|
|
57
|
+
--shadow-xl: 0px 4px 10px 0px hsl(0 0% 0% / 0.2), 0px 8px 10px -1px hsl(0 0% 0% / 0.2);
|
|
58
|
+
--shadow-2xl: 0px 4px 10px 0px hsl(0 0% 0% / 0.4);
|
|
59
|
+
}
|
|
60
|
+
}
|
package/colors.css
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Palette and shadcn-compatible semantic colors.
|
|
3
|
+
*
|
|
4
|
+
* Two layers:
|
|
5
|
+
* 1. Brand palette (--ps-violet, --ps-mint, --ps-amber, --ps-green) — the
|
|
6
|
+
* organization's visual identity. Use for accents, charts, highlights.
|
|
7
|
+
* 2. Shadcn-compatible semantics (--background, --foreground, --primary,
|
|
8
|
+
* --secondary, --muted, --accent, --destructive, --border, --ring, etc.)
|
|
9
|
+
* derived from the brand palette. These are the tokens Tailwind/shadcn
|
|
10
|
+
* components read.
|
|
11
|
+
*
|
|
12
|
+
* All values in OKLCh for perceptually uniform color mixing.
|
|
13
|
+
* Dark mode under the `.dark` class; add `class="dark"` on <html> to toggle.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
@layer base {
|
|
17
|
+
:root {
|
|
18
|
+
/* Brand palette */
|
|
19
|
+
--ps-violet: oklch(0.67 0.113 285);
|
|
20
|
+
--ps-mint: oklch(0.9 0.085 181);
|
|
21
|
+
--ps-green: oklch(0.6 0.17 155);
|
|
22
|
+
--ps-amber: oklch(0.8 0.123 80);
|
|
23
|
+
|
|
24
|
+
/* Surface */
|
|
25
|
+
--background: oklch(0.94 0.008 61);
|
|
26
|
+
--foreground: oklch(0.25 0.06 292);
|
|
27
|
+
--card: oklch(0.96 0.005 61);
|
|
28
|
+
--card-foreground: oklch(0.25 0.06 292);
|
|
29
|
+
--popover: oklch(0.96 0.005 61);
|
|
30
|
+
--popover-foreground: oklch(0.25 0.06 292);
|
|
31
|
+
|
|
32
|
+
/* Primary / secondary */
|
|
33
|
+
--primary: oklch(0.39 0.082 292);
|
|
34
|
+
--primary-foreground: oklch(0.97 0.005 292);
|
|
35
|
+
--secondary: oklch(0.89 0.023 65);
|
|
36
|
+
--secondary-foreground: oklch(0.3 0.07 292);
|
|
37
|
+
|
|
38
|
+
/* Neutral */
|
|
39
|
+
--muted: oklch(0.92 0.012 61);
|
|
40
|
+
--muted-foreground: oklch(0.55 0.05 285);
|
|
41
|
+
--accent: oklch(0.92 0.04 285);
|
|
42
|
+
--accent-foreground: oklch(0.25 0.06 292);
|
|
43
|
+
|
|
44
|
+
/* Destructive */
|
|
45
|
+
--destructive: oklch(0.71 0.157 35);
|
|
46
|
+
--destructive-foreground: oklch(0.97 0.01 35);
|
|
47
|
+
|
|
48
|
+
/* Borders / focus */
|
|
49
|
+
--border: oklch(0.87 0.018 65);
|
|
50
|
+
--input: oklch(0.85 0.02 65);
|
|
51
|
+
--ring: oklch(0.39 0.082 292);
|
|
52
|
+
|
|
53
|
+
/* Charts */
|
|
54
|
+
--chart-1: oklch(0.39 0.082 292);
|
|
55
|
+
--chart-2: oklch(0.82 0.085 181);
|
|
56
|
+
--chart-3: oklch(0.67 0.113 285);
|
|
57
|
+
--chart-4: oklch(0.8 0.123 80);
|
|
58
|
+
--chart-5: oklch(0.71 0.157 35);
|
|
59
|
+
|
|
60
|
+
/* Sidebar (opt-in for app shells that have one) */
|
|
61
|
+
--sidebar: oklch(0.92 0.01 61);
|
|
62
|
+
--sidebar-foreground: oklch(0.25 0.06 292);
|
|
63
|
+
--sidebar-primary: oklch(0.39 0.082 292);
|
|
64
|
+
--sidebar-primary-foreground: oklch(0.97 0.005 292);
|
|
65
|
+
--sidebar-accent: oklch(0.89 0.023 65);
|
|
66
|
+
--sidebar-accent-foreground: oklch(0.25 0.06 292);
|
|
67
|
+
--sidebar-border: oklch(0.87 0.018 65);
|
|
68
|
+
--sidebar-ring: oklch(0.39 0.082 292);
|
|
69
|
+
|
|
70
|
+
/* Gradient endpoints (convenience) */
|
|
71
|
+
--gradient-from: var(--primary);
|
|
72
|
+
--gradient-to: var(--ps-mint);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dark {
|
|
76
|
+
--ps-violet: oklch(0.72 0.1 285);
|
|
77
|
+
--ps-mint: oklch(0.82 0.08 181);
|
|
78
|
+
--ps-green: oklch(0.72 0.14 155);
|
|
79
|
+
--ps-amber: oklch(0.78 0.11 80);
|
|
80
|
+
|
|
81
|
+
--background: oklch(0.22 0.05 292);
|
|
82
|
+
--foreground: oklch(0.94 0.008 61);
|
|
83
|
+
--card: oklch(0.26 0.05 292);
|
|
84
|
+
--card-foreground: oklch(0.94 0.008 61);
|
|
85
|
+
--popover: oklch(0.26 0.05 292);
|
|
86
|
+
--popover-foreground: oklch(0.94 0.008 61);
|
|
87
|
+
|
|
88
|
+
--primary: oklch(0.9 0.085 181);
|
|
89
|
+
--primary-foreground: oklch(0.22 0.05 292);
|
|
90
|
+
--secondary: oklch(0.32 0.04 292);
|
|
91
|
+
--secondary-foreground: oklch(0.92 0.008 61);
|
|
92
|
+
|
|
93
|
+
--muted: oklch(0.3 0.04 292);
|
|
94
|
+
--muted-foreground: oklch(0.72 0.02 65);
|
|
95
|
+
--accent: oklch(0.3 0.025 65);
|
|
96
|
+
--accent-foreground: oklch(0.95 0.005 61);
|
|
97
|
+
|
|
98
|
+
--destructive: oklch(0.71 0.157 35);
|
|
99
|
+
--destructive-foreground: oklch(0.97 0.01 35);
|
|
100
|
+
|
|
101
|
+
--border: oklch(0.36 0.04 292);
|
|
102
|
+
--input: oklch(0.34 0.04 292);
|
|
103
|
+
--ring: oklch(0.9 0.085 181);
|
|
104
|
+
|
|
105
|
+
--chart-1: oklch(0.9 0.085 181);
|
|
106
|
+
--chart-2: oklch(0.67 0.113 285);
|
|
107
|
+
--chart-3: oklch(0.8 0.123 80);
|
|
108
|
+
--chart-4: oklch(0.5 0.1 292);
|
|
109
|
+
--chart-5: oklch(0.71 0.157 35);
|
|
110
|
+
|
|
111
|
+
--sidebar: oklch(0.24 0.05 292);
|
|
112
|
+
--sidebar-foreground: oklch(0.94 0.008 61);
|
|
113
|
+
--sidebar-primary: oklch(0.9 0.085 181);
|
|
114
|
+
--sidebar-primary-foreground: oklch(0.22 0.05 292);
|
|
115
|
+
--sidebar-accent: oklch(0.3 0.025 65);
|
|
116
|
+
--sidebar-accent-foreground: oklch(0.95 0.005 61);
|
|
117
|
+
--sidebar-border: oklch(0.36 0.04 292);
|
|
118
|
+
--sidebar-ring: oklch(0.9 0.085 181);
|
|
119
|
+
|
|
120
|
+
--gradient-from: var(--primary);
|
|
121
|
+
--gradient-to: var(--ps-violet);
|
|
122
|
+
}
|
|
123
|
+
}
|
package/grid.css
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Responsive column grid.
|
|
3
|
+
*
|
|
4
|
+
* - 14 columns below the breakpoint; 16 columns at ≥1440px.
|
|
5
|
+
* - Max content width of 1440px above the breakpoint; fluid below.
|
|
6
|
+
* - Exposes --col-w for aligning non-grid elements to column widths.
|
|
7
|
+
*
|
|
8
|
+
* Use with Tailwind's arbitrary-grid utilities:
|
|
9
|
+
* <div class="grid grid-cols-[repeat(var(--grid-cols),1fr)] gap-4">
|
|
10
|
+
*
|
|
11
|
+
* Or attach custom columns:
|
|
12
|
+
* <div style={{ gridColumn: 'span 6 / span 6' }}>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@layer base {
|
|
16
|
+
:root {
|
|
17
|
+
--grid-cols: 14;
|
|
18
|
+
--grid-gaps: calc(var(--grid-cols) - 1);
|
|
19
|
+
--grid-max-w: calc(var(--grid-cols) * 6rem - 1rem);
|
|
20
|
+
--col-w: calc((min(100vw, var(--grid-max-w)) - var(--grid-gaps) * 1rem) / var(--grid-cols));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (min-width: 1440px) {
|
|
24
|
+
:root {
|
|
25
|
+
--grid-cols: 16;
|
|
26
|
+
--grid-max-w: 1440px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/index.css
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convenience: imports every token file in the correct cascade order.
|
|
3
|
+
*
|
|
4
|
+
* Import in your app's top-level CSS:
|
|
5
|
+
* @import '@precisa-saude/themes';
|
|
6
|
+
*
|
|
7
|
+
* Or cherry-pick the modules you need:
|
|
8
|
+
* @import '@precisa-saude/themes/base.css';
|
|
9
|
+
* @import '@precisa-saude/themes/colors.css';
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@import './base.css';
|
|
13
|
+
@import './colors.css';
|
|
14
|
+
@import './grid.css';
|
|
15
|
+
@import './status.css';
|
|
16
|
+
@import './animations.css';
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@precisa-saude/themes",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Shared CSS design tokens (colors, grid, typography scaffolding, status semantics) for Precisa Saúde repositories.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css",
|
|
7
|
+
"design-tokens",
|
|
8
|
+
"themes",
|
|
9
|
+
"oklch",
|
|
10
|
+
"tailwind",
|
|
11
|
+
"precisa-saude"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/Precisa-Saude/tooling.git",
|
|
16
|
+
"directory": "packages/themes"
|
|
17
|
+
},
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"author": "Precisa Saúde",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": "./index.css",
|
|
22
|
+
"./index.css": "./index.css",
|
|
23
|
+
"./base.css": "./base.css",
|
|
24
|
+
"./colors.css": "./colors.css",
|
|
25
|
+
"./grid.css": "./grid.css",
|
|
26
|
+
"./status.css": "./status.css",
|
|
27
|
+
"./animations.css": "./animations.css"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"index.css",
|
|
31
|
+
"base.css",
|
|
32
|
+
"colors.css",
|
|
33
|
+
"grid.css",
|
|
34
|
+
"status.css",
|
|
35
|
+
"animations.css",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.0.0"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/status.css
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic status colors: success, warning, elevated, critical, info.
|
|
3
|
+
*
|
|
4
|
+
* Each exposes a base color, a foreground (for text on top), and a tint
|
|
5
|
+
* (for backgrounds / pill fills). Values in OKLCh; light and dark variants.
|
|
6
|
+
*
|
|
7
|
+
* Example usage with Tailwind v4's arbitrary values:
|
|
8
|
+
* <span class="bg-[var(--status-success)] text-[var(--status-success-foreground)]">
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@layer base {
|
|
12
|
+
:root {
|
|
13
|
+
--status-success: oklch(0.55 0.15 145);
|
|
14
|
+
--status-success-foreground: oklch(0.98 0 0);
|
|
15
|
+
--status-success-tint: oklch(0.9 0.023 145);
|
|
16
|
+
|
|
17
|
+
--status-warning: oklch(0.65 0.15 85);
|
|
18
|
+
--status-warning-foreground: oklch(0.98 0 0);
|
|
19
|
+
--status-warning-tint: oklch(0.91 0.023 85);
|
|
20
|
+
|
|
21
|
+
--status-elevated: oklch(0.6 0.17 55);
|
|
22
|
+
--status-elevated-foreground: oklch(0.98 0 0);
|
|
23
|
+
--status-elevated-tint: oklch(0.91 0.026 55);
|
|
24
|
+
|
|
25
|
+
--status-critical: oklch(0.55 0.2 25);
|
|
26
|
+
--status-critical-foreground: oklch(0.98 0 0);
|
|
27
|
+
--status-critical-tint: oklch(0.9 0.03 25);
|
|
28
|
+
|
|
29
|
+
--status-info: oklch(0.55 0.15 250);
|
|
30
|
+
--status-info-foreground: oklch(0.98 0 0);
|
|
31
|
+
--status-info-tint: oklch(0.9 0.023 250);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dark {
|
|
35
|
+
--status-success: oklch(0.7 0.15 145);
|
|
36
|
+
--status-success-foreground: oklch(0.15 0.02 145);
|
|
37
|
+
--status-success-tint: oklch(0.33 0.023 145);
|
|
38
|
+
|
|
39
|
+
--status-warning: oklch(0.75 0.15 85);
|
|
40
|
+
--status-warning-foreground: oklch(0.15 0.02 85);
|
|
41
|
+
--status-warning-tint: oklch(0.33 0.023 85);
|
|
42
|
+
|
|
43
|
+
--status-elevated: oklch(0.72 0.15 55);
|
|
44
|
+
--status-elevated-foreground: oklch(0.15 0.02 55);
|
|
45
|
+
--status-elevated-tint: oklch(0.33 0.023 55);
|
|
46
|
+
|
|
47
|
+
--status-critical: oklch(0.7 0.18 25);
|
|
48
|
+
--status-critical-foreground: oklch(0.15 0.02 25);
|
|
49
|
+
--status-critical-tint: oklch(0.33 0.027 25);
|
|
50
|
+
|
|
51
|
+
--status-info: oklch(0.7 0.15 250);
|
|
52
|
+
--status-info-foreground: oklch(0.15 0.02 250);
|
|
53
|
+
--status-info-tint: oklch(0.33 0.023 250);
|
|
54
|
+
}
|
|
55
|
+
}
|