@editora/ui-core 0.1.19 → 0.1.20

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 (299) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-orbiter.d.ts.map +1 -1
  57. package/dist/components/ui-skeleton.d.ts.map +1 -1
  58. package/dist/components/ui-split-button.d.ts +1 -0
  59. package/dist/components/ui-split-button.d.ts.map +1 -1
  60. package/dist/components/ui-time-picker.d.ts.map +1 -1
  61. package/dist/container.cjs.js +2 -2
  62. package/dist/container.esm.js +2 -3
  63. package/dist/context-menu.cjs.js +8 -8
  64. package/dist/context-menu.esm.js +157 -219
  65. package/dist/control-group.cjs.js +1 -1
  66. package/dist/control-group.esm.js +2 -3
  67. package/dist/data-table.cjs.js +4 -4
  68. package/dist/data-table.esm.js +299 -381
  69. package/dist/date-field.cjs.js +3 -3
  70. package/dist/date-field.esm.js +68 -80
  71. package/dist/date-picker.cjs.js +9 -9
  72. package/dist/date-picker.esm.js +69 -97
  73. package/dist/date-range-picker.cjs.js +3 -3
  74. package/dist/date-range-picker.esm.js +32 -56
  75. package/dist/date-range-time-picker.cjs.js +9 -9
  76. package/dist/date-range-time-picker.esm.js +111 -140
  77. package/dist/date-time-picker.cjs.js +4 -4
  78. package/dist/date-time-picker.esm.js +112 -144
  79. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  80. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  81. package/dist/description.cjs.js +1 -1
  82. package/dist/description.esm.js +3 -5
  83. package/dist/dialog.cjs.js +12 -12
  84. package/dist/dialog.esm.js +44 -63
  85. package/dist/direction-provider.cjs.js +1 -1
  86. package/dist/direction-provider.esm.js +2 -3
  87. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  88. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  89. package/dist/dismissable-layer.cjs.js +2 -2
  90. package/dist/dismissable-layer.esm.js +4 -6
  91. package/dist/dock.cjs.js +5 -5
  92. package/dist/dock.esm.js +134 -155
  93. package/dist/drawer.cjs.js +2 -2
  94. package/dist/drawer.esm.js +18 -35
  95. package/dist/dropdown.cjs.js +2 -2
  96. package/dist/dropdown.esm.js +119 -149
  97. package/dist/dropzone.cjs.js +1 -1
  98. package/dist/dropzone.esm.js +0 -1
  99. package/dist/empty-state.cjs.js +1 -1
  100. package/dist/empty-state.esm.js +1 -1
  101. package/dist/field-error.cjs.js +1 -1
  102. package/dist/field-error.esm.js +3 -5
  103. package/dist/field.cjs.js +5 -5
  104. package/dist/field.esm.js +27 -34
  105. package/dist/fieldset.cjs.js +4 -4
  106. package/dist/fieldset.esm.js +19 -24
  107. package/dist/file-upload.cjs.js +4 -4
  108. package/dist/file-upload.esm.js +69 -93
  109. package/dist/flex.cjs.js +1 -1
  110. package/dist/flex.esm.js +5 -9
  111. package/dist/floating-toolbar.cjs.js +4 -4
  112. package/dist/floating-toolbar.esm.js +60 -85
  113. package/dist/focus-scope-Bwug2gDv.js +1 -0
  114. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  115. package/dist/focus-scope.cjs.js +2 -2
  116. package/dist/focus-scope.esm.js +15 -20
  117. package/dist/form.cjs.js +2 -2
  118. package/dist/form.esm.js +26 -53
  119. package/dist/gantt.cjs.js +43 -43
  120. package/dist/gantt.esm.js +295 -322
  121. package/dist/grid.cjs.js +1 -1
  122. package/dist/grid.esm.js +5 -9
  123. package/dist/hover-card.cjs.js +4 -4
  124. package/dist/hover-card.esm.js +22 -28
  125. package/dist/icon-cloud.cjs.js +7 -7
  126. package/dist/icon-cloud.esm.js +48 -62
  127. package/dist/icon.cjs.js +1 -1
  128. package/dist/icon.esm.js +2 -4
  129. package/dist/index.cjs.js +1 -1
  130. package/dist/index.esm.js +378 -390
  131. package/dist/inline-edit.cjs.js +11 -11
  132. package/dist/inline-edit.esm.js +32 -36
  133. package/dist/input.cjs.js +17 -17
  134. package/dist/input.esm.js +50 -63
  135. package/dist/label.cjs.js +2 -2
  136. package/dist/label.esm.js +8 -17
  137. package/dist/layout.cjs.js +2 -2
  138. package/dist/layout.esm.js +20 -26
  139. package/dist/listbox-B6QgECax.js +46 -0
  140. package/dist/listbox-DJamVeFj.mjs +200 -0
  141. package/dist/listbox.cjs.js +1 -1
  142. package/dist/listbox.esm.js +2 -4
  143. package/dist/marquee.cjs.js +5 -5
  144. package/dist/marquee.esm.js +33 -50
  145. package/dist/masonry-grid.cjs.js +1 -1
  146. package/dist/masonry-grid.esm.js +5 -9
  147. package/dist/menu.cjs.js +3 -3
  148. package/dist/menu.esm.js +106 -126
  149. package/dist/menubar.cjs.js +5 -5
  150. package/dist/menubar.esm.js +118 -164
  151. package/dist/meter.cjs.js +2 -2
  152. package/dist/meter.esm.js +4 -4
  153. package/dist/multi-select.cjs.js +4 -4
  154. package/dist/multi-select.esm.js +120 -140
  155. package/dist/navigation-menu.cjs.js +4 -4
  156. package/dist/navigation-menu.esm.js +44 -55
  157. package/dist/number-field.cjs.js +2 -2
  158. package/dist/number-field.esm.js +73 -98
  159. package/dist/number-ticker.cjs.js +3 -3
  160. package/dist/number-ticker.esm.js +22 -43
  161. package/dist/odometer.cjs.js +1 -1
  162. package/dist/odometer.esm.js +5 -9
  163. package/dist/orbiter.cjs.js +13 -13
  164. package/dist/orbiter.esm.js +79 -90
  165. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  166. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  167. package/dist/pagination.cjs.js +2 -2
  168. package/dist/pagination.esm.js +14 -18
  169. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  170. package/dist/panel-group-CaD0_KQf.js +36 -0
  171. package/dist/panel-group.cjs.js +1 -1
  172. package/dist/panel-group.esm.js +2 -5
  173. package/dist/panel.cjs.js +4 -4
  174. package/dist/panel.esm.js +8 -10
  175. package/dist/password-field.cjs.js +9 -9
  176. package/dist/password-field.esm.js +62 -82
  177. package/dist/pin-input.cjs.js +3 -3
  178. package/dist/pin-input.esm.js +33 -39
  179. package/dist/placement-grid.cjs.js +4 -4
  180. package/dist/placement-grid.esm.js +108 -131
  181. package/dist/plugin-panel.cjs.js +7 -7
  182. package/dist/plugin-panel.esm.js +13 -15
  183. package/dist/popover.cjs.js +2 -2
  184. package/dist/popover.esm.js +21 -31
  185. package/dist/portal-DgpQ3Jo1.js +1 -0
  186. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  187. package/dist/portal.cjs.js +2 -2
  188. package/dist/portal.esm.js +10 -19
  189. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  190. package/dist/positioner-D_fqyx_j.js +1 -0
  191. package/dist/positioner.cjs.js +2 -2
  192. package/dist/positioner.esm.js +11 -18
  193. package/dist/presence.cjs.js +1 -1
  194. package/dist/presence.esm.js +7 -13
  195. package/dist/progress.cjs.js +1 -1
  196. package/dist/progress.esm.js +5 -9
  197. package/dist/quick-actions.cjs.js +6 -6
  198. package/dist/quick-actions.esm.js +52 -62
  199. package/dist/radio-group.cjs.js +13 -13
  200. package/dist/radio-group.esm.js +39 -51
  201. package/dist/radio.cjs.js +1 -1
  202. package/dist/radio.esm.js +5 -9
  203. package/dist/rating.cjs.js +1 -1
  204. package/dist/rating.esm.js +12 -23
  205. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  206. package/dist/roving-focus-group.cjs.js +1 -1
  207. package/dist/roving-focus-group.esm.js +3 -5
  208. package/dist/runtime-CTaOSmBj.js +1 -0
  209. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  210. package/dist/runtime.cjs.js +1 -1
  211. package/dist/runtime.esm.js +6 -6
  212. package/dist/scroll-area.cjs.js +3 -3
  213. package/dist/scroll-area.esm.js +38 -46
  214. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  215. package/dist/section.cjs.js +1 -1
  216. package/dist/section.esm.js +1 -1
  217. package/dist/select.cjs.js +7 -7
  218. package/dist/select.esm.js +67 -97
  219. package/dist/selection-popup.cjs.js +1 -1
  220. package/dist/selection-popup.esm.js +8 -15
  221. package/dist/separator.cjs.js +1 -1
  222. package/dist/separator.esm.js +1 -1
  223. package/dist/sidebar.cjs.js +18 -18
  224. package/dist/sidebar.esm.js +117 -139
  225. package/dist/skeleton.cjs.js +11 -11
  226. package/dist/skeleton.esm.js +27 -24
  227. package/dist/slider.cjs.js +1 -1
  228. package/dist/slider.esm.js +6 -11
  229. package/dist/slot.cjs.js +4 -4
  230. package/dist/slot.esm.js +16 -19
  231. package/dist/sortable.cjs.js +45 -45
  232. package/dist/sortable.esm.js +421 -524
  233. package/dist/spinning-text.cjs.js +12 -12
  234. package/dist/spinning-text.esm.js +80 -92
  235. package/dist/split-button.cjs.js +4 -4
  236. package/dist/split-button.esm.js +77 -62
  237. package/dist/splitter.cjs.js +1 -1
  238. package/dist/splitter.esm.js +1 -1
  239. package/dist/stepper.cjs.js +8 -8
  240. package/dist/stepper.esm.js +32 -52
  241. package/dist/switch.cjs.js +7 -7
  242. package/dist/switch.esm.js +23 -31
  243. package/dist/table.cjs.js +2 -2
  244. package/dist/table.esm.js +46 -56
  245. package/dist/tabs.cjs.js +3 -3
  246. package/dist/tabs.esm.js +35 -55
  247. package/dist/tags-input.cjs.js +4 -4
  248. package/dist/tags-input.esm.js +45 -62
  249. package/dist/textarea.cjs.js +6 -6
  250. package/dist/textarea.esm.js +32 -41
  251. package/dist/time-field.cjs.js +4 -4
  252. package/dist/time-field.esm.js +70 -84
  253. package/dist/time-picker.cjs.js +22 -22
  254. package/dist/time-picker.esm.js +88 -110
  255. package/dist/timeline.cjs.js +1 -1
  256. package/dist/timeline.esm.js +3 -5
  257. package/dist/toast.cjs.js +2 -2
  258. package/dist/toast.esm.js +33 -47
  259. package/dist/toggle-group.cjs.js +6 -6
  260. package/dist/toggle-group.esm.js +85 -105
  261. package/dist/toggle.cjs.js +1 -1
  262. package/dist/toggle.esm.js +3 -5
  263. package/dist/toolbar.cjs.js +1 -1
  264. package/dist/toolbar.esm.js +13 -24
  265. package/dist/tooltip.cjs.js +2 -2
  266. package/dist/tooltip.esm.js +31 -42
  267. package/dist/transfer-list.cjs.js +19 -19
  268. package/dist/transfer-list.esm.js +98 -111
  269. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  270. package/dist/tree-Dx_kv_ih.js +39 -0
  271. package/dist/tree-item.cjs.js +2 -2
  272. package/dist/tree-item.esm.js +2 -3
  273. package/dist/tree.cjs.js +1 -1
  274. package/dist/tree.esm.js +2 -5
  275. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  276. package/dist/ui-button-rXQOS9QJ.js +521 -0
  277. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  278. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  279. package/dist/visually-hidden.cjs.js +1 -1
  280. package/dist/visually-hidden.esm.js +1 -1
  281. package/dist/wizard.cjs.js +14 -14
  282. package/dist/wizard.esm.js +85 -105
  283. package/package.json +2 -2
  284. package/dist/date-time-utils-66480de4.js +0 -1
  285. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  286. package/dist/dismissable-layer-193e3bed.js +0 -1
  287. package/dist/focus-scope-2b12b4e7.js +0 -1
  288. package/dist/listbox-308789a0.mjs +0 -210
  289. package/dist/listbox-ef2f708e.js +0 -46
  290. package/dist/panel-group-40254cdd.js +0 -36
  291. package/dist/portal-c69756c0.js +0 -1
  292. package/dist/positioner-33529bb8.js +0 -1
  293. package/dist/runtime-3f13807b.js +0 -1
  294. package/dist/tree-0a7a8d05.js +0 -39
  295. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  296. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  297. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  298. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  299. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,673 +1,4 @@
1
- import { E as P } from "./ElementBase-909688f3.mjs";
2
- import "./icon-e2a85cc1.mjs";
3
- import "@editora/icons";
4
- const D = `
5
- :host {
6
- --ui-btn-radius: var(--ui-control-radius, var(--ui-radius, 4px));
7
- --ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, 40px));
8
- --ui-btn-padding-inline: var(--ui-control-padding-inline, 14px);
9
- --ui-btn-gap: var(--ui-control-gap, var(--ui-default-gap, 8px));
10
- --ui-btn-font-size: var(--ui-control-font-size, var(--ui-default-font-size, var(--ui-font-size-md, var(--font-size-2, 14px))));
11
- --ui-btn-font-weight: 400;
12
- --ui-btn-letter-spacing: var(--ui-default-letter-spacing, var(--letter-spacing-2, 0em));
13
- --ui-btn-duration: var(--ui-motion-base, 160ms);
14
- --ui-btn-easing: var(--ui-motion-easing, cubic-bezier(0.2, 0.8, 0.2, 1));
15
-
16
- --ui-btn-accent: var(--ui-color-primary, #2563eb);
17
- --ui-btn-accent-strong: color-mix(in srgb, var(--ui-btn-accent) 82%, #0f172a 18%);
18
- --ui-btn-accent-soft: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
19
-
20
- --ui-btn-surface: var(--ui-color-surface, #ffffff);
21
- --ui-btn-surface-alt: var(--ui-color-surface-alt, #f8fafc);
22
- --ui-btn-text: var(--ui-color-text, #0f172a);
23
- --ui-btn-muted: var(--ui-color-muted, #64748b);
24
- --ui-btn-ring: var(--ui-color-focus-ring, #2563eb);
25
-
26
- display: inline-flex;
27
- vertical-align: middle;
28
- box-sizing: border-box;
29
- color-scheme: light dark;
30
- font-family: var(--ui-font-family, var(--default-font-family, system-ui, sans-serif));
31
- }
32
-
33
- :host([block]) {
34
- display: flex;
35
- inline-size: 100%;
36
- }
37
-
38
- :host([tone="neutral"]) {
39
- --ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #64748b) 74%, var(--ui-color-text, #0f172a) 26%);
40
- }
41
-
42
- :host([tone="info"]) {
43
- --ui-btn-accent: var(--ui-color-primary, #2563eb);
44
- }
45
-
46
- :host([tone="success"]) {
47
- --ui-btn-accent: var(--ui-color-success, #16a34a);
48
- }
49
-
50
- :host([tone="warning"]) {
51
- --ui-btn-accent: var(--ui-color-warning, #d97706);
52
- }
53
-
54
- :host([tone="danger"]) {
55
- --ui-btn-accent: var(--ui-color-danger, #dc2626);
56
- }
57
-
58
- :host([state="error"]) {
59
- --ui-btn-accent: var(--ui-color-danger, #dc2626);
60
- }
61
-
62
- :host([state="success"]) {
63
- --ui-btn-accent: var(--ui-color-success, #16a34a);
64
- }
65
-
66
- :host([theme="dark"]) {
67
- --ui-btn-surface: color-mix(in srgb, var(--ui-color-surface, #0f172a) 88%, #020617 12%);
68
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-surface) 86%, #111827 14%);
69
- --ui-btn-text: var(--ui-color-text, #e2e8f0);
70
- --ui-btn-muted: var(--ui-color-muted, #94a3b8);
71
- }
72
-
73
- :host([theme="brand"]) {
74
- --ui-btn-accent: color-mix(in srgb, var(--ui-color-primary, #2563eb) 78%, #0ea5e9 22%);
75
- }
76
-
77
- :host([recipe="classic"]) .btn:not([disabled]) {
78
- background-image: linear-gradient(180deg, color-mix(in srgb, white 18%, transparent), color-mix(in srgb, black 10%, transparent));
79
- box-shadow:
80
- inset 0 1px 0 color-mix(in srgb, white 52%, transparent),
81
- inset 0 -1px 0 color-mix(in srgb, black 22%, transparent),
82
- 0 1px 2px rgba(15, 23, 42, 0.08),
83
- 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
84
- }
85
-
86
- :host([recipe="solid"]) .btn {
87
- background-image: none;
88
- }
89
-
90
- :host([recipe="soft"]) {
91
- --ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, white);
92
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, white);
93
- }
94
-
95
- :host([recipe="soft"]) .btn--secondary {
96
- border-color: transparent;
97
- box-shadow: none;
98
- }
99
-
100
- :host([recipe="surface"]) {
101
- --ui-btn-surface: var(--color-panel-solid, var(--ui-color-surface));
102
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 5%, var(--color-panel-solid, var(--ui-color-surface)));
103
- }
104
-
105
- :host([recipe="surface"]) .btn--secondary {
106
- border-color: color-mix(in srgb, var(--ui-btn-accent) 28%, var(--ui-color-border));
107
- box-shadow: var(--shadow-1);
108
- }
109
-
110
- :host([recipe="outline"]) {
111
- --ui-btn-surface: transparent;
112
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 6%, transparent);
113
- }
114
-
115
- :host([recipe="outline"]) .btn--secondary {
116
- border-width: 1px;
117
- border-style: solid;
118
- border-color: color-mix(in srgb, var(--ui-btn-accent) 42%, var(--ui-color-border));
119
- box-shadow: none;
120
- }
121
-
122
- :host([recipe="ghost"]) {
123
- --ui-btn-surface: transparent;
124
- --ui-btn-surface-alt: transparent;
125
- }
126
-
127
- :host([shape="none"]) {
128
- --ui-btn-radius: 0px;
129
- }
130
-
131
- :host([shape="sm"]) {
132
- --ui-btn-radius: 4px;
133
- }
134
-
135
- :host([shape="md"]) {
136
- --ui-btn-radius: 8px;
137
- }
138
-
139
- :host([shape="lg"]) {
140
- --ui-btn-radius: 12px;
141
- }
142
-
143
- :host([shape="full"]) {
144
- --ui-btn-radius: 999px;
145
- }
146
-
147
- :host([scale="1"]) {
148
- --ui-btn-min-height: 30px;
149
- --ui-btn-padding-inline: 10px;
150
- --ui-btn-font-size: 14px;
151
- --ui-btn-gap: 6px;
152
- }
153
-
154
- :host([scale="2"]) {
155
- --ui-btn-min-height: 36px;
156
- --ui-btn-padding-inline: 14px;
157
- --ui-btn-font-size: 14px;
158
- --ui-btn-gap: 8px;
159
- }
160
-
161
- :host([scale="3"]) {
162
- --ui-btn-min-height: 44px;
163
- --ui-btn-padding-inline: 18px;
164
- --ui-btn-font-size: 16px;
165
- --ui-btn-gap: 8px;
166
- }
167
-
168
- :host([scale="4"]) {
169
- --ui-btn-min-height: 56px;
170
- --ui-btn-padding-inline: 24px;
171
- --ui-btn-font-size: 18px;
172
- --ui-btn-gap: 10px;
173
- }
174
-
175
- .btn {
176
- position: relative;
177
- isolation: isolate;
178
- box-sizing: border-box;
179
- inline-size: auto;
180
- min-block-size: var(--ui-btn-min-height);
181
- padding-inline: var(--ui-btn-padding-inline);
182
- border-radius: var(--ui-btn-radius);
183
- border: 1px solid transparent;
184
- margin: 0;
185
- appearance: none;
186
- -webkit-appearance: none;
187
- font: inherit;
188
- font-size: var(--ui-btn-font-size);
189
- font-weight: var(--ui-btn-font-weight);
190
- letter-spacing: var(--ui-btn-letter-spacing);
191
- line-height: var(--ui-default-line-height, 20px);
192
- display: inline-flex;
193
- align-items: center;
194
- justify-content: center;
195
- gap: var(--ui-btn-gap);
196
- white-space: nowrap;
197
- cursor: pointer;
198
- user-select: none;
199
- -webkit-tap-highlight-color: transparent;
200
- transition:
201
- transform var(--ui-btn-duration) var(--ui-btn-easing),
202
- box-shadow var(--ui-btn-duration) var(--ui-btn-easing),
203
- background-color var(--ui-btn-duration) var(--ui-btn-easing),
204
- color var(--ui-btn-duration) var(--ui-btn-easing),
205
- border-color var(--ui-btn-duration) var(--ui-btn-easing),
206
- opacity var(--ui-btn-duration) var(--ui-btn-easing);
207
- }
208
-
209
- :host([block]) .btn {
210
- inline-size: 100%;
211
- }
212
-
213
- .btn:focus-visible {
214
- outline: 2px solid color-mix(in srgb, var(--ui-btn-ring) 70%, transparent);
215
- outline-offset: 2px;
216
- }
217
-
218
- .btn::after {
219
- content: '';
220
- position: absolute;
221
- inset: 0;
222
- border-radius: inherit;
223
- background: currentColor;
224
- opacity: 0;
225
- pointer-events: none;
226
- transition: opacity 140ms var(--ui-btn-easing);
227
- }
228
-
229
- .btn:active::after {
230
- opacity: 0.08;
231
- }
232
-
233
- .btn--primary {
234
- background: var(--ui-btn-accent);
235
- color: #ffffff;
236
- border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
237
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
238
- }
239
-
240
- .btn--primary:hover:not([disabled]) {
241
- background: var(--ui-btn-accent-strong);
242
- }
243
-
244
- .btn--secondary {
245
- background: var(--ui-btn-surface);
246
- color: color-mix(in srgb, var(--ui-btn-accent) 78%, var(--ui-btn-text) 22%);
247
- border-color: color-mix(in srgb, var(--ui-btn-accent) 22%, var(--ui-btn-muted));
248
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);
249
- }
250
-
251
- .btn--secondary:hover:not([disabled]) {
252
- background: color-mix(in srgb, var(--ui-btn-accent) 8%, var(--ui-btn-surface-alt));
253
- }
254
-
255
- .btn--ghost {
256
- background: transparent;
257
- color: color-mix(in srgb, var(--ui-btn-accent) 80%, var(--ui-btn-text) 20%);
258
- border-color: transparent;
259
- box-shadow: none;
260
- }
261
-
262
- .btn--ghost:hover:not([disabled]) {
263
- background: var(--ui-btn-accent-soft);
264
- }
265
-
266
- .btn--danger {
267
- background: var(--ui-color-danger, #dc2626);
268
- color: #ffffff;
269
- border-color: color-mix(in srgb, var(--ui-color-danger, #dc2626) 72%, #0f172a 28%);
270
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-danger, #dc2626) 22%, transparent);
271
- }
272
-
273
- .btn--danger:hover:not([disabled]) {
274
- background: color-mix(in srgb, var(--ui-color-danger, #dc2626) 86%, #0f172a 14%);
275
- }
276
-
277
- .btn--success {
278
- background: var(--ui-color-success, #16a34a);
279
- color: #ffffff;
280
- border-color: color-mix(in srgb, var(--ui-color-success, #16a34a) 70%, #0f172a 30%);
281
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #16a34a) 20%, transparent);
282
- }
283
-
284
- .btn--success:hover:not([disabled]) {
285
- background: color-mix(in srgb, var(--ui-color-success, #16a34a) 86%, #0f172a 14%);
286
- }
287
-
288
- .btn--warning {
289
- background: var(--ui-color-warning, #d97706);
290
- color: #ffffff;
291
- border-color: color-mix(in srgb, var(--ui-color-warning, #d97706) 70%, #0f172a 30%);
292
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #d97706) 18%, transparent);
293
- }
294
-
295
- .btn--warning:hover:not([disabled]) {
296
- background: color-mix(in srgb, var(--ui-color-warning, #d97706) 86%, #0f172a 14%);
297
- }
298
-
299
- :host([size="sm"]) {
300
- --ui-btn-font-size: var(--ui-font-size-sm, var(--font-size-1, 12px));
301
- --ui-btn-min-height: var(--base-button-height-sm, 32px);
302
- --ui-btn-padding-inline: 10px;
303
- --ui-btn-gap: 6px;
304
- }
305
-
306
- :host([size="lg"]) {
307
- --ui-btn-font-size: var(--ui-font-size-lg, var(--font-size-3, 16px));
308
- --ui-btn-min-height: var(--base-button-height-lg, 44px);
309
- --ui-btn-padding-inline: 18px;
310
- --ui-btn-gap: 10px;
311
- }
312
-
313
- :host([state="loading"]) .btn,
314
- :host([loading]) .btn,
315
- :host([aria-busy="true"]) .btn {
316
- cursor: progress;
317
- }
318
-
319
- :host([state="error"]) .btn:not([disabled]) {
320
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-danger, #dc2626) 38%, transparent), 0 8px 18px rgba(127, 29, 29, 0.14);
321
- }
322
-
323
- :host([state="success"]) .btn:not([disabled]) {
324
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #16a34a) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
325
- }
326
-
327
- :host([data-animation]) .btn:not([disabled]):hover {
328
- transform: translateY(-1px);
329
- box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
330
- }
331
-
332
- :host([data-animation]) .btn:not([disabled]):active {
333
- transform: translateY(0) scale(0.99);
334
- }
335
-
336
- :host([data-animation="scale"]) .btn:not([disabled]):hover {
337
- transform-origin: center;
338
- transform: translate3d(0, -2px, 0) scale(1.02);
339
- z-index: 1;
340
- backface-visibility: hidden;
341
- }
342
-
343
- :host([data-animation="pulse"]) .btn:not([disabled]):hover {
344
- animation: ui-btn-pulse 900ms ease-in-out infinite;
345
- }
346
-
347
- :host([data-animation="none"]) .btn:not([disabled]) {
348
- transition: none;
349
- animation: none;
350
- }
351
-
352
- :host([headless]) .btn {
353
- all: unset;
354
- box-sizing: border-box;
355
- display: inline-flex;
356
- align-items: center;
357
- justify-content: center;
358
- gap: var(--ui-btn-gap);
359
- cursor: pointer;
360
- border-radius: inherit;
361
- color: inherit;
362
- font: inherit;
363
- line-height: inherit;
364
- padding: inherit;
365
- border: inherit;
366
- background: inherit;
367
- }
368
-
369
- :host([headless][block]) .btn {
370
- inline-size: 100%;
371
- }
372
-
373
- .slot {
374
- display: inline-flex;
375
- align-items: center;
376
- justify-content: center;
377
- min-inline-size: 0;
378
- max-inline-size: 100%;
379
- }
380
-
381
- .slot--label {
382
- display: inline-flex;
383
- align-items: center;
384
- line-height: inherit;
385
- overflow: hidden;
386
- text-overflow: ellipsis;
387
- }
388
-
389
- .slot--prefix,
390
- .slot--suffix {
391
- line-height: 0;
392
- }
393
-
394
- .slot--prefix ::slotted(*),
395
- .slot--suffix ::slotted(*) {
396
- display: inline-flex;
397
- align-items: center;
398
- justify-content: center;
399
- line-height: 0;
400
- vertical-align: middle;
401
- }
402
-
403
- .slot--label ::slotted(*) {
404
- line-height: inherit;
405
- vertical-align: middle;
406
- }
407
-
408
- .icon {
409
- width: 16px;
410
- min-width: 16px;
411
- height: 16px;
412
- display: inline-flex;
413
- align-items: center;
414
- justify-content: center;
415
- line-height: 0;
416
- vertical-align: middle;
417
- pointer-events: none;
418
- }
419
-
420
- .spinner {
421
- width: 14px;
422
- min-width: 14px;
423
- height: 14px;
424
- border-radius: 999px;
425
- border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
426
- border-top-color: currentColor;
427
- animation: ui-btn-spin 700ms linear infinite;
428
- }
429
-
430
- .sr-only {
431
- border: 0;
432
- clip: rect(0 0 0 0);
433
- height: 1px;
434
- margin: -1px;
435
- overflow: hidden;
436
- padding: 0;
437
- position: absolute;
438
- width: 1px;
439
- white-space: nowrap;
440
- }
441
-
442
- .btn[disabled] {
443
- opacity: 0.56;
444
- cursor: not-allowed;
445
- box-shadow: none;
446
- transform: none !important;
447
- }
448
-
449
- @keyframes ui-btn-spin {
450
- to {
451
- transform: rotate(360deg);
452
- }
453
- }
454
-
455
- @keyframes ui-btn-pulse {
456
- 0% {
457
- transform: translateY(0);
458
- }
459
- 50% {
460
- transform: translateY(-2px);
461
- }
462
- 100% {
463
- transform: translateY(0);
464
- }
465
- }
466
-
467
- @media (prefers-reduced-motion: reduce) {
468
- .btn,
469
- .btn::after,
470
- .spinner {
471
- animation: none !important;
472
- transition: none !important;
473
- }
474
- }
475
-
476
- @media (prefers-contrast: more) {
477
- .btn {
478
- border-width: 2px;
479
- border-color: currentColor;
480
- box-shadow: none !important;
481
- }
482
- }
483
-
484
- @media (forced-colors: active) {
485
- :host {
486
- --ui-btn-accent: Highlight;
487
- --ui-btn-surface: Canvas;
488
- --ui-btn-text: CanvasText;
489
- --ui-btn-ring: Highlight;
490
- }
491
-
492
- .btn {
493
- forced-color-adjust: auto;
494
- border-color: ButtonText;
495
- color: ButtonText;
496
- background: ButtonFace;
497
- }
498
-
499
- .btn--primary,
500
- .btn--danger,
501
- .btn--success,
502
- .btn--warning {
503
- background: Highlight;
504
- color: HighlightText;
505
- }
506
- }
507
- `;
508
- function _(t) {
509
- return t !== null && t.toLowerCase() !== "false" && t !== "0";
510
- }
511
- function F(t) {
512
- return t === "secondary" || t === "ghost" || t === "danger" || t === "success" || t === "warning" ? t : "primary";
513
- }
514
- function I(t) {
515
- return t === "sm" || t === "lg" ? t : "md";
516
- }
517
- function S(t) {
518
- return t === "scale" || t === "pulse" || t === "none" ? t : null;
519
- }
520
- function N(t) {
521
- return t === "neutral" || t === "info" || t === "success" || t === "warning" || t === "danger" ? t : null;
522
- }
523
- function U(t) {
524
- return t === "loading" || t === "error" || t === "success" ? t : "idle";
525
- }
526
- function $(t) {
527
- return t === "submit" || t === "reset" ? t : "button";
528
- }
529
- function G(t) {
530
- return t === "classic" || t === "solid" || t === "soft" || t === "surface" || t === "outline" || t === "ghost" ? t : null;
531
- }
532
- function J(t) {
533
- return t === "none" || t === "sm" || t === "md" || t === "lg" || t === "full" ? t : null;
534
- }
535
- function K(t) {
536
- return t === "1" || t === "2" || t === "3" || t === "4" ? t : null;
537
- }
538
- function Q(t) {
539
- if (!t)
540
- return null;
541
- const n = t.trim();
542
- return n ? n === "full" ? "999px" : /^-?\d+(\.\d+)?$/.test(n) ? `${n}px` : n : null;
543
- }
544
- function r(t, n) {
545
- const e = t.getAttribute(n);
546
- if (e != null)
547
- return e;
548
- const i = t[n];
549
- return typeof i == "string" && i.length > 0 ? i : null;
550
- }
551
- function c(t, n) {
552
- const e = t.getAttribute(n);
553
- if (e != null)
554
- return _(e);
555
- const i = t[n];
556
- return typeof i == "boolean" ? i : typeof i == "string" ? _(i) : !1;
557
- }
558
- function u(t) {
559
- return t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
560
- }
561
- function L(t, n) {
562
- return !!t.querySelector(`[slot="${n}"]`);
563
- }
564
- function V(t, n) {
565
- if (n === "button")
566
- return;
567
- const e = t.closest("form");
568
- if (!e)
569
- return;
570
- if (n === "reset") {
571
- e.reset();
572
- return;
573
- }
574
- if (typeof e.requestSubmit == "function") {
575
- e.requestSubmit();
576
- return;
577
- }
578
- const i = new Event("submit", { bubbles: !0, cancelable: !0 });
579
- e.dispatchEvent(i);
580
- }
581
- class W extends P {
582
- constructor() {
583
- super(), this._slots = [], this._contentObserver = null, this._onRootClick = this._onRootClick.bind(this), this._onSlotChange = this._onSlotChange.bind(this), this._onContentMutations = this._onContentMutations.bind(this);
584
- }
585
- static get observedAttributes() {
586
- return [
587
- "disabled",
588
- "variant",
589
- "size",
590
- "headless",
591
- "loading",
592
- "icon",
593
- "block",
594
- "animation",
595
- "theme",
596
- "tone",
597
- "state",
598
- "type",
599
- "recipe",
600
- "shape",
601
- "radius",
602
- "scale",
603
- "loading-label",
604
- "aria-label"
605
- ];
606
- }
607
- connectedCallback() {
608
- super.connectedCallback(), this.root.addEventListener("click", this._onRootClick), this._contentObserver = new MutationObserver(this._onContentMutations), this._contentObserver.observe(this, { childList: !0, subtree: !1, characterData: !0 });
609
- }
610
- disconnectedCallback() {
611
- var n;
612
- this.root.removeEventListener("click", this._onRootClick), (n = this._contentObserver) == null || n.disconnect(), this._contentObserver = null, this._detachSlotListeners(), super.disconnectedCallback();
613
- }
614
- attributeChangedCallback(n, e, i) {
615
- if (e !== i) {
616
- if (n === "animation") {
617
- const o = S(i);
618
- o ? this.setAttribute("data-animation", o) : this.removeAttribute("data-animation");
619
- }
620
- this.isConnected && this.requestRender();
621
- }
622
- }
623
- _onRootClick(n) {
624
- const e = n.target, i = e == null ? void 0 : e.closest('button[data-ui-button="true"]');
625
- if (!i || i.disabled)
626
- return;
627
- const o = $(i.getAttribute("data-request-type"));
628
- queueMicrotask(() => {
629
- n.defaultPrevented || V(this, o);
630
- });
631
- }
632
- _attachSlotListeners() {
633
- this._detachSlotListeners(), this._slots = Array.from(this.root.querySelectorAll("slot")), this._slots.forEach((n) => n.addEventListener("slotchange", this._onSlotChange));
634
- }
635
- _detachSlotListeners() {
636
- this._slots.forEach((n) => n.removeEventListener("slotchange", this._onSlotChange)), this._slots = [];
637
- }
638
- _onSlotChange() {
639
- this.requestRender();
640
- }
641
- _onContentMutations() {
642
- this.requestRender();
643
- }
644
- render() {
645
- const n = c(this, "disabled"), e = c(this, "loading"), i = r(this, "state"), o = U(i), s = e || o === "loading", l = r(this, "icon"), E = F(r(this, "variant")), b = r(this, "size"), d = I(b), h = S(r(this, "animation")), a = r(this, "theme"), p = a === "dark" || a === "brand" ? a : null, f = r(this, "tone"), g = N(f), q = c(this, "block"), R = c(this, "headless"), T = $(r(this, "type")), m = G(r(this, "recipe")), x = r(this, "shape"), v = J(x), M = r(this, "radius"), y = Q(M), w = K(r(this, "scale")), k = r(this, "aria-label"), B = r(this, "loading-label") || "Loading";
646
- h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"), q ? this.setAttribute("block", "") : this.removeAttribute("block"), R ? this.setAttribute("headless", "") : this.removeAttribute("headless"), f != null && (g ? this.setAttribute("tone", g) : this.removeAttribute("tone")), b != null && (d === "md" ? this.removeAttribute("size") : this.setAttribute("size", d)), a != null && (p ? this.setAttribute("theme", p) : this.removeAttribute("theme")), i != null && (o === "idle" ? this.removeAttribute("state") : this.setAttribute("state", o)), m ? this.setAttribute("recipe", m) : this.removeAttribute("recipe"), x != null && (v ? this.setAttribute("shape", v) : this.removeAttribute("shape")), y ? this.style.setProperty("--ui-btn-radius", y) : this.style.removeProperty("--ui-btn-radius"), w ? this.setAttribute("scale", w) : this.removeAttribute("scale");
647
- const z = n || s;
648
- z ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), s ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
649
- const j = L(this, "prefix"), H = L(this, "suffix"), A = !s && l ? `<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>` : "", C = s ? '<span class="spinner" aria-hidden="true" part="spinner"></span>' : "", O = C || A || j ? `<span class="slot slot--prefix" part="prefix">${C}${A}${s ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = H ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
650
- this.setContent(`
651
- <style>${D}</style>
652
- <button
653
- class="btn btn--${E}"
654
- part="button"
655
- type="button"
656
- data-ui-button="true"
657
- data-request-type="${T}"
658
- aria-busy="${s ? "true" : "false"}"
659
- ${k ? `aria-label="${u(k)}"` : ""}
660
- ${z ? "disabled" : ""}
661
- >
662
- ${O}
663
- <span class="slot slot--label" part="label"><slot></slot></span>
664
- ${Y}
665
- ${s ? `<span class="sr-only">${u(B)}</span>` : ""}
666
- </button>
667
- `), this._attachSlotListeners();
668
- }
669
- }
670
- typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button", W);
1
+ import { U as r } from "./ui-button-Q0GNNWKC.mjs";
671
2
  export {
672
- W as UIButton
3
+ r as UIButton
673
4
  };