ptech-tokens 0.4.0 → 0.5.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/README.md +8 -2
- package/package.json +1 -1
- package/src/foundation.css +98 -0
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ The package exposes three CSS entry points:
|
|
|
39
39
|
**Hosts that want to re-theme** without replacing the library should apply CSS custom property overrides on `:root` (or a more-specific selector) in a stylesheet that loads after the library injects:
|
|
40
40
|
|
|
41
41
|
```css
|
|
42
|
-
/* host-overrides.css — loaded after
|
|
42
|
+
/* host-overrides.css — loaded after ptechlibraryv3 remote */
|
|
43
43
|
:root {
|
|
44
44
|
--color-ps-aqua: #00b8c7;
|
|
45
45
|
}
|
|
@@ -68,7 +68,7 @@ For hosts that manage their own CSS pipeline (not MF injection), the supported l
|
|
|
68
68
|
|
|
69
69
|
```ts
|
|
70
70
|
import "ptech-tokens/index.css"; // 1. token primitives (unlayered :root)
|
|
71
|
-
import "
|
|
71
|
+
import "ptechlibraryv3/dist/styles.css"; // 2. library recipes
|
|
72
72
|
import "./host-overrides.css"; // 3. host overrides — last wins
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -252,6 +252,12 @@ Classes defined in `foundation.css`:
|
|
|
252
252
|
| `.ps-card-solid` | components | Canonical single-layer card: solid `--color-ps-surface`, token border, `--radius-2xl` (16px), soft `--shadow-ps-card` — no gradient, no glow. One bordered card per region; never nest cards |
|
|
253
253
|
| `.ps-section-wrap` | components | Tinted `--color-ps-section` container (radius `--radius-2xl`, padding `--space-lg`) that groups cards/rows |
|
|
254
254
|
| `.ps-row` | components | Borderless flat list/settings row: `--color-ps-row` fill, `--radius-lg` (8px), lightens to `--color-ps-row-hover` on hover/focus-within. Layout (flex, padding) stays with the consumer |
|
|
255
|
+
| `.ps-field-label` | components | Compact uppercase field label using token typography and subtle text colour |
|
|
256
|
+
| `.ps-control-shell` | components | Shared input/select/search shell with token surface, border, hover, focus, invalid, and disabled states |
|
|
257
|
+
| `.ps-control-input` | components | Transparent inner input reset that inherits token text and placeholder colours |
|
|
258
|
+
| `.ps-control-icon` | components | Accent-coloured decorative/control icon helper |
|
|
259
|
+
| `.ps-control-action` | components | Compact icon action button helper with token hover and focus states |
|
|
260
|
+
| `.ps-icon-well` | components | Token-tinted icon container for status and leading visual affordances |
|
|
255
261
|
|
|
256
262
|
### Adding or removing tokens
|
|
257
263
|
|
package/package.json
CHANGED
package/src/foundation.css
CHANGED
|
@@ -99,4 +99,102 @@
|
|
|
99
99
|
.ps-row:focus-within {
|
|
100
100
|
background-color: var(--color-ps-row-hover);
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
/* ---------- Shared form/control recipes ----------
|
|
104
|
+
Framework-agnostic shell, icon, and action affordances for inputs,
|
|
105
|
+
selects, search fields, compact toolbar controls, and demo knobs. */
|
|
106
|
+
.ps-field-label {
|
|
107
|
+
color: var(--color-ps-text-subtle);
|
|
108
|
+
font-size: var(--font-size-xs);
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
line-height: var(--line-height-xs);
|
|
111
|
+
text-transform: uppercase;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ps-control-shell {
|
|
115
|
+
background-color: color-mix(in srgb, var(--color-ps-surface) 84%, var(--color-surface-sink));
|
|
116
|
+
border: 1px solid var(--color-ps-border);
|
|
117
|
+
border-radius: var(--radius-xl);
|
|
118
|
+
box-shadow: inset 0 1px 2px color-mix(in srgb, var(--color-surface-sink) 52%, transparent);
|
|
119
|
+
transition:
|
|
120
|
+
background-color var(--duration-fast) var(--ease-standard),
|
|
121
|
+
border-color var(--duration-fast) var(--ease-standard),
|
|
122
|
+
box-shadow var(--duration-fast) var(--ease-standard);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ps-control-shell:hover {
|
|
126
|
+
border-color: color-mix(in srgb, var(--color-ps-aqua) 22%, var(--color-ps-border-hover));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ps-control-shell:focus-within {
|
|
130
|
+
border-color: var(--color-ps-aqua);
|
|
131
|
+
box-shadow:
|
|
132
|
+
inset 0 1px 2px color-mix(in srgb, var(--color-surface-sink) 48%, transparent),
|
|
133
|
+
0 0 0 3px color-mix(in srgb, var(--color-ps-aqua) 22%, transparent);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ps-control-shell.is-invalid {
|
|
137
|
+
border-color: var(--color-ps-error);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ps-control-shell.is-invalid:focus-within {
|
|
141
|
+
box-shadow:
|
|
142
|
+
inset 0 1px 2px color-mix(in srgb, var(--color-surface-sink) 48%, transparent),
|
|
143
|
+
0 0 0 3px color-mix(in srgb, var(--color-ps-error) 22%, transparent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ps-control-shell.is-disabled {
|
|
147
|
+
cursor: not-allowed;
|
|
148
|
+
opacity: var(--opacity-disabled);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ps-control-input {
|
|
152
|
+
background: transparent;
|
|
153
|
+
border: 0;
|
|
154
|
+
color: var(--color-ps-text);
|
|
155
|
+
outline: none;
|
|
156
|
+
width: 100%;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ps-control-input::placeholder {
|
|
160
|
+
color: var(--color-ps-text-subtle);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ps-control-icon {
|
|
164
|
+
color: var(--color-ps-aqua);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.ps-control-action {
|
|
168
|
+
align-items: center;
|
|
169
|
+
background-color: transparent;
|
|
170
|
+
border: 1px solid transparent;
|
|
171
|
+
border-radius: var(--radius-lg);
|
|
172
|
+
color: var(--color-ps-text-subtle);
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
transition:
|
|
176
|
+
background-color var(--duration-fast) var(--ease-standard),
|
|
177
|
+
color var(--duration-fast) var(--ease-standard),
|
|
178
|
+
border-color var(--duration-fast) var(--ease-standard);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.ps-control-action:hover {
|
|
182
|
+
background-color: var(--color-ps-row-hover);
|
|
183
|
+
color: var(--color-ps-aqua);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ps-control-action:focus-visible {
|
|
187
|
+
outline: none;
|
|
188
|
+
box-shadow: 0 0 0 var(--focus-ring-width) var(--color-focus-ring);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ps-icon-well {
|
|
192
|
+
align-items: center;
|
|
193
|
+
background-color: color-mix(in srgb, var(--color-ps-aqua) 12%, transparent);
|
|
194
|
+
border: 1px solid color-mix(in srgb, var(--color-ps-aqua) 24%, transparent);
|
|
195
|
+
border-radius: var(--radius-xl);
|
|
196
|
+
color: var(--color-ps-aqua);
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
}
|
|
102
200
|
}
|