@grantcodes/ui 2.0.2 → 2.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 (179) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/custom-elements.json +1926 -191
  3. package/package.json +22 -21
  4. package/src/components/accordion/accordion.component.js +33 -0
  5. package/src/components/accordion/accordion.js +6 -0
  6. package/src/components/accordion/accordion.stories.js +88 -0
  7. package/src/components/accordion/accordion.styles.js +66 -0
  8. package/src/components/accordion/index.js +6 -0
  9. package/src/components/app-bar/app-bar.component.js +1 -3
  10. package/src/components/app-bar/app-bar.js +0 -2
  11. package/src/components/app-bar/app-bar.styles.js +222 -221
  12. package/src/components/app-bar/app-bar.test.js +58 -17
  13. package/src/components/app-bar/index.js +0 -2
  14. package/src/components/avatar/avatar.js +0 -12
  15. package/src/components/avatar/avatar.stories.js +0 -12
  16. package/src/components/avatar/avatar.styles.js +19 -19
  17. package/src/components/avatar/avatar.test.js +4 -4
  18. package/src/components/avatar/index.js +1 -13
  19. package/src/components/badge/badge.js +0 -2
  20. package/src/components/badge/badge.styles.js +78 -81
  21. package/src/components/badge/badge.test.js +18 -5
  22. package/src/components/badge/index.js +0 -2
  23. package/src/components/breadcrumb/breadcrumb.component.js +9 -10
  24. package/src/components/breadcrumb/breadcrumb.js +6 -4
  25. package/src/components/breadcrumb/breadcrumb.styles.js +86 -90
  26. package/src/components/breadcrumb/breadcrumb.test.js +15 -5
  27. package/src/components/breadcrumb/index.js +0 -2
  28. package/src/components/button/button.component.js +2 -2
  29. package/src/components/button/button.styles.js +58 -86
  30. package/src/components/button/button.test.js +8 -4
  31. package/src/components/button/index.js +1 -1
  32. package/src/components/button-group/button-group.test.js +0 -2
  33. package/src/components/button-group/index.js +1 -1
  34. package/src/components/card/card.component.js +40 -9
  35. package/src/components/card/card.js +3 -1
  36. package/src/components/card/card.stories.js +18 -5
  37. package/src/components/card/card.styles.js +46 -20
  38. package/src/components/card/card.test.js +0 -2
  39. package/src/components/card/index.js +1 -1
  40. package/src/components/code-preview/code-preview.component.js +9 -9
  41. package/src/components/code-preview/code-preview.js +0 -1
  42. package/src/components/code-preview/code-preview.styles.js +3 -3
  43. package/src/components/code-preview/code-preview.test.js +29 -8
  44. package/src/components/code-preview/index.js +1 -1
  45. package/src/components/container/container.component.js +1 -0
  46. package/src/components/container/container.js +0 -1
  47. package/src/components/container/container.stories.js +12 -4
  48. package/src/components/container/container.styles.js +37 -35
  49. package/src/components/container/container.test.js +0 -2
  50. package/src/components/container/index.js +1 -1
  51. package/src/components/cta/cta.component.js +108 -0
  52. package/src/components/cta/cta.js +6 -0
  53. package/src/components/cta/cta.stories.js +56 -0
  54. package/src/components/cta/cta.styles.js +64 -0
  55. package/src/components/cta/index.js +1 -0
  56. package/src/components/dialog/dialog.js +0 -1
  57. package/src/components/dialog/dialog.styles.js +8 -8
  58. package/src/components/dialog/dialog.test.js +11 -5
  59. package/src/components/dialog/index.js +1 -1
  60. package/src/components/dropdown/dropdown.component.js +5 -3
  61. package/src/components/dropdown/dropdown.js +6 -4
  62. package/src/components/dropdown/dropdown.styles.js +5 -5
  63. package/src/components/dropdown/dropdown.test.js +20 -4
  64. package/src/components/dropdown/index.js +0 -2
  65. package/src/components/dropzone/dropzone.component.js +7 -6
  66. package/src/components/dropzone/dropzone.styles.js +4 -4
  67. package/src/components/dropzone/dropzone.test.js +6 -4
  68. package/src/components/dropzone/index.js +1 -1
  69. package/src/components/feature-list/feature-list.component.js +130 -0
  70. package/src/components/feature-list/feature-list.js +6 -0
  71. package/src/components/feature-list/feature-list.stories.js +117 -0
  72. package/src/components/feature-list/feature-list.styles.js +82 -0
  73. package/src/components/feature-list/index.js +1 -0
  74. package/src/components/footer/footer-column.styles.js +46 -47
  75. package/src/components/footer/footer.js +6 -2
  76. package/src/components/footer/footer.styles.js +6 -6
  77. package/src/components/footer/footer.test.js +9 -4
  78. package/src/components/footer/index.js +1 -1
  79. package/src/components/form-field/form-field.component.js +1 -3
  80. package/src/components/form-field/form-field.js +0 -1
  81. package/src/components/form-field/form-field.styles.js +35 -37
  82. package/src/components/form-field/form-field.test.js +9 -4
  83. package/src/components/form-field/index.js +1 -1
  84. package/src/components/gallery/gallery-image.js +0 -1
  85. package/src/components/gallery/gallery.js +0 -1
  86. package/src/components/gallery/gallery.styles.js +1 -1
  87. package/src/components/gallery/gallery.test.js +5 -3
  88. package/src/components/gallery/index.js +2 -2
  89. package/src/components/hero/hero.component.js +66 -0
  90. package/src/components/hero/hero.js +6 -0
  91. package/src/components/hero/hero.stories.js +53 -0
  92. package/src/components/hero/hero.styles.js +46 -0
  93. package/src/components/hero/index.js +1 -0
  94. package/src/components/icon/icon.js +3 -2
  95. package/src/components/icon/icon.stories.js +2 -1
  96. package/src/components/icon/icon.styles.js +23 -21
  97. package/src/components/icon/icon.test.js +2 -3
  98. package/src/components/icon/index.js +1 -1
  99. package/src/components/loading/index.js +1 -1
  100. package/src/components/loading/loading.js +3 -2
  101. package/src/components/loading/loading.styles.js +1 -1
  102. package/src/components/loading/loading.test.js +0 -2
  103. package/src/components/logo-cloud/index.js +1 -0
  104. package/src/components/logo-cloud/logo-cloud.component.js +81 -0
  105. package/src/components/logo-cloud/logo-cloud.js +6 -0
  106. package/src/components/logo-cloud/logo-cloud.stories.js +107 -0
  107. package/src/components/logo-cloud/logo-cloud.styles.js +68 -0
  108. package/src/components/media-text/index.js +1 -0
  109. package/src/components/media-text/media-text.component.js +100 -0
  110. package/src/components/media-text/media-text.js +6 -0
  111. package/src/components/media-text/media-text.stories.js +69 -0
  112. package/src/components/media-text/media-text.styles.js +66 -0
  113. package/src/components/newsletter/index.js +1 -0
  114. package/src/components/newsletter/newsletter.component.js +101 -0
  115. package/src/components/newsletter/newsletter.js +6 -0
  116. package/src/components/newsletter/newsletter.stories.js +59 -0
  117. package/src/components/newsletter/newsletter.styles.js +89 -0
  118. package/src/components/notice/index.js +1 -1
  119. package/src/components/notice/notice.js +0 -1
  120. package/src/components/notice/notice.styles.js +7 -7
  121. package/src/components/notice/notice.test.js +15 -5
  122. package/src/components/pagination/index.js +1 -1
  123. package/src/components/pagination/pagination.stories.js +1 -3
  124. package/src/components/pagination/pagination.styles.js +1 -1
  125. package/src/components/pagination/pagination.test.js +9 -4
  126. package/src/components/pricing/index.js +1 -0
  127. package/src/components/pricing/pricing.component.js +119 -0
  128. package/src/components/pricing/pricing.js +6 -0
  129. package/src/components/pricing/pricing.stories.js +123 -0
  130. package/src/components/pricing/pricing.styles.js +135 -0
  131. package/src/components/sidebar/index.js +0 -2
  132. package/src/components/sidebar/sidebar.component.js +12 -10
  133. package/src/components/sidebar/sidebar.js +3 -3
  134. package/src/components/sidebar/sidebar.stories.js +0 -2
  135. package/src/components/sidebar/sidebar.styles.js +181 -186
  136. package/src/components/sidebar/sidebar.test.js +48 -13
  137. package/src/components/stats/index.js +1 -0
  138. package/src/components/stats/stats.component.js +73 -0
  139. package/src/components/stats/stats.js +6 -0
  140. package/src/components/stats/stats.stories.js +64 -0
  141. package/src/components/stats/stats.styles.js +66 -0
  142. package/src/components/tabs/index.js +2 -2
  143. package/src/components/tabs/internal/tabs-button.component.js +1 -1
  144. package/src/components/tabs/internal/tabs-button.js +0 -1
  145. package/src/components/tabs/tab.js +0 -1
  146. package/src/components/tabs/tabs.js +3 -2
  147. package/src/components/tabs/tabs.styles.js +84 -74
  148. package/src/components/testimonials/index.js +1 -0
  149. package/src/components/testimonials/testimonials.component.js +97 -0
  150. package/src/components/testimonials/testimonials.js +6 -0
  151. package/src/components/testimonials/testimonials.stories.js +78 -0
  152. package/src/components/testimonials/testimonials.styles.js +82 -0
  153. package/src/components/toast/index.js +0 -2
  154. package/src/components/toast/toast.component.js +1 -3
  155. package/src/components/toast/toast.js +10 -5
  156. package/src/components/toast/toast.stories.js +9 -5
  157. package/src/components/toast/toast.styles.js +199 -201
  158. package/src/components/toast/toast.test.js +38 -10
  159. package/src/components/tooltip/index.js +1 -1
  160. package/src/components/tooltip/tooltip.js +3 -2
  161. package/src/components/tooltip/tooltip.styles.js +3 -3
  162. package/src/components/tooltip/tooltip.test.js +10 -4
  163. package/src/css/base.css +8 -5
  164. package/src/css/colors.stories.js +27 -28
  165. package/src/css/elements/forms/input.css +9 -41
  166. package/src/css/elements/media/image.css +1 -1
  167. package/src/css/themes/todomap.css +1 -0
  168. package/src/css/tokens.stories.js +26 -21
  169. package/src/css/typography.css +1 -3
  170. package/src/css/util/focus-ring.css +30 -0
  171. package/src/css/util/index.css +1 -2
  172. package/src/lib/styles/focus-ring.styles.js +34 -0
  173. package/src/main.js +10 -1
  174. package/src/pages/agency.stories.js +164 -0
  175. package/src/pages/blog-post.stories.js +381 -0
  176. package/src/pages/saas-landing.stories.js +307 -0
  177. package/src/test-utils/assert-helpers.js +10 -8
  178. package/src/css/util/functions.css +0 -16
  179. package/src/css/util/mixins.css +0 -63
@@ -1,207 +1,205 @@
1
1
  import { css } from "lit";
2
+ import { focusRingStyles } from "../../lib/styles/focus-ring.styles.js";
2
3
 
3
4
  export const toastStyles = css`
4
- *,
5
+ ${focusRingStyles}
6
+
7
+ *,
5
8
  *::before,
6
9
  *::after {
7
- box-sizing: border-box;
8
- }
9
-
10
- :host {
11
- display: block;
12
- pointer-events: none;
13
- }
14
-
15
- /* Toast Container */
16
- .toast-container {
17
- position: fixed;
18
- z-index: 9999;
19
- display: flex;
20
- flex-direction: column;
21
- gap: 0.75rem;
22
- padding: 1rem;
23
- pointer-events: none;
24
- max-inline-size: 100vw;
25
- max-block-size: 100vh;
26
- overflow: hidden;
27
- }
28
-
29
- /* Container positions */
30
- .toast-container--top-left {
31
- inset-block-start: 0;
32
- inset-inline-start: 0;
33
- }
34
-
35
- .toast-container--top-center {
36
- inset-block-start: 0;
37
- inset-inline-start: 50%;
38
- transform: translateX(-50%);
39
- }
40
-
41
- .toast-container--top-right {
42
- inset-block-start: 0;
43
- inset-inline-end: 0;
44
- }
45
-
46
- .toast-container--bottom-left {
47
- inset-block-end: 0;
48
- inset-inline-start: 0;
49
- }
50
-
51
- .toast-container--bottom-center {
52
- inset-block-end: 0;
53
- inset-inline-start: 50%;
54
- transform: translateX(-50%);
55
- }
56
-
57
- .toast-container--bottom-right {
58
- inset-block-end: 0;
59
- inset-inline-end: 0;
60
- }
61
-
62
- /* Toast */
63
- .toast {
64
- display: flex;
65
- align-items: flex-start;
66
- gap: 0.75rem;
67
- min-inline-size: 300px;
68
- max-inline-size: 500px;
69
- padding-block: 1rem;
70
- padding-inline: 1rem;
71
- border-radius: var(--g-theme-border-radius-md);
72
- background-color: var(--g-theme-color-background-default);
73
- border-inline-start-width: 4px;
74
- border-inline-start-style: solid;
75
- pointer-events: auto;
76
- opacity: 0;
77
- transform: translateY(-1rem);
78
- transition:
79
- opacity 0.3s ease,
80
- transform 0.3s ease;
81
- }
82
-
83
- .toast--visible {
84
- opacity: 1;
85
- transform: translateY(0);
86
- }
87
-
88
- /* Variant colors */
89
- .toast--info {
90
- border-inline-start-color: var(--g-theme-color-background-utility-info);
91
- }
92
-
93
- .toast--success {
94
- border-inline-start-color: var(--g-theme-color-background-utility-success);
95
- }
96
-
97
- .toast--warning {
98
- border-inline-start-color: var(--g-theme-color-background-utility-warning);
99
- }
100
-
101
- .toast--error {
102
- border-inline-start-color: var(--g-theme-color-background-utility-error);
103
- }
104
-
105
- /* Toast icon */
106
- .toast__icon {
107
- flex-shrink: 0;
108
- inline-size: 1.5rem;
109
- block-size: 1.5rem;
110
- }
111
-
112
- .toast--info .toast__icon {
113
- color: var(--g-theme-color-background-utility-info);
114
- }
115
-
116
- .toast--success .toast__icon {
117
- color: var(--g-theme-color-background-utility-success);
118
- }
119
-
120
- .toast--warning .toast__icon {
121
- color: var(--g-theme-color-background-utility-warning);
122
- }
123
-
124
- .toast--error .toast__icon {
125
- color: var(--g-theme-color-background-utility-error);
126
- }
127
-
128
- /* Toast content */
129
- .toast__content {
130
- flex: 1;
131
- min-inline-size: 0;
132
- }
133
-
134
- .toast__title {
135
- font-weight: 600;
136
- font-size: var(--g-typography-font-size-16);
137
- margin-block-end: 0.25rem;
138
- color: var(--g-theme-color-content-default);
139
- }
140
-
141
- .toast__message {
142
- font-size: var(--g-typography-font-size-14);
143
- color: var(--g-theme-color-content-secondary);
144
- line-height: 1.5;
145
- }
146
-
147
- /* Close button */
148
- .toast__close {
149
- all: unset;
150
- flex-shrink: 0;
151
- inline-size: 1.5rem;
152
- block-size: 1.5rem;
153
- display: inline-flex;
154
- align-items: center;
155
- justify-content: center;
156
- border-radius: var(--g-theme-border-radius-md);
157
- color: var(--g-theme-color-content-secondary);
158
- cursor: pointer;
159
- transition: all 0.2s ease;
160
- margin-inline-start: 0.5rem;
161
- }
162
-
163
- .toast__close:hover {
164
- color: var(--g-theme-color-content-default);
165
- background-color: var(--g-theme-color-background-subtle-hover);
166
- }
167
-
168
- .toast__close:focus-visible {
169
- outline: 2px solid var(--component-focus-ring-color);
170
- outline-offset: 2px;
171
- }
172
-
173
- /* Bottom position toasts slide up instead of down */
174
- .toast--bottom-left,
175
- .toast--bottom-center,
176
- .toast--bottom-right {
177
- transform: translateY(1rem);
178
- }
179
-
180
- .toast--bottom-left.toast--visible,
181
- .toast--bottom-center.toast--visible,
182
- .toast--bottom-right.toast--visible {
183
- transform: translateY(0);
184
- }
185
-
186
- /* Responsive */
187
- @media (max-width: 640px) {
188
- .toast-container {
189
- inset-inline: 0;
190
- transform: none;
191
- }
192
-
193
- .toast {
194
- min-inline-size: auto;
195
- inline-size: 100%;
196
- }
197
- }
198
-
199
- /* View transitions */
200
- @media (prefers-reduced-motion: no-preference) {
201
- @supports (view-transition-name: auto) {
202
- .toast {
203
- view-transition-name: toast;
204
- }
205
- }
206
- }
10
+ box-sizing: border-box;
11
+ }
12
+
13
+ :host {
14
+ display: block;
15
+ pointer-events: none;
16
+ }
17
+
18
+ /* Toast Container */
19
+ .toast-container {
20
+ position: fixed;
21
+ z-index: 9999;
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: var(--g-theme-spacing-sm);
25
+ padding: var(--g-theme-spacing-md);
26
+ pointer-events: none;
27
+ max-inline-size: 100vw;
28
+ max-block-size: 100vh;
29
+ overflow: hidden;
30
+ }
31
+
32
+ /* Container positions */
33
+ .toast-container--top-left {
34
+ inset-block-start: 0;
35
+ inset-inline-start: 0;
36
+ }
37
+
38
+ .toast-container--top-center {
39
+ inset-block-start: 0;
40
+ inset-inline-start: 50%;
41
+ transform: translateX(-50%);
42
+ }
43
+
44
+ .toast-container--top-right {
45
+ inset-block-start: 0;
46
+ inset-inline-end: 0;
47
+ }
48
+
49
+ .toast-container--bottom-left {
50
+ inset-block-end: 0;
51
+ inset-inline-start: 0;
52
+ }
53
+
54
+ .toast-container--bottom-center {
55
+ inset-block-end: 0;
56
+ inset-inline-start: 50%;
57
+ transform: translateX(-50%);
58
+ }
59
+
60
+ .toast-container--bottom-right {
61
+ inset-block-end: 0;
62
+ inset-inline-end: 0;
63
+ }
64
+
65
+ /* Toast */
66
+ .toast {
67
+ display: flex;
68
+ align-items: flex-start;
69
+ gap: var(--g-theme-spacing-sm);
70
+ min-inline-size: 300px;
71
+ max-inline-size: 500px;
72
+ padding-block: var(--g-theme-spacing-md);
73
+ padding-inline: var(--g-theme-spacing-md);
74
+ border-radius: var(--g-theme-border-radius-md);
75
+ background-color: var(--g-theme-color-background-default);
76
+ border-inline-start-width: 4px;
77
+ border-inline-start-style: solid;
78
+ pointer-events: auto;
79
+ opacity: 0;
80
+ transform: translateY(-1rem);
81
+ transition:
82
+ opacity 0.3s ease,
83
+ transform 0.3s ease;
84
+ }
85
+
86
+ .toast--visible {
87
+ opacity: 1;
88
+ transform: translateY(0);
89
+ }
90
+
91
+ /* Variant colors */
92
+ .toast--info {
93
+ border-inline-start-color: var(--g-theme-color-background-utility-info);
94
+ }
95
+
96
+ .toast--success {
97
+ border-inline-start-color: var(--g-theme-color-background-utility-success);
98
+ }
99
+
100
+ .toast--warning {
101
+ border-inline-start-color: var(--g-theme-color-background-utility-warning);
102
+ }
103
+
104
+ .toast--error {
105
+ border-inline-start-color: var(--g-theme-color-background-utility-error);
106
+ }
107
+
108
+ /* Toast icon */
109
+ .toast__icon {
110
+ flex-shrink: 0;
111
+ inline-size: 1.5rem;
112
+ block-size: 1.5rem;
113
+ }
114
+
115
+ .toast--info .toast__icon {
116
+ color: var(--g-theme-color-background-utility-info);
117
+ }
118
+
119
+ .toast--success .toast__icon {
120
+ color: var(--g-theme-color-background-utility-success);
121
+ }
122
+
123
+ .toast--warning .toast__icon {
124
+ color: var(--g-theme-color-background-utility-warning);
125
+ }
126
+
127
+ .toast--error .toast__icon {
128
+ color: var(--g-theme-color-background-utility-error);
129
+ }
130
+
131
+ /* Toast content */
132
+ .toast__content {
133
+ flex: 1;
134
+ min-inline-size: 0;
135
+ }
136
+
137
+ .toast__title {
138
+ font-weight: var(--g-typography-font-weight-600);
139
+ font-size: var(--g-typography-font-size-16);
140
+ margin-block-end: 0.25rem;
141
+ color: var(--g-theme-color-content-default);
142
+ }
143
+
144
+ .toast__message {
145
+ font-size: var(--g-typography-font-size-14);
146
+ color: var(--g-theme-color-content-secondary);
147
+ line-height: 1.5;
148
+ }
149
+
150
+ /* Close button */
151
+ .toast__close {
152
+ all: unset;
153
+ flex-shrink: 0;
154
+ inline-size: 1.5rem;
155
+ block-size: 1.5rem;
156
+ display: inline-flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ border-radius: var(--g-theme-border-radius-md);
160
+ color: var(--g-theme-color-content-secondary);
161
+ cursor: pointer;
162
+ transition: all 0.2s ease;
163
+ margin-inline-start: 0.5rem;
164
+ }
165
+
166
+ .toast__close:hover {
167
+ color: var(--g-theme-color-content-default);
168
+ background-color: var(--g-theme-color-background-subtle-hover);
169
+ }
170
+
171
+ /* Bottom position toasts slide up instead of down */
172
+ .toast--bottom-left,
173
+ .toast--bottom-center,
174
+ .toast--bottom-right {
175
+ transform: translateY(1rem);
176
+ }
177
+
178
+ .toast--bottom-left.toast--visible,
179
+ .toast--bottom-center.toast--visible,
180
+ .toast--bottom-right.toast--visible {
181
+ transform: translateY(0);
182
+ }
183
+
184
+ /* Responsive */
185
+ @media (max-width: 640px) {
186
+ .toast-container {
187
+ inset-inline: 0;
188
+ transform: none;
189
+ }
190
+
191
+ .toast {
192
+ min-inline-size: auto;
193
+ inline-size: 100%;
194
+ }
195
+ }
196
+
197
+ /* View transitions */
198
+ @media (prefers-reduced-motion: no-preference) {
199
+ @supports (view-transition-name: auto) {
200
+ .toast {
201
+ view-transition-name: toast;
202
+ }
203
+ }
204
+ }
207
205
  `;
@@ -18,22 +18,38 @@ describe("Toast Component", () => {
18
18
 
19
19
  it("should have info variant by default", async () => {
20
20
  element = await fixture("grantcodes-toast");
21
- assert.strictEqual(element.variant, "info", "Default variant should be info");
21
+ assert.strictEqual(
22
+ element.variant,
23
+ "info",
24
+ "Default variant should be info",
25
+ );
22
26
  });
23
27
 
24
28
  it("should have 5000ms duration by default", async () => {
25
29
  element = await fixture("grantcodes-toast");
26
- assert.strictEqual(element.duration, 5000, "Default duration should be 5000ms");
30
+ assert.strictEqual(
31
+ element.duration,
32
+ 5000,
33
+ "Default duration should be 5000ms",
34
+ );
27
35
  });
28
36
 
29
37
  it("should have top-right position by default", async () => {
30
38
  element = await fixture("grantcodes-toast");
31
- assert.strictEqual(element.position, "top-right", "Default position should be top-right");
39
+ assert.strictEqual(
40
+ element.position,
41
+ "top-right",
42
+ "Default position should be top-right",
43
+ );
32
44
  });
33
45
 
34
46
  it("should be dismissible by default", async () => {
35
47
  element = await fixture("grantcodes-toast");
36
- assert.strictEqual(element.dismissible, true, "Should be dismissible by default");
48
+ assert.strictEqual(
49
+ element.dismissible,
50
+ true,
51
+ "Should be dismissible by default",
52
+ );
37
53
  });
38
54
 
39
55
  it("should render toast with correct variant class", async () => {
@@ -52,7 +68,11 @@ describe("Toast Component", () => {
52
68
 
53
69
  const title = element.shadowRoot.querySelector(".toast__title");
54
70
  assert.ok(title, "Title element should exist");
55
- assert.strictEqual(title.textContent, "Test Title", "Title text should match");
71
+ assert.strictEqual(
72
+ title.textContent,
73
+ "Test Title",
74
+ "Title text should match",
75
+ );
56
76
  });
57
77
 
58
78
  it("should not render title when not provided", async () => {
@@ -84,7 +104,11 @@ describe("Toast Component", () => {
84
104
  element = await fixture("grantcodes-toast");
85
105
 
86
106
  const toast = element.shadowRoot.querySelector(".toast");
87
- assert.strictEqual(toast.getAttribute("role"), "status", "Should have status role");
107
+ assert.strictEqual(
108
+ toast.getAttribute("role"),
109
+ "status",
110
+ "Should have status role",
111
+ );
88
112
  });
89
113
 
90
114
  it("should have aria-live=polite", async () => {
@@ -154,7 +178,11 @@ describe("Toast Container Component", () => {
154
178
 
155
179
  it("should have top-right position by default", async () => {
156
180
  element = await fixture("grantcodes-toast-container");
157
- assert.strictEqual(element.position, "top-right", "Default position should be top-right");
181
+ assert.strictEqual(
182
+ element.position,
183
+ "top-right",
184
+ "Default position should be top-right",
185
+ );
158
186
  });
159
187
 
160
188
  it("should render container with correct position class", async () => {
@@ -162,7 +190,9 @@ describe("Toast Container Component", () => {
162
190
  position: "bottom-left",
163
191
  });
164
192
 
165
- const container = element.shadowRoot.querySelector(".toast-container--bottom-left");
193
+ const container = element.shadowRoot.querySelector(
194
+ ".toast-container--bottom-left",
195
+ );
166
196
  assert.ok(container, "Container should have bottom-left position class");
167
197
  });
168
198
 
@@ -192,5 +222,3 @@ describe("Toast Container Component", () => {
192
222
  }
193
223
  });
194
224
  });
195
-
196
-
@@ -1 +1 @@
1
- export * from "./tooltip";
1
+ export * from "./tooltip.js";
@@ -3,5 +3,6 @@ import { GrantCodesTooltip } from "./tooltip.component.js";
3
3
  export * from "./tooltip.component.js";
4
4
  export default GrantCodesTooltip;
5
5
 
6
- customElements.define("grantcodes-tooltip", GrantCodesTooltip);
7
-
6
+ if (!customElements.get("grantcodes-tooltip")) {
7
+ customElements.define("grantcodes-tooltip", GrantCodesTooltip);
8
+ }
@@ -13,8 +13,8 @@ export const tooltipStyles = css`
13
13
  }
14
14
 
15
15
  .tooltip__slot {
16
- padding: 0.5rem;
17
- margin: -0.5rem;
16
+ padding: var(--g-theme-spacing-sm);
17
+ margin: calc(-1 * var(--g-theme-spacing-sm));
18
18
  /* Anchor name will be set via JavaScript to include unique ID */
19
19
  }
20
20
 
@@ -75,4 +75,4 @@ export const tooltipStyles = css`
75
75
  }
76
76
  }
77
77
 
78
- `;
78
+ `;
@@ -21,7 +21,11 @@ describe("Tooltip Component", () => {
21
21
  label: "Tooltip label",
22
22
  });
23
23
 
24
- assert.strictEqual(element.label, "Tooltip label", "Label property should be set");
24
+ assert.strictEqual(
25
+ element.label,
26
+ "Tooltip label",
27
+ "Label property should be set",
28
+ );
25
29
  });
26
30
 
27
31
  it("should have description property", async () => {
@@ -52,7 +56,11 @@ describe("Tooltip Component", () => {
52
56
 
53
57
  const content = element.shadowRoot.querySelector(".tooltip__content");
54
58
  assert.ok(content, "Tooltip content should exist");
55
- assert.strictEqual(content.textContent.trim(), "Test label", "Content should match label");
59
+ assert.strictEqual(
60
+ content.textContent.trim(),
61
+ "Test label",
62
+ "Content should match label",
63
+ );
56
64
  });
57
65
 
58
66
  it("should have role=tooltip on content", async () => {
@@ -146,5 +154,3 @@ describe("Tooltip Component", () => {
146
154
  // In a test environment, this might need special handling
147
155
  });
148
156
  });
149
-
150
-
package/src/css/base.css CHANGED
@@ -7,17 +7,20 @@
7
7
 
8
8
  @import "./typography.css";
9
9
  @import "./elements.css";
10
+ @import "./util/index.css";
10
11
 
11
12
  /* Design tokens are provided by @grantcodes/style-dictionary and applied to :root */
12
13
  :root {
13
14
  --grantcodes-ui-theme: "none";
14
15
  background-color: var(--g-theme-color-background-default);
15
16
  fill: currentColor;
16
-
17
- /* Focus ring styles - using tier-3 component tokens */
18
- --component-focus-ring-color: var(--g-theme-focus-ring-color-default);
19
- --component-focus-ring-width: var(--g-theme-focus-ring-width-default);
20
- --component-focus-ring-offset: var(--g-theme-focus-ring-offset-default);
17
+ }
18
+
19
+ /* Allow transitioning auto */
20
+ :root {
21
+ @supports (interpolate-size: allow-keywords) {
22
+ interpolate-size: allow-keywords;
23
+ }
21
24
  }
22
25
 
23
26
  ::selection {