mn-angular-lib 1.0.77 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -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
+ }
@@ -1412,9 +1412,21 @@ declare class MnTextarea implements OnInit {
1412
1412
 
1413
1413
  declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
1414
1414
  size: {
1415
+ xs: string;
1415
1416
  sm: string;
1416
1417
  md: string;
1417
1418
  lg: string;
1419
+ xl: string;
1420
+ };
1421
+ color: {
1422
+ primary: string;
1423
+ secondary: string;
1424
+ accent: string;
1425
+ neutral: string;
1426
+ info: string;
1427
+ success: string;
1428
+ warning: string;
1429
+ error: string;
1418
1430
  };
1419
1431
  borderRadius: {
1420
1432
  none: string;
@@ -1423,11 +1435,23 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
1423
1435
  md: string;
1424
1436
  lg: string;
1425
1437
  };
1426
- }, undefined, "", {
1438
+ }, undefined, "mn-checkbox", {
1427
1439
  size: {
1440
+ xs: string;
1428
1441
  sm: string;
1429
1442
  md: string;
1430
1443
  lg: string;
1444
+ xl: string;
1445
+ };
1446
+ color: {
1447
+ primary: string;
1448
+ secondary: string;
1449
+ accent: string;
1450
+ neutral: string;
1451
+ info: string;
1452
+ success: string;
1453
+ warning: string;
1454
+ error: string;
1431
1455
  };
1432
1456
  borderRadius: {
1433
1457
  none: string;
@@ -1438,9 +1462,21 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
1438
1462
  };
1439
1463
  }, undefined, tailwind_variants.TVReturnType<{
1440
1464
  size: {
1465
+ xs: string;
1441
1466
  sm: string;
1442
1467
  md: string;
1443
1468
  lg: string;
1469
+ xl: string;
1470
+ };
1471
+ color: {
1472
+ primary: string;
1473
+ secondary: string;
1474
+ accent: string;
1475
+ neutral: string;
1476
+ info: string;
1477
+ success: string;
1478
+ warning: string;
1479
+ error: string;
1444
1480
  };
1445
1481
  borderRadius: {
1446
1482
  none: string;
@@ -1449,12 +1485,14 @@ declare const mnCheckboxVariants: tailwind_variants.TVReturnType<{
1449
1485
  md: string;
1450
1486
  lg: string;
1451
1487
  };
1452
- }, undefined, "", unknown, unknown, undefined>>;
1488
+ }, undefined, "mn-checkbox", unknown, unknown, undefined>>;
1453
1489
  declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
1454
1490
  size: {
1491
+ xs: string;
1455
1492
  sm: string;
1456
1493
  md: string;
1457
1494
  lg: string;
1495
+ xl: string;
1458
1496
  };
1459
1497
  fullWidth: {
1460
1498
  true: string;
@@ -1464,9 +1502,11 @@ declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
1464
1502
  };
1465
1503
  }, undefined, "text-base-content", {
1466
1504
  size: {
1505
+ xs: string;
1467
1506
  sm: string;
1468
1507
  md: string;
1469
1508
  lg: string;
1509
+ xl: string;
1470
1510
  };
1471
1511
  fullWidth: {
1472
1512
  true: string;
@@ -1476,9 +1516,11 @@ declare const mnCheckboxWrapperVariants: tailwind_variants.TVReturnType<{
1476
1516
  };
1477
1517
  }, undefined, tailwind_variants.TVReturnType<{
1478
1518
  size: {
1519
+ xs: string;
1479
1520
  sm: string;
1480
1521
  md: string;
1481
1522
  lg: string;
1523
+ xl: string;
1482
1524
  };
1483
1525
  fullWidth: {
1484
1526
  true: string;
@@ -1501,6 +1543,8 @@ type MnCheckboxProps = {
1501
1543
  label?: string;
1502
1544
  /** Size variant of the checkbox (default: 'md') */
1503
1545
  size?: MnCheckboxVariants['size'];
1546
+ /** Color variant of the checkbox (default: 'primary') */
1547
+ color?: MnCheckboxVariants['color'];
1504
1548
  /** Border radius variant (default: 'sm') */
1505
1549
  borderRadius?: MnCheckboxVariants['borderRadius'];
1506
1550
  /** Whether the checkbox wrapper should take full width */