@duskmoon-dev/core 0.1.0 → 0.2.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 (110) hide show
  1. package/README.md +366 -78
  2. package/dist/components/accordion.css +244 -0
  3. package/dist/components/alert.css +199 -0
  4. package/dist/components/appbar.css +493 -0
  5. package/dist/components/autocomplete.css +269 -0
  6. package/dist/components/avatar.css +167 -0
  7. package/dist/components/badge.css +178 -0
  8. package/dist/components/bottom-navigation.css +263 -0
  9. package/dist/components/bottomsheet.css +334 -0
  10. package/dist/components/button.css +475 -0
  11. package/dist/components/card.css +220 -0
  12. package/dist/components/cascader.css +418 -0
  13. package/dist/components/checkbox.css +231 -0
  14. package/dist/components/chip.css +211 -0
  15. package/dist/components/collapse.css +454 -0
  16. package/dist/components/datepicker.css +741 -0
  17. package/dist/components/dialog.css +173 -0
  18. package/dist/components/divider.css +284 -0
  19. package/dist/components/drawer.css +371 -0
  20. package/dist/components/file-upload.css +321 -0
  21. package/dist/components/form-group.css +308 -0
  22. package/dist/components/form.css +441 -0
  23. package/dist/components/index.css +14951 -0
  24. package/dist/components/input.css +240 -0
  25. package/dist/components/list.css +188 -0
  26. package/dist/components/markdown-body.css +405 -0
  27. package/dist/components/modal.css +291 -0
  28. package/dist/components/multi-select.css +491 -0
  29. package/dist/components/navigation.css +736 -0
  30. package/dist/components/otp-input.css +195 -0
  31. package/dist/components/pin-input.css +184 -0
  32. package/dist/components/popover.css +392 -0
  33. package/dist/components/progress.css +238 -0
  34. package/dist/components/radio.css +183 -0
  35. package/dist/components/rating.css +230 -0
  36. package/dist/components/segment-control.css +186 -0
  37. package/dist/components/select.css +205 -0
  38. package/dist/components/skeleton.css +216 -0
  39. package/dist/components/slider.css +327 -0
  40. package/dist/components/snackbar.css +311 -0
  41. package/dist/components/stepper.css +313 -0
  42. package/dist/components/switch.css +234 -0
  43. package/dist/components/table.css +199 -0
  44. package/dist/components/textarea.css +398 -0
  45. package/dist/components/time-input.css +252 -0
  46. package/dist/components/timeline.css +353 -0
  47. package/dist/components/toast.css +251 -0
  48. package/dist/components/tooltip.css +284 -0
  49. package/dist/components/tree-select.css +472 -0
  50. package/dist/esm/components/accordion.js +251 -0
  51. package/dist/esm/components/alert.js +206 -0
  52. package/dist/esm/components/appbar.js +500 -0
  53. package/dist/esm/components/autocomplete.js +276 -0
  54. package/dist/esm/components/avatar.js +174 -0
  55. package/dist/esm/components/badge.js +185 -0
  56. package/dist/esm/components/bottom-navigation.js +270 -0
  57. package/dist/esm/components/bottomsheet.js +341 -0
  58. package/dist/esm/components/button.js +482 -0
  59. package/dist/esm/components/card.js +227 -0
  60. package/dist/esm/components/cascader.js +425 -0
  61. package/dist/esm/components/checkbox.js +238 -0
  62. package/dist/esm/components/chip.js +218 -0
  63. package/dist/esm/components/collapse.js +461 -0
  64. package/dist/esm/components/datepicker.js +748 -0
  65. package/dist/esm/components/dialog.js +180 -0
  66. package/dist/esm/components/divider.js +291 -0
  67. package/dist/esm/components/drawer.js +378 -0
  68. package/dist/esm/components/file-upload.js +328 -0
  69. package/dist/esm/components/form-group.js +315 -0
  70. package/dist/esm/components/form.js +448 -0
  71. package/dist/esm/components/input.js +247 -0
  72. package/dist/esm/components/list.js +195 -0
  73. package/dist/esm/components/markdown-body.js +412 -0
  74. package/dist/esm/components/modal.js +298 -0
  75. package/dist/esm/components/multi-select.js +498 -0
  76. package/dist/esm/components/navigation.js +743 -0
  77. package/dist/esm/components/otp-input.js +202 -0
  78. package/dist/esm/components/pin-input.js +191 -0
  79. package/dist/esm/components/popover.js +399 -0
  80. package/dist/esm/components/progress.js +245 -0
  81. package/dist/esm/components/radio.js +190 -0
  82. package/dist/esm/components/rating.js +237 -0
  83. package/dist/esm/components/segment-control.js +193 -0
  84. package/dist/esm/components/select.js +212 -0
  85. package/dist/esm/components/skeleton.js +223 -0
  86. package/dist/esm/components/slider.js +334 -0
  87. package/dist/esm/components/snackbar.js +318 -0
  88. package/dist/esm/components/stepper.js +320 -0
  89. package/dist/esm/components/switch.js +241 -0
  90. package/dist/esm/components/table.js +206 -0
  91. package/dist/esm/components/textarea.js +405 -0
  92. package/dist/esm/components/time-input.js +259 -0
  93. package/dist/esm/components/timeline.js +360 -0
  94. package/dist/esm/components/toast.js +258 -0
  95. package/dist/esm/components/tooltip.js +291 -0
  96. package/dist/esm/components/tree-select.js +479 -0
  97. package/dist/index.css +15866 -0
  98. package/dist/themes/moonlight.css +253 -0
  99. package/dist/themes/sunshine.css +250 -0
  100. package/dist/types/index.d.ts +14 -0
  101. package/dist/types/index.d.ts.map +1 -0
  102. package/dist/types/plugin.d.ts +69 -0
  103. package/dist/types/plugin.d.ts.map +1 -0
  104. package/dist/types/theme.d.ts +202 -0
  105. package/dist/types/theme.d.ts.map +1 -0
  106. package/package.json +262 -18
  107. package/dist/index.cjs +0 -243
  108. package/dist/index.cjs.map +0 -15
  109. package/dist/index.js +0 -211
  110. package/dist/index.js.map +0 -15
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Radio Component Styles
3
+ * DuskMoonUI - Material Design 3 inspired radio button
4
+ *
5
+ * Usage: <input type="radio" name="group" class="radio" />
6
+ * With label: <label class="radio-label"><input type="radio" name="group" class="radio" /><span>Option</span></label>
7
+ */
8
+
9
+ @layer components {
10
+ /* Base Radio - applied directly to input[type="radio"] */
11
+ .radio {
12
+ --radio-size: 1.25rem;
13
+ --radio-color: var(--color-primary);
14
+ --radio-border-color: var(--color-on-surface-variant);
15
+
16
+ position: relative;
17
+ display: inline-grid;
18
+ place-content: center;
19
+ width: var(--radio-size);
20
+ height: var(--radio-size);
21
+ margin: 0;
22
+ cursor: pointer;
23
+ appearance: none;
24
+ background-color: transparent;
25
+ border: 2px solid var(--radio-border-color);
26
+ border-radius: 50%;
27
+ transition: border-color 150ms ease-in-out;
28
+ }
29
+
30
+ /* Inner dot using ::before pseudo-element */
31
+ .radio::before {
32
+ content: "";
33
+ width: 0.5em;
34
+ height: 0.5em;
35
+ border-radius: 50%;
36
+ background-color: var(--radio-color);
37
+ transform: scale(0);
38
+ transition: transform 150ms ease-in-out;
39
+ }
40
+
41
+ /* Checked State */
42
+ .radio:checked {
43
+ border-color: var(--radio-color);
44
+ }
45
+
46
+ .radio:checked::before {
47
+ transform: scale(1);
48
+ }
49
+
50
+ /* Hover State */
51
+ .radio:hover:not(:disabled):not(:checked) {
52
+ border-color: var(--color-on-surface);
53
+ }
54
+
55
+ .radio:checked:hover:not(:disabled) {
56
+ border-color: color-mix(in oklch, var(--radio-color), black 10%);
57
+ }
58
+
59
+ .radio:checked:hover:not(:disabled)::before {
60
+ background-color: color-mix(in oklch, var(--radio-color), black 10%);
61
+ }
62
+
63
+ /* Focus State */
64
+ .radio:focus-visible {
65
+ outline: 2px solid var(--radio-color);
66
+ outline-offset: 2px;
67
+ }
68
+
69
+ /* Disabled State */
70
+ .radio:disabled {
71
+ cursor: not-allowed;
72
+ opacity: 0.38;
73
+ }
74
+
75
+ /* ========================================
76
+ * Size Variants
77
+ * ======================================== */
78
+
79
+ .radio-xs {
80
+ --radio-size: 0.875rem;
81
+ }
82
+
83
+ .radio-sm {
84
+ --radio-size: 1rem;
85
+ }
86
+
87
+ .radio-md {
88
+ --radio-size: 1.25rem;
89
+ }
90
+
91
+ .radio-lg {
92
+ --radio-size: 1.5rem;
93
+ }
94
+
95
+ .radio-xl {
96
+ --radio-size: 1.75rem;
97
+ }
98
+
99
+ /* ========================================
100
+ * Color Variants
101
+ * ======================================== */
102
+
103
+ .radio-primary {
104
+ --radio-color: var(--color-primary);
105
+ }
106
+
107
+ .radio-secondary {
108
+ --radio-color: var(--color-secondary);
109
+ }
110
+
111
+ .radio-tertiary {
112
+ --radio-color: var(--color-tertiary);
113
+ }
114
+
115
+ .radio-success {
116
+ --radio-color: var(--color-success);
117
+ }
118
+
119
+ .radio-warning {
120
+ --radio-color: var(--color-warning);
121
+ }
122
+
123
+ .radio-error {
124
+ --radio-color: var(--color-error);
125
+ }
126
+
127
+ .radio-info {
128
+ --radio-color: var(--color-info);
129
+ }
130
+
131
+ /* ========================================
132
+ * Radio with Label (wrapper pattern)
133
+ * ======================================== */
134
+
135
+ .radio-label {
136
+ display: inline-flex;
137
+ align-items: center;
138
+ gap: 0.5rem;
139
+ cursor: pointer;
140
+ user-select: none;
141
+ font-size: 0.875rem;
142
+ color: var(--color-on-surface);
143
+ }
144
+
145
+ .radio-label:has(.radio:disabled) {
146
+ cursor: not-allowed;
147
+ opacity: 0.38;
148
+ }
149
+
150
+ /* ========================================
151
+ * Radio Group
152
+ * ======================================== */
153
+
154
+ .radio-group {
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: 0.75rem;
158
+ }
159
+
160
+ .radio-group-horizontal {
161
+ flex-direction: row;
162
+ flex-wrap: wrap;
163
+ gap: 1.5rem;
164
+ }
165
+
166
+ .radio-group-label {
167
+ font-size: 0.875rem;
168
+ font-weight: 500;
169
+ color: var(--color-on-surface);
170
+ margin-bottom: 0.5rem;
171
+ }
172
+
173
+ /* ========================================
174
+ * Reduce Motion
175
+ * ======================================== */
176
+
177
+ @media (prefers-reduced-motion: reduce) {
178
+ .radio,
179
+ .radio::before {
180
+ transition: none;
181
+ }
182
+ }
183
+ }
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Rating Component Styles
3
+ * DuskMoonUI - Material Design 3 inspired rating system
4
+ */
5
+
6
+ @layer components {
7
+ /* Base Rating */
8
+ .rating {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ gap: 0.125rem;
12
+ }
13
+
14
+ /* Rating Item */
15
+ .rating-item {
16
+ position: relative;
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ color: var(--color-outline);
21
+ cursor: pointer;
22
+ transition: color 150ms ease-in-out, transform 150ms ease-in-out;
23
+ }
24
+
25
+ .rating-item:hover {
26
+ transform: scale(1.1);
27
+ }
28
+
29
+ .rating-item.active {
30
+ color: var(--color-warning-container);
31
+ }
32
+
33
+ .rating-item.filled {
34
+ color: var(--color-warning);
35
+ }
36
+
37
+ /* Rating Input (hidden) */
38
+ .rating-input {
39
+ position: absolute;
40
+ width: 0;
41
+ height: 0;
42
+ opacity: 0;
43
+ overflow: hidden;
44
+ }
45
+
46
+ /* Rating Icon */
47
+ .rating-icon {
48
+ width: 1.5rem;
49
+ height: 1.5rem;
50
+ font-size: 1.5rem;
51
+ line-height: 1;
52
+ }
53
+
54
+ /* Half Rating */
55
+ .rating-half {
56
+ position: relative;
57
+ overflow: hidden;
58
+ }
59
+
60
+ .rating-half .rating-icon-empty {
61
+ color: var(--color-outline);
62
+ }
63
+
64
+ .rating-half .rating-icon-filled {
65
+ position: absolute;
66
+ left: 0;
67
+ top: 0;
68
+ width: 50%;
69
+ overflow: hidden;
70
+ color: var(--color-warning);
71
+ }
72
+
73
+ /* Size Variants */
74
+ .rating-xs .rating-icon {
75
+ width: 0.875rem;
76
+ height: 0.875rem;
77
+ font-size: 0.875rem;
78
+ }
79
+
80
+ .rating-sm .rating-icon {
81
+ width: 1.25rem;
82
+ height: 1.25rem;
83
+ font-size: 1.25rem;
84
+ }
85
+
86
+ .rating-lg .rating-icon {
87
+ width: 2rem;
88
+ height: 2rem;
89
+ font-size: 2rem;
90
+ }
91
+
92
+ .rating-xl .rating-icon {
93
+ width: 2.5rem;
94
+ height: 2.5rem;
95
+ font-size: 2.5rem;
96
+ }
97
+
98
+ /* Color Variants */
99
+ .rating-primary .rating-item.filled {
100
+ color: var(--color-primary);
101
+ }
102
+
103
+ .rating-secondary .rating-item.filled {
104
+ color: var(--color-secondary);
105
+ }
106
+
107
+ .rating-error .rating-item.filled {
108
+ color: var(--color-error);
109
+ }
110
+
111
+ .rating-success .rating-item.filled {
112
+ color: var(--color-success);
113
+ }
114
+
115
+ /* Read Only */
116
+ .rating-readonly .rating-item {
117
+ cursor: default;
118
+ }
119
+
120
+ .rating-readonly .rating-item:hover {
121
+ transform: none;
122
+ }
123
+
124
+ /* Disabled */
125
+ .rating-disabled {
126
+ opacity: 0.6;
127
+ pointer-events: none;
128
+ }
129
+
130
+ /* With Label */
131
+ .rating-labeled {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 0.5rem;
135
+ }
136
+
137
+ .rating-label {
138
+ font-size: 0.875rem;
139
+ color: var(--color-on-surface-variant);
140
+ }
141
+
142
+ /* With Count */
143
+ .rating-count {
144
+ font-size: 0.75rem;
145
+ color: var(--color-on-surface-variant);
146
+ margin-left: 0.25rem;
147
+ }
148
+
149
+ /* Hover Preview */
150
+ .rating:not(.rating-readonly) .rating-item:hover ~ .rating-item {
151
+ color: var(--color-outline);
152
+ }
153
+
154
+ .rating:not(.rating-readonly):hover .rating-item {
155
+ color: var(--color-warning);
156
+ }
157
+
158
+ /* Focus Visible */
159
+ .rating-item:focus-visible {
160
+ outline: 2px solid var(--color-primary);
161
+ outline-offset: 2px;
162
+ border-radius: 0.25rem;
163
+ }
164
+
165
+ /* Rating Display (static) */
166
+ .rating-display {
167
+ display: inline-flex;
168
+ align-items: center;
169
+ gap: 0.375rem;
170
+ }
171
+
172
+ .rating-display-value {
173
+ font-size: 0.875rem;
174
+ font-weight: 600;
175
+ color: var(--color-on-surface);
176
+ }
177
+
178
+ .rating-display-stars {
179
+ display: flex;
180
+ gap: 0.0625rem;
181
+ color: var(--color-warning);
182
+ }
183
+
184
+ .rating-display-max {
185
+ font-size: 0.75rem;
186
+ color: var(--color-on-surface-variant);
187
+ }
188
+
189
+ /* Compact Rating */
190
+ .rating-compact {
191
+ gap: 0;
192
+ }
193
+
194
+ .rating-compact .rating-item {
195
+ padding: 0.125rem;
196
+ }
197
+
198
+ /* Animated */
199
+ .rating-animated .rating-item {
200
+ transition: color 150ms ease-in-out, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
201
+ }
202
+
203
+ .rating-animated .rating-item.filled {
204
+ animation: rating-pop 300ms ease-out;
205
+ }
206
+
207
+ @keyframes rating-pop {
208
+ 0% {
209
+ transform: scale(1);
210
+ }
211
+ 50% {
212
+ transform: scale(1.3);
213
+ }
214
+ 100% {
215
+ transform: scale(1);
216
+ }
217
+ }
218
+
219
+ /* Reduce Motion */
220
+ @media (prefers-reduced-motion: reduce) {
221
+ .rating-item,
222
+ .rating-animated .rating-item {
223
+ transition: color 0ms;
224
+ }
225
+
226
+ .rating-animated .rating-item.filled {
227
+ animation: none;
228
+ }
229
+ }
230
+ }
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Segment Control Component Styles
3
+ * DuskMoonUI - Material Design 3 inspired segmented button/toggle group
4
+ */
5
+
6
+ @layer components {
7
+ /* Base Segment Control */
8
+ .segment-control {
9
+ display: inline-flex;
10
+ align-items: stretch;
11
+ background-color: var(--color-surface-container);
12
+ border: 1px solid var(--color-outline);
13
+ border-radius: 1.25rem;
14
+ padding: 0.25rem;
15
+ gap: 0.25rem;
16
+ }
17
+
18
+ /* Segment Item */
19
+ .segment-item {
20
+ position: relative;
21
+ display: inline-flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ gap: 0.5rem;
25
+ padding: 0.5rem 1rem;
26
+ font-size: 0.875rem;
27
+ font-weight: 500;
28
+ line-height: 1.25rem;
29
+ color: var(--color-on-surface);
30
+ background-color: transparent;
31
+ border: none;
32
+ border-radius: 1rem;
33
+ cursor: pointer;
34
+ transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
35
+ user-select: none;
36
+ white-space: nowrap;
37
+ }
38
+
39
+ .segment-item:hover:not(:disabled):not(.segment-item-active) {
40
+ background-color: var(--color-surface-container-high);
41
+ }
42
+
43
+ .segment-item:focus-visible {
44
+ outline: 2px solid var(--color-primary);
45
+ outline-offset: 2px;
46
+ }
47
+
48
+ .segment-item:disabled {
49
+ opacity: 0.38;
50
+ cursor: not-allowed;
51
+ }
52
+
53
+ /* Active State */
54
+ .segment-item-active {
55
+ background-color: var(--color-primary-container);
56
+ color: var(--color-on-primary-container);
57
+ }
58
+
59
+ .segment-item-active:hover:not(:disabled) {
60
+ background-color: color-mix(in oklch, var(--color-primary-container), black 5%);
61
+ }
62
+
63
+ /* Segment Icon */
64
+ .segment-icon {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 1.125rem;
69
+ height: 1.125rem;
70
+ }
71
+
72
+ /* Size Variants */
73
+ .segment-control-sm {
74
+ padding: 0.125rem;
75
+ gap: 0.125rem;
76
+ border-radius: 1rem;
77
+ }
78
+
79
+ .segment-control-sm .segment-item {
80
+ padding: 0.375rem 0.75rem;
81
+ font-size: 0.75rem;
82
+ line-height: 1rem;
83
+ border-radius: 0.75rem;
84
+ }
85
+
86
+ .segment-control-lg {
87
+ padding: 0.375rem;
88
+ gap: 0.375rem;
89
+ border-radius: 1.5rem;
90
+ }
91
+
92
+ .segment-control-lg .segment-item {
93
+ padding: 0.75rem 1.5rem;
94
+ font-size: 1rem;
95
+ line-height: 1.5rem;
96
+ border-radius: 1.25rem;
97
+ }
98
+
99
+ /* Color Variants */
100
+ .segment-control-primary .segment-item-active {
101
+ background-color: var(--color-primary);
102
+ color: var(--color-primary-content);
103
+ }
104
+
105
+ .segment-control-secondary .segment-item-active {
106
+ background-color: var(--color-secondary-container);
107
+ color: var(--color-on-secondary-container);
108
+ }
109
+
110
+ .segment-control-tertiary .segment-item-active {
111
+ background-color: var(--color-tertiary-container);
112
+ color: var(--color-on-tertiary-container);
113
+ }
114
+
115
+ /* Full Width */
116
+ .segment-control-full {
117
+ display: flex;
118
+ width: 100%;
119
+ }
120
+
121
+ .segment-control-full .segment-item {
122
+ flex: 1;
123
+ }
124
+
125
+ /* Outlined Variant */
126
+ .segment-control-outlined {
127
+ background-color: transparent;
128
+ padding: 0;
129
+ gap: 0;
130
+ }
131
+
132
+ .segment-control-outlined .segment-item {
133
+ border: 1px solid var(--color-outline);
134
+ border-radius: 0;
135
+ margin-left: -1px;
136
+ }
137
+
138
+ .segment-control-outlined .segment-item:first-child {
139
+ margin-left: 0;
140
+ border-top-left-radius: 1.25rem;
141
+ border-bottom-left-radius: 1.25rem;
142
+ }
143
+
144
+ .segment-control-outlined .segment-item:last-child {
145
+ border-top-right-radius: 1.25rem;
146
+ border-bottom-right-radius: 1.25rem;
147
+ }
148
+
149
+ .segment-control-outlined .segment-item-active {
150
+ background-color: var(--color-primary-container);
151
+ border-color: var(--color-primary);
152
+ z-index: 1;
153
+ }
154
+
155
+ /* Ghost Variant */
156
+ .segment-control-ghost {
157
+ background-color: transparent;
158
+ border-color: transparent;
159
+ }
160
+
161
+ /* Icon Only */
162
+ .segment-control-icon-only .segment-item {
163
+ padding: 0.625rem;
164
+ }
165
+
166
+ .segment-control-icon-only.segment-control-sm .segment-item {
167
+ padding: 0.5rem;
168
+ }
169
+
170
+ .segment-control-icon-only.segment-control-lg .segment-item {
171
+ padding: 0.75rem;
172
+ }
173
+
174
+ /* Multiple Selection (Toggle Group) */
175
+ .segment-control-multi .segment-item-active {
176
+ background-color: var(--color-primary-container);
177
+ color: var(--color-on-primary-container);
178
+ }
179
+
180
+ /* Reduce Motion */
181
+ @media (prefers-reduced-motion: reduce) {
182
+ .segment-item {
183
+ transition: none;
184
+ }
185
+ }
186
+ }