@auriel/peppertino 0.3.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/CHANGELOG.txt +210 -122
- package/MIGRATION.md +52 -0
- package/README.md +284 -40
- package/dist/accordion.js +88 -0
- package/dist/accordion.js.map +7 -0
- package/dist/alert.js +26 -0
- package/dist/alert.js.map +7 -0
- package/dist/carousel.js +4 -0
- package/dist/carousel.js.map +2 -2
- package/dist/header.js +1 -0
- package/dist/header.js.map +2 -2
- package/dist/main.css +3607 -299
- package/dist/main.css.map +1 -1
- package/dist/modal.js +2 -0
- package/dist/modal.js.map +2 -2
- package/dist/peppertino.js +290 -11
- package/dist/peppertino.js.map +3 -3
- package/dist/select.js +2 -4
- package/dist/select.js.map +2 -2
- package/dist/switch.js +29 -0
- package/dist/switch.js.map +7 -0
- package/dist/tabs.js +27 -7
- package/dist/tabs.js.map +2 -2
- package/dist/theme.js +47 -0
- package/dist/theme.js.map +7 -0
- package/dist/toast.js +69 -0
- package/dist/toast.js.map +7 -0
- package/index.html +813 -48
- package/package.json +6 -4
- package/scripts/hex-to-hsl.mjs +75 -0
- package/scripts/lint-bem.mjs +53 -0
- package/scripts/lint-colors.mjs +87 -0
- package/src/js/accordion.js +103 -0
- package/src/js/alert.js +28 -0
- package/src/js/carousel.js +5 -0
- package/src/js/header.js +1 -0
- package/src/js/modal.js +4 -0
- package/src/js/peppertino.js +6 -0
- package/src/js/select.js +2 -4
- package/src/js/switch.js +28 -0
- package/src/js/tabs.js +31 -21
- package/src/js/theme.js +47 -0
- package/src/js/toast.js +79 -0
- package/src/scss/accordion.scss +156 -0
- package/src/scss/alert.scss +203 -0
- package/src/scss/badge.scss +90 -0
- package/src/scss/base.scss +331 -36
- package/src/scss/button.scss +44 -46
- package/src/scss/card.scss +4 -4
- package/src/scss/carousel.scss +18 -28
- package/src/scss/dark-mode.scss +514 -0
- package/src/scss/footer.scss +14 -14
- package/src/scss/forms/fieldset.scss +12 -12
- package/src/scss/forms/form-instructions.scss +8 -8
- package/src/scss/forms/text-field.scss +17 -17
- package/src/scss/forms/validation.scss +12 -12
- package/src/scss/gradient.scss +2 -2
- package/src/scss/header.scss +8 -8
- package/src/scss/main.scss +8 -0
- package/src/scss/modal.scss +2 -2
- package/src/scss/section.scss +1 -1
- package/src/scss/select.scss +8 -8
- package/src/scss/switch.scss +121 -0
- package/src/scss/table.scss +5 -5
- package/src/scss/tabs.scss +26 -26
- package/src/scss/toast.scss +170 -0
- package/src/scss/tooltip.scss +126 -0
- package/src/scss/utilities.scss +243 -0
package/src/scss/tabs.scss
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
gap: spacing(1);
|
|
11
|
-
background:
|
|
11
|
+
background: hsl(var(--pp-neutral-800-h) var(--pp-neutral-800-s) var(--pp-neutral-800-l) / 0.8);
|
|
12
12
|
border-radius: 980px;
|
|
13
13
|
padding: spacing(1);
|
|
14
14
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
cursor: pointer;
|
|
26
26
|
border: 1.5px solid transparent;
|
|
27
27
|
background: transparent;
|
|
28
|
-
color:
|
|
28
|
+
color: rgb(255 255 255 / 0.6);
|
|
29
29
|
font-family: $font-sans;
|
|
30
30
|
font-size: font-size('sm');
|
|
31
31
|
font-weight: map.get($font-weights, 'medium');
|
|
@@ -46,53 +46,53 @@
|
|
|
46
46
|
transition: stroke $transition-base;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
&:hover { color:
|
|
49
|
+
&:hover { color: rgb(255 255 255 / 0.85); }
|
|
50
50
|
|
|
51
51
|
// Default active — filled primary
|
|
52
52
|
&[aria-selected='true'],
|
|
53
53
|
&.is-active {
|
|
54
|
-
background:
|
|
54
|
+
background: var(--pp-primary);
|
|
55
55
|
color: #fff;
|
|
56
56
|
border-color: transparent;
|
|
57
|
-
box-shadow: 0 4px 16px
|
|
57
|
+
box-shadow: 0 4px 16px hsl(var(--pp-primary-h) var(--pp-primary-s) var(--pp-primary-l) / 0.45);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// ─── Variant: outline active pill ────────────────────────────────────────────
|
|
62
62
|
.pp-tabs--outline {
|
|
63
|
-
background:
|
|
63
|
+
background: hsl(var(--pp-neutral-800-h) var(--pp-neutral-800-s) var(--pp-neutral-800-l) / 0.8);
|
|
64
64
|
|
|
65
65
|
.pp-tabs__item {
|
|
66
66
|
&[aria-selected='true'],
|
|
67
67
|
&.is-active {
|
|
68
68
|
background: transparent;
|
|
69
|
-
border-color:
|
|
70
|
-
color:
|
|
71
|
-
box-shadow: 0 0 0 3px
|
|
69
|
+
border-color: var(--pp-primary);
|
|
70
|
+
color: var(--pp-primary);
|
|
71
|
+
box-shadow: 0 0 0 3px hsl(var(--pp-primary-h) var(--pp-primary-s) var(--pp-primary-l) / 0.15);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// ─── Variant: gradient active pill ───────────────────────────────────────────
|
|
77
77
|
.pp-tabs--gradient {
|
|
78
|
-
background:
|
|
78
|
+
background: hsl(var(--pp-neutral-800-h) var(--pp-neutral-800-s) var(--pp-neutral-800-l) / 0.6);
|
|
79
79
|
backdrop-filter: blur(12px);
|
|
80
80
|
-webkit-backdrop-filter: blur(12px);
|
|
81
81
|
|
|
82
82
|
.pp-tabs__item {
|
|
83
83
|
&[aria-selected='true'],
|
|
84
84
|
&.is-active {
|
|
85
|
-
background: linear-gradient(135deg,
|
|
85
|
+
background: linear-gradient(135deg, var(--pp-gradient-start), var(--pp-gradient-end));
|
|
86
86
|
border-color: transparent;
|
|
87
87
|
color: #fff;
|
|
88
|
-
box-shadow: 0 4px 16px
|
|
88
|
+
box-shadow: 0 4px 16px hsl(var(--pp-gradient-end-h) var(--pp-gradient-end-s) var(--pp-gradient-end-l) / 0.4);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// ─── Variant: gradient outline active pill ───────────────────────────────────
|
|
94
94
|
.pp-tabs--gradient-outline {
|
|
95
|
-
background:
|
|
95
|
+
background: hsl(var(--pp-neutral-800-h) var(--pp-neutral-800-s) var(--pp-neutral-800-l) / 0.6);
|
|
96
96
|
backdrop-filter: blur(12px);
|
|
97
97
|
-webkit-backdrop-filter: blur(12px);
|
|
98
98
|
|
|
@@ -100,32 +100,32 @@
|
|
|
100
100
|
&[aria-selected='true'],
|
|
101
101
|
&.is-active {
|
|
102
102
|
background: transparent;
|
|
103
|
-
border-color:
|
|
104
|
-
color:
|
|
103
|
+
border-color: var(--pp-gradient-end);
|
|
104
|
+
color: var(--pp-gradient-start);
|
|
105
105
|
// Simulate gradient border via box-shadow layering
|
|
106
106
|
box-shadow:
|
|
107
|
-
0 0 0 1.5px
|
|
108
|
-
inset 0 0 0 1.5px
|
|
109
|
-
0 4px 16px
|
|
107
|
+
0 0 0 1.5px var(--pp-gradient-end),
|
|
108
|
+
inset 0 0 0 1.5px var(--pp-gradient-start),
|
|
109
|
+
0 4px 16px hsl(var(--pp-gradient-end-h) var(--pp-gradient-end-s) var(--pp-gradient-end-l) / 0.25);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// ─── Variant: light track ────────────────────────────────────────────────────
|
|
115
115
|
.pp-tabs--light {
|
|
116
|
-
background:
|
|
116
|
+
background: var(--pp-neutral-100);
|
|
117
117
|
|
|
118
118
|
.pp-tabs__item {
|
|
119
|
-
color:
|
|
119
|
+
color: var(--pp-neutral-500);
|
|
120
120
|
|
|
121
|
-
&:hover { color:
|
|
121
|
+
&:hover { color: var(--pp-neutral-700); }
|
|
122
122
|
|
|
123
123
|
&[aria-selected='true'],
|
|
124
124
|
&.is-active {
|
|
125
125
|
background: #fff;
|
|
126
126
|
border-color: transparent;
|
|
127
|
-
color:
|
|
128
|
-
box-shadow:
|
|
127
|
+
color: var(--pp-primary);
|
|
128
|
+
box-shadow: var(--pp-shadow-md);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
&[aria-selected='true'],
|
|
134
134
|
&.is-active {
|
|
135
135
|
background: transparent;
|
|
136
|
-
border-color:
|
|
137
|
-
color:
|
|
138
|
-
box-shadow: 0 0 0 3px
|
|
136
|
+
border-color: var(--pp-primary);
|
|
137
|
+
color: var(--pp-primary);
|
|
138
|
+
box-shadow: 0 0 0 3px hsl(var(--pp-primary-h) var(--pp-primary-s) var(--pp-primary-l) / 0.12);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// PeppertinoCSS — Toast
|
|
2
|
+
//
|
|
3
|
+
// CSS-only baseline renders toast markup; JS (toast.js) handles
|
|
4
|
+
// show/dismiss lifecycle and ppToast.show() API.
|
|
5
|
+
|
|
6
|
+
@use 'sass:map';
|
|
7
|
+
@use 'base' as *;
|
|
8
|
+
|
|
9
|
+
// ─── Container ────────────────────────────────────────────────────────────────
|
|
10
|
+
.pp-toast-container {
|
|
11
|
+
position: fixed;
|
|
12
|
+
z-index: z('toast');
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: spacing(2);
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
|
|
18
|
+
&--top-right { top: spacing(5); right: spacing(5); align-items: flex-end; }
|
|
19
|
+
&--top-left { top: spacing(5); left: spacing(5); align-items: flex-start; }
|
|
20
|
+
&--top-center { top: spacing(5); left: 50%; transform: translateX(-50%); align-items: center; }
|
|
21
|
+
&--bottom-right { bottom: spacing(5); right: spacing(5); align-items: flex-end; flex-direction: column-reverse; }
|
|
22
|
+
&--bottom-left { bottom: spacing(5); left: spacing(5); align-items: flex-start; flex-direction: column-reverse; }
|
|
23
|
+
&--bottom-center{ bottom: spacing(5); left: 50%; transform: translateX(-50%); align-items: center; flex-direction: column-reverse; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ─── Toast item ───────────────────────────────────────────────────────────────
|
|
27
|
+
.pp-toast {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: flex-start;
|
|
30
|
+
gap: spacing(3);
|
|
31
|
+
padding: spacing(3) spacing(4);
|
|
32
|
+
border-radius: 12px;
|
|
33
|
+
border: 1px solid transparent;
|
|
34
|
+
background: var(--pp-bg-card);
|
|
35
|
+
box-shadow: var(--pp-shadow-lg);
|
|
36
|
+
font-family: $font-sans;
|
|
37
|
+
font-size: font-size('sm');
|
|
38
|
+
min-width: 280px;
|
|
39
|
+
max-width: 380px;
|
|
40
|
+
pointer-events: all;
|
|
41
|
+
position: relative;
|
|
42
|
+
animation: pp-toast-in 250ms cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes pp-toast-in {
|
|
46
|
+
from { opacity: 0; transform: translateY(8px) scale(0.96); }
|
|
47
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pp-toast.is-dismissing {
|
|
51
|
+
animation: pp-toast-out 200ms ease forwards;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes pp-toast-out {
|
|
55
|
+
from { opacity: 1; transform: scale(1); max-height: 120px; margin-bottom: 0; }
|
|
56
|
+
to { opacity: 0; transform: scale(0.95); max-height: 0; margin-bottom: -8px; }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ─── Icon ─────────────────────────────────────────────────────────────────────
|
|
60
|
+
.pp-toast__icon {
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
width: 20px;
|
|
63
|
+
height: 20px;
|
|
64
|
+
margin-top: 1px;
|
|
65
|
+
|
|
66
|
+
svg, i {
|
|
67
|
+
width: 20px;
|
|
68
|
+
height: 20px;
|
|
69
|
+
stroke: currentColor;
|
|
70
|
+
stroke-width: 2;
|
|
71
|
+
fill: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ─── Body ─────────────────────────────────────────────────────────────────────
|
|
76
|
+
.pp-toast__body {
|
|
77
|
+
flex: 1;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pp-toast__title {
|
|
82
|
+
font-weight: map.get($font-weights, 'semibold');
|
|
83
|
+
color: $color-on-surface;
|
|
84
|
+
margin-bottom: 2px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.pp-toast__message {
|
|
88
|
+
color: var(--pp-neutral-600);
|
|
89
|
+
line-height: 1.5;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ─── Dismiss button ───────────────────────────────────────────────────────────
|
|
93
|
+
.pp-toast__dismiss {
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
width: 22px;
|
|
96
|
+
height: 22px;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
background: transparent;
|
|
101
|
+
border: none;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
color: var(--pp-neutral-400);
|
|
105
|
+
padding: 0;
|
|
106
|
+
margin-top: 1px;
|
|
107
|
+
transition: background $transition-fast, color $transition-fast;
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background: var(--pp-neutral-100);
|
|
111
|
+
color: var(--pp-neutral-700);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
svg {
|
|
115
|
+
width: 14px;
|
|
116
|
+
height: 14px;
|
|
117
|
+
stroke: currentColor;
|
|
118
|
+
fill: none;
|
|
119
|
+
stroke-width: 2.5;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ─── Progress bar ─────────────────────────────────────────────────────────────
|
|
124
|
+
.pp-toast__progress {
|
|
125
|
+
position: absolute;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
right: 0;
|
|
129
|
+
height: 3px;
|
|
130
|
+
border-radius: 0 0 12px 12px;
|
|
131
|
+
background: var(--pp-primary);
|
|
132
|
+
transform-origin: left;
|
|
133
|
+
animation: pp-toast-progress var(--pp-toast-duration, 4000ms) linear forwards;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@keyframes pp-toast-progress {
|
|
137
|
+
from { transform: scaleX(1); }
|
|
138
|
+
to { transform: scaleX(0); }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ─── Color variants ───────────────────────────────────────────────────────────
|
|
142
|
+
.pp-toast--info {
|
|
143
|
+
border-color: hsl(var(--pp-info-h) var(--pp-info-s) var(--pp-info-l) / 0.25);
|
|
144
|
+
.pp-toast__icon { color: var(--pp-info); }
|
|
145
|
+
.pp-toast__progress { background: var(--pp-info); }
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.pp-toast--success {
|
|
149
|
+
border-color: hsl(var(--pp-success-h) var(--pp-success-s) var(--pp-success-l) / 0.25);
|
|
150
|
+
.pp-toast__icon { color: var(--pp-success); }
|
|
151
|
+
.pp-toast__progress { background: var(--pp-success); }
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.pp-toast--warning {
|
|
155
|
+
border-color: hsl(var(--pp-warning-h) var(--pp-warning-s) var(--pp-warning-l) / 0.25);
|
|
156
|
+
.pp-toast__icon { color: var(--pp-warning); }
|
|
157
|
+
.pp-toast__progress { background: var(--pp-warning); }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.pp-toast--error {
|
|
161
|
+
border-color: hsl(var(--pp-error-h) var(--pp-error-s) var(--pp-error-l) / 0.25);
|
|
162
|
+
.pp-toast__icon { color: var(--pp-error); }
|
|
163
|
+
.pp-toast__progress { background: var(--pp-error); }
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.pp-toast--neutral {
|
|
167
|
+
border-color: var(--pp-neutral-200);
|
|
168
|
+
.pp-toast__icon { color: var(--pp-neutral-500); }
|
|
169
|
+
.pp-toast__progress { background: var(--pp-neutral-500); }
|
|
170
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// PeppertinoCSS — Tooltip (CSS-only)
|
|
2
|
+
//
|
|
3
|
+
// Wraps any trigger in .pp-tooltip; the floating text sits in .pp-tooltip__content.
|
|
4
|
+
// Placement: --top (default), --bottom, --left, --right.
|
|
5
|
+
//
|
|
6
|
+
// Example:
|
|
7
|
+
// <span class="pp-tooltip">
|
|
8
|
+
// <button>Hover me</button>
|
|
9
|
+
// <span class="pp-tooltip__content pp-tooltip__content--top">Tip text</span>
|
|
10
|
+
// </span>
|
|
11
|
+
|
|
12
|
+
@use 'base' as *;
|
|
13
|
+
|
|
14
|
+
// ─── Wrapper ──────────────────────────────────────────────────────────────────
|
|
15
|
+
.pp-tooltip {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ─── Floating content ────────────────────────────────────────────────────────
|
|
21
|
+
.pp-tooltip__content {
|
|
22
|
+
position: absolute;
|
|
23
|
+
z-index: z('tooltip');
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
max-width: 220px;
|
|
26
|
+
white-space: normal;
|
|
27
|
+
word-break: break-word;
|
|
28
|
+
padding: spacing(2) spacing(3);
|
|
29
|
+
background: var(--pp-neutral-900);
|
|
30
|
+
color: #fff;
|
|
31
|
+
font-family: $font-sans;
|
|
32
|
+
font-size: font-size('xs');
|
|
33
|
+
line-height: 1.4;
|
|
34
|
+
border-radius: 6px;
|
|
35
|
+
box-shadow: var(--pp-shadow-md);
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
|
|
38
|
+
// Hidden by default
|
|
39
|
+
opacity: 0;
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
transition: opacity 150ms ease, visibility 150ms ease;
|
|
42
|
+
|
|
43
|
+
// Arrow
|
|
44
|
+
&::before {
|
|
45
|
+
content: '';
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 0;
|
|
48
|
+
height: 0;
|
|
49
|
+
border: 5px solid transparent;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ─── Show on hover / focus-within ────────────────────────────────────────────
|
|
54
|
+
.pp-tooltip:hover .pp-tooltip__content,
|
|
55
|
+
.pp-tooltip:focus-within .pp-tooltip__content,
|
|
56
|
+
.pp-tooltip__content[data-show] {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
visibility: visible;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ─── Placement: top (default) ─────────────────────────────────────────────────
|
|
62
|
+
.pp-tooltip__content,
|
|
63
|
+
.pp-tooltip__content--top {
|
|
64
|
+
bottom: calc(100% + 8px);
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translateX(-50%);
|
|
67
|
+
|
|
68
|
+
&::before {
|
|
69
|
+
top: 100%;
|
|
70
|
+
left: 50%;
|
|
71
|
+
transform: translateX(-50%);
|
|
72
|
+
border-top-color: var(--pp-neutral-900);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ─── Placement: bottom ───────────────────────────────────────────────────────
|
|
77
|
+
.pp-tooltip__content--bottom {
|
|
78
|
+
top: calc(100% + 8px);
|
|
79
|
+
left: 50%;
|
|
80
|
+
bottom: auto;
|
|
81
|
+
transform: translateX(-50%);
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
bottom: 100%;
|
|
85
|
+
top: auto;
|
|
86
|
+
left: 50%;
|
|
87
|
+
transform: translateX(-50%);
|
|
88
|
+
border-bottom-color: var(--pp-neutral-900);
|
|
89
|
+
border-top-color: transparent;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ─── Placement: left ─────────────────────────────────────────────────────────
|
|
94
|
+
.pp-tooltip__content--left {
|
|
95
|
+
right: calc(100% + 8px);
|
|
96
|
+
left: auto;
|
|
97
|
+
bottom: auto;
|
|
98
|
+
top: 50%;
|
|
99
|
+
transform: translateY(-50%);
|
|
100
|
+
|
|
101
|
+
&::before {
|
|
102
|
+
left: 100%;
|
|
103
|
+
top: 50%;
|
|
104
|
+
transform: translateY(-50%);
|
|
105
|
+
border-left-color: var(--pp-neutral-900);
|
|
106
|
+
border-top-color: transparent;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ─── Placement: right ────────────────────────────────────────────────────────
|
|
111
|
+
.pp-tooltip__content--right {
|
|
112
|
+
left: calc(100% + 8px);
|
|
113
|
+
right: auto;
|
|
114
|
+
bottom: auto;
|
|
115
|
+
top: 50%;
|
|
116
|
+
transform: translateY(-50%);
|
|
117
|
+
|
|
118
|
+
&::before {
|
|
119
|
+
right: 100%;
|
|
120
|
+
left: auto;
|
|
121
|
+
top: 50%;
|
|
122
|
+
transform: translateY(-50%);
|
|
123
|
+
border-right-color: var(--pp-neutral-900);
|
|
124
|
+
border-top-color: transparent;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// PeppertinoCSS — Utilities
|
|
2
|
+
// Margin, padding, display, visibility, flex, grid helpers
|
|
3
|
+
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
@use 'sass:string';
|
|
6
|
+
@use 'base' as *;
|
|
7
|
+
|
|
8
|
+
// ─── Display ──────────────────────────────────────────────────────────────────
|
|
9
|
+
.d-block { display: block; }
|
|
10
|
+
.d-inline { display: inline; }
|
|
11
|
+
.d-inline-block { display: inline-block; }
|
|
12
|
+
.d-flex { display: flex; }
|
|
13
|
+
.d-inline-flex { display: inline-flex; }
|
|
14
|
+
.d-grid { display: grid; }
|
|
15
|
+
.d-inline-grid { display: inline-grid; }
|
|
16
|
+
.d-none { display: none; }
|
|
17
|
+
.d-contents { display: contents; }
|
|
18
|
+
|
|
19
|
+
// ─── Visibility ───────────────────────────────────────────────────────────────
|
|
20
|
+
.visible { visibility: visible; }
|
|
21
|
+
.invisible { visibility: hidden; }
|
|
22
|
+
.sr-only {
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 1px;
|
|
25
|
+
height: 1px;
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: -1px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
clip: rect(0, 0, 0, 0);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
border-width: 0;
|
|
32
|
+
}
|
|
33
|
+
.not-sr-only {
|
|
34
|
+
position: static;
|
|
35
|
+
width: auto;
|
|
36
|
+
height: auto;
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
overflow: visible;
|
|
40
|
+
clip: auto;
|
|
41
|
+
white-space: normal;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ─── Opacity ──────────────────────────────────────────────────────────────────
|
|
45
|
+
.opacity-0 { opacity: 0; }
|
|
46
|
+
.opacity-25 { opacity: 0.25; }
|
|
47
|
+
.opacity-50 { opacity: 0.5; }
|
|
48
|
+
.opacity-75 { opacity: 0.75; }
|
|
49
|
+
.opacity-100 { opacity: 1; }
|
|
50
|
+
|
|
51
|
+
// ─── Spacing helpers — generate .m-*, .mt-*, .mx-*, .p-*, etc. ───────────────
|
|
52
|
+
// Keys: 0 1 2 3 4 5 6 8 10 12 16 20 24 32 + auto
|
|
53
|
+
// Sides: (none)=all, t=top, b=bottom, l=left, r=right, x=horizontal, y=vertical
|
|
54
|
+
|
|
55
|
+
$_sides: (
|
|
56
|
+
'': '',
|
|
57
|
+
't': '-top',
|
|
58
|
+
'b': '-bottom',
|
|
59
|
+
'l': '-left',
|
|
60
|
+
'r': '-right',
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
@each $abbr, $prop in $_sides {
|
|
64
|
+
@each $key, $value in $spacing {
|
|
65
|
+
.m#{$abbr}-#{$key} { margin#{$prop}: $value; }
|
|
66
|
+
.p#{$abbr}-#{$key} { padding#{$prop}: $value; }
|
|
67
|
+
}
|
|
68
|
+
.m#{$abbr}-auto { margin#{$prop}: auto; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// x / y axes
|
|
72
|
+
@each $key, $value in $spacing {
|
|
73
|
+
.mx-#{$key} { margin-left: $value; margin-right: $value; }
|
|
74
|
+
.my-#{$key} { margin-top: $value; margin-bottom: $value; }
|
|
75
|
+
.px-#{$key} { padding-left: $value; padding-right: $value; }
|
|
76
|
+
.py-#{$key} { padding-top: $value; padding-bottom: $value; }
|
|
77
|
+
}
|
|
78
|
+
.mx-auto { margin-left: auto; margin-right: auto; }
|
|
79
|
+
.my-auto { margin-top: auto; margin-bottom: auto; }
|
|
80
|
+
|
|
81
|
+
// ─── Gap ──────────────────────────────────────────────────────────────────────
|
|
82
|
+
@each $key, $value in $spacing {
|
|
83
|
+
.gap-#{$key} { gap: $value; }
|
|
84
|
+
.gap-x-#{$key} { column-gap: $value; }
|
|
85
|
+
.gap-y-#{$key} { row-gap: $value; }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ─── Flex helpers ─────────────────────────────────────────────────────────────
|
|
89
|
+
.flex-row { flex-direction: row; }
|
|
90
|
+
.flex-row-reverse { flex-direction: row-reverse; }
|
|
91
|
+
.flex-col { flex-direction: column; }
|
|
92
|
+
.flex-col-reverse { flex-direction: column-reverse; }
|
|
93
|
+
|
|
94
|
+
.flex-wrap { flex-wrap: wrap; }
|
|
95
|
+
.flex-nowrap { flex-wrap: nowrap; }
|
|
96
|
+
.flex-wrap-reverse { flex-wrap: wrap-reverse; }
|
|
97
|
+
|
|
98
|
+
.flex-1 { flex: 1 1 0%; }
|
|
99
|
+
.flex-auto { flex: 1 1 auto; }
|
|
100
|
+
.flex-none { flex: none; }
|
|
101
|
+
.flex-shrink-0 { flex-shrink: 0; }
|
|
102
|
+
.flex-grow { flex-grow: 1; }
|
|
103
|
+
.flex-grow-0 { flex-grow: 0; }
|
|
104
|
+
|
|
105
|
+
// Justify content
|
|
106
|
+
.justify-start { justify-content: flex-start; }
|
|
107
|
+
.justify-end { justify-content: flex-end; }
|
|
108
|
+
.justify-center { justify-content: center; }
|
|
109
|
+
.justify-between { justify-content: space-between; }
|
|
110
|
+
.justify-around { justify-content: space-around; }
|
|
111
|
+
.justify-evenly { justify-content: space-evenly; }
|
|
112
|
+
|
|
113
|
+
// Align items
|
|
114
|
+
.items-start { align-items: flex-start; }
|
|
115
|
+
.items-end { align-items: flex-end; }
|
|
116
|
+
.items-center { align-items: center; }
|
|
117
|
+
.items-baseline { align-items: baseline; }
|
|
118
|
+
.items-stretch { align-items: stretch; }
|
|
119
|
+
|
|
120
|
+
// Align self
|
|
121
|
+
.self-auto { align-self: auto; }
|
|
122
|
+
.self-start { align-self: flex-start; }
|
|
123
|
+
.self-end { align-self: flex-end; }
|
|
124
|
+
.self-center { align-self: center; }
|
|
125
|
+
.self-stretch { align-self: stretch; }
|
|
126
|
+
|
|
127
|
+
// ─── Grid helpers ─────────────────────────────────────────────────────────────
|
|
128
|
+
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
|
129
|
+
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
130
|
+
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
131
|
+
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
132
|
+
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
|
|
133
|
+
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
|
|
134
|
+
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
|
|
135
|
+
|
|
136
|
+
.grid-rows-1 { grid-template-rows: repeat(1, minmax(0, 1fr)); }
|
|
137
|
+
.grid-rows-2 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
|
|
138
|
+
.grid-rows-3 { grid-template-rows: repeat(3, minmax(0, 1fr)); }
|
|
139
|
+
.grid-rows-4 { grid-template-rows: repeat(4, minmax(0, 1fr)); }
|
|
140
|
+
|
|
141
|
+
// Col span
|
|
142
|
+
.col-span-1 { grid-column: span 1 / span 1; }
|
|
143
|
+
.col-span-2 { grid-column: span 2 / span 2; }
|
|
144
|
+
.col-span-3 { grid-column: span 3 / span 3; }
|
|
145
|
+
.col-span-4 { grid-column: span 4 / span 4; }
|
|
146
|
+
.col-span-6 { grid-column: span 6 / span 6; }
|
|
147
|
+
.col-span-full { grid-column: 1 / -1; }
|
|
148
|
+
|
|
149
|
+
// Row span
|
|
150
|
+
.row-span-1 { grid-row: span 1 / span 1; }
|
|
151
|
+
.row-span-2 { grid-row: span 2 / span 2; }
|
|
152
|
+
.row-span-3 { grid-row: span 3 / span 3; }
|
|
153
|
+
.row-span-full { grid-row: 1 / -1; }
|
|
154
|
+
|
|
155
|
+
// ─── Width ────────────────────────────────────────────────────────────────────
|
|
156
|
+
.w-full { width: 100%; }
|
|
157
|
+
.w-screen { width: 100vw; }
|
|
158
|
+
.w-auto { width: auto; }
|
|
159
|
+
.w-fit { width: fit-content; }
|
|
160
|
+
.w-min { width: min-content; }
|
|
161
|
+
.w-max { width: max-content; }
|
|
162
|
+
.w-half { width: 50%; }
|
|
163
|
+
|
|
164
|
+
// ─── Height ───────────────────────────────────────────────────────────────────
|
|
165
|
+
.h-full { height: 100%; }
|
|
166
|
+
.h-screen { height: 100vh; }
|
|
167
|
+
.h-auto { height: auto; }
|
|
168
|
+
.h-fit { height: fit-content; }
|
|
169
|
+
|
|
170
|
+
// ─── Overflow ─────────────────────────────────────────────────────────────────
|
|
171
|
+
.overflow-auto { overflow: auto; }
|
|
172
|
+
.overflow-hidden { overflow: hidden; }
|
|
173
|
+
.overflow-visible { overflow: visible; }
|
|
174
|
+
.overflow-scroll { overflow: scroll; }
|
|
175
|
+
.overflow-x-auto { overflow-x: auto; }
|
|
176
|
+
.overflow-y-auto { overflow-y: auto; }
|
|
177
|
+
.overflow-x-hidden { overflow-x: hidden; }
|
|
178
|
+
.overflow-y-hidden { overflow-y: hidden; }
|
|
179
|
+
|
|
180
|
+
// ─── Position ─────────────────────────────────────────────────────────────────
|
|
181
|
+
.static { position: static; }
|
|
182
|
+
.relative { position: relative; }
|
|
183
|
+
.absolute { position: absolute; }
|
|
184
|
+
.fixed { position: fixed; }
|
|
185
|
+
.sticky { position: sticky; }
|
|
186
|
+
|
|
187
|
+
// ─── Z-index ──────────────────────────────────────────────────────────────────
|
|
188
|
+
@each $key, $value in $z {
|
|
189
|
+
.z-#{$key} { z-index: $value; }
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ─── Border radius ────────────────────────────────────────────────────────────
|
|
193
|
+
@each $key, $value in $radius {
|
|
194
|
+
.rounded-#{$key} { border-radius: $value; }
|
|
195
|
+
}
|
|
196
|
+
.rounded { border-radius: map.get($radius, 'base'); }
|
|
197
|
+
|
|
198
|
+
// ─── Box shadow ───────────────────────────────────────────────────────────────
|
|
199
|
+
.shadow-none { box-shadow: none; }
|
|
200
|
+
.shadow-sm { box-shadow: $shadow-sm; }
|
|
201
|
+
.shadow { box-shadow: $shadow; }
|
|
202
|
+
.shadow-md { box-shadow: $shadow-md; }
|
|
203
|
+
.shadow-lg { box-shadow: $shadow-lg; }
|
|
204
|
+
.shadow-xl { box-shadow: $shadow-xl; }
|
|
205
|
+
|
|
206
|
+
// ─── Pointer / cursor ────────────────────────────────────────────────────────
|
|
207
|
+
.cursor-default { cursor: default; }
|
|
208
|
+
.cursor-pointer { cursor: pointer; }
|
|
209
|
+
.cursor-not-allowed { cursor: not-allowed; }
|
|
210
|
+
.cursor-grab { cursor: grab; }
|
|
211
|
+
.cursor-text { cursor: text; }
|
|
212
|
+
|
|
213
|
+
.pointer-events-none { pointer-events: none; }
|
|
214
|
+
.pointer-events-auto { pointer-events: auto; }
|
|
215
|
+
|
|
216
|
+
// ─── User select ─────────────────────────────────────────────────────────────
|
|
217
|
+
.select-none { user-select: none; }
|
|
218
|
+
.select-text { user-select: text; }
|
|
219
|
+
.select-all { user-select: all; }
|
|
220
|
+
.select-auto { user-select: auto; }
|
|
221
|
+
|
|
222
|
+
// ─── Responsive display helpers ──────────────────────────────────────────────
|
|
223
|
+
// .sm-d-none, .md-d-flex, .xl-d-grid, .w2xl-d-none (2xl → w2xl, digit prefix invalid)
|
|
224
|
+
$_bp-aliases: (
|
|
225
|
+
'sm': 'sm',
|
|
226
|
+
'md': 'md',
|
|
227
|
+
'lg': 'lg',
|
|
228
|
+
'xl': 'xl',
|
|
229
|
+
'2xl': 'w2xl',
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
@each $bp, $alias in $_bp-aliases {
|
|
233
|
+
$val: map.get($breakpoints, $bp);
|
|
234
|
+
@media (min-width: $val) {
|
|
235
|
+
.#{$alias}-d-none { display: none; }
|
|
236
|
+
.#{$alias}-d-block { display: block; }
|
|
237
|
+
.#{$alias}-d-flex { display: flex; }
|
|
238
|
+
.#{$alias}-d-grid { display: grid; }
|
|
239
|
+
.#{$alias}-d-inline { display: inline; }
|
|
240
|
+
.#{$alias}-d-inline-flex { display: inline-flex; }
|
|
241
|
+
.#{$alias}-d-inline-block { display: inline-block; }
|
|
242
|
+
}
|
|
243
|
+
}
|