@openelement/ui 1.0.0-alpha.14 → 1.0.0-alpha.15

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.
@@ -57,7 +57,7 @@ declare const __partProgram: {
57
57
  action?: undefined;
58
58
  path?: undefined;
59
59
  })[];
60
- regions: never[];
60
+ blocks: never[];
61
61
  dependencies: {
62
62
  signal: string;
63
63
  owner: {
@@ -172,6 +172,8 @@ export declare class OpenCodeBlock extends OpenElement {
172
172
  static __elementMetadata: typeof __elementMetadata;
173
173
  static props: typeof __compiledProps;
174
174
  static observedAttributes: typeof __observedAttributes;
175
+ static __oeUtilityClasses: boolean;
176
+ static __oeClassCandidates: readonly string[];
175
177
  static styles: StyleSheetLike[];
176
178
  copyLabel: string;
177
179
  private getCodeText;
@@ -3,7 +3,7 @@ import { OpenElement } from "@openelement/element";
3
3
  import openCodeBlockStyles from "./open-code-block.css";
4
4
  //#region src/open-code-block.tsx
5
5
  const __partProgram = {
6
- "version": 1,
6
+ "version": 2,
7
7
  "tag": "open-code-block",
8
8
  "root": {
9
9
  "id": "root",
@@ -27,7 +27,7 @@ const __partProgram = {
27
27
  "tag": "button",
28
28
  "attrs": [
29
29
  ["type", "button"],
30
- ["class", "copy-btn"],
30
+ ["class", "copy-btn absolute top-2 right-2 z-10 cursor-pointer rounded-md border-[0.5px] border-transparent bg-primary/14 px-3 py-1 font-sans text-xs font-semibold tracking-wider text-foreground transition-all duration-150 ease-in-out hover:border-primary hover:bg-primary/23"],
31
31
  ["part", "copy"]
32
32
  ],
33
33
  "children": [{
@@ -67,7 +67,7 @@ const __partProgram = {
67
67
  ]
68
68
  }
69
69
  }],
70
- "regions": [],
70
+ "blocks": [],
71
71
  "dependencies": [{
72
72
  "signal": "copyLabel",
73
73
  "owner": {
@@ -195,6 +195,31 @@ var OpenCodeBlock = class extends OpenElement {
195
195
  static __elementMetadata = __elementMetadata;
196
196
  static props = __compiledProps;
197
197
  static observedAttributes = __observedAttributes;
198
+ static __oeUtilityClasses = true;
199
+ static __oeClassCandidates = [
200
+ "copy-btn",
201
+ "absolute",
202
+ "top-2",
203
+ "right-2",
204
+ "z-10",
205
+ "cursor-pointer",
206
+ "rounded-md",
207
+ "border-[0.5px]",
208
+ "border-transparent",
209
+ "bg-primary/14",
210
+ "px-3",
211
+ "py-1",
212
+ "font-sans",
213
+ "text-xs",
214
+ "font-semibold",
215
+ "tracking-wider",
216
+ "text-foreground",
217
+ "transition-all",
218
+ "duration-150",
219
+ "ease-in-out",
220
+ "hover:border-primary",
221
+ "hover:bg-primary/23"
222
+ ];
198
223
  static styles = [openCodeBlockStyles];
199
224
  copyLabel = "Copy";
200
225
  getCodeText() {
@@ -1,137 +1,124 @@
1
- /* open-dialog — authored component styles, ported verbatim from the pre-#1558
2
- * recipe() sheet (the alpha.9 design system). The #1558 migration had
3
- * replaced this with a placeholder shell under the false note that the
4
- * component "carried no authored styles"; it did — this is that sheet. */
5
- :host {
6
- display: inline-block;
7
- }
1
+ /* open-dialog — the irreducible authored rules (alpha15 S lane).
2
+ *
3
+ * The dialog box (padding, radius, width bound, font) and the header / title /
4
+ * close / body / footer presentation are authored as Tailwind utilities in
5
+ * open-dialog.tsx: the compiler admits those static tokens and the build's
6
+ * component stylesheet carries the generated rules into this shadow root.
7
+ *
8
+ * What stays here, and why (CUSTOMIZATION.md → "Why the residue is CSS"): the
9
+ * residue is either a structural limit of the platform or one owned rule that
10
+ * reads better than its utility spelling.
11
+ * - the host box;
12
+ * - the trigger slot's cursor (`::slotted`);
13
+ * - the dialog's DERIVED surface: the foreground/border/primary triple mix of
14
+ * its frame, the popover mix of its background, the inset highlight plus
15
+ * the `--shadow-2xl` scale value, and the close button's primary-mixed hover
16
+ * background — each one formula over role pairs rather than a repeated
17
+ * escaped arbitrary value;
18
+ * - the NATIVE top-layer presentation: `::backdrop` and its scrim, and the
19
+ * entry/exit transitions. The transition configuration IS expressible
20
+ * (`starting:opacity-0` compiles into `@starting-style`,
21
+ * `transition-discrete` into `transition-behavior: allow-discrete`); the
22
+ * sheet keeps it because the whole top-layer choreography — backdrop,
23
+ * scrim, starting style, discrete behavior and its forced-colors /
24
+ * reduced-motion degradations — reads as one owned block;
25
+ * - the forced-colors and reduced-motion degradations of those transitions;
26
+ * - `:host(:state(open))`, the host's attached state.
27
+ * One owner per property: nothing here is also authored as a utility.
28
+ */
29
+ :host {
30
+ display: inline-block;
31
+ }
8
32
 
9
- ::slotted([slot='trigger']) {
10
- cursor: pointer;
11
- }
33
+ ::slotted([slot='trigger']) {
34
+ cursor: pointer;
35
+ }
12
36
 
13
- dialog {
14
- border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, color-mix(in srgb, var(--color-foreground) 25%, var(--color-border)) 62%, var(--color-primary));
15
- border-radius: var(--radius-xl);
16
- background: color-mix(in srgb, var(--color-popover) 92%, transparent);
17
- color: var(--color-foreground);
18
- padding: calc(var(--spacing) * 6);
19
- max-width: min(90vw, 480px);
20
- box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-white) 8%, transparent), var(--shadow-2xl);
21
- font-family: var(--font-sans);
22
- }
37
+ dialog {
38
+ border: calc(var(--spacing) * 0.25) solid
39
+ color-mix(
40
+ in srgb,
41
+ color-mix(in srgb, var(--color-foreground) 25%, var(--color-border)) 62%,
42
+ var(--color-primary)
43
+ );
44
+ background: color-mix(in srgb, var(--color-popover) 92%, transparent);
45
+ color: var(--color-foreground);
46
+ box-shadow:
47
+ inset 0 1px 0 color-mix(in srgb, var(--color-white) 8%, transparent),
48
+ var(--shadow-2xl);
49
+ }
23
50
 
24
- dialog::backdrop {
25
- /* Closed base: transparent. The [open] rule carries the zinc-950 scrim
26
- and starts from transparent, so the scrim fades in on entry and back
27
- out on exit instead of snapping. */
28
- background: transparent;
29
- backdrop-filter: blur(8px);
30
- /* Exit visibility: with allow-discrete the top-layer membership and the
31
- display flip wait for the transition, so the scrim fades out instead
32
- of snapping (the allow-discrete recipe, cf. upstream #591 — open
33
- upstream, does not gate this landing). */
34
- transition:
35
- background-color 0.2s ease-out,
36
- overlay 0.2s ease-out allow-discrete,
37
- display 0.2s ease-out allow-discrete;
38
- }
51
+ dialog::backdrop {
52
+ /* Closed base: transparent. The [open] rule carries the zinc-950 scrim
53
+ and starts from transparent, so the scrim fades in on entry and back
54
+ out on exit instead of snapping. */
55
+ background: transparent;
56
+ backdrop-filter: blur(8px);
57
+ /* Exit visibility: with allow-discrete the top-layer membership and the
58
+ display flip wait for the transition, so the scrim fades out instead
59
+ of snapping (the allow-discrete recipe, cf. upstream #591 — open
60
+ upstream, does not gate this landing). */
61
+ transition:
62
+ background-color 0.2s ease-out,
63
+ overlay 0.2s ease-out allow-discrete,
64
+ display 0.2s ease-out allow-discrete;
65
+ }
39
66
 
40
- dialog[open]::backdrop {
41
- background: color-mix(in srgb, var(--color-zinc-950) 68%, transparent);
42
- @starting-style {
43
- background: transparent;
44
- }
45
- }
67
+ dialog[open]::backdrop {
68
+ background: color-mix(in srgb, var(--color-zinc-950) 68%, transparent);
69
+ @starting-style {
70
+ background: transparent;
71
+ }
72
+ }
46
73
 
47
- /* Entry AND exit: the closed state is the base rule (opacity 0, lifted);
48
- opening transitions to the [open] values from the @starting-style
49
- starting point, closing transitions back to the base — the display and
50
- overlay legs carry allow-discrete so the dialog stays rendered and in
51
- the top layer until the exit transition finishes. */
52
- dialog {
53
- opacity: 0;
54
- transform: translateY(-8px);
55
- transition:
56
- opacity 0.2s ease-out,
57
- transform 0.2s ease-out,
58
- overlay 0.2s ease-out allow-discrete,
59
- display 0.2s ease-out allow-discrete;
60
- }
74
+ /* Entry AND exit: the closed state is the base rule (opacity 0, lifted);
75
+ opening transitions to the [open] values from the @starting-style
76
+ starting point, closing transitions back to the base — the display and
77
+ overlay legs carry allow-discrete so the dialog stays rendered and in
78
+ the top layer until the exit transition finishes. */
79
+ dialog {
80
+ opacity: 0;
81
+ transform: translateY(-8px);
82
+ transition:
83
+ opacity 0.2s ease-out,
84
+ transform 0.2s ease-out,
85
+ overlay 0.2s ease-out allow-discrete,
86
+ display 0.2s ease-out allow-discrete;
87
+ }
61
88
 
62
- dialog[open] {
63
- opacity: 1;
64
- transform: translateY(0);
65
- @starting-style {
66
- opacity: 0;
67
- transform: translateY(-8px);
68
- }
69
- }
89
+ dialog[open] {
90
+ opacity: 1;
91
+ transform: translateY(0);
92
+ @starting-style {
93
+ opacity: 0;
94
+ transform: translateY(-8px);
95
+ }
96
+ }
70
97
 
71
- /* Forced colors: the system owns the palette, so half-opacity frames and
72
- moving text would fight the forced rendering — the dialog appears and
73
- dismisses immediately instead (the display leg loses its deferral with
74
- the transition, which is the graceful degradation). Reduced motion
75
- collapses the same way. */
76
- @media (forced-colors: active) {
77
- dialog,
78
- dialog::backdrop {
79
- transition: none;
80
- }
81
- }
98
+ /* Forced colors: the system owns the palette, so half-opacity frames and
99
+ moving text would fight the forced rendering — the dialog appears and
100
+ dismisses immediately instead (the display leg loses its deferral with
101
+ the transition, which is the graceful degradation). Reduced motion
102
+ collapses the same way. */
103
+ @media (forced-colors: active) {
104
+ dialog,
105
+ dialog::backdrop {
106
+ transition: none;
107
+ }
108
+ }
82
109
 
83
- @media (prefers-reduced-motion: reduce) {
84
- dialog,
85
- dialog::backdrop {
86
- transition-duration: 0s;
87
- }
88
- }
110
+ @media (prefers-reduced-motion: reduce) {
111
+ dialog,
112
+ dialog::backdrop {
113
+ transition-duration: 0s;
114
+ }
115
+ }
89
116
 
90
- .dialog-header {
91
- display: flex;
92
- justify-content: space-between;
93
- align-items: center;
94
- margin-bottom: calc(var(--spacing) * 4);
95
- }
117
+ .dialog-close:hover {
118
+ color: var(--color-foreground);
119
+ background: color-mix(in srgb, var(--color-primary) 14%, transparent);
120
+ }
96
121
 
97
- .dialog-title {
98
- font-size: var(--text-xl);
99
- font-weight: var(--font-weight-semibold);
100
- color: var(--color-foreground);
101
- margin: 0;
102
- }
103
-
104
- .dialog-close {
105
- background: none;
106
- border: none;
107
- cursor: pointer;
108
- color: var(--color-muted-foreground);
109
- font-size: var(--text-xl);
110
- line-height: var(--leading-tight);
111
- padding: calc(var(--spacing) * 1);
112
- border-radius: var(--radius-md);
113
- transition: color 0.15s ease;
114
- }
115
-
116
- .dialog-close:hover {
117
- color: var(--color-foreground);
118
- background: color-mix(in srgb, var(--color-primary) 14%, transparent);
119
- }
120
-
121
- .dialog-body {
122
- font-size: var(--text-base);
123
- color: var(--color-muted-foreground);
124
- line-height: var(--leading-normal);
125
- }
126
-
127
- .dialog-footer {
128
- margin-top: calc(var(--spacing) * 5);
129
- display: flex;
130
- justify-content: flex-end;
131
- gap: calc(var(--spacing) * 2);
132
- }
133
-
134
- :host(:state(open)) dialog {
135
- display: block;
136
- }
137
-
122
+ :host(:state(open)) dialog {
123
+ display: block;
124
+ }
@@ -95,7 +95,7 @@ declare const __partProgram: {
95
95
  path?: undefined;
96
96
  name?: undefined;
97
97
  })[];
98
- regions: never[];
98
+ blocks: never[];
99
99
  dependencies: {
100
100
  signal: string;
101
101
  owner: {
@@ -248,6 +248,8 @@ export declare class OpenDialog extends OpenElement {
248
248
  static props: typeof __compiledProps;
249
249
  static observedAttributes: typeof __observedAttributes;
250
250
  static delegatesFocus: boolean;
251
+ static __oeUtilityClasses: boolean;
252
+ static __oeClassCandidates: readonly string[];
251
253
  static styles: StyleSheetLike[];
252
254
  open: boolean;
253
255
  label: string;
@@ -4,7 +4,7 @@ import overlayRecipe from "./overlay-recipe.css";
4
4
  import openDialogStyles from "./open-dialog.css";
5
5
  //#region src/open-dialog.tsx
6
6
  const __partProgram = {
7
- "version": 1,
7
+ "version": 2,
8
8
  "tag": "open-dialog",
9
9
  "root": {
10
10
  "id": "root",
@@ -26,18 +26,18 @@ const __partProgram = {
26
26
  "k": "el",
27
27
  "id": "e2",
28
28
  "tag": "dialog",
29
- "attrs": [["part", "overlay"]],
29
+ "attrs": [["class", "p-6 rounded-xl max-w-[min(90vw,480px)] font-sans"], ["part", "overlay"]],
30
30
  "children": [
31
31
  {
32
32
  "k": "el",
33
33
  "id": "e3",
34
34
  "tag": "div",
35
- "attrs": [["class", "dialog-header"], ["part", "header"]],
35
+ "attrs": [["class", "dialog-header mb-4 flex items-center justify-between"], ["part", "header"]],
36
36
  "children": [{
37
37
  "k": "el",
38
38
  "id": "e4",
39
39
  "tag": "h2",
40
- "attrs": [["class", "dialog-title"]],
40
+ "attrs": [["class", "dialog-title m-0 text-xl font-semibold text-foreground"]],
41
41
  "children": [{
42
42
  "k": "part",
43
43
  "id": "p5",
@@ -49,7 +49,7 @@ const __partProgram = {
49
49
  "tag": "button",
50
50
  "attrs": [
51
51
  ["type", "button"],
52
- ["class", "dialog-close"],
52
+ ["class", "dialog-close cursor-pointer rounded-md border-0 bg-transparent p-1 text-xl leading-tight text-muted-foreground transition-colors duration-150 ease-out"],
53
53
  ["part", "close"],
54
54
  ["aria-label", "Close"]
55
55
  ],
@@ -63,7 +63,7 @@ const __partProgram = {
63
63
  "k": "el",
64
64
  "id": "e6",
65
65
  "tag": "div",
66
- "attrs": [["class", "dialog-body"], ["part", "body"]],
66
+ "attrs": [["class", "dialog-body text-base leading-normal text-muted-foreground"], ["part", "body"]],
67
67
  "children": [{
68
68
  "k": "el",
69
69
  "id": "e7",
@@ -76,7 +76,7 @@ const __partProgram = {
76
76
  "k": "el",
77
77
  "id": "e8",
78
78
  "tag": "div",
79
- "attrs": [["class", "dialog-footer"], ["part", "footer"]],
79
+ "attrs": [["class", "dialog-footer mt-5 flex justify-end gap-2"], ["part", "footer"]],
80
80
  "children": [{
81
81
  "k": "el",
82
82
  "id": "e9",
@@ -210,7 +210,7 @@ const __partProgram = {
210
210
  }
211
211
  }
212
212
  ],
213
- "regions": [],
213
+ "blocks": [],
214
214
  "dependencies": [
215
215
  {
216
216
  "signal": "open",
@@ -534,6 +534,41 @@ var OpenDialog = class extends OpenElement {
534
534
  static props = __compiledProps;
535
535
  static observedAttributes = __observedAttributes;
536
536
  static delegatesFocus = true;
537
+ static __oeUtilityClasses = true;
538
+ static __oeClassCandidates = [
539
+ "p-6",
540
+ "rounded-xl",
541
+ "max-w-[min(90vw,480px)]",
542
+ "font-sans",
543
+ "dialog-header",
544
+ "mb-4",
545
+ "flex",
546
+ "items-center",
547
+ "justify-between",
548
+ "dialog-title",
549
+ "m-0",
550
+ "text-xl",
551
+ "font-semibold",
552
+ "text-foreground",
553
+ "dialog-close",
554
+ "cursor-pointer",
555
+ "rounded-md",
556
+ "border-0",
557
+ "bg-transparent",
558
+ "p-1",
559
+ "leading-tight",
560
+ "text-muted-foreground",
561
+ "transition-colors",
562
+ "duration-150",
563
+ "ease-out",
564
+ "dialog-body",
565
+ "text-base",
566
+ "leading-normal",
567
+ "dialog-footer",
568
+ "mt-5",
569
+ "justify-end",
570
+ "gap-2"
571
+ ];
537
572
  static styles = [overlayRecipe, openDialogStyles];
538
573
  open = false;
539
574
  label = "";
@@ -1,28 +1,22 @@
1
- /* open-dropdown — authored component styles, ported verbatim from the pre-#1558
2
- * recipe() sheet (the alpha.9 design system). The #1558 migration had
3
- * replaced this with a placeholder shell under the false note that the
4
- * component "carried no authored styles"; it did — this is that sheet. */
5
- :host {
6
- display: inline-block;
7
- }
1
+ /* open-dropdown — the irreducible authored rules (alpha15 S lane).
2
+ *
3
+ * The trigger's `display: contents` and the content's min-width/padding/font
4
+ * are authored as Tailwind utilities in open-dropdown.tsx. What stays here is
5
+ * the coupled placement block: the CSS Anchor Positioning longhands plus the
6
+ * explicit inset fallback for engines without anchor support (Firefox only
7
+ * applies `anchor()` longhands on top of an explicit inset), and the gap that
8
+ * must ride on margin-top — `calc(anchor() + length)` resolves without the
9
+ * added length there. It is one ownership block, so no utility may set
10
+ * position/inset/margin on the same element. */
11
+ :host {
12
+ display: inline-block;
13
+ }
8
14
 
9
- .trigger {
10
- display: contents;
11
- }
15
+ .content {
16
+ position: absolute;
17
+ inset: 100% auto auto 0;
18
+ top: anchor(bottom);
19
+ left: anchor(left);
20
+ margin: calc(var(--spacing) * 2) 0 0;
21
+ }
12
22
 
13
- .content {
14
- /* The base inset is the placement fallback for engines without CSS Anchor
15
- Positioning; it must stay present because Firefox's anchor resolution
16
- only applies anchor() longhands on top of an explicit inset. */
17
- position: absolute;
18
- inset: 100% auto auto 0;
19
- top: anchor(bottom);
20
- left: anchor(left);
21
- min-width: 12rem;
22
- /* The gap rides on margin-top: calc(anchor() + length) resolves without
23
- the added length in Firefox. */
24
- margin: calc(var(--spacing) * 2) 0 0;
25
- padding: calc(var(--spacing) * 2);
26
- font-family: var(--font-sans);
27
- }
28
-
@@ -59,7 +59,7 @@ declare const __partProgram: {
59
59
  handler?: undefined;
60
60
  action?: undefined;
61
61
  })[];
62
- regions: never[];
62
+ blocks: never[];
63
63
  dependencies: {
64
64
  signal: string;
65
65
  owner: {
@@ -206,6 +206,8 @@ export declare class OpenDropdown extends OpenElement {
206
206
  static __elementMetadata: typeof __elementMetadata;
207
207
  static props: typeof __compiledProps;
208
208
  static observedAttributes: typeof __observedAttributes;
209
+ static __oeUtilityClasses: boolean;
210
+ static __oeClassCandidates: readonly string[];
209
211
  static __computedFields: {
210
212
  anchorStyle: (__s: {
211
213
  anchorName: ReadonlySignal<string>;
@@ -5,7 +5,7 @@ import overlayRecipe from "./overlay-recipe.css";
5
5
  import openDropdownStyles from "./open-dropdown.css";
6
6
  //#region src/open-dropdown.tsx
7
7
  const __partProgram = {
8
- "version": 1,
8
+ "version": 2,
9
9
  "tag": "open-dropdown",
10
10
  "root": {
11
11
  "id": "root",
@@ -21,7 +21,7 @@ const __partProgram = {
21
21
  "k": "el",
22
22
  "id": "e1",
23
23
  "tag": "span",
24
- "attrs": [["class", "trigger"], ["part", "trigger"]],
24
+ "attrs": [["class", "trigger contents"], ["part", "trigger"]],
25
25
  "children": [{
26
26
  "k": "el",
27
27
  "id": "e2",
@@ -34,7 +34,7 @@ const __partProgram = {
34
34
  "id": "e3",
35
35
  "tag": "div",
36
36
  "attrs": [
37
- ["class", "overlay content"],
37
+ ["class", "overlay content min-w-48 p-2 font-sans"],
38
38
  ["part", "content"],
39
39
  ["popover", "auto"]
40
40
  ],
@@ -95,7 +95,7 @@ const __partProgram = {
95
95
  }
96
96
  }
97
97
  ],
98
- "regions": [],
98
+ "blocks": [],
99
99
  "dependencies": [{
100
100
  "signal": "anchorStyle",
101
101
  "owner": {
@@ -294,6 +294,16 @@ var OpenDropdown = class extends OpenElement {
294
294
  static __elementMetadata = __elementMetadata;
295
295
  static props = __compiledProps;
296
296
  static observedAttributes = __observedAttributes;
297
+ static __oeUtilityClasses = true;
298
+ static __oeClassCandidates = [
299
+ "trigger",
300
+ "contents",
301
+ "overlay",
302
+ "content",
303
+ "min-w-48",
304
+ "p-2",
305
+ "font-sans"
306
+ ];
297
307
  static __computedFields = { anchorStyle: (__s) => computed(() => __s.anchorName.value === "" ? "" : `position-anchor: ${__s.anchorName.value}`) };
298
308
  static styles = [overlayRecipe, openDropdownStyles];
299
309
  anchorName = "";