@grantcodes/ui 2.9.1 → 2.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.10.0](https://github.com/grantcodes/ui/compare/ui-v2.9.2...ui-v2.10.0) (2026-04-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **css:** add svh reset, scrollbar-gutter, and details animation ([f4403e6](https://github.com/grantcodes/ui/commit/f4403e618862b9b24aa6f9d7f3df0c51d5505a83))
9
+
10
+ ## [2.9.2](https://github.com/grantcodes/ui/compare/ui-v2.9.1...ui-v2.9.2) (2026-04-19)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **ui:** replace #styles/ subpath imports with relative paths for SSR/Vite compatibility ([1bb7490](https://github.com/grantcodes/ui/commit/1bb749028328bd573524c9c72f7c830098c23850)), closes [#53](https://github.com/grantcodes/ui/issues/53)
16
+
3
17
  ## [2.9.1](https://github.com/grantcodes/ui/compare/ui-v2.9.0...ui-v2.9.1) (2026-04-18)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "@grantcodes/ui",
3
- "version": "2.9.1",
3
+ "version": "2.10.0",
4
4
  "description": "A personal component system built with Lit web components",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
7
7
  "module": "src/main.js",
8
8
  "types": "src/types.d.ts",
9
9
  "author": "grantcodes",
10
- "imports": {
11
- "#styles/*": "./src/lib/styles/*"
12
- },
13
10
  "exports": {
14
11
  ".": {
15
12
  "types": "./src/types.d.ts",
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  import { html } from "lit/static-html.js";
3
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
3
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
4
4
  import accordionStyles from "./accordion.css" with { type: "css" };
5
5
 
6
6
  export class GrantCodesAccordion extends LitElement {
@@ -1,67 +1,83 @@
1
- *,
2
- *::before,
3
- *::after {
4
- box-sizing: border-box;
5
- }
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ }
6
6
 
7
- :host {
8
- display: block;
9
- }
7
+ :host {
8
+ display: block;
9
+ }
10
10
 
11
- .accordion {
12
- display: flex;
13
- flex-direction: column;
14
- gap: var(--g-theme-spacing-sm);
15
- }
11
+ .accordion {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--g-theme-spacing-sm);
15
+ }
16
16
 
17
- .accordion__item {
18
- border: 1px solid var(--g-theme-color-border-subtle, var(--g-theme-color-border-default));
19
- border-radius: var(--g-theme-border-radius-md, 0.5rem);
20
- }
17
+ .accordion__item {
18
+ border: 1px solid var(--g-theme-color-border-subtle, var(--g-theme-color-border-default));
19
+ border-radius: var(--g-theme-border-radius-md, 0.5rem);
20
+ }
21
21
 
22
- .accordion__summary {
23
- padding: var(--g-theme-spacing-md);
24
- cursor: pointer;
25
- background: var(--g-theme-color-background-subtle);
26
- font-weight: var(--g-typography-font-weight-500);
27
- list-style: none;
28
- display: flex;
29
- justify-content: space-between;
30
- align-items: center;
31
- gap: var(--g-theme-spacing-md);
32
- border-radius: var(--g-theme-border-radius-md, 0.5rem);
33
- transition-property: background-color, outline-width, outline-color;
34
- }
22
+ .accordion__item::details-content {
23
+ block-size: 0;
24
+ overflow: clip;
25
+ transition:
26
+ block-size 0.25s ease,
27
+ content-visibility 0.25s allow-discrete;
28
+ }
35
29
 
36
- .accordion__summary:hover {
37
- background: var(--g-theme-color-background-subtle-hover, var(--g-theme-color-background-subtle));
38
- }
30
+ .accordion__item[open]::details-content {
31
+ block-size: auto;
32
+ }
39
33
 
40
- .accordion__summary::-webkit-details-marker {
41
- display: none;
42
- }
34
+ .accordion__summary {
35
+ padding: var(--g-theme-spacing-md);
36
+ cursor: pointer;
37
+ background: var(--g-theme-color-background-subtle);
38
+ font-weight: var(--g-typography-font-weight-500);
39
+ list-style: none;
40
+ display: flex;
41
+ justify-content: space-between;
42
+ align-items: center;
43
+ gap: var(--g-theme-spacing-md);
44
+ border-radius: var(--g-theme-border-radius-md, 0.5rem);
45
+ transition-property: background-color, outline-width, outline-color;
46
+ }
43
47
 
44
- .accordion__chevron {
45
- display: block;
46
- inline-size: 1em;
47
- block-size: 1em;
48
- flex-shrink: 0;
49
- transition: transform 0.25s ease;
50
- color: var(--g-theme-color-content-subtle, currentColor);
51
- }
48
+ .accordion__summary:hover {
49
+ background: var(--g-theme-color-background-subtle-hover, var(--g-theme-color-background-subtle));
50
+ }
52
51
 
53
- .accordion__item[open] .accordion__chevron {
54
- transform: rotateX(180deg);
55
- }
52
+ .accordion__summary::-webkit-details-marker {
53
+ display: none;
54
+ }
55
+
56
+ .accordion__chevron {
57
+ display: block;
58
+ inline-size: 1em;
59
+ block-size: 1em;
60
+ flex-shrink: 0;
61
+ transition: transform 0.25s ease;
62
+ color: var(--g-theme-color-content-subtle, currentColor);
63
+ }
56
64
 
57
- .accordion__content {
58
- padding: var(--g-theme-spacing-md);
59
- background: var(--g-theme-color-background-default);
60
- border-radius: 0 0 var(--g-theme-border-radius-md, 0.5rem) var(--g-theme-border-radius-md, 0.5rem);
65
+ .accordion__item[open] .accordion__chevron {
66
+ transform: rotateX(180deg);
67
+ }
68
+
69
+ .accordion__content {
70
+ padding: var(--g-theme-spacing-md);
71
+ background: var(--g-theme-color-background-default);
72
+ border-radius: 0 0 var(--g-theme-border-radius-md, 0.5rem) var(--g-theme-border-radius-md, 0.5rem);
73
+ }
74
+
75
+ @media (prefers-reduced-motion: reduce) {
76
+ .accordion__chevron {
77
+ transition: none;
61
78
  }
62
79
 
63
- @media (prefers-reduced-motion: reduce) {
64
- .accordion__chevron {
65
- transition: none;
66
- }
80
+ .accordion__item::details-content {
81
+ transition: none;
67
82
  }
83
+ }
@@ -1,7 +1,7 @@
1
1
  import { LitElement } from "lit";
2
2
  import { html } from "lit";
3
3
  import { classMap } from "lit/directives/class-map.js";
4
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
4
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
5
5
  import appBarStyles from "./app-bar.css" with { type: "css" };
6
6
 
7
7
  export class GrantCodesAppBar extends LitElement {
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html } from "lit";
2
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
2
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
3
3
  import navLinkStyles from "./nav-link.css" with { type: "css" };
4
4
 
5
5
  export class GrantCodesNavLink extends LitElement {
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  import { html } from "lit/static-html.js";
3
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
3
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
4
4
  import breadcrumbStyles from "./breadcrumb.css" with { type: "css" };
5
5
 
6
6
  export class GrantCodesBreadcrumb extends LitElement {
@@ -1,5 +1,5 @@
1
1
  import { html, LitElement } from "lit";
2
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
2
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
3
3
  import buttonStyles from "./button.css" with { type: "css" };
4
4
 
5
5
  export class GrantCodesButton extends LitElement {
@@ -1,6 +1,6 @@
1
1
  import { html, LitElement } from "lit";
2
2
  import { classMap } from "lit/directives/class-map.js";
3
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
3
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
4
4
  import sidebarStyles from "./sidebar.css" with { type: "css" };
5
5
 
6
6
  export class GrantCodesSidebar extends LitElement {
@@ -2,7 +2,7 @@ import { LitElement } from "lit";
2
2
  import { html } from "lit/static-html.js";
3
3
  import { ifDefined } from "lit/directives/if-defined.js";
4
4
  import { GrantCodesTabsItem } from "./tabs-item.component.js";
5
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
5
+ import focusRingStyles from "../../../lib/styles/focus-ring.css" with { type: "css" };
6
6
  import tabsStyles from "../tabs.css" with { type: "css" };
7
7
 
8
8
  export class GrantCodesTabsButton extends GrantCodesTabsItem {
@@ -1,6 +1,6 @@
1
1
  import { GrantCodesTabsItem } from "./internal/tabs-item.component.js";
2
2
  import { html } from "lit/static-html.js";
3
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
3
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
4
4
  import tabsStyles from "./tabs.css" with { type: "css" };
5
5
 
6
6
  export class GrantCodesTab extends GrantCodesTabsItem {
@@ -1,6 +1,6 @@
1
1
  import { html, LitElement } from "lit";
2
2
  import { ifDefined } from "lit/directives/if-defined.js";
3
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
3
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
4
4
  import tabsStyles from "./tabs.css" with { type: "css" };
5
5
  import { GrantCodesTab } from "./tab.component.js";
6
6
  import { GrantCodesTabsButton } from "./internal/tabs-button.component.js";
@@ -1,7 +1,7 @@
1
1
  import { html, LitElement } from "lit";
2
2
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
3
3
  import { classMap } from "lit/directives/class-map.js";
4
- import focusRingStyles from "#styles/focus-ring.css" with { type: "css" };
4
+ import focusRingStyles from "../../lib/styles/focus-ring.css" with { type: "css" };
5
5
  import toastStyles from "./toast.css" with { type: "css" };
6
6
  import { GrantCodesIcon } from "../icon/icon.component.js";
7
7
  import { AlertCircle, Info, CheckCircle2, XCircle, X } from "../../icons.js";
package/src/css/reset.css CHANGED
@@ -5,252 +5,256 @@
5
5
  *,
6
6
  ::before,
7
7
  ::after {
8
- box-sizing: border-box;
9
- background-repeat: no-repeat;
8
+ box-sizing: border-box;
9
+ background-repeat: no-repeat;
10
10
  }
11
11
 
12
12
  ::before,
13
13
  ::after {
14
- text-decoration: inherit;
15
- vertical-align: inherit;
14
+ text-decoration: inherit;
15
+ vertical-align: inherit;
16
16
  }
17
17
 
18
18
  /* Root defaults */
19
19
  :where(:root) {
20
- font: var(--g-typography-body-font);
21
- cursor: default;
22
- line-height: 1.5;
23
- overflow-wrap: break-word;
24
- -moz-tab-size: 4;
25
- tab-size: 4;
26
- -webkit-tap-highlight-color: transparent;
27
- -webkit-text-size-adjust: 100%;
20
+ font: var(--g-typography-body-font);
21
+ cursor: default;
22
+ line-height: 1.5;
23
+ overflow-wrap: break-word;
24
+ scrollbar-gutter: stable;
25
+ -moz-tab-size: 4;
26
+ tab-size: 4;
27
+ -webkit-tap-highlight-color: transparent;
28
+ -webkit-text-size-adjust: 100%;
28
29
  }
29
30
 
30
31
  :where(:root, body) {
31
- padding: 0;
32
- margin: 0;
32
+ padding: 0;
33
+ margin: 0;
34
+ }
35
+
36
+ :where(body) {
37
+ min-block-size: 100svh;
33
38
  }
34
39
 
35
40
  code,
36
41
  kbd,
37
42
  samp,
38
43
  pre {
39
- font-family:
40
- ui-monospace,
41
- "Menlo",
42
- "Consolas",
43
- "Roboto Mono",
44
- "Ubuntu Monospace",
45
- "Noto Mono",
46
- "Oxygen Mono",
47
- "Liberation Mono",
48
- monospace,
49
- "Apple Color Emoji",
50
- "Segoe UI Emoji",
51
- "Segoe UI Symbol",
52
- "Noto Color Emoji";
44
+ font-family:
45
+ ui-monospace,
46
+ "Menlo",
47
+ "Consolas",
48
+ "Roboto Mono",
49
+ "Ubuntu Monospace",
50
+ "Noto Mono",
51
+ "Oxygen Mono",
52
+ "Liberation Mono",
53
+ monospace,
54
+ "Apple Color Emoji",
55
+ "Segoe UI Emoji",
56
+ "Segoe UI Symbol",
57
+ "Noto Color Emoji";
53
58
  }
54
59
 
55
-
56
60
  /* Grouping */
57
61
  :where(dl, ol, ul) :where(dl, ol, ul) {
58
- margin: 0;
62
+ margin: 0;
59
63
  }
60
64
 
61
65
  :where(hr) {
62
- color: inherit;
63
- height: 0;
66
+ color: inherit;
67
+ height: 0;
64
68
  }
65
69
 
66
70
  :where(nav) :where(ol, ul) {
67
- list-style-type: none;
68
- padding: 0;
71
+ list-style-type: none;
72
+ padding: 0;
69
73
  }
70
74
 
71
75
  /* Prevent VoiceOver from ignoring list semantics in Safari */
72
76
  :where(nav li)::before {
73
- content: "\200B";
74
- float: left;
77
+ content: "\200B";
78
+ float: left;
75
79
  }
76
80
 
77
81
  :where(pre) {
78
- font-size: 1em;
79
- overflow: auto;
82
+ font-size: 1em;
83
+ overflow: auto;
80
84
  }
81
85
 
82
86
  /* Text-level semantics */
83
87
  :where(abbr[title]) {
84
- text-decoration: underline dotted;
88
+ text-decoration: underline dotted;
85
89
  }
86
90
 
87
91
  :where(b, strong) {
88
- font-weight: bolder;
92
+ font-weight: bolder;
89
93
  }
90
94
 
91
95
  :where(code, kbd, samp) {
92
- font-size: 1em;
96
+ font-size: 1em;
93
97
  }
94
98
 
95
99
  :where(small) {
96
- font-size: 80%;
100
+ font-size: 80%;
97
101
  }
98
102
 
99
103
  /* Embedded content */
100
104
  :where(audio, canvas, iframe, img, svg, video) {
101
- vertical-align: middle;
105
+ vertical-align: middle;
102
106
  }
103
107
 
104
108
  :where(iframe) {
105
- border-style: none;
109
+ border-style: none;
106
110
  }
107
111
 
108
112
  :where(svg:not([fill])) {
109
- fill: currentColor;
113
+ fill: currentColor;
110
114
  }
111
115
 
112
116
  /* Tabular data */
113
117
  :where(table) {
114
- border-collapse: collapse;
115
- border-color: inherit;
116
- text-indent: 0;
118
+ border-collapse: collapse;
119
+ border-color: inherit;
120
+ text-indent: 0;
117
121
  }
118
122
 
119
123
  /* Forms — baseline normalisation */
120
124
  :where(button, input, select) {
121
- margin: 0;
125
+ margin: 0;
122
126
  }
123
127
 
124
128
  :where(button, [type="button" i], [type="reset" i], [type="submit" i]) {
125
- -webkit-appearance: button;
129
+ -webkit-appearance: button;
126
130
  }
127
131
 
128
132
  :where(fieldset) {
129
- border: 1px solid #a0a0a0;
133
+ border: 1px solid #a0a0a0;
130
134
  }
131
135
 
132
136
  :where(progress) {
133
- vertical-align: baseline;
137
+ vertical-align: baseline;
134
138
  }
135
139
 
136
140
  :where(textarea) {
137
- margin: 0;
138
- resize: vertical;
141
+ margin: 0;
142
+ resize: vertical;
139
143
  }
140
144
 
141
145
  :where([type="search" i]) {
142
- -webkit-appearance: textfield;
143
- outline-offset: -2px;
146
+ -webkit-appearance: textfield;
147
+ outline-offset: -2px;
144
148
  }
145
149
 
146
150
  ::-webkit-inner-spin-button,
147
151
  ::-webkit-outer-spin-button {
148
- height: auto;
152
+ height: auto;
149
153
  }
150
154
 
151
155
  ::-webkit-input-placeholder {
152
- color: inherit;
153
- opacity: 0.54;
156
+ color: inherit;
157
+ opacity: 0.54;
154
158
  }
155
159
 
156
160
  ::-webkit-search-decoration {
157
- -webkit-appearance: none;
161
+ -webkit-appearance: none;
158
162
  }
159
163
 
160
164
  ::-webkit-file-upload-button {
161
- -webkit-appearance: button;
162
- font: inherit;
165
+ -webkit-appearance: button;
166
+ font: inherit;
163
167
  }
164
168
 
165
169
  /* Forms — typography and colour inheritance */
166
170
  :where(button, input, select, textarea) {
167
- background-color: transparent;
168
- border: 1px solid WindowFrame;
169
- color: inherit;
170
- font: inherit;
171
- letter-spacing: inherit;
172
- padding: 0.25em 0.375em;
171
+ background-color: transparent;
172
+ border: 1px solid WindowFrame;
173
+ color: inherit;
174
+ font: inherit;
175
+ letter-spacing: inherit;
176
+ padding: 0.25em 0.375em;
173
177
  }
174
178
 
175
179
  :where([type="color" i], [type="range" i]) {
176
- border-width: 0;
177
- padding: 0;
180
+ border-width: 0;
181
+ padding: 0;
178
182
  }
179
183
 
180
184
  /* Interactive */
181
185
  :where(details > summary:first-of-type) {
182
- display: list-item;
186
+ display: list-item;
183
187
  }
184
188
 
185
189
  /* Accessibility */
186
190
  :where([aria-busy="true" i]) {
187
- cursor: progress;
191
+ cursor: progress;
188
192
  }
189
193
 
190
194
  :where([aria-controls]) {
191
- cursor: pointer;
195
+ cursor: pointer;
192
196
  }
193
197
 
194
198
  :where([aria-disabled="true" i], [disabled]) {
195
- cursor: not-allowed;
199
+ cursor: not-allowed;
196
200
  }
197
201
 
198
202
  :where([aria-hidden="false" i][hidden]) {
199
- display: initial;
203
+ display: initial;
200
204
  }
201
205
 
202
206
  :where([aria-hidden="false" i][hidden]:not(:focus)) {
203
- clip: rect(0, 0, 0, 0);
204
- position: absolute;
207
+ clip: rect(0, 0, 0, 0);
208
+ position: absolute;
205
209
  }
206
210
 
207
211
  /* Reduced motion — !important is required here to override any animation/transition regardless of specificity */
208
212
  @media (prefers-reduced-motion: reduce) {
209
- *,
210
- ::before,
211
- ::after {
212
- animation-delay: -1ms !important;
213
- animation-duration: 1ms !important;
214
- animation-iteration-count: 1 !important;
215
- background-attachment: initial !important;
216
- scroll-behavior: auto !important;
217
- transition-delay: 0s !important;
218
- transition-duration: 0s !important;
219
- }
213
+ *,
214
+ ::before,
215
+ ::after {
216
+ animation-delay: -1ms !important;
217
+ animation-duration: 1ms !important;
218
+ animation-iteration-count: 1 !important;
219
+ background-attachment: initial !important;
220
+ scroll-behavior: auto !important;
221
+ transition-delay: 0s !important;
222
+ transition-duration: 0s !important;
223
+ }
220
224
  }
221
225
 
222
226
  /* Design tokens are provided by @grantcodes/style-dictionary and applied to :root */
223
227
  :root {
224
- color-scheme: light dark;
225
- --grantcodes-ui-theme: "none";
226
- background-color: var(--g-theme-color-background-default);
227
- color: var(--g-theme-color-content-default);
228
- fill: currentColor;
228
+ color-scheme: light dark;
229
+ --grantcodes-ui-theme: "none";
230
+ background-color: var(--g-theme-color-background-default);
231
+ color: var(--g-theme-color-content-default);
232
+ fill: currentColor;
229
233
  }
230
234
 
231
235
  /* Force dark mode on any element or subtree */
232
236
  .dark {
233
- color-scheme: dark;
237
+ color-scheme: dark;
234
238
  }
235
239
 
236
240
  /* Force light mode on any element or subtree */
237
241
  .light {
238
- color-scheme: light;
242
+ color-scheme: light;
239
243
  }
240
244
 
241
245
  /* Allow transitioning auto */
242
246
  :root {
243
- @supports (interpolate-size: allow-keywords) {
244
- interpolate-size: allow-keywords;
245
- }
247
+ @supports (interpolate-size: allow-keywords) {
248
+ interpolate-size: allow-keywords;
249
+ }
246
250
  }
247
251
 
248
252
  ::selection {
249
- background-color: var(--g-theme-color-background-primary);
253
+ background-color: var(--g-theme-color-background-primary);
250
254
  }
251
255
 
252
256
  /* Default backdrop styles */
253
257
  ::backdrop {
254
- background-color: rgba(0, 0, 0, 0.4);
255
- backdrop-filter: blur(6px);
258
+ background-color: rgba(0, 0, 0, 0.4);
259
+ backdrop-filter: blur(6px);
256
260
  }