@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha19

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 (323) hide show
  1. package/README.md +6 -6
  2. package/dist/classes/QContext.svelte.d.ts +42 -0
  3. package/dist/classes/QContext.svelte.js +63 -0
  4. package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
  5. package/dist/classes/QScrollObserver.svelte.js +95 -0
  6. package/dist/classes/QTheme.svelte.d.ts +11 -0
  7. package/dist/classes/QTheme.svelte.js +49 -0
  8. package/dist/classes/Quaff.svelte.d.ts +14 -0
  9. package/dist/classes/Quaff.svelte.js +35 -0
  10. package/dist/components/avatar/QAvatar.scss +97 -0
  11. package/dist/components/avatar/QAvatar.svelte +35 -50
  12. package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
  13. package/dist/components/avatar/docs.d.ts +1 -1
  14. package/dist/components/avatar/docs.js +1 -1
  15. package/dist/components/avatar/docs.props.js +21 -5
  16. package/dist/components/avatar/index.scss +5 -3
  17. package/dist/components/avatar/props.d.ts +24 -7
  18. package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
  19. package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
  20. package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
  21. package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
  22. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
  23. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
  24. package/dist/components/breadcrumbs/docs.d.ts +1 -1
  25. package/dist/components/breadcrumbs/docs.js +1 -1
  26. package/dist/components/breadcrumbs/docs.props.js +27 -27
  27. package/dist/components/breadcrumbs/props.d.ts +25 -24
  28. package/dist/components/button/QBtn.scss +133 -0
  29. package/dist/components/button/QBtn.svelte +89 -46
  30. package/dist/components/button/QBtn.svelte.d.ts +2 -33
  31. package/dist/components/button/docs.d.ts +1 -1
  32. package/dist/components/button/docs.js +1 -1
  33. package/dist/components/button/docs.props.js +26 -18
  34. package/dist/components/button/props.d.ts +21 -15
  35. package/dist/components/card/QCard.scss +25 -0
  36. package/dist/components/card/QCard.svelte +26 -17
  37. package/dist/components/card/QCard.svelte.d.ts +2 -25
  38. package/dist/components/card/QCardActions.scss +10 -0
  39. package/dist/components/card/QCardActions.svelte +11 -8
  40. package/dist/components/card/QCardActions.svelte.d.ts +2 -21
  41. package/dist/components/card/QCardSection.scss +10 -0
  42. package/dist/components/card/QCardSection.svelte +9 -7
  43. package/dist/components/card/QCardSection.svelte.d.ts +2 -22
  44. package/dist/components/card/docs.d.ts +3 -3
  45. package/dist/components/card/docs.js +3 -3
  46. package/dist/components/card/docs.props.js +6 -14
  47. package/dist/components/card/props.d.ts +9 -15
  48. package/dist/components/checkbox/QCheckbox.svelte +6 -5
  49. package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
  50. package/dist/components/checkbox/docs.d.ts +1 -1
  51. package/dist/components/checkbox/docs.js +1 -1
  52. package/dist/components/checkbox/docs.props.js +1 -1
  53. package/dist/components/checkbox/index.scss +3 -1
  54. package/dist/components/checkbox/props.d.ts +1 -2
  55. package/dist/components/chip/QChip.scss +179 -0
  56. package/dist/components/chip/QChip.svelte +97 -69
  57. package/dist/components/chip/QChip.svelte.d.ts +2 -35
  58. package/dist/components/chip/docs.d.ts +1 -1
  59. package/dist/components/chip/docs.js +1 -1
  60. package/dist/components/chip/docs.props.js +23 -47
  61. package/dist/components/chip/props.d.ts +21 -34
  62. package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
  63. package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
  64. package/dist/components/codeBlock/docs.props.js +10 -2
  65. package/dist/components/codeBlock/props.d.ts +6 -1
  66. package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
  67. package/dist/components/dialog/QDialog.svelte +72 -70
  68. package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
  69. package/dist/components/dialog/docs.d.ts +1 -1
  70. package/dist/components/dialog/docs.js +1 -1
  71. package/dist/components/dialog/docs.props.d.ts +0 -8
  72. package/dist/components/dialog/docs.props.js +1 -131
  73. package/dist/components/dialog/props.d.ts +0 -16
  74. package/dist/components/drawer/QDrawer.scss +45 -0
  75. package/dist/components/drawer/QDrawer.svelte +87 -94
  76. package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
  77. package/dist/components/drawer/docs.d.ts +1 -1
  78. package/dist/components/drawer/docs.js +1 -1
  79. package/dist/components/drawer/docs.props.js +3 -3
  80. package/dist/components/drawer/props.d.ts +2 -2
  81. package/dist/components/footer/QFooter.scss +42 -0
  82. package/dist/components/footer/QFooter.svelte +65 -24
  83. package/dist/components/footer/QFooter.svelte.d.ts +2 -23
  84. package/dist/components/footer/docs.d.ts +1 -1
  85. package/dist/components/footer/docs.js +1 -1
  86. package/dist/components/footer/docs.props.js +14 -6
  87. package/dist/components/footer/props.d.ts +8 -5
  88. package/dist/components/header/QHeader.scss +54 -0
  89. package/dist/components/header/QHeader.svelte +52 -24
  90. package/dist/components/header/QHeader.svelte.d.ts +2 -23
  91. package/dist/components/header/docs.props.js +23 -7
  92. package/dist/components/header/props.d.ts +11 -3
  93. package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
  94. package/dist/components/icon/QIcon.svelte +29 -16
  95. package/dist/components/icon/QIcon.svelte.d.ts +2 -27
  96. package/dist/components/icon/docs.d.ts +1 -1
  97. package/dist/components/icon/docs.js +1 -1
  98. package/dist/components/icon/docs.props.js +5 -5
  99. package/dist/components/icon/props.d.ts +6 -6
  100. package/dist/components/index.d.ts +2 -2
  101. package/dist/components/index.js +2 -2
  102. package/dist/components/input/QInput.svelte +52 -25
  103. package/dist/components/input/QInput.svelte.d.ts +2 -32
  104. package/dist/components/input/docs.d.ts +1 -1
  105. package/dist/components/input/docs.js +1 -1
  106. package/dist/components/input/docs.props.js +33 -1
  107. package/dist/components/input/props.d.ts +5 -12
  108. package/dist/components/input/props.js +1 -12
  109. package/dist/components/layout/QLayout.scss +178 -0
  110. package/dist/components/layout/QLayout.svelte +100 -80
  111. package/dist/components/layout/QLayout.svelte.d.ts +16 -43
  112. package/dist/components/layout/docs.d.ts +1 -1
  113. package/dist/components/layout/docs.js +1 -1
  114. package/dist/components/layout/docs.props.js +57 -1
  115. package/dist/components/layout/props.d.ts +8 -0
  116. package/dist/components/list/QItem.scss +61 -0
  117. package/dist/components/list/QItem.svelte +65 -46
  118. package/dist/components/list/QItem.svelte.d.ts +2 -30
  119. package/dist/components/list/QItemSection.scss +45 -0
  120. package/dist/components/list/QItemSection.svelte +46 -34
  121. package/dist/components/list/QItemSection.svelte.d.ts +2 -24
  122. package/dist/components/list/QList.scss +30 -0
  123. package/dist/components/list/QList.svelte +28 -16
  124. package/dist/components/list/QList.svelte.d.ts +2 -28
  125. package/dist/components/list/docs.d.ts +1 -1
  126. package/dist/components/list/docs.js +1 -1
  127. package/dist/components/list/docs.props.js +36 -4
  128. package/dist/components/list/props.d.ts +9 -8
  129. package/dist/components/list/props.js +1 -25
  130. package/dist/components/private/ContextReseter.svelte +6 -11
  131. package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
  132. package/dist/components/private/QApi.svelte +118 -97
  133. package/dist/components/private/QApi.svelte.d.ts +4 -16
  134. package/dist/components/private/QDocs.svelte +67 -58
  135. package/dist/components/private/QDocs.svelte.d.ts +9 -20
  136. package/dist/components/private/QDocsSection.svelte +15 -22
  137. package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
  138. package/dist/components/private/QIconSnippet.svelte +12 -0
  139. package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
  140. package/dist/components/progress/QCircularProgress.scss +63 -0
  141. package/dist/components/progress/QCircularProgress.svelte +104 -28
  142. package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
  143. package/dist/components/progress/QLinearProgress.scss +75 -0
  144. package/dist/components/progress/QLinearProgress.svelte +55 -13
  145. package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
  146. package/dist/components/progress/docs.d.ts +1 -1
  147. package/dist/components/progress/docs.js +1 -1
  148. package/dist/components/progress/docs.props.js +138 -10
  149. package/dist/components/progress/props.d.ts +75 -12
  150. package/dist/components/radio/QRadio.svelte +14 -3
  151. package/dist/components/radio/QRadio.svelte.d.ts +2 -21
  152. package/dist/components/radio/docs.d.ts +1 -1
  153. package/dist/components/radio/docs.js +1 -1
  154. package/dist/components/radio/docs.props.js +2 -2
  155. package/dist/components/radio/index.scss +3 -1
  156. package/dist/components/radio/props.d.ts +2 -4
  157. package/dist/components/radio/props.js +1 -8
  158. package/dist/components/railbar/QRailbar.scss +54 -0
  159. package/dist/components/railbar/QRailbar.svelte +43 -66
  160. package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
  161. package/dist/components/railbar/docs.d.ts +1 -1
  162. package/dist/components/railbar/docs.js +1 -1
  163. package/dist/components/railbar/docs.props.js +4 -4
  164. package/dist/components/railbar/props.d.ts +3 -3
  165. package/dist/components/select/QSelect.svelte +121 -88
  166. package/dist/components/select/QSelect.svelte.d.ts +2 -34
  167. package/dist/components/select/docs.d.ts +1 -1
  168. package/dist/components/select/docs.js +8 -1
  169. package/dist/components/select/docs.props.js +41 -1
  170. package/dist/components/select/index.scss +8 -6
  171. package/dist/components/select/props.d.ts +6 -12
  172. package/dist/components/select/props.js +1 -12
  173. package/dist/components/separator/QSeparator.scss +54 -0
  174. package/dist/components/separator/QSeparator.svelte +38 -45
  175. package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
  176. package/dist/components/separator/docs.d.ts +1 -1
  177. package/dist/components/separator/docs.js +1 -1
  178. package/dist/components/separator/docs.props.js +4 -4
  179. package/dist/components/separator/props.d.ts +5 -7
  180. package/dist/components/separator/props.js +1 -9
  181. package/dist/components/switch/QSwitch.scss +305 -0
  182. package/dist/components/switch/QSwitch.svelte +96 -0
  183. package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
  184. package/dist/components/{toggle → switch}/docs.d.ts +1 -1
  185. package/dist/components/{toggle → switch}/docs.js +3 -3
  186. package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
  187. package/dist/components/{toggle → switch}/docs.props.js +30 -6
  188. package/dist/components/switch/props.d.ts +13 -0
  189. package/dist/components/switch/props.js +1 -0
  190. package/dist/components/table/QTable.svelte +99 -85
  191. package/dist/components/table/QTable.svelte.d.ts +3 -29
  192. package/dist/components/table/docs.d.ts +1 -1
  193. package/dist/components/table/docs.js +1 -1
  194. package/dist/components/table/docs.props.js +9 -1
  195. package/dist/components/table/index.scss +3 -1
  196. package/dist/components/table/props.d.ts +10 -0
  197. package/dist/components/tabs/QTab.scss +71 -0
  198. package/dist/components/tabs/QTab.svelte +75 -96
  199. package/dist/components/tabs/QTab.svelte.d.ts +2 -25
  200. package/dist/components/tabs/QTabs.scss +40 -0
  201. package/dist/components/tabs/QTabs.svelte +107 -59
  202. package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
  203. package/dist/components/tabs/docs.d.ts +1 -1
  204. package/dist/components/tabs/docs.js +1 -1
  205. package/dist/components/tabs/docs.props.js +3 -3
  206. package/dist/components/tabs/index.scss +4 -2
  207. package/dist/components/tabs/props.d.ts +5 -4
  208. package/dist/components/tabs/props.js +1 -1
  209. package/dist/components/toolbar/QToolbar.svelte +15 -12
  210. package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
  211. package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
  212. package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
  213. package/dist/components/toolbar/docs.d.ts +1 -1
  214. package/dist/components/toolbar/docs.js +1 -1
  215. package/dist/components/toolbar/docs.props.js +4 -4
  216. package/dist/components/toolbar/index.scss +12 -14
  217. package/dist/components/toolbar/props.d.ts +4 -5
  218. package/dist/components/tooltip/QTooltip.svelte +5 -9
  219. package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
  220. package/dist/components/tooltip/docs.d.ts +1 -1
  221. package/dist/components/tooltip/docs.js +1 -1
  222. package/dist/components/tooltip/docs.props.js +1 -1
  223. package/dist/components/tooltip/index.scss +3 -1
  224. package/dist/components/tooltip/props.d.ts +1 -1
  225. package/dist/composables/index.d.ts +3 -3
  226. package/dist/composables/index.js +3 -3
  227. package/dist/composables/useSize.d.ts +10 -0
  228. package/dist/composables/useSize.js +37 -0
  229. package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
  230. package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
  231. package/dist/css/_components.scss +31 -0
  232. package/dist/css/_disabled.scss +18 -0
  233. package/dist/css/{ripple.scss → _ripple.scss} +1 -1
  234. package/dist/css/_variables.scss +73 -0
  235. package/dist/css/classes/_design.scss +57 -0
  236. package/dist/css/classes/_flex.scss +62 -0
  237. package/dist/css/classes/_grid.scss +35 -0
  238. package/dist/css/classes/_index.scss +7 -0
  239. package/dist/css/classes/_overflow.scss +7 -0
  240. package/dist/css/classes/_position.scss +7 -0
  241. package/dist/css/classes/_select.scss +6 -0
  242. package/dist/css/classes/_spaces.scss +23 -0
  243. package/dist/css/fonts.scss +16 -3
  244. package/dist/css/index.css +1 -1
  245. package/dist/css/index.scss +15 -94
  246. package/dist/css/mixins/_design.scss +63 -0
  247. package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
  248. package/dist/css/mixins/_image.scss +63 -0
  249. package/dist/css/mixins/_index.scss +9 -0
  250. package/dist/css/mixins/_layout.scss +20 -0
  251. package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
  252. package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
  253. package/dist/css/mixins/_spaces.scss +36 -0
  254. package/dist/css/mixins/_typography.scss +7 -0
  255. package/dist/css/shared/q-field.scss +62 -32
  256. package/dist/css/theme/_colors.scss +173 -0
  257. package/dist/css/theme/css-variables.scss +5 -0
  258. package/dist/css/theme/page.scss +3 -3
  259. package/dist/css/theme/reset.scss +17 -1
  260. package/dist/css/theme/theme.scss +2 -3
  261. package/dist/css/theme/tokens.scss +0 -159
  262. package/dist/global.d.ts +1 -1
  263. package/dist/helpers/clickOutside.d.ts +2 -2
  264. package/dist/helpers/clickOutside.js +5 -4
  265. package/dist/helpers/ripple.d.ts +1 -1
  266. package/dist/helpers/ripple.js +14 -5
  267. package/dist/helpers/version.d.ts +1 -1
  268. package/dist/helpers/version.js +1 -1
  269. package/dist/index.d.ts +2 -1
  270. package/dist/index.js +2 -1
  271. package/dist/stores/index.d.ts +0 -2
  272. package/dist/stores/index.js +1 -2
  273. package/dist/utils/clipboard.js +2 -2
  274. package/dist/utils/colors.d.ts +71 -0
  275. package/dist/utils/colors.js +103 -15
  276. package/dist/utils/dom.d.ts +2 -0
  277. package/dist/utils/dom.js +10 -4
  278. package/dist/utils/number.d.ts +2 -0
  279. package/dist/utils/number.js +9 -0
  280. package/dist/utils/props.d.ts +2 -2
  281. package/dist/utils/props.js +8 -6
  282. package/dist/utils/router.d.ts +17 -0
  283. package/dist/utils/router.js +23 -0
  284. package/dist/utils/string.d.ts +1 -0
  285. package/dist/utils/string.js +4 -1
  286. package/dist/utils/types.d.ts +7 -2
  287. package/dist/utils/types.js +0 -3
  288. package/dist/utils/types.json +8 -5
  289. package/dist/utils/watchable.d.ts +0 -1
  290. package/dist/utils/watchable.js +1 -1
  291. package/package.json +42 -39
  292. package/dist/components/breadcrumbs/index.scss +0 -20
  293. package/dist/components/button/index.scss +0 -98
  294. package/dist/components/card/index.scss +0 -56
  295. package/dist/components/chip/index.scss +0 -103
  296. package/dist/components/drawer/index.scss +0 -59
  297. package/dist/components/footer/index.scss +0 -28
  298. package/dist/components/layout/index.scss +0 -387
  299. package/dist/components/list/index.scss +0 -144
  300. package/dist/components/progress/index.scss +0 -82
  301. package/dist/components/railbar/index.scss +0 -39
  302. package/dist/components/separator/index.scss +0 -52
  303. package/dist/components/toggle/QToggle.svelte +0 -34
  304. package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
  305. package/dist/components/toggle/index.scss +0 -31
  306. package/dist/components/toggle/props.d.ts +0 -9
  307. package/dist/components/toggle/props.js +0 -9
  308. package/dist/css/grid.scss +0 -50
  309. package/dist/css/mixins.scss +0 -137
  310. package/dist/css/states.scss +0 -75
  311. package/dist/css/theme/bridge.scss +0 -15
  312. package/dist/css/theme/theme.dark.scss +0 -39
  313. package/dist/css/theme/theme.light.scss +0 -39
  314. package/dist/css/variables-sass.scss +0 -16
  315. package/dist/stores/QTheme.d.ts +0 -42
  316. package/dist/stores/QTheme.js +0 -60
  317. package/dist/stores/Quaff.d.ts +0 -32
  318. package/dist/stores/Quaff.js +0 -58
  319. /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
  320. /package/dist/composables/{use-align.js → useAlign.js} +0 -0
  321. /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
  322. /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
  323. /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
@@ -1,69 +1,112 @@
1
- <script>import { useSize } from "../../composables";
2
- import { ripple } from "../../helpers";
3
- import { isActivationKey } from "../../utils";
4
- import { QIcon, QCircularProgress } from "../..";
5
- export let icon = void 0, label = void 0, disable = false, loading = false, unelevated = false, outline = false, round = false, rectangle = false, noRipple = false, flat = false, to = void 0, size = void 0, userClasses = "";
6
- export { userClasses as class };
7
- let qBtn;
8
- let tag;
9
- $:
10
- tag = to !== void 0 ? "a" : "button";
11
- $:
12
- sizeObj = useSize(size);
13
- $:
14
- sizeClass = sizeObj.class && sizeObj.class !== "md" ? `q-btn--${sizeObj.class}` : "";
15
- function stopIfDisabled(e) {
16
- if (disable) {
1
+ <svelte:options runes={true} />
2
+
3
+ <script lang="ts">
4
+ import QCircularProgress from "../progress/QCircularProgress.svelte";
5
+ import { useSize } from "../../composables/useSize";
6
+ import { ripple } from "../../helpers";
7
+ import { isActivationKey } from "../../utils";
8
+ import { extractImgSrc } from "../../utils/string";
9
+ import QIcon from "../icon/QIcon.svelte";
10
+ let {
11
+ disabled = false,
12
+ design = "elevated",
13
+ icon,
14
+ label,
15
+ loading = false,
16
+ rectangle = false,
17
+ noRipple = false,
18
+ rippleColor,
19
+ round = false,
20
+ to,
21
+ unelevated = false,
22
+ size = "md",
23
+ target,
24
+ onclick,
25
+ children,
26
+ ...props
27
+ } = $props();
28
+ let qBtn;
29
+ const tag = $derived(to ? "a" : "button");
30
+ const qSize = $derived(useSize(size, "q-btn"));
31
+ const src = $derived(extractImgSrc(icon));
32
+ const color = $derived(
33
+ `var(--${design === "filled" ? "on-primary" : design === "tonal" ? "on-secondary-container" : "primary"})`,
34
+ );
35
+ const rippleColorVar = $derived(
36
+ rippleColor ? `var(--${rippleColor}, ${rippleColor})` : color,
37
+ );
38
+ function stopIfDisabled(e) {
39
+ if (disabled) {
40
+ e.preventDefault();
41
+ e.stopImmediatePropagation();
42
+ return;
43
+ }
44
+ onclick?.(e);
45
+ }
46
+ function onkeydown(e) {
47
+ if (e.key === "Escape") {
48
+ qBtn?.blur();
49
+ return;
50
+ }
51
+ if (!isActivationKey(e)) {
52
+ return;
53
+ }
17
54
  e.preventDefault();
18
- e.stopImmediatePropagation();
55
+ const click = new MouseEvent("click", { relatedTarget: qBtn });
56
+ stopIfDisabled(click);
19
57
  }
20
- }
21
- function onKeyDown(e) {
22
- if (!isActivationKey(e))
23
- return;
24
- e.preventDefault();
25
- let click = new MouseEvent("click");
26
- qBtn.dispatchEvent(click);
27
- }
28
58
  </script>
29
59
 
30
60
  <svelte:element
31
61
  this={tag}
32
- use:ripple={{ disable: noRipple || disable }}
33
62
  bind:this={qBtn}
34
- aria-disabled={disable || undefined}
35
- class="q-btn {sizeClass} {userClasses}"
63
+ use:ripple={{
64
+ disabled: noRipple || disabled,
65
+ color: rippleColorVar,
66
+ }}
67
+ {...props}
68
+ class="q-btn{qSize.class ? ` ${qSize.class}` : ''}{props.class
69
+ ? ` ${props.class}`
70
+ : ''} q-btn--{design}"
36
71
  class:q-btn--unelevated={unelevated}
37
- class:q-btn--outlined={outline}
38
- class:q-btn--flat={flat}
39
72
  class:q-btn--rectangle={rectangle}
40
- class:q-btn--round={(!$$slots.default && !label) || round}
41
- href={to}
73
+ class:q-btn--round={round || (!children && !label)}
74
+ style:--q-btn-size={qSize.style}
75
+ style:--ripple-color={color}
76
+ {target}
42
77
  role={tag === "a" ? "button" : undefined}
43
- tabindex={disable ? -1 : 0}
44
- on:keydown={onKeyDown}
45
- on:click={stopIfDisabled}
46
- on:click
47
- {...$$restProps}
78
+ aria-disabled={disabled || undefined}
79
+ tabindex={disabled ? -1 : 0}
80
+ {onkeydown}
81
+ onclick={stopIfDisabled}
48
82
  >
49
83
  {#if icon && !loading}
50
- {#if icon.startsWith("img:")}
84
+ {#if src}
51
85
  <img
52
- src={icon.replace("img:", "")}
86
+ {src}
87
+ alt="q-btn leading icon"
53
88
  class="q-btn__img q-btn__img--responsive"
54
- alt="{label || 'Slotted'} button"
55
89
  />
56
90
  {:else}
57
- <QIcon name={icon} class="q-btn__icon" />
91
+ <QIcon name={icon as MaterialSymbol} {color} class="q-btn__icon" />
58
92
  {/if}
59
93
  {/if}
60
94
 
61
95
  {#if loading}
62
- <QCircularProgress indeterminate class="q-btn__loader" />
96
+ <QCircularProgress
97
+ indeterminate
98
+ trackColor="transparent"
99
+ {color}
100
+ size="1.5em"
101
+ class="q-btn__loader"
102
+ />
63
103
  {/if}
64
104
 
65
- {#if label}
66
- <span>{label}</span>
67
- {/if}
68
- <slot />
105
+ <span class="q-btn__label">
106
+ {#if label}
107
+ {label}
108
+ {:else}
109
+ {@render children?.()}
110
+ {/if}
111
+ </span>
69
112
  </svelte:element>
@@ -1,34 +1,3 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QBtnProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- icon?: QBtnProps["icon"];
7
- label?: QBtnProps["label"];
8
- disable?: QBtnProps["disable"];
9
- loading?: QBtnProps["loading"];
10
- unelevated?: QBtnProps["unelevated"];
11
- outline?: QBtnProps["outline"];
12
- round?: QBtnProps["round"];
13
- rectangle?: QBtnProps["rectangle"];
14
- noRipple?: QBtnProps["noRipple"];
15
- flat?: QBtnProps["flat"];
16
- to?: QBtnProps["to"];
17
- size?: QBtnProps["size"];
18
- class?: string | null | undefined;
19
- };
20
- events: {
21
- click: MouseEvent;
22
- } & {
23
- [evt: string]: CustomEvent<any>;
24
- };
25
- slots: {
26
- default: {};
27
- };
28
- };
29
- type QBtnProps_ = typeof __propDef.props;
30
- export { QBtnProps_ as QBtnProps };
31
- export type QBtnEvents = typeof __propDef.events;
32
- export type QBtnSlots = typeof __propDef.slots;
33
- export default class QBtn extends SvelteComponent<QBtnProps, QBtnEvents, QBtnSlots> {
34
- }
2
+ declare const QBtn: import("svelte").Component<QBtnProps, {}, "">;
3
+ export default QBtn;
@@ -1,2 +1,2 @@
1
1
  import type { QComponentDocs } from "../../utils";
2
- export declare let QBtnDocs: QComponentDocs;
2
+ export declare const QBtnDocs: QComponentDocs;
@@ -1,5 +1,5 @@
1
1
  import { QBtnDocsProps } from "./docs.props";
2
- export let QBtnDocs = {
2
+ export const QBtnDocs = {
3
3
  name: "QBtn",
4
4
  description: "Buttons help users take action, such as sending an email, sharing a document, or liking a comment.",
5
5
  docs: {
@@ -1,8 +1,8 @@
1
1
  // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
- // @quaffHash 721c97430442b5c05c756e2473f45aeb
2
+ // @quaffHash 8658ff9566d68f27112f5c6ff5b97a54
3
3
  export const QBtnDocsProps = [
4
4
  {
5
- name: "disable",
5
+ name: "disabled",
6
6
  type: "boolean",
7
7
  optional: true,
8
8
  clickableType: false,
@@ -10,18 +10,18 @@ export const QBtnDocsProps = [
10
10
  default: "false",
11
11
  },
12
12
  {
13
- name: "flat",
14
- type: "boolean",
13
+ name: "design",
14
+ type: "QBtnDesignOptions",
15
15
  optional: true,
16
- clickableType: false,
17
- description: "Use flat design for the button, removing its elevation and background-color.",
18
- default: "false",
16
+ clickableType: true,
17
+ description: "Choose the design for the button.",
18
+ default: '"elevated"',
19
19
  },
20
20
  {
21
21
  name: "icon",
22
- type: "string",
22
+ type: "MaterialSymbol | `img:${string}`",
23
23
  optional: true,
24
- clickableType: false,
24
+ clickableType: true,
25
25
  description: "Name of the leading icon to use for the button.",
26
26
  default: "undefined",
27
27
  },
@@ -41,14 +41,6 @@ export const QBtnDocsProps = [
41
41
  description: "Puts the button in a loading state, adding a loader as the leading icon.",
42
42
  default: "false",
43
43
  },
44
- {
45
- name: "outline",
46
- type: "boolean",
47
- optional: true,
48
- clickableType: false,
49
- description: "Use outline design for the button, adding a border around it.",
50
- default: "false",
51
- },
52
44
  {
53
45
  name: "rectangle",
54
46
  type: "boolean",
@@ -65,6 +57,14 @@ export const QBtnDocsProps = [
65
57
  description: "Disable the ripple effect for the button.",
66
58
  default: "false",
67
59
  },
60
+ {
61
+ name: "rippleColor",
62
+ type: "string",
63
+ optional: true,
64
+ clickableType: false,
65
+ description: "Sets the ripple effect's color for the button.",
66
+ default: "undefined",
67
+ },
68
68
  {
69
69
  name: "round",
70
70
  type: "boolean",
@@ -95,7 +95,7 @@ export const QBtnDocsProps = [
95
95
  optional: true,
96
96
  clickableType: true,
97
97
  description: "Size of the button.",
98
- default: "md",
98
+ default: '"md"',
99
99
  },
100
100
  {
101
101
  name: "target",
@@ -105,4 +105,12 @@ export const QBtnDocsProps = [
105
105
  description: 'For "a" (anchor) tag only, apply the target attribute.',
106
106
  default: "undefined",
107
107
  },
108
+ {
109
+ name: "onclick",
110
+ type: "MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>",
111
+ optional: true,
112
+ clickableType: true,
113
+ description: "This event is emitted when the button is clicked.",
114
+ default: "undefined",
115
+ },
108
116
  ];
@@ -1,22 +1,23 @@
1
- import type { NativeProps, QuaffSizes } from "../../utils";
2
- import type { HTMLAnchorAttributes, HTMLAttributes } from "svelte/elements";
3
- export type QBtnSizeOptions = Exclude<QuaffSizes, "xs">;
4
- export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
1
+ import type { MaterialSymbol } from "material-symbols";
2
+ import type { HTMLAttributes, HTMLAnchorAttributes, MouseEventHandler } from "svelte/elements";
3
+ export type QBtnSizeOptions = Exclude<Q.Size, "xs">;
4
+ export type QBtnDesignOptions = "elevated" | "filled" | "tonal" | "outlined" | "flat";
5
+ export interface QBtnProps extends HTMLAttributes<HTMLButtonElement> {
5
6
  /**
6
7
  * Puts the button in a disabled state, making it unclickable.
7
8
  * @default false
8
9
  */
9
- disable?: boolean;
10
+ disabled?: boolean;
10
11
  /**
11
- * Use flat design for the button, removing its elevation and background-color.
12
- * @default false
12
+ * Choose the design for the button.
13
+ * @default "elevated"
13
14
  */
14
- flat?: boolean;
15
+ design?: QBtnDesignOptions;
15
16
  /**
16
17
  * Name of the leading icon to use for the button.
17
18
  * @default undefined
18
19
  */
19
- icon?: string;
20
+ icon?: MaterialSymbol | `img:${string}`;
20
21
  /**
21
22
  * Text to use for the button.
22
23
  * @default undefined
@@ -27,11 +28,6 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
27
28
  * @default false
28
29
  */
29
30
  loading?: boolean;
30
- /**
31
- * Use outline design for the button, adding a border around it.
32
- * @default false
33
- */
34
- outline?: boolean;
35
31
  /**
36
32
  * Use rectangle design for the button, removing the large border-radius.
37
33
  * @default false
@@ -42,6 +38,11 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
42
38
  * @default false
43
39
  */
44
40
  noRipple?: boolean;
41
+ /**
42
+ * Sets the ripple effect's color for the button.
43
+ * @default undefined
44
+ */
45
+ rippleColor?: string;
45
46
  /**
46
47
  * Use round design for the button, giving it a circular shape.
47
48
  * @default false
@@ -59,7 +60,7 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
59
60
  unelevated?: boolean;
60
61
  /**
61
62
  * Size of the button.
62
- * @default md
63
+ * @default "md"
63
64
  */
64
65
  size?: QBtnSizeOptions;
65
66
  /**
@@ -67,4 +68,9 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
67
68
  * @default undefined
68
69
  */
69
70
  target?: HTMLAnchorAttributes["target"];
71
+ /**
72
+ * This event is emitted when the button is clicked.
73
+ * @default undefined
74
+ */
75
+ onclick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
70
76
  }
@@ -0,0 +1,25 @@
1
+ @use "$css/mixins";
2
+
3
+ .q-card {
4
+ display: block;
5
+ border-radius: 0.75rem;
6
+ transition: transform var(--speed-3) padding var(--speed-3) border-radius var(--speed-3);
7
+
8
+ @include mixins.padding("a-md");
9
+ @include mixins.elevate(1, "bottom");
10
+
11
+ &--bordered {
12
+ box-sizing: border-box;
13
+ box-shadow: none;
14
+
15
+ @include mixins.border;
16
+ }
17
+
18
+ &--flat {
19
+ box-shadow: none;
20
+ }
21
+
22
+ &--rounded {
23
+ border-radius: 2rem;
24
+ }
25
+ }
@@ -1,22 +1,31 @@
1
- <script>export let bordered = false, fill = void 0, flat = false, round = false, title = void 0, userClasses = "";
2
- export { userClasses as class };
3
- const colorOptions = ["primary", "secondary", "tertiary"];
4
- $:
5
- color = !fill ? "surface" : colorOptions.includes(fill) ? `${fill}-container` : "surface-variant";
1
+ <svelte:options runes={true} />
2
+
3
+ <script lang="ts">
4
+ let {
5
+ fill = false,
6
+ flat = false,
7
+ bordered = false,
8
+ rounded = false,
9
+ children,
10
+ ...props
11
+ } = $props();
12
+ const colorOptions = ["primary", "secondary", "tertiary"];
13
+ const color = $derived.by(() => {
14
+ if (fill) {
15
+ return colorOptions.includes(fill)
16
+ ? `${fill}-container`
17
+ : "surface-variant";
18
+ }
19
+ return "surface";
20
+ });
6
21
  </script>
7
22
 
8
- <article
9
- class="q-card {color} {userClasses}"
10
- class:q-card--bordered={bordered}
23
+ <article
24
+ {...props}
25
+ class="q-card{color ? ` ${color}` : ''}{props.class ? ` ${props.class}` : ''}"
11
26
  class:q-card--flat={flat}
12
- class:q-card--rounded={round}
13
- {...$$restProps}
27
+ class:q-card--bordered={bordered}
28
+ class:q-card--rounded={rounded}
14
29
  >
15
- {#if $$slots.title}
16
- <slot name="title" />
17
- {:else if title !== undefined}
18
- <h5 class="q-card__title">{title}</h5>
19
- {/if}
20
-
21
- <slot />
30
+ {@render children?.()}
22
31
  </article>
@@ -1,26 +1,3 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QCardProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- bordered?: QCardProps["bordered"];
7
- fill?: QCardProps["fill"];
8
- flat?: QCardProps["flat"];
9
- round?: QCardProps["round"];
10
- title?: QCardProps["title"];
11
- class?: string | null | undefined;
12
- };
13
- events: {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {
17
- title: {};
18
- default: {};
19
- };
20
- };
21
- type QCardProps_ = typeof __propDef.props;
22
- export { QCardProps_ as QCardProps };
23
- export type QCardEvents = typeof __propDef.events;
24
- export type QCardSlots = typeof __propDef.slots;
25
- export default class QCard extends SvelteComponent<QCardProps, QCardEvents, QCardSlots> {
26
- }
2
+ declare const QCard: import("svelte").Component<QCardProps, {}, "">;
3
+ export default QCard;
@@ -0,0 +1,10 @@
1
+ @use "$css/mixins";
2
+
3
+ .q-card__actions {
4
+ display: flex;
5
+ @include mixins.margin("t-sm");
6
+
7
+ &--vertical {
8
+ flex-direction: column;
9
+ }
10
+ }
@@ -1,14 +1,17 @@
1
- <script>import { useAlign } from "../../composables";
2
- export let align = void 0, vertical = false, userClasses = "";
3
- export { userClasses as class };
4
- $:
5
- alignClass = useAlign(align);
1
+ <svelte:options runes={true} />
2
+
3
+ <script lang="ts">
4
+ import { useAlign } from "../../composables/useAlign";
5
+ let { align, vertical = false, children, ...props } = $props();
6
+ const alignClass = $derived(useAlign(align));
6
7
  </script>
7
8
 
8
9
  <nav
9
- class="q-card__actions {alignClass} {userClasses}"
10
+ {...props}
11
+ class="q-card__actions{alignClass ? ` ${alignClass}` : ''}{props.class
12
+ ? ` ${props.class}`
13
+ : ''}"
10
14
  class:q-card__actions--vertical={vertical}
11
- {...$$restProps}
12
15
  >
13
- <slot />
16
+ {@render children?.()}
14
17
  </nav>
@@ -1,22 +1,3 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QCardActionsProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- align?: QCardActionsProps["align"];
7
- vertical?: QCardActionsProps["vertical"];
8
- class?: string | null | undefined;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {
14
- default: {};
15
- };
16
- };
17
- type QCardActionsProps_ = typeof __propDef.props;
18
- export { QCardActionsProps_ as QCardActionsProps };
19
- export type QCardActionsEvents = typeof __propDef.events;
20
- export type QCardActionsSlots = typeof __propDef.slots;
21
- export default class QCardActions extends SvelteComponent<QCardActionsProps, QCardActionsEvents, QCardActionsSlots> {
22
- }
2
+ declare const QCardActions: import("svelte").Component<QCardActionsProps, {}, "">;
3
+ export default QCardActions;
@@ -0,0 +1,10 @@
1
+ @use "$css/mixins";
2
+
3
+ .q-card__section {
4
+ @include mixins.padding("a-sm");
5
+
6
+ &--horizontal {
7
+ border-radius: 0;
8
+ @include mixins.margin("t-sm");
9
+ }
10
+ }
@@ -1,12 +1,14 @@
1
- <script>export let horizontal = false, userClasses = "";
2
- export { userClasses as class };
1
+ <svelte:options runes={true} />
2
+
3
+ <script lang="ts">
4
+ let { horizontal = false, children, ...props } = $props();
3
5
  </script>
4
6
 
5
7
  <div
6
- class="q-card__section {userClasses}"
8
+ {...props}
9
+ class="q-card__section{props.class ? ` ${props.class}` : ''}"
7
10
  class:q-card__section--horizontal={horizontal}
8
- {...$$restProps}
9
- on:scroll
10
- >
11
- <slot />
11
+ class:row={horizontal}
12
+ >
13
+ {@render children?.()}
12
14
  </div>
@@ -1,23 +1,3 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QCardSectionProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- horizontal?: QCardSectionProps["horizontal"];
7
- class?: string | null | undefined;
8
- };
9
- events: {
10
- scroll: Event;
11
- } & {
12
- [evt: string]: CustomEvent<any>;
13
- };
14
- slots: {
15
- default: {};
16
- };
17
- };
18
- type QCardSectionProps_ = typeof __propDef.props;
19
- export { QCardSectionProps_ as QCardSectionProps };
20
- export type QCardSectionEvents = typeof __propDef.events;
21
- export type QCardSectionSlots = typeof __propDef.slots;
22
- export default class QCardSection extends SvelteComponent<QCardSectionProps, QCardSectionEvents, QCardSectionSlots> {
23
- }
2
+ declare const QCardSection: import("svelte").Component<QCardSectionProps, {}, "">;
3
+ export default QCardSection;
@@ -1,4 +1,4 @@
1
1
  import type { QComponentDocs } from "../../utils";
2
- export declare let QCardDocs: QComponentDocs;
3
- export declare let QCardSectionDocs: QComponentDocs;
4
- export declare let QCardActionsDocs: QComponentDocs;
2
+ export declare const QCardDocs: QComponentDocs;
3
+ export declare const QCardSectionDocs: QComponentDocs;
4
+ export declare const QCardActionsDocs: QComponentDocs;
@@ -1,5 +1,5 @@
1
1
  import { QCardActionsDocsProps, QCardDocsProps, QCardSectionDocsProps } from "./docs.props";
2
- export let QCardDocs = {
2
+ export const QCardDocs = {
3
3
  name: "QCard",
4
4
  description: "Cards provide a clean, flexible, and convenient means of displaying a wide variety of content.",
5
5
  docs: {
@@ -14,7 +14,7 @@ export let QCardDocs = {
14
14
  events: [],
15
15
  },
16
16
  };
17
- export let QCardSectionDocs = {
17
+ export const QCardSectionDocs = {
18
18
  name: "QCardSection",
19
19
  description: "Sections are used to group similar content within a card.",
20
20
  docs: {
@@ -29,7 +29,7 @@ export let QCardSectionDocs = {
29
29
  events: [],
30
30
  },
31
31
  };
32
- export let QCardActionsDocs = {
32
+ export const QCardActionsDocs = {
33
33
  name: "QCardActions",
34
34
  description: "Actions hold actionable items like buttons within a card.",
35
35
  docs: {