@remix-run/ui 0.0.0 → 0.1.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 (273) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -2
  3. package/dist/animation/animate-layout-mixin.d.ts +12 -0
  4. package/dist/animation/animate-layout-mixin.js +214 -0
  5. package/dist/animation/animate-layout-mixin.js.map +1 -0
  6. package/dist/animation/animate-mixins.d.ts +29 -0
  7. package/dist/animation/animate-mixins.js +235 -0
  8. package/dist/animation/animate-mixins.js.map +1 -0
  9. package/dist/animation/index.d.ts +6 -0
  10. package/dist/animation/index.js +5 -0
  11. package/dist/animation/index.js.map +1 -0
  12. package/dist/animation/spring.d.ts +75 -0
  13. package/dist/animation/spring.js +183 -0
  14. package/dist/animation/spring.js.map +1 -0
  15. package/dist/animation/tween.d.ts +70 -0
  16. package/dist/animation/tween.js +93 -0
  17. package/dist/animation/tween.js.map +1 -0
  18. package/dist/components/accordion/accordion.d.ts +92 -0
  19. package/dist/components/accordion/accordion.js +337 -0
  20. package/dist/components/accordion/accordion.js.map +1 -0
  21. package/dist/components/anchor/anchor.d.ts +13 -0
  22. package/dist/components/anchor/anchor.js +558 -0
  23. package/dist/components/anchor/anchor.js.map +1 -0
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +11 -0
  25. package/dist/components/breadcrumbs/breadcrumbs.js +78 -0
  26. package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
  27. package/dist/components/button/button.d.ts +23 -0
  28. package/dist/components/button/button.js +147 -0
  29. package/dist/components/button/button.js.map +1 -0
  30. package/dist/components/combobox/combobox.d.ts +101 -0
  31. package/dist/components/combobox/combobox.js +708 -0
  32. package/dist/components/combobox/combobox.js.map +1 -0
  33. package/dist/components/glyph/glyph.d.ts +14 -0
  34. package/dist/components/glyph/glyph.js +65 -0
  35. package/dist/components/glyph/glyph.js.map +1 -0
  36. package/dist/components/listbox/listbox.d.ts +67 -0
  37. package/dist/components/listbox/listbox.js +340 -0
  38. package/dist/components/listbox/listbox.js.map +1 -0
  39. package/dist/components/menu/hover-aim.d.ts +5 -0
  40. package/dist/components/menu/hover-aim.js +308 -0
  41. package/dist/components/menu/hover-aim.js.map +1 -0
  42. package/dist/components/menu/menu.d.ts +164 -0
  43. package/dist/components/menu/menu.js +1106 -0
  44. package/dist/components/menu/menu.js.map +1 -0
  45. package/dist/components/popover/popover.d.ts +35 -0
  46. package/dist/components/popover/popover.js +138 -0
  47. package/dist/components/popover/popover.js.map +1 -0
  48. package/dist/components/select/select.d.ts +67 -0
  49. package/dist/components/select/select.js +397 -0
  50. package/dist/components/select/select.js.map +1 -0
  51. package/dist/components/separator/separator.d.ts +2 -0
  52. package/dist/components/separator/separator.js +15 -0
  53. package/dist/components/separator/separator.js.map +1 -0
  54. package/dist/components/tabs/tabs.d.ts +78 -0
  55. package/dist/components/tabs/tabs.js +341 -0
  56. package/dist/components/tabs/tabs.js.map +1 -0
  57. package/dist/index.d.ts +28 -0
  58. package/dist/index.js +21 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/interactions/keydown/keydown.d.ts +1 -0
  61. package/dist/interactions/keydown/keydown.js +8 -0
  62. package/dist/interactions/keydown/keydown.js.map +1 -0
  63. package/dist/interactions/outside-click/outside-click-mixin.d.ts +2 -0
  64. package/dist/interactions/outside-click/outside-click-mixin.js +29 -0
  65. package/dist/interactions/outside-click/outside-click-mixin.js.map +1 -0
  66. package/dist/interactions/typeahead/typeahead-mixin.d.ts +8 -0
  67. package/dist/interactions/typeahead/typeahead-mixin.js +59 -0
  68. package/dist/interactions/typeahead/typeahead-mixin.js.map +1 -0
  69. package/dist/jsx-runtime.d.ts +2 -0
  70. package/dist/jsx-runtime.js +3 -0
  71. package/dist/jsx-runtime.js.map +1 -0
  72. package/dist/runtime/client-entries.d.ts +91 -0
  73. package/dist/runtime/client-entries.js +40 -0
  74. package/dist/runtime/client-entries.js.map +1 -0
  75. package/dist/runtime/component.d.ts +223 -0
  76. package/dist/runtime/component.js +152 -0
  77. package/dist/runtime/component.js.map +1 -0
  78. package/dist/runtime/create-element.d.ts +10 -0
  79. package/dist/runtime/create-element.js +29 -0
  80. package/dist/runtime/create-element.js.map +1 -0
  81. package/dist/runtime/diff-dom.d.ts +2 -0
  82. package/dist/runtime/diff-dom.js +364 -0
  83. package/dist/runtime/diff-dom.js.map +1 -0
  84. package/dist/runtime/diff-props.d.ts +9 -0
  85. package/dist/runtime/diff-props.js +195 -0
  86. package/dist/runtime/diff-props.js.map +1 -0
  87. package/dist/runtime/document-state.d.ts +11 -0
  88. package/dist/runtime/document-state.js +106 -0
  89. package/dist/runtime/document-state.js.map +1 -0
  90. package/dist/runtime/dom.d.ts +3189 -0
  91. package/dist/runtime/dom.js +2 -0
  92. package/dist/runtime/dom.js.map +1 -0
  93. package/dist/runtime/error-event.d.ts +20 -0
  94. package/dist/runtime/error-event.js +19 -0
  95. package/dist/runtime/error-event.js.map +1 -0
  96. package/dist/runtime/event-listeners.d.ts +50 -0
  97. package/dist/runtime/event-listeners.js +31 -0
  98. package/dist/runtime/event-listeners.js.map +1 -0
  99. package/dist/runtime/frame.d.ts +119 -0
  100. package/dist/runtime/frame.js +915 -0
  101. package/dist/runtime/frame.js.map +1 -0
  102. package/dist/runtime/invariant.d.ts +23 -0
  103. package/dist/runtime/invariant.js +33 -0
  104. package/dist/runtime/invariant.js.map +1 -0
  105. package/dist/runtime/jsx.d.ts +320 -0
  106. package/dist/runtime/jsx.js +31 -0
  107. package/dist/runtime/jsx.js.map +1 -0
  108. package/dist/runtime/mixins/attrs-mixin.d.ts +9 -0
  109. package/dist/runtime/mixins/attrs-mixin.js +23 -0
  110. package/dist/runtime/mixins/attrs-mixin.js.map +1 -0
  111. package/dist/runtime/mixins/link-mixin.d.ts +17 -0
  112. package/dist/runtime/mixins/link-mixin.js +101 -0
  113. package/dist/runtime/mixins/link-mixin.js.map +1 -0
  114. package/dist/runtime/mixins/mixin.d.ts +145 -0
  115. package/dist/runtime/mixins/mixin.js +570 -0
  116. package/dist/runtime/mixins/mixin.js.map +1 -0
  117. package/dist/runtime/mixins/on-mixin.d.ts +16 -0
  118. package/dist/runtime/mixins/on-mixin.js +49 -0
  119. package/dist/runtime/mixins/on-mixin.js.map +1 -0
  120. package/dist/runtime/mixins/ref-mixin.d.ts +9 -0
  121. package/dist/runtime/mixins/ref-mixin.js +21 -0
  122. package/dist/runtime/mixins/ref-mixin.js.map +1 -0
  123. package/dist/runtime/navigation.d.ts +22 -0
  124. package/dist/runtime/navigation.js +102 -0
  125. package/dist/runtime/navigation.js.map +1 -0
  126. package/dist/runtime/reconcile.d.ts +11 -0
  127. package/dist/runtime/reconcile.js +1240 -0
  128. package/dist/runtime/reconcile.js.map +1 -0
  129. package/dist/runtime/render.d.ts +54 -0
  130. package/dist/runtime/render.js +50 -0
  131. package/dist/runtime/render.js.map +1 -0
  132. package/dist/runtime/run.d.ts +45 -0
  133. package/dist/runtime/run.js +68 -0
  134. package/dist/runtime/run.js.map +1 -0
  135. package/dist/runtime/scheduler.d.ts +30 -0
  136. package/dist/runtime/scheduler.js +185 -0
  137. package/dist/runtime/scheduler.js.map +1 -0
  138. package/dist/runtime/svg-attributes.d.ts +5 -0
  139. package/dist/runtime/svg-attributes.js +124 -0
  140. package/dist/runtime/svg-attributes.js.map +1 -0
  141. package/dist/runtime/to-vnode.d.ts +3 -0
  142. package/dist/runtime/to-vnode.js +43 -0
  143. package/dist/runtime/to-vnode.js.map +1 -0
  144. package/dist/runtime/typed-event-target.d.ts +50 -0
  145. package/dist/runtime/typed-event-target.js +6 -0
  146. package/dist/runtime/typed-event-target.js.map +1 -0
  147. package/dist/runtime/vdom.d.ts +55 -0
  148. package/dist/runtime/vdom.js +198 -0
  149. package/dist/runtime/vdom.js.map +1 -0
  150. package/dist/runtime/vnode.d.ts +79 -0
  151. package/dist/runtime/vnode.js +38 -0
  152. package/dist/runtime/vnode.js.map +1 -0
  153. package/dist/server/stream.d.ts +57 -0
  154. package/dist/server/stream.js +1007 -0
  155. package/dist/server/stream.js.map +1 -0
  156. package/dist/style/css-mixin.d.ts +8 -0
  157. package/dist/style/css-mixin.js +54 -0
  158. package/dist/style/css-mixin.js.map +1 -0
  159. package/dist/style/index.d.ts +5 -0
  160. package/dist/style/index.js +4 -0
  161. package/dist/style/index.js.map +1 -0
  162. package/dist/style/style.d.ts +24 -0
  163. package/dist/style/style.js +269 -0
  164. package/dist/style/style.js.map +1 -0
  165. package/dist/style/stylesheet.d.ts +11 -0
  166. package/dist/style/stylesheet.js +174 -0
  167. package/dist/style/stylesheet.js.map +1 -0
  168. package/dist/test.d.ts +2 -0
  169. package/dist/test.js +2 -0
  170. package/dist/test.js.map +1 -0
  171. package/dist/theme/contract.d.ts +259 -0
  172. package/dist/theme/contract.js +131 -0
  173. package/dist/theme/contract.js.map +1 -0
  174. package/dist/theme/glyph-contract.d.ts +13 -0
  175. package/dist/theme/glyph-contract.js +34 -0
  176. package/dist/theme/glyph-contract.js.map +1 -0
  177. package/dist/theme/presets/rmx-01/glyphs.d.ts +2 -0
  178. package/dist/theme/presets/rmx-01/glyphs.js +252 -0
  179. package/dist/theme/presets/rmx-01/glyphs.js.map +1 -0
  180. package/dist/theme/presets/rmx-01/index.d.ts +2 -0
  181. package/dist/theme/presets/rmx-01/index.js +119 -0
  182. package/dist/theme/presets/rmx-01/index.js.map +1 -0
  183. package/dist/theme/runtime.d.ts +2 -0
  184. package/dist/theme/runtime.js +81 -0
  185. package/dist/theme/runtime.js.map +1 -0
  186. package/dist/theme/theme.d.ts +6 -0
  187. package/dist/theme/theme.js +5 -0
  188. package/dist/theme/theme.js.map +1 -0
  189. package/dist/utils/flash-attribute.d.ts +1 -0
  190. package/dist/utils/flash-attribute.js +11 -0
  191. package/dist/utils/flash-attribute.js.map +1 -0
  192. package/dist/utils/scroll-lock.d.ts +3 -0
  193. package/dist/utils/scroll-lock.js +69 -0
  194. package/dist/utils/scroll-lock.js.map +1 -0
  195. package/dist/utils/wait-for-css-transition.d.ts +1 -0
  196. package/dist/utils/wait-for-css-transition.js +58 -0
  197. package/dist/utils/wait-for-css-transition.js.map +1 -0
  198. package/dist/utils/wait.d.ts +1 -0
  199. package/dist/utils/wait.js +6 -0
  200. package/dist/utils/wait.js.map +1 -0
  201. package/package.json +125 -5
  202. package/src/animation/animate-layout-mixin.ts +266 -0
  203. package/src/animation/animate-mixins.ts +292 -0
  204. package/src/animation/index.ts +6 -0
  205. package/src/animation/spring.ts +299 -0
  206. package/src/animation/tween.ts +134 -0
  207. package/src/components/accordion/accordion.tsx +565 -0
  208. package/src/components/anchor/anchor.ts +904 -0
  209. package/src/components/breadcrumbs/breadcrumbs.tsx +124 -0
  210. package/src/components/button/README.md +44 -0
  211. package/src/components/button/button.tsx +188 -0
  212. package/src/components/combobox/README.md +145 -0
  213. package/src/components/combobox/combobox.tsx +1014 -0
  214. package/src/components/glyph/glyph.tsx +110 -0
  215. package/src/components/listbox/listbox.ts +447 -0
  216. package/src/components/menu/hover-aim.ts +428 -0
  217. package/src/components/menu/menu.tsx +1547 -0
  218. package/src/components/popover/README.md +122 -0
  219. package/src/components/popover/popover.ts +201 -0
  220. package/src/components/select/select.tsx +585 -0
  221. package/src/components/separator/separator.ts +19 -0
  222. package/src/components/tabs/README.md +105 -0
  223. package/src/components/tabs/tabs.tsx +499 -0
  224. package/src/index.ts +72 -0
  225. package/src/interactions/keydown/keydown.ts +14 -0
  226. package/src/interactions/outside-click/outside-click-mixin.ts +55 -0
  227. package/src/interactions/typeahead/typeahead-mixin.ts +89 -0
  228. package/src/jsx-runtime.ts +2 -0
  229. package/src/runtime/client-entries.ts +137 -0
  230. package/src/runtime/component.ts +402 -0
  231. package/src/runtime/create-element.ts +38 -0
  232. package/src/runtime/diff-dom.ts +404 -0
  233. package/src/runtime/diff-props.ts +209 -0
  234. package/src/runtime/document-state.ts +130 -0
  235. package/src/runtime/dom.ts +3971 -0
  236. package/src/runtime/error-event.ts +26 -0
  237. package/src/runtime/event-listeners.ts +171 -0
  238. package/src/runtime/frame.ts +1211 -0
  239. package/src/runtime/invariant.ts +31 -0
  240. package/src/runtime/jsx.ts +398 -0
  241. package/src/runtime/mixins/attrs-mixin.ts +35 -0
  242. package/src/runtime/mixins/link-mixin.ts +131 -0
  243. package/src/runtime/mixins/mixin.ts +908 -0
  244. package/src/runtime/mixins/on-mixin.ts +89 -0
  245. package/src/runtime/mixins/ref-mixin.ts +32 -0
  246. package/src/runtime/navigation.ts +136 -0
  247. package/src/runtime/reconcile.ts +1722 -0
  248. package/src/runtime/render.ts +101 -0
  249. package/src/runtime/run.ts +100 -0
  250. package/src/runtime/scheduler.ts +262 -0
  251. package/src/runtime/svg-attributes.ts +133 -0
  252. package/src/runtime/to-vnode.ts +50 -0
  253. package/src/runtime/typed-event-target.ts +67 -0
  254. package/src/runtime/vdom.ts +295 -0
  255. package/src/runtime/vnode.ts +137 -0
  256. package/src/server/stream.ts +1342 -0
  257. package/src/style/css-mixin.ts +82 -0
  258. package/src/style/index.ts +10 -0
  259. package/src/style/style.ts +312 -0
  260. package/src/style/stylesheet.ts +209 -0
  261. package/src/test/setup.ts +7 -0
  262. package/src/test/utils.ts +45 -0
  263. package/src/test.ts +2 -0
  264. package/src/theme/contract.ts +183 -0
  265. package/src/theme/glyph-contract.ts +57 -0
  266. package/src/theme/presets/rmx-01/glyphs.tsx +308 -0
  267. package/src/theme/presets/rmx-01/index.ts +121 -0
  268. package/src/theme/runtime.ts +116 -0
  269. package/src/theme/theme.ts +15 -0
  270. package/src/utils/flash-attribute.ts +11 -0
  271. package/src/utils/scroll-lock.ts +97 -0
  272. package/src/utils/wait-for-css-transition.ts +66 -0
  273. package/src/utils/wait.ts +5 -0
@@ -0,0 +1,78 @@
1
+ import { jsx as _jsx } from "@remix-run/ui/jsx-runtime";
2
+ // @jsxRuntime classic
3
+ // @jsx createElement
4
+ import { css, createElement } from '@remix-run/ui';
5
+ import { Glyph } from "../glyph/glyph.js";
6
+ import { theme } from "../../theme/theme.js";
7
+ const rootCss = css({
8
+ minWidth: 0,
9
+ });
10
+ const listCss = css({
11
+ display: 'flex',
12
+ flexWrap: 'wrap',
13
+ alignItems: 'center',
14
+ gap: `${theme.space.xs} ${theme.space.sm}`,
15
+ minWidth: 0,
16
+ margin: 0,
17
+ padding: 0,
18
+ listStyle: 'none',
19
+ });
20
+ const itemCss = css({
21
+ display: 'inline-flex',
22
+ alignItems: 'center',
23
+ minWidth: 0,
24
+ });
25
+ const separatorCss = css({
26
+ display: 'inline-flex',
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ flexShrink: 0,
30
+ width: theme.fontSize.sm,
31
+ height: theme.fontSize.sm,
32
+ color: theme.colors.text.muted,
33
+ });
34
+ const linkCss = css({
35
+ color: theme.colors.text.secondary,
36
+ fontSize: theme.fontSize.sm,
37
+ lineHeight: theme.lineHeight.normal,
38
+ textDecoration: 'none',
39
+ whiteSpace: 'nowrap',
40
+ '&:hover': {
41
+ color: theme.colors.text.primary,
42
+ },
43
+ });
44
+ const currentCss = css({
45
+ color: theme.colors.text.primary,
46
+ fontSize: theme.fontSize.sm,
47
+ lineHeight: theme.lineHeight.normal,
48
+ fontWeight: theme.fontWeight.medium,
49
+ whiteSpace: 'nowrap',
50
+ });
51
+ const textCss = css({
52
+ color: theme.colors.text.secondary,
53
+ fontSize: theme.fontSize.sm,
54
+ lineHeight: theme.lineHeight.normal,
55
+ whiteSpace: 'nowrap',
56
+ });
57
+ export function Breadcrumbs(handle) {
58
+ return () => {
59
+ let { 'aria-label': ariaLabel, items, separator, mix, ...navProps } = handle.props;
60
+ let currentIndex = items.findIndex((item) => item.current);
61
+ if (currentIndex === -1) {
62
+ currentIndex = Math.max(0, items.length - 1);
63
+ }
64
+ let separatorContent = separator ?? _jsx(Glyph, { name: "chevronRight" });
65
+ return (_jsx("nav", { "aria-label": ariaLabel ?? 'Breadcrumb', ...navProps, mix: [rootCss, mix], children: _jsx("ol", { mix: listCss, children: items.flatMap((item, index) => {
66
+ let isCurrent = index === currentIndex;
67
+ let content = isCurrent ? (_jsx("span", { "aria-current": "page", mix: currentCss, children: item.label })) : item.href ? (_jsx("a", { href: item.href, mix: linkCss, children: item.label })) : (_jsx("span", { mix: textCss, children: item.label }));
68
+ let nodes = [
69
+ _jsx("li", { mix: itemCss, children: content }, `item-${index}`),
70
+ ];
71
+ if (index < items.length - 1) {
72
+ nodes.push(_jsx("li", { "aria-hidden": "true", mix: separatorCss, children: separatorContent }, `separator-${index}`));
73
+ }
74
+ return nodes;
75
+ }) }) }));
76
+ };
77
+ }
78
+ //# sourceMappingURL=breadcrumbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/breadcrumbs/breadcrumbs.tsx"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,qBAAqB;AACrB,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGlD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAa5C,MAAM,OAAO,GAAG,GAAG,CAAC;IAClB,QAAQ,EAAE,CAAC;CACZ,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,GAAG,CAAC;IAClB,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1C,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,MAAM;CAClB,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,GAAG,CAAC;IAClB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,CAAC;CACZ,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,GAAG,CAAC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MAAM,GAAG,CAAC,EAAE,CAAC;wBAC7B,KAAK,CAAC,IAAI,CACR,4BAA2C,MAAM,EAAC,GAAG,EAAE,YAAY,YAChE,gBAAgB,IADV,aAAa,KAAK,EAAE,CAExB,CACN,CAAA;oBACH,CAAC;oBAED,OAAO,KAAK,CAAA;gBACd,CAAC,CAAC,GACC,GACD,CACP,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { CSSMixinDescriptor, ElementProps, Handle, Props, RemixNode } from '@remix-run/ui';
2
+ export declare const baseStyle: readonly [import("@remix-run/ui").MixinDescriptor<Element, [], ElementProps>, CSSMixinDescriptor];
3
+ export declare const iconStyle: readonly [import("@remix-run/ui").MixinDescriptor<Element, [Partial<ElementProps>], ElementProps>, CSSMixinDescriptor];
4
+ export declare const labelStyle: CSSMixinDescriptor;
5
+ export declare const primaryStyle: CSSMixinDescriptor;
6
+ export declare const secondaryStyle: CSSMixinDescriptor;
7
+ export declare const ghostStyle: CSSMixinDescriptor;
8
+ export declare const dangerStyle: CSSMixinDescriptor;
9
+ declare const toneStyleByTone: {
10
+ readonly primary: CSSMixinDescriptor;
11
+ readonly secondary: CSSMixinDescriptor;
12
+ readonly ghost: CSSMixinDescriptor;
13
+ readonly danger: CSSMixinDescriptor;
14
+ };
15
+ export type ButtonTone = keyof typeof toneStyleByTone;
16
+ export type ButtonProps = Omit<Props<'button'>, 'children'> & {
17
+ readonly children?: RemixNode;
18
+ readonly endIcon?: RemixNode;
19
+ readonly startIcon?: RemixNode;
20
+ readonly tone?: ButtonTone;
21
+ };
22
+ export declare function Button(handle: Handle<ButtonProps>): () => import("@remix-run/ui").RemixElement;
23
+ export {};
@@ -0,0 +1,147 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@remix-run/ui/jsx-runtime";
2
+ // @jsxRuntime classic
3
+ // @jsx createElement
4
+ import { attrs, createElement, createMixin, css } from '@remix-run/ui';
5
+ import { theme } from "../../theme/theme.js";
6
+ const ghostButtonToneCss = css({
7
+ backgroundColor: 'transparent',
8
+ backgroundImage: 'none',
9
+ color: theme.colors.text.secondary,
10
+ border: '0.5px solid transparent',
11
+ boxShadow: 'none',
12
+ '&:hover': {
13
+ backgroundColor: theme.surface.lvl3,
14
+ color: theme.colors.text.primary,
15
+ },
16
+ '&:active': {
17
+ backgroundColor: `color-mix(in oklab, ${theme.surface.lvl3} 94%, black)`,
18
+ color: `color-mix(in oklab, ${theme.colors.text.primary} 94%, black)`,
19
+ },
20
+ '&:focus-visible': {
21
+ outline: `2px solid ${theme.colors.focus.ring}`,
22
+ outlineOffset: '2px',
23
+ backgroundColor: theme.surface.lvl3,
24
+ color: theme.colors.text.primary,
25
+ },
26
+ '&:disabled': {
27
+ opacity: 0.6,
28
+ },
29
+ });
30
+ const buttonBaseStyleCss = css({
31
+ '--rmx-button-label-padding-inline': theme.space.xs,
32
+ all: 'unset',
33
+ boxSizing: 'border-box',
34
+ cursor: 'revert',
35
+ position: 'relative',
36
+ isolation: 'isolate',
37
+ display: 'inline-flex',
38
+ alignItems: 'center',
39
+ justifyContent: 'center',
40
+ overflow: 'hidden',
41
+ borderRadius: theme.radius.full,
42
+ fontFamily: theme.fontFamily.sans,
43
+ minHeight: theme.control.height.sm,
44
+ paddingInline: theme.space.md,
45
+ fontSize: theme.fontSize.xs,
46
+ lineHeight: '1',
47
+ fontWeight: theme.fontWeight.medium,
48
+ whiteSpace: 'nowrap',
49
+ textDecoration: 'none',
50
+ userSelect: 'none',
51
+ WebkitUserSelect: 'none',
52
+ verticalAlign: 'top',
53
+ });
54
+ const buttonLabelCss = css({
55
+ display: 'inline-flex',
56
+ alignItems: 'center',
57
+ minWidth: 0,
58
+ paddingInline: 'var(--rmx-button-label-padding-inline)',
59
+ });
60
+ const buttonIconCss = css({
61
+ display: 'inline-flex',
62
+ alignItems: 'center',
63
+ justifyContent: 'center',
64
+ width: '1em',
65
+ height: '1em',
66
+ flexShrink: 0,
67
+ '& > svg': {
68
+ display: 'block',
69
+ width: '100%',
70
+ height: '100%',
71
+ },
72
+ });
73
+ const buttonIconAttrsCss = attrs({ 'aria-hidden': true });
74
+ const buttonDefaultsMixin = createMixin((handle, hostType) => (props) => {
75
+ if (hostType !== 'button' || props.type !== undefined) {
76
+ return handle.element;
77
+ }
78
+ return createElement(handle.element, {
79
+ ...props,
80
+ type: 'button',
81
+ });
82
+ });
83
+ const buttonDefaultsCss = buttonDefaultsMixin();
84
+ export const baseStyle = [buttonDefaultsCss, buttonBaseStyleCss];
85
+ export const iconStyle = [buttonIconAttrsCss, buttonIconCss];
86
+ export const labelStyle = buttonLabelCss;
87
+ export const primaryStyle = createButtonCss(theme.colors.action.primary);
88
+ export const secondaryStyle = createButtonCss(theme.colors.action.secondary);
89
+ export const ghostStyle = ghostButtonToneCss;
90
+ export const dangerStyle = createButtonCss(theme.colors.action.danger);
91
+ const toneStyleByTone = {
92
+ primary: primaryStyle,
93
+ secondary: secondaryStyle,
94
+ ghost: ghostStyle,
95
+ danger: dangerStyle,
96
+ };
97
+ export function Button(handle) {
98
+ return () => {
99
+ let { children, endIcon, mix, startIcon, tone = 'secondary', ...buttonProps } = handle.props;
100
+ return (_jsxs("button", { ...buttonProps, mix: [baseStyle, toneStyleByTone[tone], mix], children: [startIcon ? _jsx("span", { mix: iconStyle, children: startIcon }) : null, children !== undefined ? _jsx("span", { mix: labelStyle, children: children }) : null, endIcon ? _jsx("span", { mix: iconStyle, children: endIcon }) : null] }));
101
+ };
102
+ }
103
+ function createButtonCss(buttonTheme) {
104
+ let borderColor = createButtonBorderColor(buttonTheme.border);
105
+ let hoverBorderColor = createButtonBorderColor(buttonTheme.backgroundHover);
106
+ let activeBorderColor = createButtonBorderColor(buttonTheme.backgroundActive);
107
+ return css({
108
+ backgroundColor: buttonTheme.background,
109
+ backgroundImage: createButtonBackgroundImage(buttonTheme.background),
110
+ color: buttonTheme.foreground,
111
+ border: `0.5px solid ${borderColor}`,
112
+ boxShadow: `${createButtonHighlight(buttonTheme.background)}, ${theme.shadow.xs}, ${theme.shadow.sm}`,
113
+ '&:hover': {
114
+ backgroundColor: buttonTheme.backgroundHover,
115
+ backgroundImage: createButtonBackgroundImage(buttonTheme.backgroundHover),
116
+ borderColor: hoverBorderColor,
117
+ },
118
+ '&:active': {
119
+ backgroundColor: buttonTheme.backgroundActive,
120
+ backgroundImage: createButtonBackgroundImage(buttonTheme.backgroundActive),
121
+ borderColor: activeBorderColor,
122
+ boxShadow: `${createButtonHighlight(buttonTheme.backgroundActive, 0.12)}, ${theme.shadow.xs}`,
123
+ },
124
+ '&:focus-visible': {
125
+ outline: `2px solid ${theme.colors.focus.ring}`,
126
+ outlineOffset: '2px',
127
+ },
128
+ '&:disabled': {
129
+ opacity: 0.6,
130
+ cursor: 'not-allowed',
131
+ },
132
+ });
133
+ }
134
+ function createButtonBackgroundImage(background) {
135
+ return `linear-gradient(to bottom, ${createButtonHighlightColor(background, 0.18)} 0%, ${background} 100%)`;
136
+ }
137
+ function createButtonBorderColor(color) {
138
+ return `color-mix(in oklab, ${color} 74%, black)`;
139
+ }
140
+ function createButtonHighlight(background, amount = 0.16) {
141
+ return `inset 0 1px 0 ${createButtonHighlightColor(background, amount)}`;
142
+ }
143
+ function createButtonHighlightColor(background, amount) {
144
+ let alpha = Math.round(amount * 100);
145
+ return `color-mix(in oklab, white ${alpha}%, ${background})`;
146
+ }
147
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,qBAAqB;AACrB,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGtE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,MAAM,kBAAkB,GAAuB,GAAG,CAAC;IACjD,eAAe,EAAE,aAAa;IAC9B,eAAe,EAAE,MAAM;IACvB,KAAK,EAAE,KAA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Aa;SACtB;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,UAAkB;IACrD,OAAO,8BAA8B,0BAA0B,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,UAAU,QAAQ,CAAA;AAC7G,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,uBAAuB,KAAK,cAAc,CAAA;AACnD,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAkB,EAAE,MAAM,GAAG,IAAI;IAC9D,OAAO,iBAAiB,0BAA0B,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAA;AAC1E,CAAC;AAED,SAAS,0BAA0B,CAAC,UAAkB,EAAE,MAAc;IACpE,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;IACpC,OAAO,6BAA6B,KAAK,MAAM,UAAU,GAAG,CAAA;AAC9D,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { type CSSMixinDescriptor, type ElementProps, type Handle, type Props, type RemixNode } from '@remix-run/ui';
2
+ import * as listbox from '../listbox/listbox.ts';
3
+ import { type SearchValue } from '../../interactions/typeahead/typeahead-mixin.ts';
4
+ declare const COMBOBOX_CHANGE_EVENT: "rmx:combobox-change";
5
+ type ComboboxChangeHandler = (event: ComboboxChangeEvent, signal: AbortSignal) => void | Promise<void>;
6
+ type ShowReason = 'hint' | 'nav';
7
+ export declare const inputStyle: CSSMixinDescriptor;
8
+ export declare const popoverStyle: CSSMixinDescriptor;
9
+ declare global {
10
+ interface HTMLElementEventMap {
11
+ [COMBOBOX_CHANGE_EVENT]: ComboboxChangeEvent;
12
+ }
13
+ }
14
+ export declare class ComboboxChangeEvent extends Event {
15
+ readonly label: string | null;
16
+ readonly optionId: string | null;
17
+ readonly value: string | null;
18
+ constructor({ label, optionId, value, }: {
19
+ label: string | null;
20
+ optionId: string | null;
21
+ value: string | null;
22
+ });
23
+ }
24
+ export type ComboboxOpenStrategy = 'selected' | 'selected-or-none' | 'first' | 'last';
25
+ export interface ComboboxHandle {
26
+ readonly activeOptionId: string | null;
27
+ readonly id: string;
28
+ readonly inputText: string;
29
+ readonly isOpen: boolean;
30
+ readonly label: string | null;
31
+ readonly value: string | null;
32
+ close: () => void;
33
+ open: (strategy?: ComboboxOpenStrategy) => Promise<void>;
34
+ }
35
+ export interface ComboboxContextProps {
36
+ children?: RemixNode;
37
+ defaultValue?: string | null;
38
+ disabled?: boolean;
39
+ name?: string;
40
+ ref?: (handle: ComboboxHandle) => void;
41
+ }
42
+ export interface ComboboxProps extends Omit<Props<'div'>, 'children'> {
43
+ children?: RemixNode;
44
+ defaultValue?: string | null;
45
+ disabled?: boolean;
46
+ inputId?: string;
47
+ name?: string;
48
+ placeholder?: string;
49
+ }
50
+ export interface ComboboxOptionOptions {
51
+ disabled?: boolean;
52
+ label: string;
53
+ searchValue?: SearchValue;
54
+ value: string;
55
+ }
56
+ export interface ComboboxOptionProps extends Omit<Props<'div'>, 'children'> {
57
+ children?: RemixNode;
58
+ disabled?: boolean;
59
+ label: string;
60
+ searchValue?: SearchValue;
61
+ value: string;
62
+ }
63
+ interface ComboboxContextValue {
64
+ readonly activeId: string | undefined;
65
+ readonly disabled: boolean;
66
+ readonly filterText: string;
67
+ readonly inputText: string;
68
+ readonly isOpen: boolean;
69
+ readonly listId: string;
70
+ readonly name: string | undefined;
71
+ readonly showReason: ShowReason;
72
+ readonly surfaceVisible: boolean;
73
+ readonly value: listbox.ListboxValue;
74
+ clearInputSelection: () => void;
75
+ close: () => void;
76
+ handleBlur: () => void;
77
+ handleEscape: () => void;
78
+ navigateNext: () => void;
79
+ navigatePrevious: () => void;
80
+ open: (strategy?: ComboboxOpenStrategy) => Promise<void>;
81
+ openFromArrow: (direction: 'first' | 'last') => Promise<void>;
82
+ openFromInputActivation: () => Promise<void>;
83
+ registerInput: (node: HTMLInputElement) => void;
84
+ registerSurface: (node: HTMLElement) => void;
85
+ setInputText: (text: string) => Promise<void>;
86
+ syncPopoverMinWidth: () => void;
87
+ selectActive: () => Promise<void>;
88
+ unregisterInput: (node: HTMLInputElement) => void;
89
+ unregisterSurface: (node: HTMLElement) => void;
90
+ }
91
+ declare function ComboboxProvider(handle: Handle<ComboboxContextProps, ComboboxContextValue>): () => import("@remix-run/ui").RemixElement;
92
+ declare const popoverMixin: <boundNode extends HTMLElement = HTMLElement>() => import("@remix-run/ui").MixinDescriptor<boundNode, [], ElementProps>;
93
+ export declare const Context: typeof ComboboxProvider;
94
+ export declare const hiddenInput: <boundNode extends HTMLInputElement = HTMLInputElement>() => import("@remix-run/ui").MixinDescriptor<boundNode, [], ElementProps>;
95
+ export declare const input: <boundNode extends HTMLInputElement = HTMLInputElement>() => import("@remix-run/ui").MixinDescriptor<boundNode, [], ElementProps>;
96
+ export declare const list: <boundNode extends HTMLElement = HTMLElement>() => import("@remix-run/ui").MixinDescriptor<boundNode, [], ElementProps>;
97
+ export declare const option: <boundNode extends HTMLElement = HTMLElement>(options: ComboboxOptionOptions) => import("@remix-run/ui").MixinDescriptor<boundNode, [options: ComboboxOptionOptions], ElementProps>;
98
+ export { popoverMixin as popover };
99
+ export declare function onComboboxChange(handler: ComboboxChangeHandler, captureBoolean?: boolean): import("@remix-run/ui").MixinDescriptor<HTMLElement, ["rmx:combobox-change", (event: import("@remix-run/ui").Dispatched<ComboboxChangeEvent, HTMLElement>, signal: AbortSignal) => void | Promise<void>, (boolean | undefined)?], ElementProps>;
100
+ export declare function Combobox(handle: Handle<ComboboxProps>): () => import("@remix-run/ui").RemixElement;
101
+ export declare function ComboboxOption(handle: Handle<ComboboxOptionProps>): () => import("@remix-run/ui").RemixElement;