@pg-labs-incubator/cobweb 0.0.0-stage → 0.0.1

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 (320) hide show
  1. package/LICENSE +163 -0
  2. package/README.md +82 -2
  3. package/package.json +111 -3
  4. package/src/action/action.yaml +291 -0
  5. package/src/action/button-group.yaml +56 -0
  6. package/src/action/button.yaml +239 -0
  7. package/src/action/split-button.yaml +87 -0
  8. package/src/color/color.yaml +181 -0
  9. package/src/color/palette.yaml +147 -0
  10. package/src/container/card.yaml +170 -0
  11. package/src/container/corner-radius.yaml +50 -0
  12. package/src/container/elevation.yaml +19 -0
  13. package/src/design.yaml +41 -0
  14. package/src/feedback/feedback.yaml +225 -0
  15. package/src/icon/icon-font.yaml +28 -0
  16. package/src/icon/icon.yaml +31 -0
  17. package/src/input/date-picker.yaml +144 -0
  18. package/src/input/date-range-input.yaml +162 -0
  19. package/src/input/range-slider.yaml +161 -0
  20. package/src/input/select.yaml +230 -0
  21. package/src/input/slider.yaml +172 -0
  22. package/src/input/text-field.yaml +240 -0
  23. package/src/input/time-picker.yaml +220 -0
  24. package/src/motion/motion.yaml +371 -0
  25. package/src/navigation/app-bar.yaml +147 -0
  26. package/src/navigation/navigation.yaml +339 -0
  27. package/src/navigation/scroll.yaml +23 -0
  28. package/src/navigation/search.yaml +112 -0
  29. package/src/navigation/tabs.yaml +144 -0
  30. package/src/navigation/toolbar.yaml +130 -0
  31. package/src/selection/checkbox.yaml +162 -0
  32. package/src/selection/chip.yaml +219 -0
  33. package/src/selection/radio.yaml +125 -0
  34. package/src/selection/segmented-group.yaml +11 -0
  35. package/src/selection/segmented.yaml +69 -0
  36. package/src/selection/switch.yaml +209 -0
  37. package/src/spacing/measurement.yaml +80 -0
  38. package/src/state/state.yaml +38 -0
  39. package/src/surface/surface.yaml +483 -0
  40. package/src/text/line-height.yaml +144 -0
  41. package/src/text/typeface.yaml +31 -0
  42. package/src/text/typescale.yaml +726 -0
  43. package/target/esbuild/action/action.css +1 -0
  44. package/target/esbuild/action/base.jsx +1 -0
  45. package/target/esbuild/action/button.jsx +17 -0
  46. package/target/esbuild/action/fab-menu-context.jsx +1 -0
  47. package/target/esbuild/action/fab-menu.jsx +15 -0
  48. package/target/esbuild/action/fab.jsx +7 -0
  49. package/target/esbuild/action/group.jsx +22 -0
  50. package/target/esbuild/action/icon-button.jsx +5 -0
  51. package/target/esbuild/action/index.jsx +1 -0
  52. package/target/esbuild/action/split-button.jsx +12 -0
  53. package/target/esbuild/color/contrast.jsx +1 -0
  54. package/target/esbuild/color/dynamic.jsx +1 -0
  55. package/target/esbuild/color/hct.jsx +1 -0
  56. package/target/esbuild/color/index.css +1 -0
  57. package/target/esbuild/color/index.jsx +1 -0
  58. package/target/esbuild/color/palette.jsx +1 -0
  59. package/target/esbuild/color/scheme.jsx +1 -0
  60. package/target/esbuild/color/temperature.jsx +1 -0
  61. package/target/esbuild/container/card.css +1 -0
  62. package/target/esbuild/container/card.jsx +1 -0
  63. package/target/esbuild/container/elevation-shadow.css +1 -0
  64. package/target/esbuild/container/elevation-shadow.jsx +1 -0
  65. package/target/esbuild/container/index.jsx +1 -0
  66. package/target/esbuild/dom/client.jsx +1 -0
  67. package/target/esbuild/dom/index.jsx +1 -0
  68. package/target/esbuild/dom/server.jsx +1 -0
  69. package/target/esbuild/dom/types.jsx +1 -0
  70. package/target/esbuild/feedback/badge.jsx +15 -0
  71. package/target/esbuild/feedback/feedback.css +1 -0
  72. package/target/esbuild/feedback/focus.jsx +1 -0
  73. package/target/esbuild/feedback/index.jsx +1 -0
  74. package/target/esbuild/feedback/loading.jsx +7 -0
  75. package/target/esbuild/feedback/observe.jsx +1 -0
  76. package/target/esbuild/feedback/progress.jsx +35 -0
  77. package/target/esbuild/feedback/snackbar.jsx +23 -0
  78. package/target/esbuild/feedback/tooltip.jsx +24 -0
  79. package/target/esbuild/icon/icon.css +1 -0
  80. package/target/esbuild/icon/icon.jsx +1 -0
  81. package/target/esbuild/icon/index.jsx +1 -0
  82. package/target/esbuild/index.css +1 -0
  83. package/target/esbuild/index.jsx +1 -0
  84. package/target/esbuild/input/autocomplete.jsx +5 -0
  85. package/target/esbuild/input/base.jsx +4 -0
  86. package/target/esbuild/input/date-picker.css +1 -0
  87. package/target/esbuild/input/date-picker.jsx +104 -0
  88. package/target/esbuild/input/date-range-input.css +1 -0
  89. package/target/esbuild/input/date-time.jsx +21 -0
  90. package/target/esbuild/input/index.css +1 -0
  91. package/target/esbuild/input/index.jsx +1 -0
  92. package/target/esbuild/input/paired-input.jsx +1 -0
  93. package/target/esbuild/input/picker-dialog.css +1 -0
  94. package/target/esbuild/input/picker-dialog.jsx +14 -0
  95. package/target/esbuild/input/select.css +1 -0
  96. package/target/esbuild/input/select.jsx +63 -0
  97. package/target/esbuild/input/slider.css +1 -0
  98. package/target/esbuild/input/slider.jsx +51 -0
  99. package/target/esbuild/input/text-field.css +1 -0
  100. package/target/esbuild/input/text-field.jsx +67 -0
  101. package/target/esbuild/input/time-picker.css +1 -0
  102. package/target/esbuild/input/time-picker.jsx +29 -0
  103. package/target/esbuild/motion/frame.jsx +1 -0
  104. package/target/esbuild/motion/index.css +1 -0
  105. package/target/esbuild/motion/index.jsx +1 -0
  106. package/target/esbuild/motion/material.jsx +1 -0
  107. package/target/esbuild/motion/motion.jsx +1 -0
  108. package/target/esbuild/motion/spring.jsx +1 -0
  109. package/target/esbuild/motion/transition.css +1 -0
  110. package/target/esbuild/motion/transition.jsx +1 -0
  111. package/target/esbuild/motion/velocity.jsx +1 -0
  112. package/target/esbuild/navigation/app-bar.jsx +51 -0
  113. package/target/esbuild/navigation/base.jsx +1 -0
  114. package/target/esbuild/navigation/drawer.jsx +25 -0
  115. package/target/esbuild/navigation/index.jsx +1 -0
  116. package/target/esbuild/navigation/navigation.css +1 -0
  117. package/target/esbuild/navigation/navigation.jsx +29 -0
  118. package/target/esbuild/navigation/scroll.jsx +1 -0
  119. package/target/esbuild/navigation/search.jsx +29 -0
  120. package/target/esbuild/navigation/tabs.jsx +7 -0
  121. package/target/esbuild/navigation/toolbar.jsx +23 -0
  122. package/target/esbuild/selection/base.jsx +1 -0
  123. package/target/esbuild/selection/checkbox.jsx +14 -0
  124. package/target/esbuild/selection/chip.jsx +23 -0
  125. package/target/esbuild/selection/index.jsx +1 -0
  126. package/target/esbuild/selection/radio.jsx +9 -0
  127. package/target/esbuild/selection/segmented.jsx +15 -0
  128. package/target/esbuild/selection/selection.css +1 -0
  129. package/target/esbuild/selection/switch.jsx +14 -0
  130. package/target/esbuild/shape/corner-rounding.jsx +1 -0
  131. package/target/esbuild/shape/cubic.jsx +1 -0
  132. package/target/esbuild/shape/index.jsx +1 -0
  133. package/target/esbuild/shape/material-shapes.jsx +1 -0
  134. package/target/esbuild/shape/morph.jsx +1 -0
  135. package/target/esbuild/shape/path.jsx +1 -0
  136. package/target/esbuild/shape/point.jsx +1 -0
  137. package/target/esbuild/shape/rounded-polygon.jsx +1 -0
  138. package/target/esbuild/shape/shapes.jsx +1 -0
  139. package/target/esbuild/spacing/index.jsx +1 -0
  140. package/target/esbuild/state/component.css +1 -0
  141. package/target/esbuild/state/component.jsx +1 -0
  142. package/target/esbuild/state/controller.jsx +1 -0
  143. package/target/esbuild/state/index.jsx +1 -0
  144. package/target/esbuild/state/ripple.jsx +1 -0
  145. package/target/esbuild/state/state.jsx +1 -0
  146. package/target/esbuild/state/style.jsx +1 -0
  147. package/target/esbuild/surface/carousel-layout.jsx +1 -0
  148. package/target/esbuild/surface/carousel.css +1 -0
  149. package/target/esbuild/surface/carousel.jsx +10 -0
  150. package/target/esbuild/surface/dialog.jsx +35 -0
  151. package/target/esbuild/surface/divider.jsx +1 -0
  152. package/target/esbuild/surface/drag.jsx +1 -0
  153. package/target/esbuild/surface/gestures.css +1 -0
  154. package/target/esbuild/surface/gestures.jsx +7 -0
  155. package/target/esbuild/surface/index.css +1 -0
  156. package/target/esbuild/surface/index.jsx +1 -0
  157. package/target/esbuild/surface/interactive.jsx +1 -0
  158. package/target/esbuild/surface/list-patterns.jsx +26 -0
  159. package/target/esbuild/surface/list.css +1 -0
  160. package/target/esbuild/surface/list.jsx +9 -0
  161. package/target/esbuild/surface/menu.css +1 -0
  162. package/target/esbuild/surface/menu.jsx +12 -0
  163. package/target/esbuild/surface/scaffold.jsx +47 -0
  164. package/target/esbuild/surface/sheet.jsx +21 -0
  165. package/target/esbuild/surface/side-sheet.jsx +17 -0
  166. package/target/esbuild/surface/slots.jsx +1 -0
  167. package/target/esbuild/surface/surface.css +1 -0
  168. package/target/esbuild/surface/surface.jsx +1 -0
  169. package/target/esbuild/text/index.css +1 -0
  170. package/target/esbuild/text/index.jsx +1 -0
  171. package/target/esbuild/text/text.css +1 -0
  172. package/target/esbuild/text/text.jsx +3 -0
  173. package/target/esbuild/text/typography.css +1 -0
  174. package/target/esbuild/text/typography.jsx +1 -0
  175. package/target/esbuild/util/box-side.jsx +1 -0
  176. package/target/esbuild/util/debug.jsx +1 -0
  177. package/target/esbuild/util/dom.jsx +1 -0
  178. package/target/esbuild/util/event.jsx +1 -0
  179. package/target/esbuild/util/index.jsx +1 -0
  180. package/target/esbuild/util/preconditions.jsx +1 -0
  181. package/target/esbuild/util/reactive.jsx +1 -0
  182. package/target/tsc/action/action.css.d.ts +3 -0
  183. package/target/tsc/action/base.d.ts +211 -0
  184. package/target/tsc/action/button.d.ts +126 -0
  185. package/target/tsc/action/fab-menu-context.d.ts +16 -0
  186. package/target/tsc/action/fab-menu.d.ts +112 -0
  187. package/target/tsc/action/fab.d.ts +98 -0
  188. package/target/tsc/action/group.d.ts +166 -0
  189. package/target/tsc/action/icon-button.d.ts +79 -0
  190. package/target/tsc/action/index.d.ts +24 -0
  191. package/target/tsc/action/split-button.d.ts +78 -0
  192. package/target/tsc/color/contrast.d.ts +48 -0
  193. package/target/tsc/color/dynamic.d.ts +203 -0
  194. package/target/tsc/color/hct.d.ts +114 -0
  195. package/target/tsc/color/index.css.d.ts +3 -0
  196. package/target/tsc/color/index.d.ts +23 -0
  197. package/target/tsc/color/palette.d.ts +30 -0
  198. package/target/tsc/color/scheme.d.ts +446 -0
  199. package/target/tsc/color/temperature.d.ts +24 -0
  200. package/target/tsc/container/card.css.d.ts +3 -0
  201. package/target/tsc/container/card.d.ts +110 -0
  202. package/target/tsc/container/elevation-shadow.css.d.ts +3 -0
  203. package/target/tsc/container/elevation-shadow.d.ts +23 -0
  204. package/target/tsc/container/index.d.ts +44 -0
  205. package/target/tsc/dom/client.d.ts +387 -0
  206. package/target/tsc/dom/index.d.ts +93 -0
  207. package/target/tsc/dom/server.d.ts +65 -0
  208. package/target/tsc/dom/types.d.ts +134 -0
  209. package/target/tsc/feedback/badge.d.ts +116 -0
  210. package/target/tsc/feedback/feedback.css.d.ts +3 -0
  211. package/target/tsc/feedback/focus.d.ts +20 -0
  212. package/target/tsc/feedback/index.d.ts +17 -0
  213. package/target/tsc/feedback/loading.d.ts +194 -0
  214. package/target/tsc/feedback/observe.d.ts +75 -0
  215. package/target/tsc/feedback/progress.d.ts +281 -0
  216. package/target/tsc/feedback/snackbar.d.ts +398 -0
  217. package/target/tsc/feedback/tooltip.d.ts +326 -0
  218. package/target/tsc/icon/icon.css.d.ts +3 -0
  219. package/target/tsc/icon/icon.d.ts +69 -0
  220. package/target/tsc/icon/index.d.ts +13 -0
  221. package/target/tsc/index.css.d.ts +3 -0
  222. package/target/tsc/index.d.ts +7 -0
  223. package/target/tsc/input/autocomplete.d.ts +119 -0
  224. package/target/tsc/input/base.d.ts +282 -0
  225. package/target/tsc/input/date-picker.css.d.ts +3 -0
  226. package/target/tsc/input/date-picker.d.ts +351 -0
  227. package/target/tsc/input/date-range-input.css.d.ts +3 -0
  228. package/target/tsc/input/date-time.d.ts +171 -0
  229. package/target/tsc/input/index.css.d.ts +3 -0
  230. package/target/tsc/input/index.d.ts +27 -0
  231. package/target/tsc/input/paired-input.d.ts +435 -0
  232. package/target/tsc/input/picker-dialog.css.d.ts +3 -0
  233. package/target/tsc/input/picker-dialog.d.ts +84 -0
  234. package/target/tsc/input/select.css.d.ts +3 -0
  235. package/target/tsc/input/select.d.ts +267 -0
  236. package/target/tsc/input/slider.css.d.ts +3 -0
  237. package/target/tsc/input/slider.d.ts +372 -0
  238. package/target/tsc/input/text-field.css.d.ts +3 -0
  239. package/target/tsc/input/text-field.d.ts +415 -0
  240. package/target/tsc/input/time-picker.css.d.ts +3 -0
  241. package/target/tsc/input/time-picker.d.ts +212 -0
  242. package/target/tsc/motion/frame.d.ts +36 -0
  243. package/target/tsc/motion/index.css.d.ts +3 -0
  244. package/target/tsc/motion/index.d.ts +34 -0
  245. package/target/tsc/motion/material.d.ts +110 -0
  246. package/target/tsc/motion/motion.d.ts +235 -0
  247. package/target/tsc/motion/spring.d.ts +223 -0
  248. package/target/tsc/motion/transition.css.d.ts +3 -0
  249. package/target/tsc/motion/transition.d.ts +597 -0
  250. package/target/tsc/motion/velocity.d.ts +54 -0
  251. package/target/tsc/navigation/app-bar.d.ts +473 -0
  252. package/target/tsc/navigation/base.d.ts +320 -0
  253. package/target/tsc/navigation/drawer.d.ts +301 -0
  254. package/target/tsc/navigation/index.d.ts +25 -0
  255. package/target/tsc/navigation/navigation.css.d.ts +3 -0
  256. package/target/tsc/navigation/navigation.d.ts +537 -0
  257. package/target/tsc/navigation/scroll.d.ts +218 -0
  258. package/target/tsc/navigation/search.d.ts +332 -0
  259. package/target/tsc/navigation/tabs.d.ts +497 -0
  260. package/target/tsc/navigation/toolbar.d.ts +248 -0
  261. package/target/tsc/selection/base.d.ts +100 -0
  262. package/target/tsc/selection/checkbox.d.ts +194 -0
  263. package/target/tsc/selection/chip.d.ts +358 -0
  264. package/target/tsc/selection/index.d.ts +21 -0
  265. package/target/tsc/selection/radio.d.ts +198 -0
  266. package/target/tsc/selection/segmented.d.ts +333 -0
  267. package/target/tsc/selection/selection.css.d.ts +3 -0
  268. package/target/tsc/selection/switch.d.ts +165 -0
  269. package/target/tsc/shape/corner-rounding.d.ts +36 -0
  270. package/target/tsc/shape/cubic.d.ts +215 -0
  271. package/target/tsc/shape/index.d.ts +35 -0
  272. package/target/tsc/shape/material-shapes.d.ts +176 -0
  273. package/target/tsc/shape/morph.d.ts +91 -0
  274. package/target/tsc/shape/path.d.ts +177 -0
  275. package/target/tsc/shape/point.d.ts +165 -0
  276. package/target/tsc/shape/rounded-polygon.d.ts +289 -0
  277. package/target/tsc/shape/shapes.d.ts +76 -0
  278. package/target/tsc/spacing/index.d.ts +19 -0
  279. package/target/tsc/state/component.css.d.ts +3 -0
  280. package/target/tsc/state/component.d.ts +276 -0
  281. package/target/tsc/state/controller.d.ts +257 -0
  282. package/target/tsc/state/index.d.ts +19 -0
  283. package/target/tsc/state/ripple.d.ts +50 -0
  284. package/target/tsc/state/state.d.ts +129 -0
  285. package/target/tsc/state/style.d.ts +22 -0
  286. package/target/tsc/surface/carousel-layout.d.ts +212 -0
  287. package/target/tsc/surface/carousel.css.d.ts +3 -0
  288. package/target/tsc/surface/carousel.d.ts +231 -0
  289. package/target/tsc/surface/dialog.d.ts +580 -0
  290. package/target/tsc/surface/divider.d.ts +92 -0
  291. package/target/tsc/surface/drag.d.ts +92 -0
  292. package/target/tsc/surface/gestures.css.d.ts +3 -0
  293. package/target/tsc/surface/gestures.d.ts +292 -0
  294. package/target/tsc/surface/index.css.d.ts +3 -0
  295. package/target/tsc/surface/index.d.ts +29 -0
  296. package/target/tsc/surface/interactive.d.ts +22 -0
  297. package/target/tsc/surface/list-patterns.d.ts +384 -0
  298. package/target/tsc/surface/list.css.d.ts +3 -0
  299. package/target/tsc/surface/list.d.ts +340 -0
  300. package/target/tsc/surface/menu.css.d.ts +3 -0
  301. package/target/tsc/surface/menu.d.ts +590 -0
  302. package/target/tsc/surface/scaffold.d.ts +337 -0
  303. package/target/tsc/surface/sheet.d.ts +384 -0
  304. package/target/tsc/surface/side-sheet.d.ts +183 -0
  305. package/target/tsc/surface/slots.d.ts +21 -0
  306. package/target/tsc/surface/surface.css.d.ts +3 -0
  307. package/target/tsc/surface/surface.d.ts +192 -0
  308. package/target/tsc/text/index.css.d.ts +3 -0
  309. package/target/tsc/text/index.d.ts +18 -0
  310. package/target/tsc/text/text.css.d.ts +3 -0
  311. package/target/tsc/text/text.d.ts +94 -0
  312. package/target/tsc/text/typography.css.d.ts +3 -0
  313. package/target/tsc/text/typography.d.ts +82 -0
  314. package/target/tsc/util/box-side.d.ts +76 -0
  315. package/target/tsc/util/debug.d.ts +20 -0
  316. package/target/tsc/util/dom.d.ts +35 -0
  317. package/target/tsc/util/event.d.ts +93 -0
  318. package/target/tsc/util/index.d.ts +12 -0
  319. package/target/tsc/util/preconditions.d.ts +79 -0
  320. package/target/tsc/util/reactive.d.ts +36 -0
@@ -0,0 +1 @@
1
+ @layer cw-style{.cw-Text{contain:content;pointer-events:none;touch-action:none;user-select:none}._cw-Text-body,._cw-Text-body-large{-cw-typescale:--cw-Typescale-body-large}._cw-Text-body-medium{-cw-typescale:--cw-Typescale-body-medium}._cw-Text-body-small{-cw-typescale:--cw-Typescale-body-small}._cw-Text-body-large-emphasized{-cw-typescale:--cw-Typescale-body-large-emphasized}._cw-Text-body-medium-emphasized{-cw-typescale:--cw-Typescale-body-medium-emphasized}._cw-Text-body-small-emphasized{-cw-typescale:--cw-Typescale-body-small-emphasized}._cw-Text-display,._cw-Text-display-large{-cw-typescale:--cw-Typescale-display-large}._cw-Text-display-medium{-cw-typescale:--cw-Typescale-display-medium}._cw-Text-display-small{-cw-typescale:--cw-Typescale-display-small}._cw-Text-display-large-emphasized{-cw-typescale:--cw-Typescale-display-large-emphasized}._cw-Text-display-medium-emphasized{-cw-typescale:--cw-Typescale-display-medium-emphasized}._cw-Text-display-small-emphasized{-cw-typescale:--cw-Typescale-display-small-emphasized}._cw-Text-headline,._cw-Text-headline-large{-cw-typescale:--cw-Typescale-headline-large}._cw-Text-headline-medium{-cw-typescale:--cw-Typescale-headline-medium}._cw-Text-headline-small{-cw-typescale:--cw-Typescale-headline-small}._cw-Text-headline-large-emphasized{-cw-typescale:--cw-Typescale-headline-large-emphasized}._cw-Text-headline-medium-emphasized{-cw-typescale:--cw-Typescale-headline-medium-emphasized}._cw-Text-headline-small-emphasized{-cw-typescale:--cw-Typescale-headline-small-emphasized}._cw-Text-label,._cw-Text-label-large{-cw-typescale:--cw-Typescale-label-large}._cw-Text-label-medium{-cw-typescale:--cw-Typescale-label-medium}._cw-Text-label-small{-cw-typescale:--cw-Typescale-label-small}._cw-Text-label-large-emphasized{-cw-typescale:--cw-Typescale-label-large-emphasized}._cw-Text-label-medium-emphasized{-cw-typescale:--cw-Typescale-label-medium-emphasized}._cw-Text-label-small-emphasized{-cw-typescale:--cw-Typescale-label-small-emphasized}._cw-Text-title,._cw-Text-title-large{-cw-typescale:--cw-Typescale-title-large}._cw-Text-title-medium{-cw-typescale:--cw-Typescale-title-medium}._cw-Text-title-small{-cw-typescale:--cw-Typescale-title-small}._cw-Text-title-large-emphasized{-cw-typescale:--cw-Typescale-title-large-emphasized}._cw-Text-title-medium-emphasized{-cw-typescale:--cw-Typescale-title-medium-emphasized}._cw-Text-title-small-emphasized{-cw-typescale:--cw-Typescale-title-small-emphasized}}
@@ -0,0 +1,3 @@
1
+ import{defineDomComponent as a}from"..";import"./text.css";function s(e){return`_cw-Text-${e??"body-large"}`}const i=a(()=>(e,t)=><span{...e}classList={{...e.classList,[s(t.scale)]:!0,"cw-Text":!0}}>
2
+ {t.value??""}
3
+ </span>,e=>class extends e{constructor(t){super(t,{styleElementIsFunction:!0})}applyComponentProps(){const[t,o]=super.readProp("scale");o&&super.setClass("scale",s(t));const[p,r]=super.readProp("value");r&&(super.styleElement.textContent=p??"")}render(){return<span class="cw-Text"/>}});export{i as Text};
@@ -0,0 +1 @@
1
+ @layer cw-style{._cw-Typography-auto{--_CW-TYPOGRAPHY-EXPLICIT_CATEGORY: initial}._cw-Typography-small{--_CW-TYPOGRAPHY-EXPLICIT_CATEGORY: 0}._cw-Typography-medium{--_CW-TYPOGRAPHY-EXPLICIT_CATEGORY: 1}._cw-Typography-large{--_CW-TYPOGRAPHY-EXPLICIT_CATEGORY: 2}._cw-Typography-extraLarge{--_CW-TYPOGRAPHY-EXPLICIT_CATEGORY: 3}:where([lang]){--_CW-TYPOGRAPHY-SCRIPT_CATEGORY: initial}:where([lang*=-Cyrl i],[lang*=-Grek i],[lang*=-Hebr i],[lang*=-Latn i]:not(:lang(vi))){--_CW-TYPOGRAPHY-SCRIPT_CATEGORY: 0}:where([lang*=-Arab i],[lang*=-Beng i],[lang*=-Deva i],[lang*=-Ethi i],[lang*=-Gujr i],[lang*=-Guru i],[lang*=-Hang i],[lang*=-Hani i],[lang*=-Hans i],[lang*=-Hant i],[lang*=-Hira i],[lang*=-Hrkt i],[lang*=-Jpan i],[lang*=-Kana i],[lang*=-Khmr i],[lang*=-Knda i],[lang*=-Kore i],[lang*=-Laoo i],[lang*=-Mlym i],[lang*=-Orya i],[lang*=-Sinh i],[lang*=-Taml i],[lang*=-Thai i],[lang*=-Tibt i]){--_CW-TYPOGRAPHY-SCRIPT_CATEGORY: 1}:where([lang*=-Mymr i],[lang*=-Telu i]){--_CW-TYPOGRAPHY-SCRIPT_CATEGORY: 2}:where(.cw-Typography,.cw-Typography [lang]):lang(am,ar,as,bho,bn,bo,brx,ckb,doi,dz,fa,gu,hi,ja,km,kn,ko,kok,ks,lo,mai,ml,mni,mr,ne,or,pa,prs,ps,sa,sd,si,ta,th,ti,ug,ur,vi,yue,zh){--_CW-TYPOGRAPHY-LANGUAGE_CATEGORY: 1}:where(.cw-Typography,.cw-Typography [lang]):lang(my,te){--_CW-TYPOGRAPHY-LANGUAGE_CATEGORY: 2}:where(.cw-Typography,.cw-Typography [lang]){--_CW-TYPOGRAPHY-CATEGORY: var( --_CW-TYPOGRAPHY-EXPLICIT_CATEGORY, var(--_CW-TYPOGRAPHY-SCRIPT_CATEGORY, var(--_CW-TYPOGRAPHY-LANGUAGE_CATEGORY)) );--_CW-TYPOGRAPHY-LANGUAGE_CATEGORY: 0;--_CW-TYPOGRAPHY-W0: clamp(0, 1 - var(--_CW-TYPOGRAPHY-CATEGORY), 1);--_CW-TYPOGRAPHY-W1: clamp( 0, 1 - max(var(--_CW-TYPOGRAPHY-CATEGORY) - 1, 1 - var(--_CW-TYPOGRAPHY-CATEGORY)), 1 );--_CW-TYPOGRAPHY-W2: clamp( 0, 1 - max(var(--_CW-TYPOGRAPHY-CATEGORY) - 2, 2 - var(--_CW-TYPOGRAPHY-CATEGORY)), 1 );--_CW-TYPOGRAPHY-W3: clamp(0, var(--_CW-TYPOGRAPHY-CATEGORY) - 2, 1);--cw-LineHeight-body-large: calc( cw-var(--cw-LineHeight-body-large, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--body-large) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--body-large) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--body-large) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-body-medium: calc( cw-var(--cw-LineHeight-body-medium, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--body-medium) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--body-medium) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--body-medium) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-body-small: calc( cw-var(--cw-LineHeight-body-small, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--body-small) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--body-small) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--body-small) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-display-large: calc( cw-var(--cw-LineHeight-display-large, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--display-large) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--display-large) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--display-large) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-display-medium: calc( cw-var(--cw-LineHeight-display-medium, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--display-medium) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--display-medium) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--display-medium) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-display-small: calc( cw-var(--cw-LineHeight-display-small, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--display-small) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--display-small) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--display-small) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-headline-large: calc( cw-var(--cw-LineHeight-headline-large, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--headline-large) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--headline-large) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--headline-large) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-headline-medium: calc( cw-var(--cw-LineHeight-headline-medium, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--headline-medium) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--headline-medium) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--headline-medium) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-headline-small: calc( cw-var(--cw-LineHeight-headline-small, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--headline-small) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--headline-small) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--headline-small) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-label-large: calc( cw-var(--cw-LineHeight-label-large, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--label-large) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--label-large) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--label-large) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-label-medium: calc( cw-var(--cw-LineHeight-label-medium, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--label-medium) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--label-medium) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--label-medium) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-label-small: calc( cw-var(--cw-LineHeight-label-small, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--label-small) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--label-small) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--label-small) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-title-large: calc( cw-var(--cw-LineHeight-title-large, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--title-large) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--title-large) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--title-large) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-title-medium: calc( cw-var(--cw-LineHeight-title-medium, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--title-medium) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--title-medium) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--title-medium) * var(--_CW-TYPOGRAPHY-W3) );--cw-LineHeight-title-small: calc( cw-var(--cw-LineHeight-title-small, default) * var(--_CW-TYPOGRAPHY-W0) + cw-var(--cw-LineHeight-theme-medium--title-small) * var(--_CW-TYPOGRAPHY-W1) + cw-var(--cw-LineHeight-theme-large--title-small) * var(--_CW-TYPOGRAPHY-W2) + cw-var(--cw-LineHeight-theme-extraLarge--title-small) * var(--_CW-TYPOGRAPHY-W3) )}}
@@ -0,0 +1 @@
1
+ import{insert as p}from"solid-js/web";import{defineDomComponent as s}from"..";import"./typography.css";function r(o){return`_cw-Typography-${o??"auto"}`}const h=s(()=>(o,e)=><div{...o}classList={{...o.classList,[r(e.height)]:!0,"cw-Typography":!0}}/>,o=>class extends o{constructor(e){super(e,{styleElementIsFunction:!0})}applyComponentProps(){const[e,t]=super.readProp("height");t&&super.setClass("height",r(e))}render(e){const t=<div class="cw-Typography"/>;return p(t,e),t}});export{h as Typography};
@@ -0,0 +1 @@
1
+ import{isServer as a}from"solid-js/web";const e=0,r=1,o=2,i=3;function B(l){return l===i||l===r?0:1}function d(l,x){const n=a?null:l.ownerDocument.defaultView;if(n===null)return[e,r,o,i];const s=n.getComputedStyle(l,x??null),c=s.getPropertyValue("writing-mode"),t=s.getPropertyValue("direction")==="rtl";switch(c){case"sideways-rl":case"tb":case"tb-rl":case"vertical-rl":return[r,t?e:o,i,t?o:e];case"tb-lr":case"vertical-lr":return[i,t?e:o,r,t?o:e];case"sideways-lr":return[i,t?o:e,r,t?e:o];case"horizontal-tb":default:return[e,t?i:r,o,t?r:i]}}export{o as BoxBottom,i as BoxLeft,r as BoxRight,e as BoxTop,B as axisOfBoxSide,d as logicalBoxSidesOf};
@@ -0,0 +1 @@
1
+ import{DEV as e}from"solid-js";function r(n,o){if(e&&(typeof n=="function"&&(n=n()),!n))throw new Error(o===void 0?"assertion failed":`assertion failed: ${o}`)}function t(n,...o){e&&console.log(n,...o)}export{r as assertDebug,t as printDebug};
@@ -0,0 +1 @@
1
+ const i=new Map([["contenteditable",["true","false"]],["draggable",["true","false"]],["spellcheck",["true","false"]],["translate",["yes","no"]]]);function o(e,t){return t==null?null:typeof t!="boolean"||e.startsWith("aria-")?t.toString():i.get(e)?.[t?0:1]??(t?"":null)}function s(e,t,n){const r=n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"?o(t,n):void 0;r===null?e.removeAttribute(t):r!==void 0&&e.setAttribute(t,r)}export{o as attributeValueOf,s as setAttribute};
@@ -0,0 +1 @@
1
+ import{isServer as d}from"solid-js/web";import{printDebug as l}from"./debug";const i=["stopPropagation","stopImmediatePropagation"],a=new WeakMap,u=!d&&(()=>{let t=!1;const e={get passive(){return t=!0,!1}},o=()=>{};try{try{window.addEventListener("test",o,e)}finally{window.removeEventListener("test",o,e)}return l(`passive event listeners are${t?"":" not"} supported`),t}catch(n){return l("passive event listeners are not supported",n),!1}})();function h(t,e){return u?t:t.capture??!1}function c(t){for(const e of t.composedPath())if(e.nodeType===Node.DOCUMENT_NODE)return e;return null}function f(t,e){const o=i.map(n=>Object.getOwnPropertyDescriptor(t,n));for(const n of i){const r=t[n];Object.defineProperty(t,n,{configurable:!0,writable:!0,value(){r.call(this),e()}})}return()=>i.forEach((n,r)=>{const s=o[r];s===void 0?Reflect.deleteProperty(t,n):Object.defineProperty(t,n,s)})}class p{#i;#e;#t;#n;#o;#r;#a;#l;#s;constructor(e){const o=e.bubbles&&!e.cancelBubble?c(e):null,n=()=>this.#d();this.#i=e,this.#e=[],this.#t=o,this.#n=o?.defaultView??null,this.#o=r=>{r===e&&e.cancelBubble&&n()},this.#r=r=>{r===e&&n()},this.#a=o===null?null:f(e,()=>queueMicrotask(n)),this.#l=o!==null&&e.isTrusted?setTimeout(n,0):void 0,this.#s=!1,this.#t?.addEventListener(e.type,this.#o),this.#n?.addEventListener(e.type,this.#r),(o===null||!e.isTrusted)&&queueMicrotask(n)}request(e,o){this.#e.push({action:e,preventDefault:o})}#d(){const e=this.#i,o=e.eventPhase!==Event.NONE;let n=e.defaultPrevented;if(!this.#s){this.#s=!0,a.delete(e),this.#t?.removeEventListener(e.type,this.#o),this.#n?.removeEventListener(e.type,this.#r),this.#a?.(),clearTimeout(this.#l);for(const{action:r,preventDefault:s}of this.#e){if(n)return;s&&(n=!0,o&&e.preventDefault()),queueMicrotask(r)}}}}function y(t,e,o,n=!0){let r=a.get(t);t.defaultPrevented||(r===void 0&&(r=new p(t),a.set(t,r)),r.request(o,n))}function m(t,e){const o=t.relatedTarget;return o?.nodeType===Node.ELEMENT_NODE&&e.contains(o)}export{u as HAS_PASSIVE_EVENT_LISTENERS,y as deferAfterDelegatedCancellation,h as eventListenerOptionsOf,m as isLeaveWithin};
@@ -0,0 +1 @@
1
+ import{BoxBottom as t,BoxLeft as r,BoxRight as c,BoxTop as i,axisOfBoxSide as x,logicalBoxSidesOf as f}from"./box-side";import{assertDebug as p,printDebug as s}from"./debug";import{attributeValueOf as h,setAttribute as m}from"./dom";import{HAS_PASSIVE_EVENT_LISTENERS as B,deferAfterDelegatedCancellation as k,eventListenerOptionsOf as l}from"./event";import{checkArgument as d,checkArray as g,checkBoolean as b,checkBrowser as A,checkNumber as O,checkObject as E,checkServer as D,checkState as L,checkString as V,checkValueDefined as v}from"./preconditions";import{consumeProps as P,isPropReactive as R}from"./reactive";export{t as BoxBottom,r as BoxLeft,c as BoxRight,i as BoxTop,B as HAS_PASSIVE_EVENT_LISTENERS,p as assertDebug,h as attributeValueOf,x as axisOfBoxSide,d as checkArgument,g as checkArray,b as checkBoolean,A as checkBrowser,O as checkNumber,E as checkObject,D as checkServer,L as checkState,V as checkString,v as checkValueDefined,P as consumeProps,k as deferAfterDelegatedCancellation,l as eventListenerOptionsOf,R as isPropReactive,f as logicalBoxSidesOf,s as printDebug,m as setAttribute};
@@ -0,0 +1 @@
1
+ import{isServer as t}from"solid-js/web";function i(n,e){if(!n)throw new Error(e===void 0?"invalid state":`invalid state: ${e}`)}function a(){i(!t,"expected browser environment")}function c(){i(t,"expected server environment")}function u(n,e){if(!n)throw new Error(e===void 0?"invalid argument":`invalid argument: ${e}`)}function l(n,e){if(n==null)throw new ReferenceError(`${e??"value"} is 'null' or 'undefined'`)}function r(n,e,o){if(typeof e!==n)throw new TypeError(`${o??"value"} is not a ${n}`)}function f(n,e){r("boolean",n,e)}function v(n,e){r("number",n,e)}function d(n,e){r("string",n,e)}function w(n,e){r("object",n,e)}function k(n,e){if(!Array.isArray(n))throw new TypeError(`${e??"value"} is not an array`)}export{u as checkArgument,k as checkArray,f as checkBoolean,a as checkBrowser,v as checkNumber,w as checkObject,c as checkServer,i as checkState,d as checkString,l as checkValueDefined};
@@ -0,0 +1 @@
1
+ import{$PROXY as i,untrack as c}from"solid-js";function u(e,t){return i in e||Object.getOwnPropertyDescriptor(e,t)?.get!==void 0}function d(e,t,P){const r={};if(!(i in e))for(const n of t){const o=Object.getOwnPropertyDescriptor(e,n);o?.get===void 0&&(r[n]=o?.value)}return P!==void 0&&P.length>0&&c(()=>{for(const n of P)r[n]=e[n]}),r}export{d as consumeProps,u as isPropReactive};
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};
@@ -0,0 +1,211 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomProps, FunctionElement } from "..";
3
+ import type { InteractableProps } from "../state";
4
+ import { InteractableController } from "../state/controller";
5
+ import "./action.css";
6
+ /**
7
+ * Native button element properties shared by action controls.
8
+ *
9
+ * The `disabled`, `tabIndex`, and `type` properties are local component properties, applied to the
10
+ * native button by the component controller. Other native attributes remain available through the
11
+ * namespaced `attr:` properties supplied by {@link DomProps}.
12
+ */
13
+ export type ActionButtonElementProps = DomProps<HTMLButtonElement, Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "tabindex" | "type">> & {
14
+ /**
15
+ * Button is disabled and cannot be focused or activated.
16
+ *
17
+ * @defaultValue `false`
18
+ */
19
+ disabled?: boolean | undefined;
20
+ /**
21
+ * Native button submission behavior.
22
+ *
23
+ * @defaultValue `"button"`
24
+ */
25
+ type?: "button" | "reset" | "submit" | undefined;
26
+ /**
27
+ * Sequential focus index. A disabled button is removed from the sequential focus order.
28
+ */
29
+ tabIndex?: number | undefined;
30
+ };
31
+ /**
32
+ * Link properties of action controls which navigate.
33
+ *
34
+ * An action which navigates must be a link: it is then announced as a link, can be opened in a new
35
+ * tab or window, shows its destination, and is followed without script. A control with an `href`
36
+ * therefore renders a native link in place of its native button. Common buttons accept these
37
+ * properties.
38
+ */
39
+ export type ActionLinkProps = {
40
+ /**
41
+ * Link destination.
42
+ *
43
+ * When specified, the control renders a native link; otherwise, it renders a native button.
44
+ * Changing this between a destination and `undefined` replaces the rendered element.
45
+ */
46
+ href?: string | undefined;
47
+ };
48
+ /**
49
+ * Action button visual variants.
50
+ */
51
+ export type ActionButtonVariant = "elevated" | "filled" | "filled-tonal" | "outlined" | "text";
52
+ /**
53
+ * Action button sizes, from extra small (32px) to extra large (136px).
54
+ */
55
+ export type ActionButtonSize = "lg" | "md" | "sm" | "xl" | "xs";
56
+ /**
57
+ * Toggle state properties of action controls.
58
+ *
59
+ * Toggles expose their state through `aria-pressed`. The state is controlled when `checked` is
60
+ * supplied, and uncontrolled otherwise.
61
+ */
62
+ export type ActionToggleProps = {
63
+ /**
64
+ * Current controlled toggle state.
65
+ *
66
+ * Supplying this property, including `undefined`, selects controlled mode at construction.
67
+ * Update it from {@link ActionToggleProps.onChange} to accept a requested state.
68
+ */
69
+ checked?: boolean | undefined;
70
+ /**
71
+ * Initial toggle state when {@link ActionToggleProps.checked} is omitted.
72
+ *
73
+ * @defaultValue `false`
74
+ * @remarks
75
+ * Read once at construction. Toggle state does not participate in native form reset.
76
+ */
77
+ defaultChecked?: boolean | undefined;
78
+ /**
79
+ * Toggle state cannot be changed by activation.
80
+ *
81
+ * A read-only toggle remains focusable, with a focus indicator, and is exposed with
82
+ * `aria-disabled="true"`. Its activation is cancelled.
83
+ *
84
+ * @defaultValue `false`
85
+ */
86
+ readOnly?: boolean | undefined;
87
+ /**
88
+ * Request the next toggle state after an uncancelled click finishes propagation.
89
+ *
90
+ * Runs for controlled and uncontrolled toggles, before uncontrolled state is committed. Cancel
91
+ * the click in `onClick`, `event:click`, or an ancestor handler to prevent the request. The
92
+ * change callback itself does not provide a cancellation mechanism.
93
+ *
94
+ * @see {@link ActionChangeHandler}
95
+ */
96
+ onChange?: ActionChangeHandler | undefined;
97
+ };
98
+ /**
99
+ * Properties of every native action control.
100
+ *
101
+ * This is the property type of icon buttons and of floating action buttons. An
102
+ * {@link ActionButtonController} accepts these properties, with a `ref` of any function element,
103
+ * and the {@link ActionLinkProps} of a control which can render a link. Common buttons expose the
104
+ * toggle properties only through {@link ./button#ToggleButton}, which supplies `toggle`.
105
+ */
106
+ export type BaseActionButtonProps = ActionButtonElementProps & ActionToggleProps & {
107
+ /**
108
+ * Enable toggle behavior and the `aria-pressed` state.
109
+ *
110
+ * @defaultValue `false`
111
+ */
112
+ toggle?: boolean | undefined;
113
+ };
114
+ /**
115
+ * Action toggle change callback.
116
+ *
117
+ * The controller and event follow the next state, so a callback which only needs the boolean
118
+ * state can omit the other parameters. See {@link ActionToggleProps.onChange} for ordering.
119
+ *
120
+ * @param checked - requested toggle state
121
+ * @param controller - action controller receiving activation
122
+ * @param event - originating click event
123
+ */
124
+ export type ActionChangeHandler = (checked: boolean, controller: ActionButtonController<BaseActionButtonProps>, event: Event) => void;
125
+ /**
126
+ * Client controller for native action buttons.
127
+ *
128
+ * The native button, or the native link rendered in its place for an
129
+ * {@link ActionLinkProps.href | `href`}, is both the style and function element. The controller
130
+ * applies the native `disabled`, `href`, `tabindex`, and `type` attributes, the toggle state
131
+ * (`aria-pressed`, `aria-disabled` for read-only toggles), and the state classes of the
132
+ * component, all keyed by the base CSS class the controller is constructed with:
133
+ *
134
+ * | Class | Applied when |
135
+ * | ---------------------------- | ------------------------------- |
136
+ * | `<base>-disabled` | the button is disabled |
137
+ * | `<base>-toggle` | the button is a toggle |
138
+ * | `<base>-checked` | the toggle is checked |
139
+ * | `<base>-{hover,focus,press}` | an interaction state is entered |
140
+ *
141
+ * Disabled buttons enter no interaction state. Read-only toggles enter only the focus state, so
142
+ * that keyboard focus remains visible. A link has no `type`, and cannot be disabled natively: a
143
+ * disabled link keeps its `href`, as a disabled tab or navigation destination does, is exposed with
144
+ * `aria-disabled="true"`, and its activation by a click or <kbd>Enter</kbd> is cancelled. An
145
+ * authored `attr:aria-pressed` or `attr:aria-disabled` replaces the respective managed attribute.
146
+ *
147
+ * @typeParam P - component properties type, whose `ref` the bound omits, since its type is the type
148
+ * of the function element
149
+ */
150
+ export declare abstract class ActionButtonController<P extends Omit<BaseActionButtonProps, "ref"> & ActionLinkProps> extends InteractableController<P> {
151
+ #private;
152
+ /**
153
+ * Construct a new `ActionButtonController`.
154
+ *
155
+ * @param props - component properties
156
+ * @param baseClassName - base CSS class of the component's state and interaction classes
157
+ */
158
+ constructor(props: InteractableProps<P>, baseClassName: string);
159
+ /**
160
+ * Test whether the button is disabled.
161
+ *
162
+ * @returns `true` if, and only if, the button is disabled
163
+ */
164
+ isDisabled(): boolean;
165
+ /**
166
+ * Test whether the button is a toggle.
167
+ *
168
+ * @returns `true` if, and only if, the button is a toggle
169
+ */
170
+ isToggle(): boolean;
171
+ /**
172
+ * Test whether the button is a checked toggle.
173
+ *
174
+ * @returns `true` if, and only if, the button is a toggle and its toggle state is checked
175
+ */
176
+ isChecked(): boolean;
177
+ /**
178
+ * Compose a state CSS class of this controller.
179
+ *
180
+ * @param name - state suffix
181
+ * @returns base CSS class joined with `name`
182
+ */
183
+ protected actionClass(name: string): string;
184
+ /**
185
+ * Apply native, toggle, and interaction state properties.
186
+ *
187
+ * The `disabled`, `aria-disabled`, and `type` attributes depend on whether the function element
188
+ * is a link, and are applied again whenever `href` changes. The element which then replaces the
189
+ * function element receives the attributes applied so far, so that they may be applied before
190
+ * or after the replacement.
191
+ */
192
+ protected applyComponentProps(): void;
193
+ /**
194
+ * Move the listeners cancelling the activation of a disabled link to a new function element
195
+ * which is a native link.
196
+ *
197
+ * @param curr - new function element, or `null` when absent
198
+ * @see {@link ../dom/client#DomController.onFunctionElementChanged}
199
+ */
200
+ protected onFunctionElementChanged(curr: FunctionElement<P> | null): void;
201
+ /**
202
+ * Handle an interaction event, and request a new toggle state after a click.
203
+ *
204
+ * Events received by a disabled button are ignored. A click on a read-only toggle is cancelled.
205
+ * Otherwise a click on a toggle requests the next state once the click has finished propagating
206
+ * and was not cancelled; an uncontrolled toggle then commits that state.
207
+ *
208
+ * @param event - interaction event received
209
+ */
210
+ protected onEvent(event: Event): void;
211
+ }
@@ -0,0 +1,126 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomProps } from "..";
3
+ import type { InteractableComponent, InteractableProps } from "../state";
4
+ import type { ActionButtonElementProps, ActionButtonSize, ActionButtonVariant, ActionLinkProps, ActionToggleProps } from "./base";
5
+ /**
6
+ * Common button properties.
7
+ *
8
+ * A common button with an {@link ./base#ActionLinkProps.href | `href`} renders a native link, and
9
+ * a native button otherwise. The `disabled`, `href`, `tabIndex`, and `type` properties are local
10
+ * component properties, applied to the native element by the component controller. Other native
11
+ * attributes of either element remain available through the namespaced `attr:` properties
12
+ * supplied by {@link DomProps}, such as `attr:target`, `attr:rel`, `attr:download`,
13
+ * `attr:hreflang`, and `attr:referrerpolicy` of a link.
14
+ */
15
+ export type ButtonProps = DomProps<HTMLAnchorElement | HTMLButtonElement, Omit<JSX.AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement> & JSX.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "disabled" | "href" | "tabindex" | "type">> & ActionLinkProps & {
16
+ /**
17
+ * Button is disabled and cannot be activated.
18
+ *
19
+ * A disabled button cannot be focused. A link cannot be disabled natively: a disabled link
20
+ * keeps its `href`, as a disabled tab or navigation destination does, but is exposed with
21
+ * `aria-disabled="true"`, is removed from the sequential focus order, takes no pointer events,
22
+ * and is not followed.
23
+ *
24
+ * @defaultValue `false`
25
+ */
26
+ disabled?: boolean | undefined;
27
+ /**
28
+ * Native button submission behavior, which a link does not have: a link has no `type`.
29
+ *
30
+ * @defaultValue `"button"`
31
+ */
32
+ type?: "button" | "reset" | "submit" | undefined;
33
+ /**
34
+ * Sequential focus index. A disabled button or link is removed from the sequential focus order.
35
+ */
36
+ tabIndex?: number | undefined;
37
+ /**
38
+ * Button visual variant.
39
+ *
40
+ * @defaultValue `"filled"`
41
+ */
42
+ variant?: ActionButtonVariant | undefined;
43
+ /**
44
+ * Button size. Inside a button group or split button, the container's size applies instead.
45
+ *
46
+ * @defaultValue `"md"`
47
+ */
48
+ size?: ActionButtonSize | undefined;
49
+ /**
50
+ * Round or square resting shape. Inside a button group, the group's shape applies instead.
51
+ *
52
+ * @defaultValue `"round"`
53
+ */
54
+ shape?: "round" | "square" | undefined;
55
+ /**
56
+ * Icon displayed before the label.
57
+ */
58
+ leadingIcon?: JSX.Element;
59
+ /**
60
+ * Icon displayed after the label.
61
+ */
62
+ trailingIcon?: JSX.Element;
63
+ };
64
+ /**
65
+ * Toggle button visual variants. Material 3 defines no text toggle button.
66
+ */
67
+ export type ToggleButtonVariant = Exclude<ActionButtonVariant, "text">;
68
+ /**
69
+ * Toggle button properties.
70
+ *
71
+ * A toggle button is always a native button: its selected state is not a destination, so it has
72
+ * neither an `href` nor the native attributes of a link.
73
+ */
74
+ export type ToggleButtonProps = ActionButtonElementProps & ActionToggleProps & Pick<ButtonProps, "leadingIcon" | "shape" | "size" | "trailingIcon"> & {
75
+ /**
76
+ * Toggle button visual variant.
77
+ *
78
+ * @defaultValue `"filled"`
79
+ */
80
+ variant?: ToggleButtonVariant | undefined;
81
+ };
82
+ /**
83
+ * Material 3 common button.
84
+ *
85
+ * Common buttons are native buttons with an optional leading and trailing icon around a label.
86
+ * They come in five sizes and five variants, and morph their corners while pressed.
87
+ *
88
+ * A common button with an `href` is a native link instead, as an action which navigates must be.
89
+ * The link has the classes, interaction states, and appearance of the button; see
90
+ * {@link ButtonProps} for its attributes and its disabled state.
91
+ *
92
+ * # Design
93
+ *
94
+ * The [cw-Button](./button.yaml) attribute sizes the button and the [cw-Action](./action.yaml)
95
+ * attribute colors it; each variant is a `cw-Action` theme.
96
+ *
97
+ * # Elements
98
+ *
99
+ * | Class | Element |
100
+ * | ------------------------------ | -------------------------------------------- |
101
+ * | `cw-Button` | native button, or native link with an `href` |
102
+ * | `cw-ActionButton-leadingIcon` | leading icon slot |
103
+ * | `cw-ActionButton-label` | label slot |
104
+ * | `cw-ActionButton-trailingIcon` | trailing icon slot |
105
+ *
106
+ * Empty slots are not displayed. The button applies `cw-Button-disabled` while disabled and the
107
+ * `cw-Button-{hover,focus,press}` interaction classes.
108
+ *
109
+ * @param props - component properties
110
+ * @returns rendered component elements
111
+ */
112
+ export declare const Button: InteractableComponent<ButtonProps>;
113
+ /**
114
+ * Material 3 toggle button.
115
+ *
116
+ * Toggle buttons are common buttons with a selected state, exposed through `aria-pressed`.
117
+ * Supplying `checked` makes the state controlled; omitting it keeps an internal state initialized
118
+ * from `defaultChecked`. A round toggle becomes square when selected and a square toggle round,
119
+ * with the fast spatial spring; colors follow the unselected and selected roles of its variant.
120
+ * The toggle applies `cw-Button-toggle`, and `cw-Button-checked` while selected. A toggle button
121
+ * is never a link: its selected state is not a destination, so it accepts no `href`.
122
+ *
123
+ * @param props - component properties
124
+ * @returns rendered component elements
125
+ */
126
+ export declare function ToggleButton(props: InteractableProps<ToggleButtonProps>): JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Menu linkage shared by a floating-action-button menu with its trigger.
3
+ */
4
+ export interface FABMenuTriggerContextValue {
5
+ /**
6
+ * Id of the menu items region the trigger controls.
7
+ */
8
+ readonly itemsId: string;
9
+ /**
10
+ * Menu is open, when the trigger factory runs.
11
+ *
12
+ * @remarks
13
+ * This is **not** reactive. The menu itself keeps the linkage of the trigger control current.
14
+ */
15
+ readonly open: boolean;
16
+ }
@@ -0,0 +1,112 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps } from "..";
3
+ import type { InteractableProps } from "../state";
4
+ import type { ActionToggleProps } from "./base";
5
+ import type { FABProps } from "./fab";
6
+ import type { FABMenuTriggerContextValue } from "./fab-menu-context";
7
+ import { FAB } from "./fab";
8
+ import "./action.css";
9
+ /**
10
+ * Render function of a floating-action-button menu trigger.
11
+ *
12
+ * @param context - menu linkage
13
+ * @returns focusable menu trigger
14
+ */
15
+ export type FABMenuTriggerFactory = (context: FABMenuTriggerContextValue) => JSX.Element;
16
+ /**
17
+ * Floating-action-button menu properties.
18
+ */
19
+ export type FABMenuProps = DomProps<HTMLDivElement, JSX.HTMLAttributes<HTMLDivElement>> & {
20
+ /**
21
+ * Current controlled open state.
22
+ *
23
+ * Supplying this property, including `undefined`, selects controlled mode at construction.
24
+ * Update it from {@link FABMenuProps.onOpenChange} to accept a requested state.
25
+ */
26
+ open?: boolean | undefined;
27
+ /**
28
+ * Initial open state when {@link FABMenuProps.open} is omitted.
29
+ *
30
+ * @defaultValue `false`
31
+ * @remarks
32
+ * Read once at construction.
33
+ */
34
+ defaultOpen?: boolean | undefined;
35
+ /**
36
+ * Request a new open state, after trigger activation, item activation, Escape, ArrowDown on the
37
+ * trigger, or a pointer press outside the menu.
38
+ *
39
+ * Runs for controlled and uncontrolled menus, after uncontrolled state is applied.
40
+ *
41
+ * @param open - requested open state
42
+ */
43
+ onOpenChange?: ((open: boolean) => void) | undefined;
44
+ /**
45
+ * Menu trigger factory, evaluated with the menu linkage in scope.
46
+ *
47
+ * The factory must return exactly one focusable control, normally a {@link FABMenuTrigger};
48
+ * text, several controls, and controls removed from the sequential focus order receive no menu
49
+ * linkage. The factory runs again when a signal it reads changes, replacing the trigger.
50
+ */
51
+ trigger: FABMenuTriggerFactory;
52
+ };
53
+ /**
54
+ * Floating-action-button menu item properties.
55
+ */
56
+ export type FABMenuItemProps = Omit<FABProps, keyof ActionToggleProps | "expanded" | "extended" | "lowered" | "size" | "toggle">;
57
+ /**
58
+ * Floating-action-button menu trigger properties.
59
+ */
60
+ export type FABMenuTriggerProps = FABProps;
61
+ /**
62
+ * Material 3 floating-action-button menu.
63
+ *
64
+ * A FAB menu opens a column of menu items above its trigger, normally a {@link FABMenuTrigger}.
65
+ * The trigger factory renders the trigger; the menu links its control to the items with
66
+ * `aria-controls` and `aria-expanded`, unless the author changes those attributes. Activating the
67
+ * trigger toggles the menu. ArrowDown on the trigger opens it and focuses the top item; Escape, an
68
+ * activated item, or a pointer press outside the menu closes it. Focus returns to the trigger when
69
+ * it was lost or rested within the menu, except after an outside press.
70
+ *
71
+ * Opening, the trigger FAB morphs into the close button and items reveal from their end edge,
72
+ * staggered from the item nearest the trigger, as in Compose; closing reverses the motion from the
73
+ * top item. A closed menu's items are inert.
74
+ *
75
+ * # Elements
76
+ *
77
+ * | Class | Element |
78
+ * | -------------------- | ------------------------------------------ |
79
+ * | `cw-FABMenu` | menu root; `_cw-FABMenu-open` while open |
80
+ * | `cw-FABMenu-trigger` | trigger slot |
81
+ * | `cw-FABMenu-items` | items region, above the trigger's end edge |
82
+ *
83
+ * # Design
84
+ *
85
+ * The `fabMenu` and `closeButton` roles of [cw-Button](./button.yaml) space the menu and size the
86
+ * close button, and its `fabMenuItem` theme sizes {@link FABMenuItem}s.
87
+ *
88
+ * @param props - component properties
89
+ * @returns rendered component elements
90
+ */
91
+ export declare const FABMenu: DomComponent<FABMenuProps>;
92
+ /**
93
+ * Floating-action-button menu item.
94
+ *
95
+ * Items are extended floating action buttons styled as fully round menu items: 56px tall, with a
96
+ * leading icon and a title label, in the color of their variant (normally a container color).
97
+ * Each item is as wide as its icon and label, at most the width of the viewport less 16px on each
98
+ * side; a longer label wraps, and its item grows taller (`FloatingActionButtonMenu`). Activating
99
+ * an item closes its menu.
100
+ *
101
+ * @param props - component properties
102
+ * @returns rendered component elements
103
+ */
104
+ export declare function FABMenuItem(props: InteractableProps<FABMenuItemProps>): JSX.Element;
105
+ /**
106
+ * Floating-action-button menu trigger.
107
+ *
108
+ * This is a {@link FAB}; inside the trigger slot of an open {@link FABMenu} it morphs into the
109
+ * close button, with the selected colors of its variant. Swap its icon for a close icon from the
110
+ * menu's open state.
111
+ */
112
+ export declare const FABMenuTrigger: typeof FAB;
@@ -0,0 +1,98 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { InteractableComponent } from "../state";
3
+ import type { BaseActionButtonProps } from "./base";
4
+ /**
5
+ * Floating-action-button color variants.
6
+ *
7
+ * | Variant | Container | Content |
8
+ * | ---------------------------------- | ---------------------- | ---------------------- |
9
+ * | `primary`, `primary-container` | primary container | on primary container |
10
+ * | `secondary`, `secondary-container` | secondary container | on secondary container |
11
+ * | `tertiary`, `tertiary-container` | tertiary container | on tertiary container |
12
+ * | `primary-filled` | primary | on primary |
13
+ * | `secondary-filled` | secondary | on secondary |
14
+ * | `tertiary-filled` | tertiary | on tertiary |
15
+ * | `surface` | surface container high | primary |
16
+ */
17
+ export type FABVariant = "primary" | "primary-container" | "primary-filled" | "secondary" | "secondary-container" | "secondary-filled" | "surface" | "tertiary" | "tertiary-container" | "tertiary-filled";
18
+ /**
19
+ * Floating-action-button sizes beside the baseline 56px FAB. Material 3 Expressive deprecates the
20
+ * small FAB.
21
+ */
22
+ export type FABSize = "large" | "medium" | "small";
23
+ /**
24
+ * Floating-action-button properties.
25
+ */
26
+ export type FABProps = BaseActionButtonProps & {
27
+ /**
28
+ * Floating-action-button color variant.
29
+ *
30
+ * @defaultValue `"primary"`
31
+ */
32
+ variant?: FABVariant | undefined;
33
+ /**
34
+ * Floating-action-button size, or `undefined` for the baseline FAB. An extended small FAB is
35
+ * 56px tall.
36
+ */
37
+ size?: FABSize | undefined;
38
+ /**
39
+ * Render an extended FAB, which shows its label beside the icon.
40
+ *
41
+ * A FAB which is not extended shows only its icon; its label remains its accessible name.
42
+ *
43
+ * @defaultValue `false`
44
+ */
45
+ extended?: boolean | undefined;
46
+ /**
47
+ * Extended FAB shows its label. Collapsing an extended FAB animates it to the icon-only FAB of
48
+ * the same height, keeping the label as the accessible name.
49
+ *
50
+ * @defaultValue `true`
51
+ */
52
+ expanded?: boolean | undefined;
53
+ /**
54
+ * Use the lowered elevation, for a FAB on a surface which does not need emphasis.
55
+ *
56
+ * @defaultValue `false`
57
+ */
58
+ lowered?: boolean | undefined;
59
+ /**
60
+ * Icon content.
61
+ */
62
+ leadingIcon?: JSX.Element;
63
+ };
64
+ /**
65
+ * Material 3 floating action button (FAB).
66
+ *
67
+ * FABs are native buttons for the primary action of a screen. They come in the baseline, medium,
68
+ * and large sizes (and the deprecated small size), in container and filled colors, and as extended
69
+ * FABs which show a label beside the icon. An extended FAB collapses to the icon-only FAB of the
70
+ * same height when `expanded` is `false`, animating its width with a spatial spring and its label
71
+ * opacity with an effects spring, as Compose does for each size.
72
+ *
73
+ * A toggle FAB (`toggle`), Compose's `ToggleFloatingActionButton`, morphs while selected into the
74
+ * fully round 56px close button of a FAB menu, with the selected colors, at the top-end corner of
75
+ * its unchanged layout box; a {@link ./fab-menu#FABMenuTrigger} morphs likewise while its menu is
76
+ * open. The state is exposed through `aria-pressed`, with the controlled and uncontrolled contract
77
+ * of {@link ./button#ToggleButton}.
78
+ *
79
+ * # Design
80
+ *
81
+ * The [cw-Button](./button.yaml) attribute sizes the FAB through its `fab*` themes, and the
82
+ * [cw-Action](./action.yaml) attribute colors it and sets its elevation.
83
+ *
84
+ * # Elements
85
+ *
86
+ * | Class | Element |
87
+ * | -------------- | ----------------------------------------- |
88
+ * | `cw-FAB` | native button |
89
+ * | `cw-FAB-icon` | icon slot |
90
+ * | `cw-FAB-label` | label slot, shown only by an expanded FAB |
91
+ *
92
+ * The button applies `cw-FAB-disabled` while disabled and the `cw-FAB-{hover,focus,press}`
93
+ * interaction classes.
94
+ *
95
+ * @param props - component properties
96
+ * @returns rendered component elements
97
+ */
98
+ export declare const FAB: InteractableComponent<FABProps>;