@auriel/peppertino 0.2.0 → 0.4.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.
Files changed (46) hide show
  1. package/CHANGELOG.txt +122 -56
  2. package/README.md +333 -38
  3. package/dist/accordion.js +51 -0
  4. package/dist/accordion.js.map +7 -0
  5. package/dist/carousel.js +152 -0
  6. package/dist/carousel.js.map +7 -0
  7. package/dist/header.js +30 -3
  8. package/dist/header.js.map +2 -2
  9. package/dist/main.css +4660 -710
  10. package/dist/main.css.map +1 -1
  11. package/dist/modal.js +61 -2
  12. package/dist/modal.js.map +2 -2
  13. package/dist/peppertino.js +477 -17
  14. package/dist/peppertino.js.map +4 -4
  15. package/dist/select.js +25 -8
  16. package/dist/select.js.map +3 -3
  17. package/dist/tabs.js +31 -4
  18. package/dist/tabs.js.map +2 -2
  19. package/dist/validation.js +130 -0
  20. package/dist/validation.js.map +7 -0
  21. package/index.html +1493 -42
  22. package/package.json +1 -1
  23. package/src/js/accordion.js +61 -0
  24. package/src/js/carousel.js +148 -0
  25. package/src/js/peppertino.js +4 -0
  26. package/src/js/validation.js +132 -0
  27. package/src/scss/accordion.scss +156 -0
  28. package/src/scss/alert.scss +204 -0
  29. package/src/scss/base.scss +130 -16
  30. package/src/scss/card.scss +4 -4
  31. package/src/scss/carousel.scss +313 -0
  32. package/src/scss/dark-mode.scss +474 -0
  33. package/src/scss/footer.scss +224 -0
  34. package/src/scss/forms/fieldset.scss +127 -0
  35. package/src/scss/forms/form-instructions.scss +133 -0
  36. package/src/scss/forms/label.scss +115 -0
  37. package/src/scss/forms/text-field.scss +240 -0
  38. package/src/scss/forms/validation.scss +215 -0
  39. package/src/scss/forms.scss +8 -0
  40. package/src/scss/header.scss +8 -8
  41. package/src/scss/main.scss +7 -0
  42. package/src/scss/section.scss +1 -1
  43. package/src/scss/select.scss +5 -5
  44. package/src/scss/table.scss +5 -5
  45. package/src/scss/utilities.scss +243 -0
  46. package/.claude/settings.local.json +0 -8
@@ -0,0 +1,127 @@
1
+ // PeppertinoCSS — Forms / Fieldset & Legend
2
+
3
+ @use 'sass:map';
4
+ @use '../base' as *;
5
+
6
+ // ─── Fieldset ─────────────────────────────────────────────────────────────────
7
+ .pp-fieldset,
8
+ fieldset.pp-fieldset {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: spacing(4);
12
+ width: 100%;
13
+ padding: spacing(6);
14
+ margin: 0;
15
+ background: var(--pp-bg-card);
16
+ border: 1px solid $color-border;
17
+ border-radius: 12px;
18
+ min-width: 0;
19
+ }
20
+
21
+ // ─── Legend ──────────────────────────────────────────────────────────────────
22
+ .pp-legend,
23
+ .pp-fieldset > legend {
24
+ float: left;
25
+ width: 100%;
26
+ padding: 0 0 spacing(4) 0;
27
+ margin-bottom: spacing(2);
28
+ border-bottom: 1px solid $color-border;
29
+ font-family: $font-sans;
30
+ font-size: font-size('sm');
31
+ font-weight: map.get($font-weights, 'semibold');
32
+ letter-spacing: 0.06em;
33
+ text-transform: uppercase;
34
+ color: $color-neutral-500;
35
+ line-height: 1.4;
36
+
37
+ & + * { clear: both; }
38
+ }
39
+
40
+ // ─── Variants ────────────────────────────────────────────────────────────────
41
+ .pp-fieldset--ghost {
42
+ background: var(--pp-neutral-50);
43
+ border-color: transparent;
44
+ }
45
+
46
+ .pp-fieldset--filled {
47
+ background: var(--pp-neutral-100);
48
+ border-color: var(--pp-neutral-200);
49
+ }
50
+
51
+ .pp-fieldset--primary {
52
+ border-color: rgba($color-primary, 0.35);
53
+ box-shadow: 0 0 0 3px rgba($color-primary, 0.06);
54
+
55
+ .pp-fieldset > legend,
56
+ .pp-legend {
57
+ color: $color-primary;
58
+ border-bottom-color: rgba($color-primary, 0.2);
59
+ }
60
+ }
61
+
62
+ .pp-fieldset--error {
63
+ border-color: rgba($color-error, 0.4);
64
+ box-shadow: 0 0 0 3px rgba($color-error, 0.06);
65
+
66
+ .pp-fieldset > legend,
67
+ .pp-legend {
68
+ color: $color-error;
69
+ border-bottom-color: rgba($color-error, 0.2);
70
+ }
71
+ }
72
+
73
+ .pp-fieldset[disabled],
74
+ .pp-fieldset[aria-disabled='true'] {
75
+ opacity: 0.5;
76
+ pointer-events: none;
77
+ cursor: not-allowed;
78
+ }
79
+
80
+ // ─── Legend size modifiers ────────────────────────────────────────────────────
81
+ .pp-legend--sm {
82
+ font-size: font-size('xs');
83
+ padding-bottom: spacing(3);
84
+ margin-bottom: spacing(1);
85
+ }
86
+
87
+ .pp-legend--lg {
88
+ font-size: font-size('base');
89
+ font-weight: map.get($font-weights, 'bold');
90
+ letter-spacing: -0.01em;
91
+ text-transform: none;
92
+ padding-bottom: spacing(4);
93
+ }
94
+
95
+ .pp-legend--inline {
96
+ display: flex;
97
+ align-items: center;
98
+ gap: spacing(2);
99
+
100
+ svg,
101
+ [data-lucide] {
102
+ flex-shrink: 0;
103
+ width: 1em;
104
+ height: 1em;
105
+ stroke: currentColor;
106
+ fill: none;
107
+ stroke-width: 2;
108
+ stroke-linecap: round;
109
+ stroke-linejoin: round;
110
+ }
111
+ }
112
+
113
+ // ─── Forced-colors ───────────────────────────────────────────────────────────
114
+ @media (forced-colors: active) {
115
+ .pp-fieldset,
116
+ fieldset.pp-fieldset {
117
+ border-color: ButtonText;
118
+ forced-color-adjust: auto;
119
+ }
120
+
121
+ .pp-legend,
122
+ .pp-fieldset > legend {
123
+ color: ButtonText;
124
+ border-bottom-color: ButtonText;
125
+ forced-color-adjust: auto;
126
+ }
127
+ }
@@ -0,0 +1,133 @@
1
+ // PeppertinoCSS — Forms / Form Instructions
2
+
3
+ @use 'sass:map';
4
+ @use '../base' as *;
5
+
6
+ // ─── Pre-form instructions block ─────────────────────────────────────────────
7
+ .pp-form-instructions {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: spacing(2);
11
+ width: 100%;
12
+ padding: spacing(4) spacing(5);
13
+ border-left: 3px solid $color-primary;
14
+ border-radius: 0 map.get($radius, 'md') map.get($radius, 'md') 0;
15
+ background: rgba($color-primary, 0.04);
16
+ font-family: $font-sans;
17
+ }
18
+
19
+ .pp-form-instructions__title {
20
+ font-size: font-size('sm');
21
+ font-weight: map.get($font-weights, 'semibold');
22
+ color: $color-neutral-800;
23
+ line-height: 1.4;
24
+ }
25
+
26
+ .pp-form-instructions__list {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: spacing(1);
30
+ list-style: none;
31
+ padding: 0;
32
+ margin: 0;
33
+ }
34
+
35
+ .pp-form-instructions__item {
36
+ display: flex;
37
+ align-items: flex-start;
38
+ gap: spacing(2);
39
+ font-size: font-size('sm');
40
+ font-weight: map.get($font-weights, 'regular');
41
+ color: $color-neutral-600;
42
+ line-height: 1.6;
43
+
44
+ &::before {
45
+ content: '';
46
+ flex-shrink: 0;
47
+ width: 5px;
48
+ height: 5px;
49
+ margin-top: 0.45em;
50
+ border-radius: 50%;
51
+ background: $color-primary;
52
+ }
53
+ }
54
+
55
+ // ─── Variants ────────────────────────────────────────────────────────────────
56
+ .pp-form-instructions--neutral {
57
+ border-left-color: $color-neutral-400;
58
+ background: $color-neutral-50;
59
+
60
+ .pp-form-instructions__item::before { background: $color-neutral-400; }
61
+ }
62
+
63
+ .pp-form-instructions--warning {
64
+ border-left-color: $color-warning;
65
+ background: rgba($color-warning, 0.06);
66
+
67
+ .pp-form-instructions__title { color: #92400e; }
68
+ .pp-form-instructions__item { color: #92400e; }
69
+ .pp-form-instructions__item::before { background: $color-warning; }
70
+ }
71
+
72
+ .pp-form-instructions--error {
73
+ border-left-color: $color-error;
74
+ background: rgba($color-error, 0.05);
75
+
76
+ .pp-form-instructions__title { color: $color-primary-dark; }
77
+ .pp-form-instructions__item { color: $color-primary-dark; }
78
+ .pp-form-instructions__item::before { background: $color-error; }
79
+ }
80
+
81
+ // ─── In-form hint ─────────────────────────────────────────────────────────────
82
+ .pp-form-hint {
83
+ display: flex;
84
+ align-items: flex-start;
85
+ gap: spacing(2);
86
+ font-family: $font-sans;
87
+ font-size: font-size('xs');
88
+ font-weight: map.get($font-weights, 'regular');
89
+ color: $color-neutral-600;
90
+ line-height: 1.6;
91
+ padding: spacing(2) 0;
92
+
93
+ [data-lucide], svg {
94
+ flex-shrink: 0;
95
+ width: 14px;
96
+ height: 14px;
97
+ margin-top: 1px;
98
+ stroke: $color-neutral-400;
99
+ fill: none;
100
+ stroke-width: 2;
101
+ stroke-linecap: round;
102
+ stroke-linejoin: round;
103
+ }
104
+ }
105
+
106
+ // ─── Required-field note ─────────────────────────────────────────────────────
107
+ .pp-form-required-note {
108
+ font-family: $font-sans;
109
+ font-size: font-size('xs');
110
+ color: $color-neutral-600;
111
+ line-height: 1.5;
112
+
113
+ abbr {
114
+ font-weight: map.get($font-weights, 'semibold');
115
+ color: $color-primary-dark;
116
+ text-decoration: none;
117
+ border: none;
118
+ }
119
+ }
120
+
121
+ // ─── Forced-colors ───────────────────────────────────────────────────────────
122
+ @media (forced-colors: active) {
123
+ .pp-form-instructions {
124
+ border-left-color: Highlight;
125
+ background: transparent;
126
+ forced-color-adjust: auto;
127
+ }
128
+
129
+ .pp-form-instructions__item::before {
130
+ background: Highlight;
131
+ forced-color-adjust: none;
132
+ }
133
+ }
@@ -0,0 +1,115 @@
1
+ // PeppertinoCSS — Forms / Label
2
+
3
+ @use 'sass:map';
4
+ @use '../base' as *;
5
+
6
+ :root {
7
+ --pp-label-primary: #{$color-neutral-900};
8
+ --pp-label-secondary: #{$color-neutral-500};
9
+ --pp-label-tertiary: #{$color-neutral-400};
10
+ --pp-label-quaternary: #{$color-neutral-300};
11
+ }
12
+
13
+ // ─── Base ─────────────────────────────────────────────────────────────────────
14
+ .pp-label {
15
+ display: inline-block;
16
+ font-family: $font-sans;
17
+ font-size: font-size('base');
18
+ font-weight: map.get($font-weights, 'regular');
19
+ line-height: 1.5;
20
+ letter-spacing: -0.011em;
21
+ color: var(--pp-label-primary);
22
+ user-select: none;
23
+ cursor: default;
24
+ max-width: 100%;
25
+ }
26
+
27
+ // ─── Importance tiers ────────────────────────────────────────────────────────
28
+ .pp-label--primary { color: var(--pp-label-primary); }
29
+ .pp-label--secondary { color: var(--pp-label-secondary); }
30
+ .pp-label--tertiary { color: var(--pp-label-tertiary); }
31
+ .pp-label--quaternary { color: var(--pp-label-quaternary); }
32
+
33
+ // ─── Size scale ──────────────────────────────────────────────────────────────
34
+ .pp-label--headline {
35
+ font-size: font-size('xl');
36
+ font-weight: map.get($font-weights, 'semibold');
37
+ letter-spacing: -0.02em;
38
+ line-height: 1.25;
39
+ }
40
+
41
+ .pp-label--subheadline {
42
+ font-size: font-size('base');
43
+ font-weight: map.get($font-weights, 'medium');
44
+ letter-spacing: -0.011em;
45
+ line-height: 1.4;
46
+ }
47
+
48
+ .pp-label--body {
49
+ font-size: font-size('base');
50
+ font-weight: map.get($font-weights, 'regular');
51
+ letter-spacing: -0.011em;
52
+ line-height: 1.5;
53
+ }
54
+
55
+ .pp-label--callout {
56
+ font-size: font-size('sm');
57
+ font-weight: map.get($font-weights, 'regular');
58
+ letter-spacing: -0.009em;
59
+ line-height: 1.5;
60
+ }
61
+
62
+ .pp-label--footnote {
63
+ font-size: font-size('xs');
64
+ font-weight: map.get($font-weights, 'regular');
65
+ letter-spacing: 0;
66
+ line-height: 1.4;
67
+ }
68
+
69
+ .pp-label--caption {
70
+ font-size: font-size('xs');
71
+ font-weight: map.get($font-weights, 'medium');
72
+ letter-spacing: 0.01em;
73
+ line-height: 1.4;
74
+ text-transform: uppercase;
75
+ }
76
+
77
+ // ─── Modifiers ───────────────────────────────────────────────────────────────
78
+ .pp-label--selectable {
79
+ user-select: text;
80
+ cursor: text;
81
+ }
82
+
83
+ .pp-label--truncate {
84
+ overflow: hidden;
85
+ text-overflow: ellipsis;
86
+ white-space: nowrap;
87
+ display: block;
88
+ }
89
+
90
+ // ─── Icon + label row ────────────────────────────────────────────────────────
91
+ .pp-label-row {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ gap: spacing(2);
95
+ color: var(--pp-label-primary);
96
+
97
+ svg,
98
+ [data-lucide] {
99
+ flex-shrink: 0;
100
+ width: 1em;
101
+ height: 1em;
102
+ }
103
+ }
104
+
105
+ // ─── Forced-colors ───────────────────────────────────────────────────────────
106
+ @media (forced-colors: active) {
107
+ .pp-label,
108
+ .pp-label--primary,
109
+ .pp-label--secondary,
110
+ .pp-label--tertiary,
111
+ .pp-label--quaternary {
112
+ color: ButtonText;
113
+ forced-color-adjust: auto;
114
+ }
115
+ }
@@ -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: var(--pp-bg-input);
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: var(--pp-neutral-100);
83
+ }
84
+
85
+ &[readonly] {
86
+ background: var(--pp-neutral-50);
87
+ color: var(--pp-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
+ }