@auriel/peppertino 0.2.0 → 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.
@@ -0,0 +1,240 @@
1
+ // PeppertinoCSS — Forms / Text Field
2
+
3
+ @use 'sass:map';
4
+ @use '../base' as *;
5
+
6
+ // ─── Field wrapper ────────────────────────────────────────────────────────────
7
+ .pp-field {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: spacing(1);
11
+ width: 100%;
12
+ }
13
+
14
+ // ─── Label row ───────────────────────────────────────────────────────────────
15
+ .pp-field__label {
16
+ display: flex;
17
+ align-items: baseline;
18
+ gap: spacing(2);
19
+ font-family: $font-sans;
20
+ font-size: font-size('sm');
21
+ font-weight: map.get($font-weights, 'medium');
22
+ color: $color-neutral-700;
23
+ line-height: 1.4;
24
+ cursor: default;
25
+ }
26
+
27
+ .pp-field__required {
28
+ font-style: normal;
29
+ font-size: font-size('sm');
30
+ font-weight: map.get($font-weights, 'semibold');
31
+ color: $color-primary-dark;
32
+ text-decoration: none;
33
+ border: none;
34
+ cursor: default;
35
+
36
+ &::before { content: '*'; }
37
+ }
38
+
39
+ .pp-field__optional {
40
+ font-size: font-size('xs');
41
+ font-weight: map.get($font-weights, 'regular');
42
+ color: $color-neutral-400;
43
+ letter-spacing: 0.02em;
44
+ }
45
+
46
+ // ─── Input / Textarea ─────────────────────────────────────────────────────────
47
+ .pp-field__input,
48
+ .pp-field__textarea {
49
+ display: block;
50
+ width: 100%;
51
+ font-family: $font-sans;
52
+ font-size: font-size('base');
53
+ font-weight: map.get($font-weights, 'regular');
54
+ color: $color-on-surface;
55
+ background: #fff;
56
+ border: 1px solid $color-border;
57
+ border-radius: map.get($radius, 'md');
58
+ padding: 10px spacing(4);
59
+ transition: border-color $transition-fast, box-shadow $transition-fast;
60
+ outline: none;
61
+ appearance: none;
62
+ -webkit-appearance: none;
63
+
64
+ &::placeholder {
65
+ color: $color-neutral-500;
66
+ opacity: 1;
67
+ }
68
+
69
+ &:hover:not(:disabled):not([aria-disabled='true']) {
70
+ border-color: $color-neutral-400;
71
+ }
72
+
73
+ &:focus {
74
+ border-color: $color-primary;
75
+ box-shadow: 0 0 0 3px rgba($color-primary, 0.12);
76
+ }
77
+
78
+ &:disabled,
79
+ &[aria-disabled='true'] {
80
+ opacity: 0.5;
81
+ cursor: not-allowed;
82
+ background: $color-neutral-100;
83
+ }
84
+
85
+ &[readonly] {
86
+ background: $color-neutral-50;
87
+ color: $color-neutral-600;
88
+ cursor: default;
89
+ }
90
+ }
91
+
92
+ .pp-field__textarea {
93
+ padding: spacing(3) spacing(4);
94
+ resize: vertical;
95
+ min-height: 96px;
96
+ line-height: 1.6;
97
+ }
98
+
99
+ // ─── Hint text ───────────────────────────────────────────────────────────────
100
+ .pp-field__hint {
101
+ font-family: $font-sans;
102
+ font-size: font-size('xs');
103
+ font-weight: map.get($font-weights, 'regular');
104
+ color: $color-neutral-600;
105
+ line-height: 1.5;
106
+ }
107
+
108
+ // ─── Validation message ───────────────────────────────────────────────────────
109
+ .pp-field__message {
110
+ display: flex;
111
+ align-items: flex-start;
112
+ gap: spacing(1);
113
+ font-family: $font-sans;
114
+ font-size: font-size('xs');
115
+ font-weight: map.get($font-weights, 'medium');
116
+ line-height: 1.5;
117
+
118
+ [data-lucide],
119
+ svg {
120
+ flex-shrink: 0;
121
+ width: 14px;
122
+ height: 14px;
123
+ margin-top: 1px;
124
+ stroke: currentColor;
125
+ fill: none;
126
+ stroke-width: 2;
127
+ stroke-linecap: round;
128
+ stroke-linejoin: round;
129
+ }
130
+ }
131
+
132
+ // ─── Validation states ────────────────────────────────────────────────────────
133
+ .pp-field--error {
134
+ .pp-field__input,
135
+ .pp-field__textarea {
136
+ border-color: $color-error;
137
+ &:focus { border-color: $color-error; box-shadow: 0 0 0 3px rgba($color-error, 0.12); }
138
+ }
139
+ .pp-field__message {
140
+ color: $color-primary-dark;
141
+ [data-lucide], svg { stroke: $color-error; }
142
+ }
143
+ }
144
+
145
+ .pp-field--success {
146
+ .pp-field__input,
147
+ .pp-field__textarea {
148
+ border-color: $color-success;
149
+ &:focus { border-color: $color-success; box-shadow: 0 0 0 3px rgba($color-success, 0.12); }
150
+ }
151
+ .pp-field__message {
152
+ color: #15803d;
153
+ [data-lucide], svg { stroke: $color-success; }
154
+ }
155
+ }
156
+
157
+ .pp-field--warning {
158
+ .pp-field__input,
159
+ .pp-field__textarea {
160
+ border-color: $color-warning;
161
+ &:focus { border-color: $color-warning; box-shadow: 0 0 0 3px rgba($color-warning, 0.12); }
162
+ }
163
+ .pp-field__message {
164
+ color: #92400e;
165
+ [data-lucide], svg { stroke: $color-warning; }
166
+ }
167
+ }
168
+
169
+ // ─── Sizes ────────────────────────────────────────────────────────────────────
170
+ .pp-field--sm {
171
+ .pp-field__input,
172
+ .pp-field__textarea {
173
+ padding: spacing(1) spacing(3);
174
+ font-size: font-size('sm');
175
+ border-radius: map.get($radius, 'base');
176
+ }
177
+ }
178
+
179
+ .pp-field--lg {
180
+ .pp-field__input,
181
+ .pp-field__textarea {
182
+ padding: spacing(3) spacing(5);
183
+ font-size: font-size('lg');
184
+ border-radius: map.get($radius, 'lg');
185
+ }
186
+ }
187
+
188
+ // ─── Icon wrap ────────────────────────────────────────────────────────────────
189
+ .pp-field__input-wrap {
190
+ position: relative;
191
+ display: flex;
192
+ align-items: center;
193
+
194
+ .pp-field__input { padding-left: spacing(10); }
195
+ &--trail .pp-field__input { padding-right: spacing(10); }
196
+ }
197
+
198
+ .pp-field__icon {
199
+ position: absolute;
200
+ left: spacing(3);
201
+ display: flex;
202
+ align-items: center;
203
+ pointer-events: none;
204
+ color: $color-neutral-400;
205
+
206
+ [data-lucide], svg {
207
+ width: 16px;
208
+ height: 16px;
209
+ stroke: currentColor;
210
+ fill: none;
211
+ stroke-width: 2;
212
+ stroke-linecap: round;
213
+ stroke-linejoin: round;
214
+ }
215
+
216
+ &--trail { left: auto; right: spacing(3); }
217
+ }
218
+
219
+ // ─── Character count ──────────────────────────────────────────────────────────
220
+ .pp-field__count {
221
+ font-family: $font-sans;
222
+ font-size: font-size('xs');
223
+ color: $color-neutral-400;
224
+ text-align: right;
225
+ line-height: 1.4;
226
+
227
+ &--warn { color: #92400e; }
228
+ &--over { color: $color-primary-dark; font-weight: map.get($font-weights, 'medium'); }
229
+ }
230
+
231
+ // ─── Forced-colors ───────────────────────────────────────────────────────────
232
+ @media (forced-colors: active) {
233
+ .pp-field__input,
234
+ .pp-field__textarea {
235
+ border-color: ButtonText;
236
+ forced-color-adjust: auto;
237
+ }
238
+
239
+ .pp-field__required { color: LinkText; }
240
+ }
@@ -0,0 +1,215 @@
1
+ // PeppertinoCSS — Forms / Validation
2
+
3
+ @use 'sass:map';
4
+ @use '../base' as *;
5
+
6
+ // ─── Native pseudo-class states ───────────────────────────────────────────────
7
+ .pp-field--validate {
8
+ .pp-field__input:valid,
9
+ .pp-field__textarea:valid {
10
+ border-color: $color-success;
11
+ &:focus { box-shadow: 0 0 0 3px rgba($color-success, 0.12); }
12
+ }
13
+
14
+ .pp-field__input:invalid,
15
+ .pp-field__textarea:invalid {
16
+ border-color: $color-error;
17
+ &:focus { box-shadow: 0 0 0 3px rgba($color-error, 0.12); }
18
+ }
19
+
20
+ .pp-field__input:user-valid,
21
+ .pp-field__textarea:user-valid { border-color: $color-success; }
22
+
23
+ .pp-field__input:user-invalid,
24
+ .pp-field__textarea:user-invalid { border-color: $color-error; }
25
+ }
26
+
27
+ // ─── aria-invalid attribute states ───────────────────────────────────────────
28
+ .pp-field__input[aria-invalid='true'],
29
+ .pp-field__textarea[aria-invalid='true'] {
30
+ border-color: $color-error;
31
+ &:focus { border-color: $color-error; box-shadow: 0 0 0 3px rgba($color-error, 0.12); }
32
+ }
33
+
34
+ .pp-field__input[aria-invalid='false'],
35
+ .pp-field__textarea[aria-invalid='false'] {
36
+ border-color: $color-success;
37
+ &:focus { border-color: $color-success; box-shadow: 0 0 0 3px rgba($color-success, 0.12); }
38
+ }
39
+
40
+ // ─── Validating (async in progress) ──────────────────────────────────────────
41
+ .pp-field--validating {
42
+ .pp-field__input,
43
+ .pp-field__textarea {
44
+ border-color: $color-neutral-300;
45
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");
46
+ background-repeat: no-repeat;
47
+ background-position: right spacing(3) center;
48
+ background-size: 16px;
49
+ padding-right: spacing(10);
50
+ animation: pp-field-spin 0.8s linear infinite;
51
+ }
52
+ }
53
+
54
+ @keyframes pp-field-spin {
55
+ from { filter: none; }
56
+ to { filter: hue-rotate(360deg); }
57
+ }
58
+
59
+ // ─── Validation summary ───────────────────────────────────────────────────────
60
+ .pp-validation-summary {
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: spacing(3);
64
+ padding: spacing(4) spacing(5);
65
+ background: rgba($color-error, 0.05);
66
+ border: 1px solid rgba($color-error, 0.3);
67
+ border-left: 3px solid $color-error;
68
+ border-radius: 0 map.get($radius, 'md') map.get($radius, 'md') 0;
69
+ width: 100%;
70
+
71
+ &:not(.is-visible):not([aria-hidden='false']) { display: none; }
72
+ }
73
+
74
+ .pp-validation-summary__title {
75
+ display: flex;
76
+ align-items: center;
77
+ gap: spacing(2);
78
+ font-family: $font-sans;
79
+ font-size: font-size('sm');
80
+ font-weight: map.get($font-weights, 'semibold');
81
+ color: $color-primary-dark;
82
+ line-height: 1.4;
83
+
84
+ [data-lucide], svg {
85
+ flex-shrink: 0;
86
+ width: 16px;
87
+ height: 16px;
88
+ stroke: $color-error;
89
+ fill: none;
90
+ stroke-width: 2;
91
+ stroke-linecap: round;
92
+ stroke-linejoin: round;
93
+ }
94
+ }
95
+
96
+ .pp-validation-summary__list {
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: spacing(1);
100
+ list-style: none;
101
+ padding: 0;
102
+ margin: 0;
103
+ }
104
+
105
+ .pp-validation-summary__item {
106
+ display: flex;
107
+ align-items: baseline;
108
+ gap: spacing(2);
109
+ font-family: $font-sans;
110
+ font-size: font-size('sm');
111
+ color: $color-primary-dark;
112
+ line-height: 1.6;
113
+
114
+ &::before {
115
+ content: '';
116
+ flex-shrink: 0;
117
+ width: 5px;
118
+ height: 5px;
119
+ margin-bottom: 1px;
120
+ border-radius: 50%;
121
+ background: $color-error;
122
+ align-self: center;
123
+ }
124
+
125
+ a {
126
+ color: $color-primary-dark;
127
+ text-decoration: underline;
128
+ text-underline-offset: 2px;
129
+ font-weight: map.get($font-weights, 'medium');
130
+ transition: color $transition-fast;
131
+
132
+ &:hover { color: $color-primary; }
133
+ &:focus-visible {
134
+ outline: 2px solid $color-primary;
135
+ outline-offset: 2px;
136
+ border-radius: 2px;
137
+ }
138
+ }
139
+ }
140
+
141
+ // ─── Confirmation checkbox ────────────────────────────────────────────────────
142
+ .pp-confirm {
143
+ display: flex;
144
+ align-items: flex-start;
145
+ gap: spacing(3);
146
+ padding: spacing(4);
147
+ background: $color-neutral-50;
148
+ border: 1px solid $color-border;
149
+ border-radius: map.get($radius, 'md');
150
+ cursor: pointer;
151
+ transition: border-color $transition-fast, background $transition-fast;
152
+
153
+ &:has(input:checked) {
154
+ border-color: $color-primary;
155
+ background: rgba($color-primary, 0.04);
156
+ }
157
+
158
+ &:has(input:focus-visible) {
159
+ outline: 2px solid $color-primary;
160
+ outline-offset: 2px;
161
+ }
162
+ }
163
+
164
+ .pp-confirm__input {
165
+ flex-shrink: 0;
166
+ width: 18px;
167
+ height: 18px;
168
+ margin-top: 1px;
169
+ accent-color: $color-primary;
170
+ cursor: pointer;
171
+
172
+ &:focus-visible { outline: none; }
173
+ }
174
+
175
+ .pp-confirm__label {
176
+ font-family: $font-sans;
177
+ font-size: font-size('sm');
178
+ font-weight: map.get($font-weights, 'regular');
179
+ color: $color-neutral-700;
180
+ line-height: 1.6;
181
+ cursor: pointer;
182
+ user-select: none;
183
+ }
184
+
185
+ .pp-confirm--destructive {
186
+ border-color: rgba($color-error, 0.3);
187
+ background: rgba($color-error, 0.03);
188
+
189
+ &:has(input:checked) {
190
+ border-color: $color-error;
191
+ background: rgba($color-error, 0.06);
192
+ }
193
+
194
+ .pp-confirm__label { color: $color-primary-dark; }
195
+ }
196
+
197
+ // Gated submit — disabled until confirmation checkbox is checked
198
+ form:has(.pp-confirm__input:not(:checked)) [type='submit'].pp-submit--gated {
199
+ opacity: 0.4;
200
+ pointer-events: none;
201
+ cursor: not-allowed;
202
+ }
203
+
204
+ // ─── Forced-colors ───────────────────────────────────────────────────────────
205
+ @media (forced-colors: active) {
206
+ .pp-validation-summary {
207
+ border-color: Mark;
208
+ forced-color-adjust: auto;
209
+ }
210
+
211
+ .pp-confirm {
212
+ border-color: ButtonText;
213
+ forced-color-adjust: auto;
214
+ }
215
+ }
@@ -0,0 +1,8 @@
1
+ // PeppertinoCSS — Forms
2
+ // Aggregates all form component partials in alphabetical order.
3
+
4
+ @use 'forms/fieldset';
5
+ @use 'forms/form-instructions';
6
+ @use 'forms/label';
7
+ @use 'forms/text-field';
8
+ @use 'forms/validation';
@@ -3,6 +3,9 @@
3
3
  @use 'base';
4
4
  @use 'button';
5
5
  @use 'card';
6
+ @use 'carousel';
7
+ @use 'footer';
8
+ @use 'forms';
6
9
  @use 'gradient';
7
10
  @use 'header';
8
11
  @use 'modal';
@@ -1,8 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "WebFetch(domain:feathericons.com)",
5
- "WebFetch(domain:github.com)"
6
- ]
7
- }
8
- }