loseta 0.17.0 → 0.19.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 (70) hide show
  1. package/README.md +37 -8
  2. package/dist/commands/add.d.ts +8 -0
  3. package/dist/commands/add.js +60 -15
  4. package/dist/commands/add.js.map +1 -1
  5. package/dist/commands/init.js +2 -1
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/config.d.ts +7 -0
  8. package/dist/config.js +13 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/imports.d.ts +4 -0
  11. package/dist/imports.js +30 -2
  12. package/dist/imports.js.map +1 -1
  13. package/dist/install.d.ts +23 -3
  14. package/dist/install.js +84 -5
  15. package/dist/install.js.map +1 -1
  16. package/dist/style-switch.js +2 -1
  17. package/dist/style-switch.js.map +1 -1
  18. package/dist/types.d.ts +11 -0
  19. package/dist/ui.js +4 -1
  20. package/dist/ui.js.map +1 -1
  21. package/package.json +4 -3
  22. package/registry/behaviors/calendar.js +855 -0
  23. package/registry/behaviors/carousel.js +280 -0
  24. package/registry/behaviors/code-block.js +106 -0
  25. package/registry/behaviors/combobox.js +237 -0
  26. package/registry/behaviors/command.js +105 -0
  27. package/registry/behaviors/core.js +302 -0
  28. package/registry/behaviors/dialog.js +97 -0
  29. package/registry/behaviors/hover-overlay.js +180 -0
  30. package/registry/behaviors/listbox.js +135 -0
  31. package/registry/behaviors/menu.js +586 -0
  32. package/registry/behaviors/message-scroller.js +147 -0
  33. package/registry/behaviors/popover.js +127 -0
  34. package/registry/behaviors/questionnaire.js +91 -0
  35. package/registry/behaviors/resizable.js +463 -0
  36. package/registry/behaviors/select.js +196 -0
  37. package/registry/behaviors/tabs.js +95 -0
  38. package/registry/behaviors/toast.js +137 -0
  39. package/registry/components/carousel.css +1 -0
  40. package/registry/components/code-block.css +19 -0
  41. package/registry/components/hover-card.css +2 -2
  42. package/registry/components/resizable.css +49 -0
  43. package/registry/components/tooltip.css +4 -1
  44. package/registry/examples/alert-dialog.html +21 -21
  45. package/registry/examples/button-group.html +3 -3
  46. package/registry/examples/calendar.html +387 -326
  47. package/registry/examples/carousel.html +80 -2
  48. package/registry/examples/code-block.html +10 -4
  49. package/registry/examples/combobox.html +2 -0
  50. package/registry/examples/command.html +17 -17
  51. package/registry/examples/context-menu.html +18 -18
  52. package/registry/examples/dialog.html +15 -15
  53. package/registry/examples/drawer.html +22 -22
  54. package/registry/examples/questionnaire.html +2 -2
  55. package/registry/examples/resizable.html +88 -15
  56. package/registry/examples/select.html +7 -0
  57. package/registry/examples/sheet.html +23 -23
  58. package/registry/examples/sidebar.html +11 -11
  59. package/registry/examples/toast.html +11 -0
  60. package/registry/primitives/dialog-shell.css +5 -0
  61. package/registry/registry.json +280 -1
  62. package/registry/schema.json +17 -0
  63. package/registry/styles/luma/resizable.css +10 -0
  64. package/registry/styles/lyra/resizable.css +10 -0
  65. package/registry/styles/maia/resizable.css +10 -0
  66. package/registry/styles/mira/resizable.css +10 -0
  67. package/registry/styles/nova/resizable.css +10 -0
  68. package/registry/styles/rhea/resizable.css +10 -0
  69. package/registry/styles/sera/resizable.css +10 -0
  70. package/registry/styles/vega/resizable.css +10 -0
@@ -38,12 +38,90 @@
38
38
  </div>
39
39
  </div>
40
40
  <div class="carousel-controls">
41
- <button type="button" class="carousel-button" aria-label="Previous slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button>
41
+ <button type="button" class="carousel-button" data-slot="previous" aria-label="Previous slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button>
42
42
  <div class="carousel-indicators" role="group" aria-label="Slides">
43
43
  <button type="button" class="carousel-indicator" aria-label="Go to slide 1" aria-current="true"></button>
44
44
  <button type="button" class="carousel-indicator" aria-label="Go to slide 2"></button>
45
45
  <button type="button" class="carousel-indicator" aria-label="Go to slide 3"></button>
46
46
  </div>
47
- <button type="button" class="carousel-button" aria-label="Next slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
47
+ <button type="button" class="carousel-button" data-slot="next" aria-label="Next slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
48
48
  </div>
49
49
  </section>
50
+
51
+ <!-- Vertical -->
52
+ <section class="carousel" data-orientation="vertical" aria-roledescription="carousel" aria-label="Release notes">
53
+ <div class="carousel-viewport" tabindex="0" style="height: 14rem">
54
+ <div class="carousel-track">
55
+ <div class="carousel-item" role="group" aria-roledescription="slide" aria-label="1 of 2">
56
+ <div class="card">
57
+ <header>
58
+ <h3 data-slot="title">Registry</h3>
59
+ <p data-slot="description">Ship the files you read</p>
60
+ </header>
61
+ <section>
62
+ <p>The same CSS and behavior files power the docs and the install.</p>
63
+ </section>
64
+ </div>
65
+ </div>
66
+ <div class="carousel-item" role="group" aria-roledescription="slide" aria-label="2 of 2">
67
+ <div class="card">
68
+ <header>
69
+ <h3 data-slot="title">Layers</h3>
70
+ <p data-slot="description">Keep the cascade boring</p>
71
+ </header>
72
+ <section>
73
+ <p>Tokens, reset, base, components, style and utilities stay in order.</p>
74
+ </section>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <div class="carousel-controls">
80
+ <button type="button" class="carousel-button" data-slot="previous" aria-label="Previous slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button>
81
+ <div class="carousel-indicators" role="group" aria-label="Slides">
82
+ <button type="button" class="carousel-indicator" aria-label="Go to slide 1" aria-current="true"></button>
83
+ <button type="button" class="carousel-indicator" aria-label="Go to slide 2"></button>
84
+ </div>
85
+ <button type="button" class="carousel-button" data-slot="next" aria-label="Next slide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
86
+ </div>
87
+ </section>
88
+
89
+ <!-- Right-to-left -->
90
+ <div dir="rtl" lang="ar">
91
+ <section class="carousel" data-orientation="horizontal" aria-roledescription="carousel" aria-label="مكونات مميزة">
92
+ <div class="carousel-viewport" tabindex="0">
93
+ <div class="carousel-track">
94
+ <div class="carousel-item" role="group" aria-roledescription="slide" aria-label="1 من 2">
95
+ <div class="card">
96
+ <header>
97
+ <h3 data-slot="title">لوحة</h3>
98
+ <p data-slot="description">سطح واضح</p>
99
+ </header>
100
+ <section>
101
+ <p>تتبع الشرائح اتجاه الصفحة وتعمل بمفاتيح الأسهم.</p>
102
+ </section>
103
+ </div>
104
+ </div>
105
+ <div class="carousel-item" role="group" aria-roledescription="slide" aria-label="2 من 2">
106
+ <div class="card">
107
+ <header>
108
+ <h3 data-slot="title">حوار</h3>
109
+ <p data-slot="description">تركيز محفوظ</p>
110
+ </header>
111
+ <section>
112
+ <p>تعيد الطبقات ترتيب نفس العناصر دون تغيير الترميز.</p>
113
+ </section>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ <div class="carousel-controls">
119
+ <button type="button" class="carousel-button" data-slot="previous" aria-label="الشريحة السابقة"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg></button>
120
+ <div class="carousel-indicators" role="group" aria-label="الشرائح">
121
+ <button type="button" class="carousel-indicator" aria-label="الانتقال إلى الشريحة 1" aria-current="true"></button>
122
+ <button type="button" class="carousel-indicator" aria-label="الانتقال إلى الشريحة 2"></button>
123
+ </div>
124
+ <button type="button" class="carousel-button" data-slot="next" aria-label="الشريحة التالية"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
125
+ </div>
126
+ </section>
127
+ </div>
@@ -8,7 +8,7 @@
8
8
  <header>
9
9
  <span data-slot="title">app/api/chat/route.ts</span>
10
10
  <div data-slot="actions">
11
- <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy code"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
11
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="copy" aria-label="Copy code"><span data-slot="copy-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></span><span data-slot="check-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span></button>
12
12
  </div>
13
13
  </header>
14
14
  <pre dir="ltr" tabindex="0"><code>import { streamText } from "ai";
@@ -28,6 +28,9 @@ export async function POST(request: Request) {
28
28
  <div class="code-block">
29
29
  <header>
30
30
  <span data-slot="title">app/dashboard/page.tsx</span>
31
+ <div data-slot="actions">
32
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="copy" aria-label="Copy code"><span data-slot="copy-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></span><span data-slot="check-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span></button>
33
+ </div>
31
34
  </header>
32
35
  <pre data-line-numbers style="--line-start: 12" dir="ltr" tabindex="0"><code><span data-slot="line"><span data-slot="line-content"> if (!session) {</span></span>
33
36
  <span data-slot="line"><span data-slot="line-content"> redirect("/login");</span></span>
@@ -45,6 +48,9 @@ export async function POST(request: Request) {
45
48
  <div class="code-block">
46
49
  <header>
47
50
  <span data-slot="title">components/greeting.tsx</span>
51
+ <div data-slot="actions">
52
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="copy" aria-label="Copy code"><span data-slot="copy-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></span><span data-slot="check-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span></button>
53
+ </div>
48
54
  </header>
49
55
  <pre dir="ltr" tabindex="0"><code><span data-slot="line"><span data-slot="line-content">export function Greeting({ name }: { name: string }) {</span></span>
50
56
  <span data-slot="line"><span data-slot="line-content"> return &lt;p&gt;Hello, {name}&lt;/p&gt;;</span></span>
@@ -59,8 +65,8 @@ export async function POST(request: Request) {
59
65
  <header>
60
66
  <span data-slot="title">Error</span>
61
67
  <div data-slot="actions">
62
- <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Wrap lines" aria-pressed="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="6" y2="6"/><path d="M3 12h15a3 3 0 1 1 0 6h-4"/><polyline points="16 16 14 18 16 20"/><line x1="3" x2="10" y1="18" y2="18"/></svg></button>
63
- <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy output"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
68
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="wrap" aria-label="Wrap lines" aria-pressed="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="6" y2="6"/><path d="M3 12h15a3 3 0 1 1 0 6h-4"/><polyline points="16 16 14 18 16 20"/><line x1="3" x2="10" y1="18" y2="18"/></svg></button>
69
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="copy" aria-label="Copy output"><span data-slot="copy-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></span><span data-slot="check-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span></button>
64
70
  </div>
65
71
  </header>
66
72
  <pre data-wrap dir="ltr" tabindex="0"><code>TypeError: The model "anthropic/claude-sonnet-4.5" returned an error: Request too large. The prompt is 212,431 tokens but the context window is 200,000 tokens.</code></pre>
@@ -69,7 +75,7 @@ export async function POST(request: Request) {
69
75
  <!-- Floating actions -->
70
76
  <div class="code-block">
71
77
  <div data-slot="actions">
72
- <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy output"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
78
+ <button class="btn" data-variant="ghost" data-size="icon-xs" type="button" data-slot="copy" aria-label="Copy output"><span data-slot="copy-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></span><span data-slot="check-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span></button>
73
79
  </div>
74
80
  <pre dir="ltr" tabindex="0"><code>$ pnpm add ai @ai-sdk/react zod
75
81
  Packages: +14
@@ -1,6 +1,7 @@
1
1
  <!-- Default -->
2
2
  <div class="combobox">
3
3
  <input role="combobox" aria-expanded="false" aria-controls="combobox-default-panel" aria-autocomplete="list" placeholder="Select a framework..." aria-label="Select a framework">
4
+ <input type="hidden" data-slot="input" name="value">
4
5
  <div data-popover data-side="bottom" aria-hidden="true" id="combobox-default-panel">
5
6
  <div role="listbox" aria-label="Frameworks">
6
7
  <div role="option" aria-selected="false"><span data-slot="text">React</span></div>
@@ -14,6 +15,7 @@
14
15
  <!-- Single -->
15
16
  <div class="combobox">
16
17
  <input role="combobox" aria-expanded="false" aria-controls="combobox-fruit-panel" aria-autocomplete="list" placeholder="Search fruit..." aria-label="Search fruit">
18
+ <input type="hidden" data-slot="input" name="value">
17
19
  <button type="button" class="btn" data-variant="ghost" data-size="icon-xs" data-slot="clear" aria-label="Clear">×</button>
18
20
  <div data-popover data-side="bottom" aria-hidden="true" id="combobox-fruit-panel">
19
21
  <div role="listbox" aria-label="Fruit">
@@ -1,10 +1,10 @@
1
1
  <!-- Default -->
2
2
  <div class="command" style="width: 100%; max-width: 24rem">
3
3
  <div class="input-group" role="group" aria-label="Search commands">
4
- <input class="input" type="text" placeholder="Type a command..." aria-label="Search commands">
4
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-1" aria-expanded="true" aria-autocomplete="list" placeholder="Type a command..." aria-label="Search commands">
5
5
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
6
6
  </div>
7
- <div role="listbox" aria-label="Commands">
7
+ <div role="listbox" id="demo-command-listbox-1" aria-label="Commands">
8
8
  <div role="group" aria-labelledby="demo-command-default-suggestions">
9
9
  <div data-slot="label" id="demo-command-default-suggestions">Suggestions</div>
10
10
  <div role="option">
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
 
47
47
  <!-- Dialog -->
48
- <button type="button" class="btn" data-variant="outline">
48
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-command">
49
49
  Open command
50
50
  </button>
51
51
 
@@ -58,10 +58,10 @@
58
58
  <section>
59
59
  <div class="command">
60
60
  <div class="input-group" role="group" aria-label="Search commands">
61
- <input class="input" type="text" placeholder="Type a command..." aria-label="Search commands" autofocus>
61
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-2" aria-expanded="true" aria-autocomplete="list" placeholder="Type a command..." aria-label="Search commands" autofocus>
62
62
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
63
63
  </div>
64
- <div role="listbox" aria-label="Commands">
64
+ <div role="listbox" id="demo-command-listbox-2" aria-label="Commands">
65
65
  <div role="group" aria-labelledby="command-group-navigation">
66
66
  <div data-slot="label" id="command-group-navigation">Navigation</div>
67
67
  <div role="option">
@@ -119,7 +119,7 @@
119
119
  </dialog>
120
120
 
121
121
  <!-- Shortcuts -->
122
- <button type="button" class="btn" data-variant="outline">
122
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-command-shortcuts">
123
123
  Open shortcuts
124
124
  </button>
125
125
 
@@ -132,10 +132,10 @@
132
132
  <section>
133
133
  <div class="command">
134
134
  <div class="input-group" role="group" aria-label="Search shortcuts">
135
- <input class="input" type="text" placeholder="Search shortcuts..." aria-label="Search shortcuts" autofocus>
135
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-3" aria-expanded="true" aria-autocomplete="list" placeholder="Search shortcuts..." aria-label="Search shortcuts" autofocus>
136
136
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
137
137
  </div>
138
- <div role="listbox" aria-label="Shortcuts">
138
+ <div role="listbox" id="demo-command-listbox-3" aria-label="Shortcuts">
139
139
  <div role="group" aria-labelledby="command-shortcuts-navigation">
140
140
  <div data-slot="label" id="command-shortcuts-navigation">Navigation</div>
141
141
  <div role="option">
@@ -179,7 +179,7 @@
179
179
  </dialog>
180
180
 
181
181
  <!-- Scrollable -->
182
- <button type="button" class="btn" data-variant="outline">
182
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-command-scrollable">
183
183
  Open all commands
184
184
  </button>
185
185
 
@@ -192,10 +192,10 @@
192
192
  <section>
193
193
  <div class="command">
194
194
  <div class="input-group" role="group" aria-label="Search commands">
195
- <input class="input" type="text" placeholder="Type a command..." aria-label="Search commands" autofocus>
195
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-4" aria-expanded="true" aria-autocomplete="list" placeholder="Type a command..." aria-label="Search commands" autofocus>
196
196
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
197
197
  </div>
198
- <div role="listbox" aria-label="Commands">
198
+ <div role="listbox" id="demo-command-listbox-4" aria-label="Commands">
199
199
  <div role="group" aria-labelledby="command-scrollable-navigation">
200
200
  <div data-slot="label" id="command-scrollable-navigation">Navigation</div>
201
201
  <div role="option"><span data-slot="text">Go home</span><span data-slot="shortcut">⌘H</span></div>
@@ -246,10 +246,10 @@
246
246
  <section>
247
247
  <div class="command">
248
248
  <div class="input-group" role="group" aria-label="Search commands">
249
- <input class="input" type="text" placeholder="Type a command..." aria-label="Search commands">
249
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-5" aria-expanded="true" aria-autocomplete="list" placeholder="Type a command..." aria-label="Search commands">
250
250
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
251
251
  </div>
252
- <div role="listbox" aria-label="Commands">
252
+ <div role="listbox" id="demo-command-listbox-5" aria-label="Commands">
253
253
  <div role="group" aria-labelledby="command-card-files">
254
254
  <div data-slot="label" id="command-card-files">Files</div>
255
255
  <div role="option">
@@ -294,10 +294,10 @@
294
294
  </header>
295
295
  <div class="command">
296
296
  <div class="input-group" role="group" aria-label="Search commands">
297
- <input class="input" type="text" placeholder="Type a command..." aria-label="Search commands">
297
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-6" aria-expanded="true" aria-autocomplete="list" placeholder="Type a command..." aria-label="Search commands">
298
298
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
299
299
  </div>
300
- <div role="listbox" aria-label="Commands">
300
+ <div role="listbox" id="demo-command-listbox-6" aria-label="Commands">
301
301
  <div role="group" aria-labelledby="command-popover-files">
302
302
  <div data-slot="label" id="command-popover-files">Files</div>
303
303
  <div role="option">
@@ -329,10 +329,10 @@
329
329
  <div dir="rtl" lang="ar" style="width: 100%; max-width: 24rem">
330
330
  <div class="command">
331
331
  <div class="input-group" role="group" aria-label="ابحث عن الأوامر">
332
- <input class="input" type="text" placeholder="اكتب أمرًا..." aria-label="ابحث عن الأوامر">
332
+ <input class="input" type="text" role="combobox" aria-controls="demo-command-listbox-7" aria-expanded="true" aria-autocomplete="list" placeholder="اكتب أمرًا..." aria-label="ابحث عن الأوامر">
333
333
  <span data-slot="addon" data-align="inline-start" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg></span>
334
334
  </div>
335
- <div role="listbox" aria-label="الأوامر">
335
+ <div role="listbox" id="demo-command-listbox-7" aria-label="الأوامر">
336
336
  <div role="group" aria-labelledby="command-rtl-suggestions">
337
337
  <div data-slot="label" id="command-rtl-suggestions">اقتراحات</div>
338
338
  <div role="option">
@@ -1,7 +1,7 @@
1
1
  <!-- Default -->
2
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
2
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-1" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
3
3
  <p>Right-click anywhere in this area.</p>
4
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
4
+ <div class="context-menu" id="demo-context-1" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
5
5
  <button type="button" role="menuitem">Profile</button>
6
6
  <button type="button" role="menuitem">Billing</button>
7
7
  <button type="button" role="menuitem">Team</button>
@@ -10,9 +10,9 @@
10
10
  </div>
11
11
 
12
12
  <!-- Submenu -->
13
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
13
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-2" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
14
14
  <p>Right-click anywhere in this area.</p>
15
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
15
+ <div class="context-menu" id="demo-context-2" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
16
16
  <button type="button" role="menuitem">Copy <span data-slot="shortcut">⌘C</span></button>
17
17
  <button type="button" role="menuitem">Cut <span data-slot="shortcut">⌘X</span></button>
18
18
  <div role="none">
@@ -36,9 +36,9 @@
36
36
  </div>
37
37
 
38
38
  <!-- Shortcuts -->
39
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
39
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-3" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
40
40
  <p>Right-click anywhere in this area.</p>
41
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
41
+ <div class="context-menu" id="demo-context-3" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
42
42
  <button type="button" role="menuitem">Back <span data-slot="shortcut">⌘[</span></button>
43
43
  <button type="button" role="menuitem" disabled>Forward <span data-slot="shortcut">⌘]</span></button>
44
44
  <button type="button" role="menuitem">Reload <span data-slot="shortcut">⌘R</span></button>
@@ -49,9 +49,9 @@
49
49
  </div>
50
50
 
51
51
  <!-- Groups -->
52
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
52
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-4" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
53
53
  <p>Right-click anywhere in this area.</p>
54
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
54
+ <div class="context-menu" id="demo-context-4" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
55
55
  <div role="group" aria-label="File">
56
56
  <div role="heading" aria-level="2">File</div>
57
57
  <button type="button" role="menuitem">New file <span data-slot="shortcut">⌘N</span></button>
@@ -76,9 +76,9 @@
76
76
  </div>
77
77
 
78
78
  <!-- Icons -->
79
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
79
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-5" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
80
80
  <p>Right-click anywhere in this area.</p>
81
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
81
+ <div class="context-menu" id="demo-context-5" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
82
82
  <button type="button" role="menuitem"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg> Copy</button>
83
83
  <button type="button" role="menuitem"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/></svg> Cut</button>
84
84
  <button type="button" role="menuitem"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/></svg> Paste</button>
@@ -88,9 +88,9 @@
88
88
  </div>
89
89
 
90
90
  <!-- Checkboxes -->
91
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
91
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-6" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
92
92
  <p>Right-click anywhere in this area.</p>
93
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
93
+ <div class="context-menu" id="demo-context-6" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
94
94
  <button type="button" role="menuitemcheckbox" aria-checked="true">
95
95
  Show bookmarks bar
96
96
  <span data-slot="indicator" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></span>
@@ -107,9 +107,9 @@
107
107
  </div>
108
108
 
109
109
  <!-- Radio -->
110
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
110
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-7" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
111
111
  <p>Right-click anywhere in this area.</p>
112
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
112
+ <div class="context-menu" id="demo-context-7" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
113
113
  <div role="group" aria-label="People">
114
114
  <div role="heading" aria-level="2">People</div>
115
115
  <button type="button" role="menuitemradio" aria-checked="true">
@@ -141,9 +141,9 @@
141
141
  </div>
142
142
 
143
143
  <!-- Destructive -->
144
- <div style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
144
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-8" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
145
145
  <p>Right-click anywhere in this area.</p>
146
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
146
+ <div class="context-menu" id="demo-context-8" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
147
147
  <button type="button" role="menuitem"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/></svg> Edit</button>
148
148
  <button type="button" role="menuitem"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" x2="12" y1="2" y2="15"/></svg> Share</button>
149
149
  <div role="separator"></div>
@@ -152,9 +152,9 @@
152
152
  </div>
153
153
 
154
154
  <!-- Right-to-left -->
155
- <div dir="rtl" lang="ar" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
155
+ <div tabindex="0" aria-haspopup="menu" aria-controls="demo-context-9" dir="rtl" lang="ar" style="display: grid; place-items: center; min-height: 10rem; border: 1px dashed var(--border); border-radius: var(--radius-lg)">
156
156
  <p>انقر بزر الماوس الأيمن هنا.</p>
157
- <div class="context-menu" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
157
+ <div class="context-menu" id="demo-context-9" role="menu" aria-hidden="true" style="--context-x: 0px; --context-y: 0px">
158
158
  <button type="button" role="menuitem">رجوع <span data-slot="shortcut">⌘[</span></button>
159
159
  <button type="button" role="menuitem" disabled>تقدم <span data-slot="shortcut">⌘]</span></button>
160
160
  <button type="button" role="menuitem">إعادة تحميل <span data-slot="shortcut">⌘R</span></button>
@@ -1,5 +1,5 @@
1
1
  <!-- Default -->
2
- <button type="button" class="btn">Open dialog</button>
2
+ <button type="button" class="btn" data-open-dialog="demo-dialog-default">Open dialog</button>
3
3
 
4
4
  <dialog class="dialog" id="demo-dialog-default" aria-labelledby="dialog-default-title" aria-describedby="dialog-default-description">
5
5
  <div>
@@ -10,8 +10,8 @@
10
10
  </p>
11
11
  </header>
12
12
  <footer>
13
- <button type="button" class="btn" data-variant="outline">Cancel</button>
14
- <button type="button" class="btn">Continue</button>
13
+ <button type="button" class="btn" data-variant="outline" data-close-dialog>Cancel</button>
14
+ <button type="button" class="btn" data-close-dialog>Continue</button>
15
15
  </footer>
16
16
  <form method="dialog">
17
17
  <button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
@@ -20,7 +20,7 @@
20
20
  </dialog>
21
21
 
22
22
  <!-- Edit profile -->
23
- <button type="button" class="btn">Open profile dialog</button>
23
+ <button type="button" class="btn" data-open-dialog="demo-dialog">Open profile dialog</button>
24
24
 
25
25
  <dialog class="dialog" id="demo-dialog" aria-labelledby="dialog-title" aria-describedby="dialog-description">
26
26
  <div>
@@ -43,8 +43,8 @@
43
43
  </div>
44
44
  </section>
45
45
  <footer>
46
- <button type="button" class="btn" data-variant="outline">Cancel</button>
47
- <button type="button" class="btn">Save changes</button>
46
+ <button type="button" class="btn" data-variant="outline" data-close-dialog>Cancel</button>
47
+ <button type="button" class="btn" data-close-dialog>Save changes</button>
48
48
  </footer>
49
49
  <form method="dialog">
50
50
  <button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
@@ -53,7 +53,7 @@
53
53
  </dialog>
54
54
 
55
55
  <!-- Custom close button -->
56
- <button type="button" class="btn" data-variant="outline">
56
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-dialog-close-button">
57
57
  Open share dialog
58
58
  </button>
59
59
 
@@ -72,13 +72,13 @@
72
72
  </div>
73
73
  </section>
74
74
  <footer data-align="start">
75
- <button type="button" class="btn" data-variant="outline">Close</button>
75
+ <button type="button" class="btn" data-variant="outline" data-close-dialog>Close</button>
76
76
  </footer>
77
77
  </div>
78
78
  </dialog>
79
79
 
80
80
  <!-- No close button -->
81
- <button type="button" class="btn" data-variant="outline">
81
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-dialog-no-close">
82
82
  Open dialog without close
83
83
  </button>
84
84
 
@@ -94,7 +94,7 @@
94
94
  </dialog>
95
95
 
96
96
  <!-- Scrollable content -->
97
- <button type="button" class="btn" data-variant="outline">
97
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-dialog-scrollable">
98
98
  Open scrollable dialog
99
99
  </button>
100
100
 
@@ -123,7 +123,7 @@
123
123
  </dialog>
124
124
 
125
125
  <!-- Sticky footer -->
126
- <button type="button" class="btn" data-variant="outline">
126
+ <button type="button" class="btn" data-variant="outline" data-open-dialog="demo-dialog-sticky-footer">
127
127
  Open sticky footer dialog
128
128
  </button>
129
129
 
@@ -146,14 +146,14 @@
146
146
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
147
147
  </section>
148
148
  <footer>
149
- <button type="button" class="btn" data-variant="outline">Close</button>
149
+ <button type="button" class="btn" data-variant="outline" data-close-dialog>Close</button>
150
150
  </footer>
151
151
  </div>
152
152
  </dialog>
153
153
 
154
154
  <!-- Right-to-left -->
155
155
  <div dir="rtl" lang="ar" style="display: flex; flex-wrap: wrap; gap: 0.5rem">
156
- <button type="button" class="btn">فتح الحوار</button>
156
+ <button type="button" class="btn" data-open-dialog="demo-dialog-rtl">فتح الحوار</button>
157
157
 
158
158
  <dialog class="dialog" id="demo-dialog-rtl" aria-labelledby="dialog-rtl-title" aria-describedby="dialog-rtl-description">
159
159
  <div>
@@ -176,8 +176,8 @@
176
176
  </div>
177
177
  </section>
178
178
  <footer>
179
- <button type="button" class="btn" data-variant="outline">إلغاء</button>
180
- <button type="button" class="btn">حفظ التغييرات</button>
179
+ <button type="button" class="btn" data-variant="outline" data-close-dialog>إلغاء</button>
180
+ <button type="button" class="btn" data-close-dialog>حفظ التغييرات</button>
181
181
  </footer>
182
182
  <form method="dialog">
183
183
  <button class="btn" data-variant="ghost" data-size="icon-sm" aria-label="إغلاق"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>