@db-vincent/components 0.0.0-stage → 0.1.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 (62) hide show
  1. package/package.json +28 -4
  2. package/src/astro/Accordion.astro +37 -0
  3. package/src/astro/Alert.astro +73 -0
  4. package/src/astro/Badge.astro +23 -0
  5. package/src/astro/Breadcrumbs.astro +45 -0
  6. package/src/astro/Button.astro +125 -0
  7. package/src/astro/Card.astro +63 -0
  8. package/src/astro/Checkbox.astro +61 -0
  9. package/src/astro/Chip.astro +116 -0
  10. package/src/astro/CodeBlock.astro +17 -0
  11. package/src/astro/EmptyState.astro +45 -0
  12. package/src/astro/Example.astro +37 -0
  13. package/src/astro/Grid.astro +50 -0
  14. package/src/astro/GridItem.astro +23 -0
  15. package/src/astro/Icon.astro +52 -0
  16. package/src/astro/Modal.astro +117 -0
  17. package/src/astro/Navbar.astro +756 -0
  18. package/src/astro/PageHeader.astro +34 -0
  19. package/src/astro/Pagination.astro +162 -0
  20. package/src/astro/Radio.astro +58 -0
  21. package/src/astro/RadioGroup.astro +25 -0
  22. package/src/astro/Section.astro +25 -0
  23. package/src/astro/Select.astro +403 -0
  24. package/src/astro/Sidebar.astro +215 -0
  25. package/src/astro/Skeleton.astro +39 -0
  26. package/src/astro/Spinner.astro +19 -0
  27. package/src/astro/Table.astro +254 -0
  28. package/src/astro/TextField.astro +287 -0
  29. package/src/astro/ThemeToggle.astro +66 -0
  30. package/src/astro/Toast.astro +181 -0
  31. package/src/astro/TopBar.astro +29 -0
  32. package/src/data/icons.ts +104 -0
  33. package/src/scripts/toast.ts +531 -0
  34. package/src/styles/accordion.css +77 -0
  35. package/src/styles/alert.css +106 -0
  36. package/src/styles/badge.css +46 -0
  37. package/src/styles/base.css +203 -0
  38. package/src/styles/breadcrumbs.css +52 -0
  39. package/src/styles/button.css +163 -0
  40. package/src/styles/card.css +108 -0
  41. package/src/styles/chip.css +104 -0
  42. package/src/styles/choice.css +137 -0
  43. package/src/styles/code.css +42 -0
  44. package/src/styles/empty.css +57 -0
  45. package/src/styles/example.css +55 -0
  46. package/src/styles/grid.css +62 -0
  47. package/src/styles/input.css +198 -0
  48. package/src/styles/modal.css +143 -0
  49. package/src/styles/motion.css +96 -0
  50. package/src/styles/nav.css +230 -0
  51. package/src/styles/navbar.css +656 -0
  52. package/src/styles/page-header.css +59 -0
  53. package/src/styles/pagination.css +77 -0
  54. package/src/styles/section.css +36 -0
  55. package/src/styles/select.css +235 -0
  56. package/src/styles/skeleton.css +64 -0
  57. package/src/styles/spinner.css +42 -0
  58. package/src/styles/table.css +175 -0
  59. package/src/styles/theme-toggle.css +29 -0
  60. package/src/styles/toast.css +207 -0
  61. package/src/styles/topbar.css +30 -0
  62. package/README.md +0 -3
@@ -0,0 +1,96 @@
1
+ @layer motion {
2
+ .ds-motion-lift,
3
+ .ds-motion-underline,
4
+ .ds-motion-arrow,
5
+ .ds-motion-row {
6
+ --ds-motion-time: var(--motion-duration);
7
+ --ds-motion-delay: var(--motion-delay-none);
8
+ }
9
+
10
+ .ds-motion-fast {
11
+ --ds-motion-time: var(--motion-duration-fast);
12
+ }
13
+
14
+ .ds-motion-slow {
15
+ --ds-motion-time: var(--motion-duration-slow);
16
+ }
17
+
18
+ .ds-motion-delay {
19
+ --ds-motion-delay: var(--motion-delay-short);
20
+ }
21
+
22
+ .ds-motion-delay-long {
23
+ --ds-motion-delay: var(--motion-delay-long);
24
+ }
25
+
26
+ .ds-motion-lift {
27
+ transition:
28
+ transform var(--ds-motion-time) var(--motion-ease) var(--ds-motion-delay),
29
+ box-shadow var(--ds-motion-time) var(--motion-ease) var(--ds-motion-delay),
30
+ border-color var(--ds-motion-time) var(--motion-ease)
31
+ var(--ds-motion-delay);
32
+ }
33
+
34
+ .ds-motion-lift:hover,
35
+ .ds-motion-lift:focus-visible {
36
+ box-shadow: var(--motion-lift-shadow);
37
+ transform: translateY(var(--motion-lift-y));
38
+ }
39
+
40
+ .ds-motion-underline {
41
+ background-image: linear-gradient(currentColor, currentColor);
42
+ background-position: 0 100%;
43
+ background-repeat: no-repeat;
44
+ background-size: 0 var(--motion-underline-thickness);
45
+ padding-block-end: var(--motion-underline-offset);
46
+ text-decoration: none;
47
+ transition: background-size var(--ds-motion-time) var(--motion-ease)
48
+ var(--ds-motion-delay);
49
+ }
50
+
51
+ .ds-motion-underline:hover,
52
+ .ds-motion-underline:focus-visible {
53
+ background-size: 100% var(--motion-underline-thickness);
54
+ }
55
+
56
+ .ds-motion-arrow {
57
+ align-items: center;
58
+ display: inline-flex;
59
+ gap: var(--space-2);
60
+ text-decoration: none;
61
+ }
62
+
63
+ .ds-motion-arrow__target {
64
+ display: inline-flex;
65
+ transition: transform var(--ds-motion-time) var(--motion-ease)
66
+ var(--ds-motion-delay);
67
+ }
68
+
69
+ .ds-motion-arrow:hover .ds-motion-arrow__target,
70
+ .ds-motion-arrow:focus-visible .ds-motion-arrow__target {
71
+ transform: translateX(var(--motion-nudge));
72
+ }
73
+
74
+ .ds-motion-row {
75
+ transition:
76
+ background-color var(--ds-motion-time) var(--motion-ease)
77
+ var(--ds-motion-delay),
78
+ transform var(--ds-motion-time) var(--motion-ease) var(--ds-motion-delay);
79
+ }
80
+
81
+ .ds-motion-row:hover,
82
+ .ds-motion-row:focus-within {
83
+ transform: translateX(var(--motion-row-nudge));
84
+ }
85
+
86
+ @media (prefers-reduced-motion: reduce) {
87
+ .ds-motion-lift:hover,
88
+ .ds-motion-lift:focus-visible,
89
+ .ds-motion-arrow:hover .ds-motion-arrow__target,
90
+ .ds-motion-arrow:focus-visible .ds-motion-arrow__target,
91
+ .ds-motion-row:hover,
92
+ .ds-motion-row:focus-within {
93
+ transform: none;
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,230 @@
1
+ @layer components {
2
+ .ds-nav {
3
+ background: var(--nav-bg);
4
+ border-inline-end: 1px solid var(--nav-border);
5
+ display: flex;
6
+ flex-direction: column;
7
+ height: 100dvh;
8
+ padding: var(--space-4);
9
+ width: var(--nav-width);
10
+ }
11
+
12
+ .ds-nav__brand {
13
+ align-items: center;
14
+ color: var(--nav-brand-fg);
15
+ display: flex;
16
+ font-size: var(--nav-brand-size);
17
+ font-weight: var(--weight-semibold);
18
+ gap: var(--space-2-5);
19
+ letter-spacing: var(--type-heading-tracking);
20
+ min-height: var(--space-10);
21
+ padding-inline: var(--nav-item-padding-x);
22
+ text-decoration: none;
23
+ }
24
+
25
+ .ds-nav__brand-mark {
26
+ align-items: center;
27
+ background: var(--nav-brand-mark-bg);
28
+ border-radius: var(--radius-sm);
29
+ color: var(--nav-brand-mark-fg);
30
+ display: inline-flex;
31
+ height: var(--space-7);
32
+ justify-content: center;
33
+ width: var(--space-7);
34
+ }
35
+
36
+ .ds-nav__scroll {
37
+ flex: 1;
38
+ margin-block-start: var(--space-6);
39
+ overflow-y: auto;
40
+ scrollbar-color: var(--nav-scrollbar) transparent;
41
+ scrollbar-width: thin;
42
+ }
43
+
44
+ .ds-nav__group + .ds-nav__group {
45
+ margin-block-start: var(--space-6);
46
+ }
47
+
48
+ .ds-nav__group-label {
49
+ color: var(--nav-group-label-fg);
50
+ font-family: var(--font-body);
51
+ font-size: var(--nav-group-label-size);
52
+ font-weight: var(--type-overline-weight);
53
+ letter-spacing: var(--type-overline-tracking);
54
+ padding-inline: var(--nav-item-padding-x);
55
+ text-transform: uppercase;
56
+ }
57
+
58
+ .ds-nav__list {
59
+ display: grid;
60
+ gap: var(--space-0-5);
61
+ list-style: none;
62
+ margin-block-start: var(--space-2);
63
+ padding: 0;
64
+ }
65
+
66
+ .ds-nav__link,
67
+ .ds-nav__summary {
68
+ align-items: center;
69
+ border-radius: var(--nav-item-radius);
70
+ color: var(--nav-item-fg);
71
+ display: flex;
72
+ font-size: var(--text-sm);
73
+ gap: var(--nav-item-gap);
74
+ min-height: var(--nav-item-height);
75
+ padding: var(--space-1) var(--nav-item-padding-x);
76
+ text-decoration: none;
77
+ transition:
78
+ background-color var(--duration-fast) var(--ease-standard),
79
+ color var(--duration-fast) var(--ease-standard);
80
+ width: 100%;
81
+ }
82
+
83
+ .ds-nav__link:hover,
84
+ .ds-nav__summary:hover {
85
+ background: var(--nav-item-bg-hover);
86
+ color: var(--nav-item-fg-hover);
87
+ }
88
+
89
+ .ds-nav__link[aria-current="page"] {
90
+ background: var(--nav-item-bg-active);
91
+ color: var(--nav-item-fg-active);
92
+ font-weight: var(--weight-medium);
93
+ }
94
+
95
+ .ds-nav__link[aria-current="page"] .ds-nav__icon {
96
+ color: var(--nav-item-indicator);
97
+ }
98
+
99
+ .ds-nav__link:focus-visible,
100
+ .ds-nav__summary:focus-visible {
101
+ outline: var(--nav-focus-width) solid var(--nav-focus-color);
102
+ outline-offset: var(--nav-focus-offset);
103
+ }
104
+
105
+ .ds-nav__icon {
106
+ color: var(--nav-icon);
107
+ flex: none;
108
+ }
109
+
110
+ .ds-nav__summary[data-active="true"] {
111
+ color: var(--nav-item-fg-active);
112
+ font-weight: var(--weight-medium);
113
+ }
114
+
115
+ .ds-nav__summary[data-active="true"] .ds-nav__icon {
116
+ color: var(--nav-item-indicator);
117
+ }
118
+
119
+ .ds-nav__badge {
120
+ margin-inline-start: auto;
121
+ }
122
+
123
+ .ds-nav__summary {
124
+ cursor: pointer;
125
+ justify-content: flex-start;
126
+ list-style: none;
127
+ }
128
+
129
+ .ds-nav__summary::-webkit-details-marker {
130
+ display: none;
131
+ }
132
+
133
+ .ds-nav__summary .ds-nav__chevron {
134
+ margin-inline-start: auto;
135
+ transition: transform var(--duration-fast) var(--ease-standard);
136
+ }
137
+
138
+ .ds-nav__submenu[open] > .ds-nav__summary .ds-nav__chevron {
139
+ transform: rotate(90deg);
140
+ }
141
+
142
+ .ds-nav__submenu .ds-nav__list {
143
+ border-inline-start: 1px solid var(--nav-border);
144
+ margin-block-start: var(--space-1);
145
+ margin-inline-start: calc(var(--nav-item-padding-x) + var(--space-2));
146
+ padding-inline-start: var(--space-2);
147
+ }
148
+
149
+ .ds-nav__footer {
150
+ border-top: 1px solid var(--nav-border);
151
+ margin-block-start: var(--space-4);
152
+ padding-block-start: var(--space-4);
153
+ }
154
+
155
+ .ds-nav__mobilebar {
156
+ align-items: center;
157
+ background: var(--nav-mobilebar-bg);
158
+ border-bottom: 1px solid var(--nav-border);
159
+ display: none;
160
+ gap: var(--space-3);
161
+ justify-content: space-between;
162
+ min-height: var(--layout-header);
163
+ padding-inline: var(--space-4);
164
+ position: sticky;
165
+ top: 0;
166
+ z-index: var(--z-sticky);
167
+ }
168
+
169
+ .ds-nav__toggle {
170
+ align-items: center;
171
+ background: var(--nav-toggle-bg);
172
+ border: 1px solid var(--nav-toggle-border);
173
+ border-radius: var(--radius-sm);
174
+ color: var(--nav-toggle-fg);
175
+ display: inline-flex;
176
+ height: var(--space-10);
177
+ justify-content: center;
178
+ width: var(--space-10);
179
+ }
180
+
181
+ .ds-nav__toggle:focus-visible {
182
+ outline: var(--nav-focus-width) solid var(--nav-focus-color);
183
+ outline-offset: var(--nav-focus-offset);
184
+ }
185
+
186
+ .ds-nav__backdrop {
187
+ background: var(--nav-mobile-backdrop);
188
+ inset: 0;
189
+ opacity: 0;
190
+ position: fixed;
191
+ transition: opacity var(--duration-base) var(--ease-standard);
192
+ visibility: hidden;
193
+ z-index: var(--z-overlay);
194
+ }
195
+
196
+ @media (max-width: 900px) {
197
+ .ds-nav {
198
+ inset-block: 0;
199
+ inset-inline-start: 0;
200
+ position: fixed;
201
+ transform: translateX(-100%);
202
+ transition: transform var(--duration-base) var(--ease-standard);
203
+ z-index: var(--z-modal);
204
+ }
205
+
206
+ .ds-nav__mobilebar {
207
+ display: flex;
208
+ }
209
+
210
+ .ds-nav__backdrop {
211
+ display: block;
212
+ }
213
+
214
+ .ds-nav[data-open="true"] {
215
+ transform: none;
216
+ }
217
+
218
+ .ds-nav[data-open="true"] + .ds-nav__backdrop {
219
+ opacity: 1;
220
+ visibility: visible;
221
+ }
222
+ }
223
+
224
+ @media (prefers-reduced-motion: reduce) {
225
+ .ds-nav,
226
+ .ds-nav__backdrop {
227
+ transition: none;
228
+ }
229
+ }
230
+ }