mn-angular-lib 1.0.76 → 1.0.78
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/fesm2022/mn-angular-lib.mjs +630 -639
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/features/mn-checkbox/mn-checkbox.css +188 -0
- package/src/lib/features/mn-grid/mn-grid.component.css +63 -0
- package/src/lib/features/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +9 -0
- package/src/lib/features/mn-skeleton/mn-skeleton.css +9 -1
- package/types/mn-angular-lib.d.ts +571 -423
package/package.json
CHANGED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Self-contained checkbox styling — a faithful reproduction of daisyui's
|
|
3
|
+
* `checkbox` component WITHOUT depending on daisyui.
|
|
4
|
+
*
|
|
5
|
+
* Unlike mn-select (which renders entirely with Tailwind utilities), the
|
|
6
|
+
* checkbox needs a component stylesheet: daisyui draws the checkmark with a
|
|
7
|
+
* `::before` pseudo-element and an animated `clip-path`, which cannot be
|
|
8
|
+
* expressed as utility classes on a native <input>. Shipping it as component
|
|
9
|
+
* CSS also means it compiles with the component and does not rely on the
|
|
10
|
+
* consumer's Tailwind scanning the library.
|
|
11
|
+
*
|
|
12
|
+
* Colors come from the theme CSS variables the consuming app already provides
|
|
13
|
+
* (--color-primary, --color-base-content, etc. — see demo-app styles.css).
|
|
14
|
+
* The depth shadows hardcode daisyui's default depth (0.1 opacity) and the
|
|
15
|
+
* `--fx-noise` layer is dropped.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
.mn-checkbox {
|
|
19
|
+
/* Defaults; size/color modifier classes override these. */
|
|
20
|
+
--mn-checkbox-size: 1.5rem;
|
|
21
|
+
--mn-checkbox-input-color: var(--color-primary);
|
|
22
|
+
--mn-checkbox-check-color: var(--color-primary-content, #fff);
|
|
23
|
+
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-block;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
width: var(--mn-checkbox-size);
|
|
29
|
+
height: var(--mn-checkbox-size);
|
|
30
|
+
padding: 0.25rem;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
appearance: none;
|
|
34
|
+
-webkit-appearance: none;
|
|
35
|
+
color: var(--mn-checkbox-check-color);
|
|
36
|
+
border: 1px solid var(--mn-checkbox-input-color, color-mix(in oklab, var(--color-base-content) 20%, transparent));
|
|
37
|
+
border-radius: 0.25rem;
|
|
38
|
+
box-shadow: 0 1px oklch(0% 0 0 / 0.1) inset,
|
|
39
|
+
0 0 #0000 inset,
|
|
40
|
+
0 0 #0000;
|
|
41
|
+
transition: background-color 0.2s,
|
|
42
|
+
box-shadow 0.2s;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.mn-checkbox::before {
|
|
46
|
+
content: '';
|
|
47
|
+
display: block;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
rotate: 45deg;
|
|
51
|
+
background-color: currentColor;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
box-shadow: 0 3px 0 0 oklch(100% 0 0 / 0.1) inset;
|
|
54
|
+
clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 80%, 70% 80%, 70% 100%);
|
|
55
|
+
transition: clip-path 0.3s,
|
|
56
|
+
opacity 0.1s,
|
|
57
|
+
rotate 0.3s,
|
|
58
|
+
translate 0.3s;
|
|
59
|
+
transition-delay: 0.1s;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mn-checkbox:focus-visible {
|
|
63
|
+
outline: 2px solid var(--mn-checkbox-input-color, currentColor);
|
|
64
|
+
outline-offset: 2px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mn-checkbox:checked,
|
|
68
|
+
.mn-checkbox[aria-checked='true'] {
|
|
69
|
+
background-color: var(--mn-checkbox-input-color);
|
|
70
|
+
box-shadow: 0 0 #0000 inset,
|
|
71
|
+
0 8px 0 -4px oklch(100% 0 0 / 0.1) inset,
|
|
72
|
+
0 1px oklch(0% 0 0 / 0.1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.mn-checkbox:checked::before,
|
|
76
|
+
.mn-checkbox[aria-checked='true']::before {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 0%, 70% 0%, 70% 100%);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.mn-checkbox:indeterminate {
|
|
82
|
+
background-color: var(--mn-checkbox-input-color);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.mn-checkbox:indeterminate::before {
|
|
86
|
+
opacity: 1;
|
|
87
|
+
rotate: 0deg;
|
|
88
|
+
translate: 0 -35%;
|
|
89
|
+
clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 80%, 80% 80%, 80% 100%);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.mn-checkbox:disabled {
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
opacity: 0.2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ========== Sizes (daisyui dimensions verbatim) ========== */
|
|
98
|
+
|
|
99
|
+
.mn-checkbox-xs {
|
|
100
|
+
--mn-checkbox-size: 1rem;
|
|
101
|
+
padding: 0.125rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mn-checkbox-sm {
|
|
105
|
+
--mn-checkbox-size: 1.25rem;
|
|
106
|
+
padding: 0.1875rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mn-checkbox-md {
|
|
110
|
+
--mn-checkbox-size: 1.5rem;
|
|
111
|
+
padding: 0.25rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.mn-checkbox-lg {
|
|
115
|
+
--mn-checkbox-size: 1.75rem;
|
|
116
|
+
padding: 0.3125rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.mn-checkbox-xl {
|
|
120
|
+
--mn-checkbox-size: 2rem;
|
|
121
|
+
padding: 0.375rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ========== Colors ========== */
|
|
125
|
+
/* Content tokens carry a #fff fallback because not every theme defines the
|
|
126
|
+
* full *-content palette; without it currentColor would inherit body text. */
|
|
127
|
+
|
|
128
|
+
.mn-checkbox-primary {
|
|
129
|
+
--mn-checkbox-input-color: var(--color-primary);
|
|
130
|
+
--mn-checkbox-check-color: var(--color-primary-content, #fff);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.mn-checkbox-secondary {
|
|
134
|
+
--mn-checkbox-input-color: var(--color-secondary);
|
|
135
|
+
--mn-checkbox-check-color: var(--color-secondary-content, #fff);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.mn-checkbox-accent {
|
|
139
|
+
--mn-checkbox-input-color: var(--color-accent);
|
|
140
|
+
--mn-checkbox-check-color: var(--color-accent-content, #fff);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.mn-checkbox-neutral {
|
|
144
|
+
--mn-checkbox-input-color: var(--color-neutral);
|
|
145
|
+
--mn-checkbox-check-color: var(--color-neutral-content, #fff);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.mn-checkbox-info {
|
|
149
|
+
--mn-checkbox-input-color: var(--color-info);
|
|
150
|
+
--mn-checkbox-check-color: var(--color-info-content, #fff);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.mn-checkbox-success {
|
|
154
|
+
--mn-checkbox-input-color: var(--color-success);
|
|
155
|
+
--mn-checkbox-check-color: var(--color-success-content, #fff);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.mn-checkbox-warning {
|
|
159
|
+
--mn-checkbox-input-color: var(--color-warning);
|
|
160
|
+
--mn-checkbox-check-color: var(--color-warning-content, #fff);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.mn-checkbox-error {
|
|
164
|
+
--mn-checkbox-input-color: var(--color-error);
|
|
165
|
+
--mn-checkbox-check-color: var(--color-error-content, #fff);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ========== Border radius ========== */
|
|
169
|
+
|
|
170
|
+
.mn-checkbox-radius-none {
|
|
171
|
+
border-radius: 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.mn-checkbox-radius-xs {
|
|
175
|
+
border-radius: 0.125rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.mn-checkbox-radius-sm {
|
|
179
|
+
border-radius: 0.25rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.mn-checkbox-radius-md {
|
|
183
|
+
border-radius: 0.375rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.mn-checkbox-radius-lg {
|
|
187
|
+
border-radius: 0.5rem;
|
|
188
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Responsive card grid driven by CSS custom properties set inline by the
|
|
3
|
+
* component. Dynamic Tailwind classes (e.g. md:grid-cols-3) can't be used: the
|
|
4
|
+
* consuming app's JIT can't see runtime values and would drop them. Breakpoints
|
|
5
|
+
* match Tailwind defaults (sm 640, md 768, lg 1024, xl 1280).
|
|
6
|
+
*
|
|
7
|
+
* Each `--mn-grid-cols-*` falls back to the next-smaller breakpoint so consumers
|
|
8
|
+
* only set the breakpoints they care about.
|
|
9
|
+
*/
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mn-grid {
|
|
15
|
+
display: grid;
|
|
16
|
+
gap: var(--mn-grid-gap, 1rem);
|
|
17
|
+
grid-template-columns: repeat(var(--mn-grid-cols-base, 1), minmax(0, 1fr));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 640px) {
|
|
21
|
+
.mn-grid {
|
|
22
|
+
grid-template-columns: repeat(
|
|
23
|
+
var(--mn-grid-cols-sm, var(--mn-grid-cols-base, 1)),
|
|
24
|
+
minmax(0, 1fr)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (min-width: 768px) {
|
|
30
|
+
.mn-grid {
|
|
31
|
+
grid-template-columns: repeat(
|
|
32
|
+
var(--mn-grid-cols-md, var(--mn-grid-cols-sm, var(--mn-grid-cols-base, 1))),
|
|
33
|
+
minmax(0, 1fr)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 1024px) {
|
|
39
|
+
.mn-grid {
|
|
40
|
+
grid-template-columns: repeat(
|
|
41
|
+
var(--mn-grid-cols-lg, var(--mn-grid-cols-md, var(--mn-grid-cols-sm, var(--mn-grid-cols-base, 1)))),
|
|
42
|
+
minmax(0, 1fr)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (min-width: 1280px) {
|
|
48
|
+
.mn-grid {
|
|
49
|
+
grid-template-columns: repeat(
|
|
50
|
+
var(--mn-grid-cols-xl, var(--mn-grid-cols-lg, var(--mn-grid-cols-md, var(--mn-grid-cols-sm, var(--mn-grid-cols-base, 1))))),
|
|
51
|
+
minmax(0, 1fr)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* auto-fit layout (minCardWidth). Two classes → higher specificity than the
|
|
58
|
+
* single-class media-query rules above, so it wins at every width regardless of
|
|
59
|
+
* any `cols` vars that may also be set.
|
|
60
|
+
*/
|
|
61
|
+
.mn-grid.mn-grid--auto {
|
|
62
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--mn-grid-min, 18rem), 1fr));
|
|
63
|
+
}
|
|
@@ -24,6 +24,15 @@
|
|
|
24
24
|
transition: none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/* A swipe past the dismiss threshold glides the sheet off-screen via its transform
|
|
28
|
+
transition. Suppress the slide-up keyframe (it would snap back to 0 first); the
|
|
29
|
+
backdrop still fades out via its own .closing animation. */
|
|
30
|
+
:host(.swipe-dismissing) .modal-container,
|
|
31
|
+
:host(.swipe-dismissing).closing .modal-container {
|
|
32
|
+
animation: none !important;
|
|
33
|
+
transition: transform 0.2s ease-in;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
@keyframes fadeIn {
|
|
28
37
|
from { opacity: 0; }
|
|
29
38
|
to { opacity: 1; }
|
|
@@ -14,11 +14,19 @@
|
|
|
14
14
|
.mn-skeleton-shimmer-bar {
|
|
15
15
|
position: absolute;
|
|
16
16
|
inset: 0;
|
|
17
|
+
/* Highlight band derives from a theme token (base-100) so it contrasts against
|
|
18
|
+
the base-300 surface in both light and dark themes, instead of a fixed white. */
|
|
17
19
|
background: linear-gradient(
|
|
18
20
|
90deg,
|
|
19
21
|
transparent 0%,
|
|
20
|
-
|
|
22
|
+
color-mix(in srgb, var(--color-base-100) 65%, transparent) 50%,
|
|
21
23
|
transparent 100%
|
|
22
24
|
);
|
|
23
25
|
animation: mn-skeleton-shimmer 1.5s ease-in-out infinite;
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
@media (prefers-reduced-motion: reduce) {
|
|
29
|
+
.mn-skeleton-shimmer-bar {
|
|
30
|
+
animation: none;
|
|
31
|
+
}
|
|
32
|
+
}
|