@codepom/react 0.1.0 → 2.0.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/LICENSE +21 -0
- package/README.md +157 -0
- package/dist/index.cjs +418 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.mjs +1215 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +193 -193
- package/package.json +12 -3
- package/dist/index.js +0 -943
- package/dist/index.js.map +0 -1
package/dist/styles.css
CHANGED
|
@@ -1,246 +1,246 @@
|
|
|
1
1
|
/* @codepom/react — component styles. Requires @codepom/tokens/css to be imported first. */
|
|
2
2
|
|
|
3
3
|
/* ── Base ─────────────────────────────────────────────────────────── */
|
|
4
|
-
.cp { font-family: var(--
|
|
5
|
-
*:focus-visible { outline: 2px solid var(--
|
|
4
|
+
.cp { font-family: var(--pom-font-sans); }
|
|
5
|
+
*:focus-visible { outline: 2px solid var(--pom-amber-400); outline-offset: 2px; border-radius: 4px; }
|
|
6
6
|
*:focus:not(:focus-visible) { outline: none; }
|
|
7
7
|
|
|
8
8
|
/* ── Button ───────────────────────────────────────────────────────── */
|
|
9
|
-
.
|
|
9
|
+
.pom-btn {
|
|
10
10
|
display: inline-flex; align-items: center; justify-content: center;
|
|
11
|
-
gap: var(--
|
|
11
|
+
gap: var(--pom-space-2); font-family: var(--pom-font-sans); font-weight: 600;
|
|
12
12
|
line-height: 1; border: 1px solid transparent; cursor: pointer;
|
|
13
|
-
transition: background var(--
|
|
14
|
-
color var(--
|
|
15
|
-
border-color var(--
|
|
16
|
-
opacity var(--
|
|
13
|
+
transition: background var(--pom-duration-fast) var(--pom-ease-out),
|
|
14
|
+
color var(--pom-duration-fast) var(--pom-ease-out),
|
|
15
|
+
border-color var(--pom-duration-fast) var(--pom-ease-out),
|
|
16
|
+
opacity var(--pom-duration-fast) var(--pom-ease-out);
|
|
17
17
|
text-decoration: none; white-space: nowrap; user-select: none;
|
|
18
18
|
}
|
|
19
|
-
.
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
.
|
|
23
|
-
.
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.
|
|
19
|
+
.pom-btn:disabled, .pom-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
|
|
20
|
+
.pom-btn-primary { background: var(--pom-amber-400); color: var(--pom-navy-950); }
|
|
21
|
+
.pom-btn-primary:hover { background: var(--pom-amber-500); }
|
|
22
|
+
.pom-btn-secondary { background: var(--pom-navy-800); color: var(--pom-foreground); border-color: var(--pom-navy-700); }
|
|
23
|
+
.pom-btn-secondary:hover { background: #243150; }
|
|
24
|
+
.pom-btn-accent { background: var(--pom-cyan-400); color: var(--pom-navy-950); }
|
|
25
|
+
.pom-btn-accent:hover { background: var(--pom-cyan-500); }
|
|
26
|
+
.pom-btn-outline { background: transparent; color: var(--pom-amber-400); border-color: var(--pom-amber-400); }
|
|
27
|
+
.pom-btn-outline:hover { background: rgba(251,176,64,0.12); }
|
|
28
|
+
.pom-btn-ghost { background: transparent; color: var(--pom-foreground); }
|
|
29
|
+
.pom-btn-ghost:hover { background: var(--pom-navy-800); }
|
|
30
|
+
.pom-btn-destructive { background: var(--pom-amber-600); color: var(--pom-ivory-50); }
|
|
31
|
+
.pom-btn-destructive:hover { background: #c2410c; }
|
|
32
|
+
.pom-btn-sm { font-size: 13px; padding: 7px 13px; border-radius: var(--pom-radius-sm); }
|
|
33
|
+
.pom-btn-md { font-size: 14px; padding: 10px 18px; border-radius: var(--pom-radius-md); }
|
|
34
|
+
.pom-btn-lg { font-size: 16px; padding: 13px 24px; border-radius: 10px; }
|
|
35
35
|
|
|
36
36
|
/* ── Badge ────────────────────────────────────────────────────────── */
|
|
37
|
-
.
|
|
37
|
+
.pom-badge {
|
|
38
38
|
display: inline-flex; align-items: center; gap: 6px;
|
|
39
|
-
font-family: var(--
|
|
40
|
-
padding: 3px 10px; border-radius: var(--
|
|
39
|
+
font-family: var(--pom-font-sans); font-size: 12px; font-weight: 600;
|
|
40
|
+
padding: 3px 10px; border-radius: var(--pom-radius-full); white-space: nowrap;
|
|
41
41
|
}
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
.
|
|
48
|
-
.
|
|
49
|
-
.
|
|
50
|
-
.
|
|
42
|
+
.pom-badge-primary { background: var(--pom-amber-400); color: var(--pom-navy-950); }
|
|
43
|
+
.pom-badge-accent { background: var(--pom-cyan-400); color: var(--pom-navy-950); }
|
|
44
|
+
.pom-badge-secondary { background: var(--pom-navy-800); color: var(--pom-foreground); }
|
|
45
|
+
.pom-badge-success { background: rgba(74,222,128,0.15); color: var(--pom-success); }
|
|
46
|
+
.pom-badge-warning { background: rgba(251,146,60,0.15); color: var(--pom-warning); }
|
|
47
|
+
.pom-badge-error { background: rgba(248,113,113,0.15); color: var(--pom-error); }
|
|
48
|
+
.pom-badge-outline { background: transparent; border: 1px solid var(--pom-navy-700); color: var(--pom-text-secondary); }
|
|
49
|
+
.pom-badge-mono { background: var(--pom-navy-900); border: 1px solid var(--pom-navy-800); color: var(--pom-text-secondary); font-family: var(--pom-font-mono); font-size: 11px; border-radius: var(--pom-radius-sm); }
|
|
50
|
+
.pom-badge-dot::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
|
|
51
51
|
|
|
52
52
|
/* ── Alert ────────────────────────────────────────────────────────── */
|
|
53
|
-
.
|
|
54
|
-
display: flex; gap: var(--
|
|
55
|
-
border-radius: var(--
|
|
53
|
+
.pom-alert {
|
|
54
|
+
display: flex; gap: var(--pom-space-3); padding: 14px 16px;
|
|
55
|
+
border-radius: var(--pom-radius-lg); border: 1px solid;
|
|
56
56
|
}
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
.
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
.
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
.
|
|
69
|
-
.
|
|
70
|
-
.
|
|
57
|
+
.pom-alert-icon { flex: none; margin-top: 1px; }
|
|
58
|
+
.pom-alert-body { flex: 1; min-width: 0; }
|
|
59
|
+
.pom-alert-title { font-weight: 600; font-size: 14px; margin: 0 0 3px; }
|
|
60
|
+
.pom-alert-msg { font-size: 13px; color: var(--pom-text-secondary); line-height: 1.55; margin: 0; }
|
|
61
|
+
.pom-alert-close { flex: none; background: none; border: none; cursor: pointer; color: var(--pom-text-tertiary); padding: 0; margin-top: 1px; transition: color var(--pom-duration-fast); }
|
|
62
|
+
.pom-alert-close:hover { color: var(--pom-foreground); }
|
|
63
|
+
.pom-alert-info { border-color: rgba(0,223,255,0.3); background: rgba(0,223,255,0.06); }
|
|
64
|
+
.pom-alert-success { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.06); }
|
|
65
|
+
.pom-alert-warning { border-color: rgba(251,146,60,0.3); background: rgba(251,146,60,0.06); }
|
|
66
|
+
.pom-alert-error { border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.06); }
|
|
67
|
+
.pom-alert-info .pom-alert-title { color: var(--pom-cyan-400); }
|
|
68
|
+
.pom-alert-success .pom-alert-title { color: var(--pom-success); }
|
|
69
|
+
.pom-alert-warning .pom-alert-title { color: var(--pom-warning); }
|
|
70
|
+
.pom-alert-error .pom-alert-title { color: var(--pom-error); }
|
|
71
71
|
|
|
72
72
|
/* ── Card ─────────────────────────────────────────────────────────── */
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.
|
|
77
|
-
.
|
|
78
|
-
.
|
|
73
|
+
.pom-card { background: var(--pom-card); border: 1px solid var(--pom-border); border-radius: var(--pom-radius-xl); box-shadow: var(--pom-shadow-1); }
|
|
74
|
+
.pom-card-padding { padding: var(--pom-space-6); }
|
|
75
|
+
.pom-card-header { padding: var(--pom-space-5) var(--pom-space-6); border-bottom: 1px solid var(--pom-border); }
|
|
76
|
+
.pom-card-footer { padding: var(--pom-space-4) var(--pom-space-6); border-top: 1px solid var(--pom-border); display: flex; align-items: center; justify-content: flex-end; gap: var(--pom-space-3); }
|
|
77
|
+
.pom-card-title { font-size: 16px; font-weight: 600; color: var(--pom-foreground); margin: 0 0 4px; }
|
|
78
|
+
.pom-card-desc { font-size: 13px; color: var(--pom-text-secondary); margin: 0; }
|
|
79
79
|
|
|
80
80
|
/* ── Input / Form ─────────────────────────────────────────────────── */
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
width: 100%; background: var(--
|
|
84
|
-
border-radius: var(--
|
|
85
|
-
font-size: 14px; font-family: var(--
|
|
86
|
-
transition: border-color var(--
|
|
87
|
-
box-shadow var(--
|
|
81
|
+
.pom-label { display: block; font-size: 13px; font-weight: 500; color: var(--pom-text-secondary); margin-bottom: var(--pom-space-1); font-family: var(--pom-font-sans); }
|
|
82
|
+
.pom-input {
|
|
83
|
+
width: 100%; background: var(--pom-card); border: 1px solid var(--pom-border);
|
|
84
|
+
border-radius: var(--pom-radius-md); padding: 10px 14px; color: var(--pom-foreground);
|
|
85
|
+
font-size: 14px; font-family: var(--pom-font-sans); outline: none;
|
|
86
|
+
transition: border-color var(--pom-duration-fast) var(--pom-ease-out),
|
|
87
|
+
box-shadow var(--pom-duration-fast) var(--pom-ease-out);
|
|
88
88
|
}
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
.
|
|
92
|
-
.
|
|
93
|
-
.
|
|
94
|
-
.
|
|
95
|
-
.
|
|
96
|
-
.
|
|
89
|
+
.pom-input::placeholder { color: var(--pom-text-tertiary); }
|
|
90
|
+
.pom-input:focus { border-color: var(--pom-amber-400); box-shadow: 0 0 0 2px rgba(251,176,64,0.2); }
|
|
91
|
+
.pom-input:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
92
|
+
.pom-input-error { border-color: var(--pom-error); }
|
|
93
|
+
.pom-input-error:focus { box-shadow: 0 0 0 2px rgba(248,113,113,0.2); }
|
|
94
|
+
.pom-hint { font-size: 12px; color: var(--pom-text-tertiary); margin-top: var(--pom-space-1); }
|
|
95
|
+
.pom-error-msg { font-size: 12px; color: var(--pom-error); margin-top: var(--pom-space-1); }
|
|
96
|
+
.pom-field { display: flex; flex-direction: column; }
|
|
97
97
|
|
|
98
98
|
/* ── Avatar ───────────────────────────────────────────────────────── */
|
|
99
|
-
.
|
|
100
|
-
.
|
|
101
|
-
.
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
.
|
|
106
|
-
.
|
|
107
|
-
.
|
|
108
|
-
.
|
|
109
|
-
.
|
|
110
|
-
.
|
|
111
|
-
.
|
|
112
|
-
.
|
|
113
|
-
.
|
|
114
|
-
.
|
|
115
|
-
.
|
|
116
|
-
.
|
|
117
|
-
.
|
|
118
|
-
.
|
|
99
|
+
.pom-avatar { position: relative; display: inline-flex; flex: none; border-radius: 50%; }
|
|
100
|
+
.pom-avatar img { border-radius: 50%; object-fit: cover; display: block; }
|
|
101
|
+
.pom-avatar-xs { width: 24px; height: 24px; font-size: 9px; }
|
|
102
|
+
.pom-avatar-sm { width: 32px; height: 32px; font-size: 11px; }
|
|
103
|
+
.pom-avatar-md { width: 40px; height: 40px; font-size: 13px; }
|
|
104
|
+
.pom-avatar-lg { width: 48px; height: 48px; font-size: 15px; }
|
|
105
|
+
.pom-avatar-xl { width: 64px; height: 64px; font-size: 19px; }
|
|
106
|
+
.pom-avatar-inner { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--pom-font-sans); user-select: none; }
|
|
107
|
+
.pom-avatar-status { position: absolute; bottom: 0; right: 0; border-radius: 50%; border: 2px solid var(--pom-background); }
|
|
108
|
+
.pom-avatar-xs .pom-avatar-status { width: 7px; height: 7px; }
|
|
109
|
+
.pom-avatar-sm .pom-avatar-status { width: 9px; height: 9px; }
|
|
110
|
+
.pom-avatar-md .pom-avatar-status { width: 11px; height: 11px; }
|
|
111
|
+
.pom-avatar-lg .pom-avatar-status { width: 13px; height: 13px; }
|
|
112
|
+
.pom-avatar-xl .pom-avatar-status { width: 15px; height: 15px; }
|
|
113
|
+
.pom-avatar-online .pom-avatar-status { background: var(--pom-success); }
|
|
114
|
+
.pom-avatar-away .pom-avatar-status { background: var(--pom-amber-400); }
|
|
115
|
+
.pom-avatar-busy .pom-avatar-status { background: var(--pom-error); }
|
|
116
|
+
.pom-avatar-offline .pom-avatar-status { background: var(--pom-navy-700); }
|
|
117
|
+
.pom-avatar-group { display: flex; flex-direction: row; }
|
|
118
|
+
.pom-avatar-group .pom-avatar + .pom-avatar { margin-left: -8px; }
|
|
119
119
|
|
|
120
120
|
/* ── Tabs ─────────────────────────────────────────────────────────── */
|
|
121
|
-
.
|
|
122
|
-
.
|
|
123
|
-
.
|
|
124
|
-
display: inline-flex; align-items: center; gap: var(--
|
|
121
|
+
.pom-tabs-underline { display: flex; align-items: center; border-bottom: 1px solid var(--pom-border); gap: 0; }
|
|
122
|
+
.pom-tabs-pill { display: flex; align-items: center; gap: var(--pom-space-2); background: var(--pom-card); border: 1px solid var(--pom-border); border-radius: var(--pom-radius-lg); padding: 5px; }
|
|
123
|
+
.pom-tab {
|
|
124
|
+
display: inline-flex; align-items: center; gap: var(--pom-space-2);
|
|
125
125
|
padding: 8px 16px; font-size: 14px; font-weight: 500;
|
|
126
|
-
font-family: var(--
|
|
126
|
+
font-family: var(--pom-font-sans); background: none; border: none;
|
|
127
127
|
cursor: pointer; white-space: nowrap;
|
|
128
|
-
transition: color var(--
|
|
128
|
+
transition: color var(--pom-duration-fast), background var(--pom-duration-fast), border-color var(--pom-duration-fast);
|
|
129
129
|
}
|
|
130
|
-
.
|
|
131
|
-
.
|
|
130
|
+
.pom-tab:disabled { opacity: 0.4; pointer-events: none; }
|
|
131
|
+
.pom-tab-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--pom-radius-full); background: var(--pom-navy-800); color: var(--pom-text-secondary); }
|
|
132
132
|
|
|
133
|
-
.
|
|
134
|
-
.
|
|
135
|
-
.
|
|
136
|
-
.
|
|
133
|
+
.pom-tabs-underline .pom-tab { color: var(--pom-text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
|
|
134
|
+
.pom-tabs-underline .pom-tab:hover { color: var(--pom-foreground); }
|
|
135
|
+
.pom-tabs-underline .pom-tab[aria-selected="true"] { color: var(--pom-amber-400); border-bottom-color: var(--pom-amber-400); }
|
|
136
|
+
.pom-tabs-underline .pom-tab[aria-selected="true"] .pom-tab-badge { background: rgba(251,176,64,0.18); color: var(--pom-amber-400); }
|
|
137
137
|
|
|
138
|
-
.
|
|
139
|
-
.
|
|
140
|
-
.
|
|
141
|
-
.
|
|
138
|
+
.pom-tabs-pill .pom-tab { color: var(--pom-text-secondary); border-radius: var(--pom-radius-md); }
|
|
139
|
+
.pom-tabs-pill .pom-tab:hover { color: var(--pom-foreground); }
|
|
140
|
+
.pom-tabs-pill .pom-tab[aria-selected="true"] { background: var(--pom-navy-800); color: var(--pom-foreground); }
|
|
141
|
+
.pom-tabs-pill .pom-tab[aria-selected="true"] .pom-tab-badge { background: rgba(251,176,64,0.18); color: var(--pom-amber-400); }
|
|
142
142
|
|
|
143
|
-
.
|
|
143
|
+
.pom-tab-panel[hidden] { display: none; }
|
|
144
144
|
|
|
145
145
|
/* ── Tooltip ──────────────────────────────────────────────────────── */
|
|
146
|
-
.
|
|
147
|
-
.
|
|
146
|
+
.pom-tooltip-wrap { position: relative; display: inline-flex; }
|
|
147
|
+
.pom-tooltip {
|
|
148
148
|
position: absolute; z-index: 50; white-space: nowrap;
|
|
149
|
-
border-radius: var(--
|
|
150
|
-
border: 1px solid var(--
|
|
151
|
-
font-size: 12px; font-weight: 500; color: var(--
|
|
152
|
-
box-shadow: var(--
|
|
153
|
-
opacity: 0; transition: opacity var(--
|
|
149
|
+
border-radius: var(--pom-radius-md); background: var(--pom-navy-800);
|
|
150
|
+
border: 1px solid var(--pom-navy-700); padding: 6px 10px;
|
|
151
|
+
font-size: 12px; font-weight: 500; color: var(--pom-foreground);
|
|
152
|
+
box-shadow: var(--pom-shadow-3); pointer-events: none;
|
|
153
|
+
opacity: 0; transition: opacity var(--pom-duration-fast) var(--pom-ease-out);
|
|
154
154
|
}
|
|
155
|
-
.
|
|
156
|
-
.
|
|
157
|
-
.
|
|
158
|
-
.
|
|
159
|
-
.
|
|
160
|
-
.
|
|
161
|
-
.
|
|
162
|
-
.
|
|
163
|
-
.
|
|
164
|
-
.
|
|
155
|
+
.pom-tooltip-visible { opacity: 1; }
|
|
156
|
+
.pom-tooltip-top { bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
|
|
157
|
+
.pom-tooltip-bottom { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
|
|
158
|
+
.pom-tooltip-left { right: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
|
|
159
|
+
.pom-tooltip-right { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
|
|
160
|
+
.pom-tooltip-arrow { position: absolute; border: 5px solid transparent; }
|
|
161
|
+
.pom-tooltip-top .pom-tooltip-arrow { top: 100%; left: 50%; transform: translateX(-50%); border-top-color: var(--pom-navy-800); }
|
|
162
|
+
.pom-tooltip-bottom .pom-tooltip-arrow { bottom: 100%; left: 50%; transform: translateX(-50%); border-bottom-color: var(--pom-navy-800); }
|
|
163
|
+
.pom-tooltip-left .pom-tooltip-arrow { left: 100%; top: 50%; transform: translateY(-50%); border-left-color: var(--pom-navy-800); }
|
|
164
|
+
.pom-tooltip-right .pom-tooltip-arrow { right: 100%; top: 50%; transform: translateY(-50%); border-right-color: var(--pom-navy-800); }
|
|
165
165
|
|
|
166
166
|
/* ── Modal ────────────────────────────────────────────────────────── */
|
|
167
|
-
.
|
|
167
|
+
.pom-modal-backdrop {
|
|
168
168
|
position: fixed; inset: 0; z-index: 50;
|
|
169
169
|
background: rgba(8,25,46,0.75); backdrop-filter: blur(4px);
|
|
170
|
-
display: flex; align-items: center; justify-content: center; padding: var(--
|
|
171
|
-
animation:
|
|
170
|
+
display: flex; align-items: center; justify-content: center; padding: var(--pom-space-6);
|
|
171
|
+
animation: pom-backdrop-in var(--pom-duration-enter) var(--pom-ease-out);
|
|
172
172
|
}
|
|
173
|
-
.
|
|
174
|
-
background: var(--
|
|
173
|
+
.pom-modal {
|
|
174
|
+
background: var(--pom-background); border: 1px solid var(--pom-border);
|
|
175
175
|
border-radius: 16px; width: 100%; overflow: hidden;
|
|
176
|
-
box-shadow: var(--
|
|
177
|
-
animation:
|
|
176
|
+
box-shadow: var(--pom-shadow-5);
|
|
177
|
+
animation: pom-modal-in var(--pom-duration-enter) var(--pom-ease-spring);
|
|
178
178
|
}
|
|
179
|
-
.
|
|
180
|
-
.
|
|
181
|
-
.
|
|
182
|
-
.
|
|
183
|
-
.
|
|
184
|
-
.
|
|
185
|
-
.
|
|
186
|
-
.
|
|
187
|
-
.
|
|
188
|
-
.
|
|
189
|
-
|
|
190
|
-
@keyframes
|
|
191
|
-
@keyframes
|
|
179
|
+
.pom-modal-sm { max-width: 380px; }
|
|
180
|
+
.pom-modal-md { max-width: 512px; }
|
|
181
|
+
.pom-modal-lg { max-width: 720px; }
|
|
182
|
+
.pom-modal-full { max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); }
|
|
183
|
+
.pom-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--pom-border); }
|
|
184
|
+
.pom-modal-title { font-size: 16px; font-weight: 600; color: var(--pom-foreground); margin: 0; }
|
|
185
|
+
.pom-modal-close { background: none; border: none; color: var(--pom-text-tertiary); cursor: pointer; padding: 4px; border-radius: var(--pom-radius-sm); transition: color var(--pom-duration-fast); }
|
|
186
|
+
.pom-modal-close:hover { color: var(--pom-foreground); }
|
|
187
|
+
.pom-modal-body { padding: 24px; font-size: 14px; color: var(--pom-text-secondary); line-height: 1.6; overflow-y: auto; }
|
|
188
|
+
.pom-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--pom-space-3); padding: 16px 24px; border-top: 1px solid var(--pom-border); }
|
|
189
|
+
|
|
190
|
+
@keyframes pom-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
|
|
191
|
+
@keyframes pom-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
|
|
192
192
|
|
|
193
193
|
/* ── Toast ────────────────────────────────────────────────────────── */
|
|
194
|
-
.
|
|
194
|
+
.pom-toast-region {
|
|
195
195
|
position: fixed; z-index: 9999;
|
|
196
|
-
display: flex; flex-direction: column; gap: var(--
|
|
197
|
-
pointer-events: none; padding: var(--
|
|
196
|
+
display: flex; flex-direction: column; gap: var(--pom-space-2);
|
|
197
|
+
pointer-events: none; padding: var(--pom-space-5);
|
|
198
198
|
}
|
|
199
|
-
.
|
|
200
|
-
.
|
|
201
|
-
.
|
|
202
|
-
.
|
|
203
|
-
.
|
|
204
|
-
.
|
|
205
|
-
|
|
206
|
-
.
|
|
207
|
-
display: flex; align-items: flex-start; gap: var(--
|
|
208
|
-
background: var(--
|
|
209
|
-
border-radius: var(--
|
|
210
|
-
min-width: 280px; max-width: 360px; box-shadow: var(--
|
|
199
|
+
.pom-toast-region-br { bottom: 0; right: 0; align-items: flex-end; }
|
|
200
|
+
.pom-toast-region-bl { bottom: 0; left: 0; align-items: flex-start; }
|
|
201
|
+
.pom-toast-region-tr { top: 0; right: 0; align-items: flex-end; }
|
|
202
|
+
.pom-toast-region-tl { top: 0; left: 0; align-items: flex-start; }
|
|
203
|
+
.pom-toast-region-bc { bottom: 0; left: 50%; transform: translateX(-50%); align-items: center; }
|
|
204
|
+
.pom-toast-region-tc { top: 0; left: 50%; transform: translateX(-50%); align-items: center; }
|
|
205
|
+
|
|
206
|
+
.pom-toast {
|
|
207
|
+
display: flex; align-items: flex-start; gap: var(--pom-space-3);
|
|
208
|
+
background: var(--pom-background); border: 1px solid;
|
|
209
|
+
border-radius: var(--pom-radius-lg); padding: 14px 16px;
|
|
210
|
+
min-width: 280px; max-width: 360px; box-shadow: var(--pom-shadow-4);
|
|
211
211
|
pointer-events: all;
|
|
212
|
-
animation:
|
|
212
|
+
animation: pom-toast-in var(--pom-duration-enter) var(--pom-ease-spring);
|
|
213
213
|
}
|
|
214
|
-
.
|
|
215
|
-
.
|
|
216
|
-
.
|
|
217
|
-
.
|
|
218
|
-
.
|
|
219
|
-
.
|
|
220
|
-
.
|
|
221
|
-
.
|
|
222
|
-
.
|
|
223
|
-
.
|
|
224
|
-
.
|
|
225
|
-
.
|
|
226
|
-
.
|
|
227
|
-
.
|
|
228
|
-
|
|
229
|
-
@keyframes
|
|
214
|
+
.pom-toast-info { border-color: rgba(0,223,255,0.35); }
|
|
215
|
+
.pom-toast-success { border-color: rgba(74,222,128,0.35); }
|
|
216
|
+
.pom-toast-warning { border-color: rgba(251,146,60,0.35); }
|
|
217
|
+
.pom-toast-error { border-color: rgba(248,113,113,0.35); }
|
|
218
|
+
.pom-toast-icon { flex: none; margin-top: 1px; }
|
|
219
|
+
.pom-toast-body { flex: 1; min-width: 0; }
|
|
220
|
+
.pom-toast-title { font-weight: 600; font-size: 14px; margin: 0 0 3px; }
|
|
221
|
+
.pom-toast-msg { font-size: 13px; color: var(--pom-text-secondary); margin: 0; line-height: 1.5; }
|
|
222
|
+
.pom-toast-close { flex: none; background: none; border: none; color: var(--pom-text-tertiary); cursor: pointer; padding: 0; margin-top: 1px; transition: color var(--pom-duration-fast); }
|
|
223
|
+
.pom-toast-close:hover { color: var(--pom-foreground); }
|
|
224
|
+
.pom-toast-info .pom-toast-title { color: var(--pom-cyan-400); }
|
|
225
|
+
.pom-toast-success .pom-toast-title { color: var(--pom-success); }
|
|
226
|
+
.pom-toast-warning .pom-toast-title { color: var(--pom-warning); }
|
|
227
|
+
.pom-toast-error .pom-toast-title { color: var(--pom-error); }
|
|
228
|
+
|
|
229
|
+
@keyframes pom-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
|
|
230
230
|
|
|
231
231
|
/* ── Pagination ───────────────────────────────────────────────────── */
|
|
232
|
-
.
|
|
233
|
-
.
|
|
234
|
-
.
|
|
235
|
-
.
|
|
236
|
-
.
|
|
237
|
-
.
|
|
232
|
+
.pom-pagination { display: flex; align-items: center; gap: var(--pom-space-1); }
|
|
233
|
+
.pom-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: var(--pom-radius-md); font-size: 14px; font-weight: 500; font-family: var(--pom-font-sans); cursor: pointer; background: transparent; border: 1px solid var(--pom-border); color: var(--pom-text-secondary); transition: all var(--pom-duration-fast); }
|
|
234
|
+
.pom-page-btn:hover { border-color: var(--pom-navy-700); color: var(--pom-foreground); }
|
|
235
|
+
.pom-page-btn[aria-current="page"] { background: var(--pom-amber-400); color: var(--pom-navy-950); border-color: var(--pom-amber-400); font-weight: 600; }
|
|
236
|
+
.pom-page-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
|
|
237
|
+
.pom-page-ellipsis { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--pom-text-tertiary); font-size: 14px; }
|
|
238
238
|
|
|
239
239
|
/* ── Breadcrumb ───────────────────────────────────────────────────── */
|
|
240
|
-
.
|
|
241
|
-
.
|
|
242
|
-
.
|
|
243
|
-
.
|
|
244
|
-
.
|
|
245
|
-
.
|
|
246
|
-
.
|
|
240
|
+
.pom-breadcrumb { display: flex; align-items: center; }
|
|
241
|
+
.pom-breadcrumb ol { display: flex; align-items: center; gap: var(--pom-space-1); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
|
|
242
|
+
.pom-breadcrumb li { display: flex; align-items: center; gap: var(--pom-space-1); font-size: 14px; }
|
|
243
|
+
.pom-breadcrumb a { color: var(--pom-text-secondary); text-decoration: none; transition: color var(--pom-duration-fast); }
|
|
244
|
+
.pom-breadcrumb a:hover { color: var(--pom-foreground); }
|
|
245
|
+
.pom-breadcrumb [aria-current="page"] { color: var(--pom-foreground); font-weight: 500; }
|
|
246
|
+
.pom-breadcrumb-sep { color: var(--pom-text-tertiary); display: inline-flex; align-items: center; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codepom/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "CodePom design system — React components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,12 +25,18 @@
|
|
|
25
25
|
"react-dom": ">=18"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
29
|
+
"@testing-library/react": "^16.3.2",
|
|
30
|
+
"@testing-library/user-event": "^14.6.1",
|
|
28
31
|
"@types/react": "^18.3.0",
|
|
29
32
|
"@types/react-dom": "^18.3.0",
|
|
33
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
34
|
+
"jsdom": "^29.1.1",
|
|
30
35
|
"react": "^18.3.0",
|
|
31
36
|
"react-dom": "^18.3.0",
|
|
32
37
|
"tsup": "^8.0.0",
|
|
33
|
-
"typescript": "^5.4.0"
|
|
38
|
+
"typescript": "^5.4.0",
|
|
39
|
+
"vitest": "^4.1.9"
|
|
34
40
|
},
|
|
35
41
|
"keywords": [
|
|
36
42
|
"react",
|
|
@@ -55,6 +61,9 @@
|
|
|
55
61
|
},
|
|
56
62
|
"scripts": {
|
|
57
63
|
"build": "tsup && cp src/styles.css dist/styles.css",
|
|
58
|
-
"dev": "tsup --watch"
|
|
64
|
+
"dev": "tsup --watch",
|
|
65
|
+
"test": "vitest run",
|
|
66
|
+
"test:watch": "vitest",
|
|
67
|
+
"test:coverage": "vitest run --coverage"
|
|
59
68
|
}
|
|
60
69
|
}
|