@db-vincent/components 0.0.0-stage → 0.1.1

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 (86) 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/Avatar.astro +88 -0
  5. package/src/astro/AvatarGroup.astro +63 -0
  6. package/src/astro/Badge.astro +23 -0
  7. package/src/astro/Breadcrumbs.astro +45 -0
  8. package/src/astro/Button.astro +125 -0
  9. package/src/astro/Card.astro +63 -0
  10. package/src/astro/Checkbox.astro +61 -0
  11. package/src/astro/Chip.astro +135 -0
  12. package/src/astro/CodeBlock.astro +17 -0
  13. package/src/astro/Drawer.astro +30 -0
  14. package/src/astro/EmptyState.astro +45 -0
  15. package/src/astro/Example.astro +37 -0
  16. package/src/astro/Grid.astro +56 -0
  17. package/src/astro/GridItem.astro +25 -0
  18. package/src/astro/Icon.astro +52 -0
  19. package/src/astro/Menu.astro +151 -0
  20. package/src/astro/MenuItem.astro +57 -0
  21. package/src/astro/Modal.astro +124 -0
  22. package/src/astro/Navbar.astro +756 -0
  23. package/src/astro/PageHeader.astro +34 -0
  24. package/src/astro/Pagination.astro +212 -0
  25. package/src/astro/Popover.astro +51 -0
  26. package/src/astro/Progress.astro +71 -0
  27. package/src/astro/Radio.astro +58 -0
  28. package/src/astro/RadioGroup.astro +25 -0
  29. package/src/astro/Section.astro +25 -0
  30. package/src/astro/Select.astro +420 -0
  31. package/src/astro/Sidebar.astro +215 -0
  32. package/src/astro/Skeleton.astro +41 -0
  33. package/src/astro/Spinner.astro +20 -0
  34. package/src/astro/Stepper.astro +82 -0
  35. package/src/astro/Switch.astro +78 -0
  36. package/src/astro/Table.astro +268 -0
  37. package/src/astro/Tabs.astro +83 -0
  38. package/src/astro/TextField.astro +305 -0
  39. package/src/astro/ThemeToggle.astro +66 -0
  40. package/src/astro/Toast.astro +181 -0
  41. package/src/astro/Tooltip.astro +54 -0
  42. package/src/astro/TopBar.astro +29 -0
  43. package/src/data/icons.ts +120 -0
  44. package/src/scripts/avatar.ts +33 -0
  45. package/src/scripts/menu.ts +218 -0
  46. package/src/scripts/tabs.ts +127 -0
  47. package/src/scripts/toast.ts +565 -0
  48. package/src/scripts/tooltip.ts +127 -0
  49. package/src/styles/accordion.css +79 -0
  50. package/src/styles/alert.css +108 -0
  51. package/src/styles/avatar.css +131 -0
  52. package/src/styles/badge.css +48 -0
  53. package/src/styles/base.css +205 -0
  54. package/src/styles/breadcrumbs.css +54 -0
  55. package/src/styles/button.css +174 -0
  56. package/src/styles/card.css +112 -0
  57. package/src/styles/chip.css +106 -0
  58. package/src/styles/choice.css +143 -0
  59. package/src/styles/code.css +44 -0
  60. package/src/styles/empty.css +59 -0
  61. package/src/styles/example.css +57 -0
  62. package/src/styles/grid.css +64 -0
  63. package/src/styles/input.css +208 -0
  64. package/src/styles/menu.css +151 -0
  65. package/src/styles/modal.css +285 -0
  66. package/src/styles/motion.css +114 -0
  67. package/src/styles/nav.css +232 -0
  68. package/src/styles/navbar.css +658 -0
  69. package/src/styles/page-header.css +62 -0
  70. package/src/styles/pagination.css +81 -0
  71. package/src/styles/popover.css +134 -0
  72. package/src/styles/progress.css +95 -0
  73. package/src/styles/section.css +38 -0
  74. package/src/styles/select.css +246 -0
  75. package/src/styles/skeleton.css +66 -0
  76. package/src/styles/spinner.css +44 -0
  77. package/src/styles/sr-only.css +14 -0
  78. package/src/styles/stepper.css +169 -0
  79. package/src/styles/switch.css +143 -0
  80. package/src/styles/table.css +177 -0
  81. package/src/styles/tabs.css +120 -0
  82. package/src/styles/theme-toggle.css +31 -0
  83. package/src/styles/toast.css +225 -0
  84. package/src/styles/tooltip.css +63 -0
  85. package/src/styles/topbar.css +32 -0
  86. package/README.md +0 -3
@@ -0,0 +1,225 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ /* A toast is a neutral, raised popover surface. The type lives in the icon;
5
+ the card itself stays calm so a stack never reads as inline content. */
6
+ .ds-toast {
7
+ align-items: center;
8
+ background: var(--toast-bg);
9
+ border: 1px solid var(--toast-border);
10
+ border-radius: var(--toast-radius);
11
+ box-shadow: var(--toast-shadow);
12
+ color: var(--toast-fg);
13
+ display: flex;
14
+ gap: var(--toast-gap);
15
+ max-width: min(var(--toast-width), calc(100vw - var(--space-8)));
16
+ min-width: 0;
17
+ padding: var(--toast-padding);
18
+ pointer-events: auto;
19
+ width: 100%;
20
+ }
21
+
22
+ .ds-toast__icon {
23
+ color: var(--toast-icon-fg);
24
+ display: inline-flex;
25
+ flex: none;
26
+ }
27
+
28
+ .ds-toast--info .ds-toast__icon {
29
+ color: var(--toast-info-icon);
30
+ }
31
+
32
+ .ds-toast--success .ds-toast__icon {
33
+ color: var(--toast-success-icon);
34
+ }
35
+
36
+ .ds-toast--warning .ds-toast__icon {
37
+ color: var(--toast-warning-icon);
38
+ }
39
+
40
+ .ds-toast--danger .ds-toast__icon {
41
+ color: var(--toast-danger-icon);
42
+ }
43
+
44
+ .ds-toast--loading .ds-toast__icon {
45
+ animation: ds-toast-spin calc(var(--duration-slower) * 2) linear infinite;
46
+ color: var(--toast-loading-icon);
47
+ }
48
+
49
+ .ds-toast__content {
50
+ display: grid;
51
+ flex: 1;
52
+ gap: var(--toast-body-gap);
53
+ min-width: 0;
54
+ }
55
+
56
+ .ds-toast__title {
57
+ color: var(--toast-fg);
58
+ font-size: var(--toast-title-size);
59
+ font-weight: var(--toast-title-weight);
60
+ line-height: var(--leading-sm);
61
+ margin: 0;
62
+ }
63
+
64
+ .ds-toast__body {
65
+ color: var(--toast-body-fg);
66
+ font-size: var(--toast-body-size);
67
+ line-height: var(--leading-sm);
68
+ margin: 0;
69
+ }
70
+
71
+ .ds-toast__actions {
72
+ align-items: center;
73
+ display: flex;
74
+ flex: none;
75
+ gap: var(--space-2);
76
+ }
77
+
78
+ .ds-toast__action {
79
+ align-items: center;
80
+ background: var(--toast-action-bg);
81
+ border: 1px solid var(--toast-action-border);
82
+ border-radius: var(--toast-action-radius);
83
+ color: var(--toast-action-fg);
84
+ cursor: pointer;
85
+ display: inline-flex;
86
+ font: inherit;
87
+ font-size: var(--toast-action-font-size);
88
+ font-weight: var(--toast-action-font-weight);
89
+ height: var(--toast-action-height);
90
+ justify-content: center;
91
+ padding-inline: var(--toast-action-padding-x);
92
+ text-decoration: none;
93
+ transition:
94
+ background-color var(--duration-fast) var(--ease-standard),
95
+ border-color var(--duration-fast) var(--ease-standard);
96
+ white-space: nowrap;
97
+ }
98
+
99
+ @media (hover: hover) and (pointer: fine) {
100
+ .ds-toast__action:hover {
101
+ background: var(--toast-action-bg-hover);
102
+ }
103
+ }
104
+
105
+ .ds-toast__action:focus-visible {
106
+ outline: var(--toast-focus-width) solid var(--toast-focus-color);
107
+ outline-offset: var(--toast-focus-offset);
108
+ }
109
+
110
+ .ds-toast__close {
111
+ align-items: center;
112
+ background: transparent;
113
+ border: 0;
114
+ border-radius: var(--radius-sm);
115
+ color: var(--toast-close-fg);
116
+ cursor: pointer;
117
+ display: inline-flex;
118
+ flex: none;
119
+ height: var(--space-7);
120
+ justify-content: center;
121
+ padding: 0;
122
+ transition:
123
+ background-color var(--duration-fast) var(--ease-standard),
124
+ color var(--duration-fast) var(--ease-standard);
125
+ width: var(--space-7);
126
+ }
127
+
128
+ @media (hover: hover) and (pointer: fine) {
129
+ .ds-toast__close:hover {
130
+ background: var(--toast-close-bg-hover);
131
+ color: var(--toast-close-fg-hover);
132
+ }
133
+ }
134
+
135
+ .ds-toast__close:focus-visible {
136
+ outline: var(--toast-focus-width) solid var(--toast-focus-color);
137
+ outline-offset: var(--toast-focus-offset);
138
+ }
139
+
140
+ .ds-toast-region {
141
+ bottom: var(--space-4);
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: var(--toast-viewport-gap);
145
+ inset-inline-end: var(--space-4);
146
+ max-width: calc(100vw - var(--space-8));
147
+ pointer-events: none;
148
+ position: fixed;
149
+ width: min(var(--toast-width), calc(100vw - var(--space-8)));
150
+ z-index: var(--z-toast);
151
+ }
152
+
153
+ /* Toast cards share one bottom-end anchor. Collapsed, older cards peek out
154
+ behind the frontmost one; hover or keyboard focus expands the stack. */
155
+ .ds-toast-region .ds-toast {
156
+ bottom: 0;
157
+ inset-inline-end: 0;
158
+ position: absolute;
159
+ transform: translateY(
160
+ calc(var(--toast-index, 0) * var(--toast-stack-peek) * -1)
161
+ )
162
+ scale(calc(1 - var(--toast-index, 0) * var(--toast-stack-scale-step)));
163
+ transform-origin: bottom center;
164
+ transition:
165
+ transform var(--duration-slow) var(--ease-spring),
166
+ opacity var(--duration-base) var(--ease-standard);
167
+ z-index: calc(100 - var(--toast-index, 0));
168
+ }
169
+
170
+ @starting-style {
171
+ .ds-toast-region .ds-toast {
172
+ opacity: 0;
173
+ transform: translateY(100%) scale(0.98);
174
+ }
175
+ }
176
+
177
+ .ds-toast-region:hover .ds-toast,
178
+ .ds-toast-region:focus-within .ds-toast {
179
+ transform: translateY(calc(-1 * var(--toast-offset, 0px))) scale(1);
180
+ }
181
+
182
+ .ds-toast-region .ds-toast[data-toast-leaving] {
183
+ opacity: 0;
184
+ pointer-events: none;
185
+ transform: translateY(100%) scale(0.98);
186
+ transition:
187
+ transform 150ms var(--ease-standard),
188
+ opacity 150ms var(--ease-standard);
189
+ }
190
+
191
+ .ds-toast-region .ds-toast[data-toast-limited] {
192
+ opacity: 0;
193
+ pointer-events: none;
194
+ transform: translateY(var(--space-3)) scale(0.98);
195
+ transition: opacity var(--duration-fast) var(--ease-exit);
196
+ }
197
+
198
+ @keyframes ds-toast-spin {
199
+ to {
200
+ transform: rotate(360deg);
201
+ }
202
+ }
203
+
204
+ @media (prefers-reduced-motion: reduce) {
205
+ .ds-toast-region .ds-toast {
206
+ transition: opacity 120ms var(--ease-standard);
207
+ }
208
+
209
+ @starting-style {
210
+ .ds-toast-region .ds-toast {
211
+ opacity: 0;
212
+ transform: none;
213
+ }
214
+ }
215
+
216
+ .ds-toast-region .ds-toast[data-toast-leaving] {
217
+ transform: none;
218
+ transition: opacity 120ms var(--ease-standard);
219
+ }
220
+
221
+ .ds-toast--loading .ds-toast__icon {
222
+ animation: none;
223
+ }
224
+ }
225
+ }
@@ -0,0 +1,63 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ /* Positioning and the .ds-anchor wrapper live in popover.css. */
4
+ @layer components {
5
+ .ds-tooltip {
6
+ --ds-anchor-gap: var(--tooltip-gap);
7
+
8
+ background: var(--tooltip-bg);
9
+ border: 0;
10
+ border-radius: var(--tooltip-radius);
11
+ color: var(--tooltip-fg);
12
+ font-size: var(--tooltip-font-size);
13
+ line-height: var(--tooltip-line-height);
14
+ max-width: min(var(--tooltip-max-width), calc(100vw - var(--space-8)));
15
+ opacity: 0;
16
+ overflow: visible;
17
+ padding: var(--tooltip-padding-y) var(--tooltip-padding-x);
18
+ transform: scale(var(--tooltip-scale-from));
19
+ transition:
20
+ opacity var(--tooltip-duration) var(--tooltip-ease-exit),
21
+ transform var(--tooltip-duration) var(--tooltip-ease-exit),
22
+ display var(--tooltip-duration) allow-discrete,
23
+ overlay var(--tooltip-duration) allow-discrete;
24
+ width: max-content;
25
+ }
26
+
27
+ .ds-tooltip:popover-open {
28
+ opacity: 1;
29
+ transform: none;
30
+ transition:
31
+ opacity var(--tooltip-duration) var(--tooltip-ease-enter),
32
+ transform var(--tooltip-duration) var(--tooltip-ease-enter),
33
+ display var(--tooltip-duration) allow-discrete,
34
+ overlay var(--tooltip-duration) allow-discrete;
35
+ }
36
+
37
+ /* Set by script when another tooltip is open or just closed: skip the
38
+ animation so scanning a toolbar feels immediate. */
39
+ .ds-tooltip[data-instant],
40
+ .ds-tooltip[data-instant]:popover-open {
41
+ transition-duration: 0s;
42
+ }
43
+
44
+ @starting-style {
45
+ .ds-tooltip:popover-open {
46
+ opacity: 0;
47
+ transform: scale(var(--tooltip-scale-from));
48
+ }
49
+ }
50
+
51
+ @media (prefers-reduced-motion: reduce) {
52
+ .ds-tooltip,
53
+ .ds-tooltip:popover-open {
54
+ transform: none;
55
+ }
56
+
57
+ @starting-style {
58
+ .ds-tooltip:popover-open {
59
+ transform: none;
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,32 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-topbar {
5
+ background: var(--topbar-bg);
6
+ border-bottom: 1px solid var(--topbar-border);
7
+ }
8
+
9
+ .ds-topbar__inner {
10
+ align-items: center;
11
+ display: flex;
12
+ gap: var(--topbar-gap);
13
+ min-height: var(--topbar-height);
14
+ padding-inline: var(--topbar-padding-x);
15
+ }
16
+
17
+ .ds-topbar__start {
18
+ flex: 1 1 auto;
19
+ min-width: 0;
20
+ }
21
+
22
+ .ds-topbar__actions {
23
+ display: flex;
24
+ flex-shrink: 0;
25
+ gap: var(--topbar-gap);
26
+ margin-inline-start: auto;
27
+ }
28
+
29
+ .ds-topbar__start:empty + .ds-topbar__actions {
30
+ margin-inline-start: 0;
31
+ }
32
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.