@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,190 @@
1
+ // Auto-generated from radio.css
2
+ export const css = `/**
3
+ * Radio Component Styles
4
+ * DuskMoonUI - Material Design 3 inspired radio button
5
+ *
6
+ * Usage: <input type="radio" name="group" class="radio" />
7
+ * With label: <label class="radio-label"><input type="radio" name="group" class="radio" /><span>Option</span></label>
8
+ */
9
+
10
+ @layer components {
11
+ /* Base Radio - applied directly to input[type="radio"] */
12
+ .radio {
13
+ --radio-size: 1.25rem;
14
+ --radio-color: var(--color-primary);
15
+ --radio-border-color: var(--color-on-surface-variant);
16
+
17
+ position: relative;
18
+ display: inline-grid;
19
+ place-content: center;
20
+ width: var(--radio-size);
21
+ height: var(--radio-size);
22
+ margin: 0;
23
+ cursor: pointer;
24
+ appearance: none;
25
+ background-color: transparent;
26
+ border: 2px solid var(--radio-border-color);
27
+ border-radius: 50%;
28
+ transition: border-color 150ms ease-in-out;
29
+ }
30
+
31
+ /* Inner dot using ::before pseudo-element */
32
+ .radio::before {
33
+ content: "";
34
+ width: 0.5em;
35
+ height: 0.5em;
36
+ border-radius: 50%;
37
+ background-color: var(--radio-color);
38
+ transform: scale(0);
39
+ transition: transform 150ms ease-in-out;
40
+ }
41
+
42
+ /* Checked State */
43
+ .radio:checked {
44
+ border-color: var(--radio-color);
45
+ }
46
+
47
+ .radio:checked::before {
48
+ transform: scale(1);
49
+ }
50
+
51
+ /* Hover State */
52
+ .radio:hover:not(:disabled):not(:checked) {
53
+ border-color: var(--color-on-surface);
54
+ }
55
+
56
+ .radio:checked:hover:not(:disabled) {
57
+ border-color: color-mix(in oklch, var(--radio-color), black 10%);
58
+ }
59
+
60
+ .radio:checked:hover:not(:disabled)::before {
61
+ background-color: color-mix(in oklch, var(--radio-color), black 10%);
62
+ }
63
+
64
+ /* Focus State */
65
+ .radio:focus-visible {
66
+ outline: 2px solid var(--radio-color);
67
+ outline-offset: 2px;
68
+ }
69
+
70
+ /* Disabled State */
71
+ .radio:disabled {
72
+ cursor: not-allowed;
73
+ opacity: 0.38;
74
+ }
75
+
76
+ /* ========================================
77
+ * Size Variants
78
+ * ======================================== */
79
+
80
+ .radio-xs {
81
+ --radio-size: 0.875rem;
82
+ }
83
+
84
+ .radio-sm {
85
+ --radio-size: 1rem;
86
+ }
87
+
88
+ .radio-md {
89
+ --radio-size: 1.25rem;
90
+ }
91
+
92
+ .radio-lg {
93
+ --radio-size: 1.5rem;
94
+ }
95
+
96
+ .radio-xl {
97
+ --radio-size: 1.75rem;
98
+ }
99
+
100
+ /* ========================================
101
+ * Color Variants
102
+ * ======================================== */
103
+
104
+ .radio-primary {
105
+ --radio-color: var(--color-primary);
106
+ }
107
+
108
+ .radio-secondary {
109
+ --radio-color: var(--color-secondary);
110
+ }
111
+
112
+ .radio-tertiary {
113
+ --radio-color: var(--color-tertiary);
114
+ }
115
+
116
+ .radio-success {
117
+ --radio-color: var(--color-success);
118
+ }
119
+
120
+ .radio-warning {
121
+ --radio-color: var(--color-warning);
122
+ }
123
+
124
+ .radio-error {
125
+ --radio-color: var(--color-error);
126
+ }
127
+
128
+ .radio-info {
129
+ --radio-color: var(--color-info);
130
+ }
131
+
132
+ /* ========================================
133
+ * Radio with Label (wrapper pattern)
134
+ * ======================================== */
135
+
136
+ .radio-label {
137
+ display: inline-flex;
138
+ align-items: center;
139
+ gap: 0.5rem;
140
+ cursor: pointer;
141
+ user-select: none;
142
+ font-size: 0.875rem;
143
+ color: var(--color-on-surface);
144
+ }
145
+
146
+ .radio-label:has(.radio:disabled) {
147
+ cursor: not-allowed;
148
+ opacity: 0.38;
149
+ }
150
+
151
+ /* ========================================
152
+ * Radio Group
153
+ * ======================================== */
154
+
155
+ .radio-group {
156
+ display: flex;
157
+ flex-direction: column;
158
+ gap: 0.75rem;
159
+ }
160
+
161
+ .radio-group-horizontal {
162
+ flex-direction: row;
163
+ flex-wrap: wrap;
164
+ gap: 1.5rem;
165
+ }
166
+
167
+ .radio-group-label {
168
+ font-size: 0.875rem;
169
+ font-weight: 500;
170
+ color: var(--color-on-surface);
171
+ margin-bottom: 0.5rem;
172
+ }
173
+
174
+ /* ========================================
175
+ * Reduce Motion
176
+ * ======================================== */
177
+
178
+ @media (prefers-reduced-motion: reduce) {
179
+ .radio,
180
+ .radio::before {
181
+ transition: none;
182
+ }
183
+ }
184
+ }
185
+ `;
186
+
187
+ const sheet = new CSSStyleSheet();
188
+ sheet.replaceSync(css);
189
+ export const styles = sheet;
190
+ export default sheet;
@@ -0,0 +1,237 @@
1
+ // Auto-generated from rating.css
2
+ export const css = `/**
3
+ * Rating Component Styles
4
+ * DuskMoonUI - Material Design 3 inspired rating system
5
+ */
6
+
7
+ @layer components {
8
+ /* Base Rating */
9
+ .rating {
10
+ display: inline-flex;
11
+ align-items: center;
12
+ gap: 0.125rem;
13
+ }
14
+
15
+ /* Rating Item */
16
+ .rating-item {
17
+ position: relative;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ color: var(--color-outline);
22
+ cursor: pointer;
23
+ transition: color 150ms ease-in-out, transform 150ms ease-in-out;
24
+ }
25
+
26
+ .rating-item:hover {
27
+ transform: scale(1.1);
28
+ }
29
+
30
+ .rating-item.active {
31
+ color: var(--color-warning-container);
32
+ }
33
+
34
+ .rating-item.filled {
35
+ color: var(--color-warning);
36
+ }
37
+
38
+ /* Rating Input (hidden) */
39
+ .rating-input {
40
+ position: absolute;
41
+ width: 0;
42
+ height: 0;
43
+ opacity: 0;
44
+ overflow: hidden;
45
+ }
46
+
47
+ /* Rating Icon */
48
+ .rating-icon {
49
+ width: 1.5rem;
50
+ height: 1.5rem;
51
+ font-size: 1.5rem;
52
+ line-height: 1;
53
+ }
54
+
55
+ /* Half Rating */
56
+ .rating-half {
57
+ position: relative;
58
+ overflow: hidden;
59
+ }
60
+
61
+ .rating-half .rating-icon-empty {
62
+ color: var(--color-outline);
63
+ }
64
+
65
+ .rating-half .rating-icon-filled {
66
+ position: absolute;
67
+ left: 0;
68
+ top: 0;
69
+ width: 50%;
70
+ overflow: hidden;
71
+ color: var(--color-warning);
72
+ }
73
+
74
+ /* Size Variants */
75
+ .rating-xs .rating-icon {
76
+ width: 0.875rem;
77
+ height: 0.875rem;
78
+ font-size: 0.875rem;
79
+ }
80
+
81
+ .rating-sm .rating-icon {
82
+ width: 1.25rem;
83
+ height: 1.25rem;
84
+ font-size: 1.25rem;
85
+ }
86
+
87
+ .rating-lg .rating-icon {
88
+ width: 2rem;
89
+ height: 2rem;
90
+ font-size: 2rem;
91
+ }
92
+
93
+ .rating-xl .rating-icon {
94
+ width: 2.5rem;
95
+ height: 2.5rem;
96
+ font-size: 2.5rem;
97
+ }
98
+
99
+ /* Color Variants */
100
+ .rating-primary .rating-item.filled {
101
+ color: var(--color-primary);
102
+ }
103
+
104
+ .rating-secondary .rating-item.filled {
105
+ color: var(--color-secondary);
106
+ }
107
+
108
+ .rating-error .rating-item.filled {
109
+ color: var(--color-error);
110
+ }
111
+
112
+ .rating-success .rating-item.filled {
113
+ color: var(--color-success);
114
+ }
115
+
116
+ /* Read Only */
117
+ .rating-readonly .rating-item {
118
+ cursor: default;
119
+ }
120
+
121
+ .rating-readonly .rating-item:hover {
122
+ transform: none;
123
+ }
124
+
125
+ /* Disabled */
126
+ .rating-disabled {
127
+ opacity: 0.6;
128
+ pointer-events: none;
129
+ }
130
+
131
+ /* With Label */
132
+ .rating-labeled {
133
+ display: flex;
134
+ align-items: center;
135
+ gap: 0.5rem;
136
+ }
137
+
138
+ .rating-label {
139
+ font-size: 0.875rem;
140
+ color: var(--color-on-surface-variant);
141
+ }
142
+
143
+ /* With Count */
144
+ .rating-count {
145
+ font-size: 0.75rem;
146
+ color: var(--color-on-surface-variant);
147
+ margin-left: 0.25rem;
148
+ }
149
+
150
+ /* Hover Preview */
151
+ .rating:not(.rating-readonly) .rating-item:hover ~ .rating-item {
152
+ color: var(--color-outline);
153
+ }
154
+
155
+ .rating:not(.rating-readonly):hover .rating-item {
156
+ color: var(--color-warning);
157
+ }
158
+
159
+ /* Focus Visible */
160
+ .rating-item:focus-visible {
161
+ outline: 2px solid var(--color-primary);
162
+ outline-offset: 2px;
163
+ border-radius: 0.25rem;
164
+ }
165
+
166
+ /* Rating Display (static) */
167
+ .rating-display {
168
+ display: inline-flex;
169
+ align-items: center;
170
+ gap: 0.375rem;
171
+ }
172
+
173
+ .rating-display-value {
174
+ font-size: 0.875rem;
175
+ font-weight: 600;
176
+ color: var(--color-on-surface);
177
+ }
178
+
179
+ .rating-display-stars {
180
+ display: flex;
181
+ gap: 0.0625rem;
182
+ color: var(--color-warning);
183
+ }
184
+
185
+ .rating-display-max {
186
+ font-size: 0.75rem;
187
+ color: var(--color-on-surface-variant);
188
+ }
189
+
190
+ /* Compact Rating */
191
+ .rating-compact {
192
+ gap: 0;
193
+ }
194
+
195
+ .rating-compact .rating-item {
196
+ padding: 0.125rem;
197
+ }
198
+
199
+ /* Animated */
200
+ .rating-animated .rating-item {
201
+ transition: color 150ms ease-in-out, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
202
+ }
203
+
204
+ .rating-animated .rating-item.filled {
205
+ animation: rating-pop 300ms ease-out;
206
+ }
207
+
208
+ @keyframes rating-pop {
209
+ 0% {
210
+ transform: scale(1);
211
+ }
212
+ 50% {
213
+ transform: scale(1.3);
214
+ }
215
+ 100% {
216
+ transform: scale(1);
217
+ }
218
+ }
219
+
220
+ /* Reduce Motion */
221
+ @media (prefers-reduced-motion: reduce) {
222
+ .rating-item,
223
+ .rating-animated .rating-item {
224
+ transition: color 0ms;
225
+ }
226
+
227
+ .rating-animated .rating-item.filled {
228
+ animation: none;
229
+ }
230
+ }
231
+ }
232
+ `;
233
+
234
+ const sheet = new CSSStyleSheet();
235
+ sheet.replaceSync(css);
236
+ export const styles = sheet;
237
+ export default sheet;
@@ -0,0 +1,193 @@
1
+ // Auto-generated from segment-control.css
2
+ export const css = `/**
3
+ * Segment Control Component Styles
4
+ * DuskMoonUI - Material Design 3 inspired segmented button/toggle group
5
+ */
6
+
7
+ @layer components {
8
+ /* Base Segment Control */
9
+ .segment-control {
10
+ display: inline-flex;
11
+ align-items: stretch;
12
+ background-color: var(--color-surface-container);
13
+ border: 1px solid var(--color-outline);
14
+ border-radius: 1.25rem;
15
+ padding: 0.25rem;
16
+ gap: 0.25rem;
17
+ }
18
+
19
+ /* Segment Item */
20
+ .segment-item {
21
+ position: relative;
22
+ display: inline-flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ gap: 0.5rem;
26
+ padding: 0.5rem 1rem;
27
+ font-size: 0.875rem;
28
+ font-weight: 500;
29
+ line-height: 1.25rem;
30
+ color: var(--color-on-surface);
31
+ background-color: transparent;
32
+ border: none;
33
+ border-radius: 1rem;
34
+ cursor: pointer;
35
+ transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
36
+ user-select: none;
37
+ white-space: nowrap;
38
+ }
39
+
40
+ .segment-item:hover:not(:disabled):not(.segment-item-active) {
41
+ background-color: var(--color-surface-container-high);
42
+ }
43
+
44
+ .segment-item:focus-visible {
45
+ outline: 2px solid var(--color-primary);
46
+ outline-offset: 2px;
47
+ }
48
+
49
+ .segment-item:disabled {
50
+ opacity: 0.38;
51
+ cursor: not-allowed;
52
+ }
53
+
54
+ /* Active State */
55
+ .segment-item-active {
56
+ background-color: var(--color-primary-container);
57
+ color: var(--color-on-primary-container);
58
+ }
59
+
60
+ .segment-item-active:hover:not(:disabled) {
61
+ background-color: color-mix(in oklch, var(--color-primary-container), black 5%);
62
+ }
63
+
64
+ /* Segment Icon */
65
+ .segment-icon {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ width: 1.125rem;
70
+ height: 1.125rem;
71
+ }
72
+
73
+ /* Size Variants */
74
+ .segment-control-sm {
75
+ padding: 0.125rem;
76
+ gap: 0.125rem;
77
+ border-radius: 1rem;
78
+ }
79
+
80
+ .segment-control-sm .segment-item {
81
+ padding: 0.375rem 0.75rem;
82
+ font-size: 0.75rem;
83
+ line-height: 1rem;
84
+ border-radius: 0.75rem;
85
+ }
86
+
87
+ .segment-control-lg {
88
+ padding: 0.375rem;
89
+ gap: 0.375rem;
90
+ border-radius: 1.5rem;
91
+ }
92
+
93
+ .segment-control-lg .segment-item {
94
+ padding: 0.75rem 1.5rem;
95
+ font-size: 1rem;
96
+ line-height: 1.5rem;
97
+ border-radius: 1.25rem;
98
+ }
99
+
100
+ /* Color Variants */
101
+ .segment-control-primary .segment-item-active {
102
+ background-color: var(--color-primary);
103
+ color: var(--color-primary-content);
104
+ }
105
+
106
+ .segment-control-secondary .segment-item-active {
107
+ background-color: var(--color-secondary-container);
108
+ color: var(--color-on-secondary-container);
109
+ }
110
+
111
+ .segment-control-tertiary .segment-item-active {
112
+ background-color: var(--color-tertiary-container);
113
+ color: var(--color-on-tertiary-container);
114
+ }
115
+
116
+ /* Full Width */
117
+ .segment-control-full {
118
+ display: flex;
119
+ width: 100%;
120
+ }
121
+
122
+ .segment-control-full .segment-item {
123
+ flex: 1;
124
+ }
125
+
126
+ /* Outlined Variant */
127
+ .segment-control-outlined {
128
+ background-color: transparent;
129
+ padding: 0;
130
+ gap: 0;
131
+ }
132
+
133
+ .segment-control-outlined .segment-item {
134
+ border: 1px solid var(--color-outline);
135
+ border-radius: 0;
136
+ margin-left: -1px;
137
+ }
138
+
139
+ .segment-control-outlined .segment-item:first-child {
140
+ margin-left: 0;
141
+ border-top-left-radius: 1.25rem;
142
+ border-bottom-left-radius: 1.25rem;
143
+ }
144
+
145
+ .segment-control-outlined .segment-item:last-child {
146
+ border-top-right-radius: 1.25rem;
147
+ border-bottom-right-radius: 1.25rem;
148
+ }
149
+
150
+ .segment-control-outlined .segment-item-active {
151
+ background-color: var(--color-primary-container);
152
+ border-color: var(--color-primary);
153
+ z-index: 1;
154
+ }
155
+
156
+ /* Ghost Variant */
157
+ .segment-control-ghost {
158
+ background-color: transparent;
159
+ border-color: transparent;
160
+ }
161
+
162
+ /* Icon Only */
163
+ .segment-control-icon-only .segment-item {
164
+ padding: 0.625rem;
165
+ }
166
+
167
+ .segment-control-icon-only.segment-control-sm .segment-item {
168
+ padding: 0.5rem;
169
+ }
170
+
171
+ .segment-control-icon-only.segment-control-lg .segment-item {
172
+ padding: 0.75rem;
173
+ }
174
+
175
+ /* Multiple Selection (Toggle Group) */
176
+ .segment-control-multi .segment-item-active {
177
+ background-color: var(--color-primary-container);
178
+ color: var(--color-on-primary-container);
179
+ }
180
+
181
+ /* Reduce Motion */
182
+ @media (prefers-reduced-motion: reduce) {
183
+ .segment-item {
184
+ transition: none;
185
+ }
186
+ }
187
+ }
188
+ `;
189
+
190
+ const sheet = new CSSStyleSheet();
191
+ sheet.replaceSync(css);
192
+ export const styles = sheet;
193
+ export default sheet;