@quaffui/quaff 0.1.0-prealpha16 → 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 (269) 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 -60
  12. package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
  13. package/dist/components/avatar/docs.props.js +21 -5
  14. package/dist/components/avatar/index.scss +5 -3
  15. package/dist/components/avatar/props.d.ts +24 -7
  16. package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
  17. package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -9
  18. package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
  19. package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
  20. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +64 -38
  21. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
  22. package/dist/components/breadcrumbs/docs.props.js +27 -27
  23. package/dist/components/breadcrumbs/props.d.ts +25 -24
  24. package/dist/components/button/QBtn.scss +133 -0
  25. package/dist/components/button/QBtn.svelte +88 -48
  26. package/dist/components/button/QBtn.svelte.d.ts +2 -33
  27. package/dist/components/button/docs.props.js +26 -18
  28. package/dist/components/button/props.d.ts +21 -15
  29. package/dist/components/card/QCard.scss +25 -0
  30. package/dist/components/card/QCard.svelte +25 -16
  31. package/dist/components/card/QCard.svelte.d.ts +2 -25
  32. package/dist/components/card/QCardActions.scss +10 -0
  33. package/dist/components/card/QCardActions.svelte +11 -8
  34. package/dist/components/card/QCardActions.svelte.d.ts +2 -21
  35. package/dist/components/card/QCardSection.scss +10 -0
  36. package/dist/components/card/QCardSection.svelte +8 -6
  37. package/dist/components/card/QCardSection.svelte.d.ts +2 -22
  38. package/dist/components/card/docs.props.js +6 -14
  39. package/dist/components/card/props.d.ts +9 -15
  40. package/dist/components/checkbox/QCheckbox.svelte +8 -3
  41. package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
  42. package/dist/components/checkbox/docs.props.js +1 -1
  43. package/dist/components/checkbox/index.scss +3 -1
  44. package/dist/components/checkbox/props.d.ts +1 -2
  45. package/dist/components/chip/QChip.scss +179 -0
  46. package/dist/components/chip/QChip.svelte +95 -70
  47. package/dist/components/chip/QChip.svelte.d.ts +2 -35
  48. package/dist/components/chip/docs.props.js +23 -47
  49. package/dist/components/chip/props.d.ts +21 -34
  50. package/dist/components/codeBlock/QCodeBlock.svelte +64 -42
  51. package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -20
  52. package/dist/components/codeBlock/docs.props.js +10 -2
  53. package/dist/components/codeBlock/props.d.ts +6 -1
  54. package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
  55. package/dist/components/dialog/QDialog.svelte +72 -70
  56. package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
  57. package/dist/components/dialog/docs.props.d.ts +0 -8
  58. package/dist/components/dialog/docs.props.js +1 -131
  59. package/dist/components/dialog/props.d.ts +0 -16
  60. package/dist/components/drawer/QDrawer.scss +45 -0
  61. package/dist/components/drawer/QDrawer.svelte +87 -91
  62. package/dist/components/drawer/QDrawer.svelte.d.ts +6 -32
  63. package/dist/components/drawer/docs.props.js +3 -3
  64. package/dist/components/drawer/props.d.ts +2 -2
  65. package/dist/components/footer/QFooter.scss +42 -0
  66. package/dist/components/footer/QFooter.svelte +62 -23
  67. package/dist/components/footer/QFooter.svelte.d.ts +2 -23
  68. package/dist/components/footer/docs.props.js +14 -6
  69. package/dist/components/footer/props.d.ts +8 -5
  70. package/dist/components/header/QHeader.scss +54 -0
  71. package/dist/components/header/QHeader.svelte +52 -24
  72. package/dist/components/header/QHeader.svelte.d.ts +2 -23
  73. package/dist/components/header/docs.props.js +23 -7
  74. package/dist/components/header/props.d.ts +11 -3
  75. package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
  76. package/dist/components/icon/QIcon.svelte +29 -16
  77. package/dist/components/icon/QIcon.svelte.d.ts +2 -27
  78. package/dist/components/icon/docs.props.js +3 -3
  79. package/dist/components/icon/props.d.ts +4 -4
  80. package/dist/components/index.d.ts +2 -2
  81. package/dist/components/index.js +2 -2
  82. package/dist/components/input/QInput.svelte +52 -25
  83. package/dist/components/input/QInput.svelte.d.ts +2 -32
  84. package/dist/components/input/docs.props.js +33 -1
  85. package/dist/components/input/props.d.ts +5 -12
  86. package/dist/components/input/props.js +1 -12
  87. package/dist/components/layout/QLayout.scss +178 -0
  88. package/dist/components/layout/QLayout.svelte +100 -80
  89. package/dist/components/layout/QLayout.svelte.d.ts +16 -43
  90. package/dist/components/layout/docs.props.js +57 -1
  91. package/dist/components/layout/props.d.ts +8 -0
  92. package/dist/components/list/QItem.scss +61 -0
  93. package/dist/components/list/QItem.svelte +65 -46
  94. package/dist/components/list/QItem.svelte.d.ts +2 -30
  95. package/dist/components/list/QItemSection.scss +45 -0
  96. package/dist/components/list/QItemSection.svelte +48 -33
  97. package/dist/components/list/QItemSection.svelte.d.ts +2 -24
  98. package/dist/components/list/QList.scss +30 -0
  99. package/dist/components/list/QList.svelte +25 -14
  100. package/dist/components/list/QList.svelte.d.ts +2 -28
  101. package/dist/components/list/docs.props.js +36 -4
  102. package/dist/components/list/props.d.ts +9 -8
  103. package/dist/components/list/props.js +1 -25
  104. package/dist/components/private/ContextReseter.svelte +6 -11
  105. package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
  106. package/dist/components/private/QApi.svelte +117 -103
  107. package/dist/components/private/QApi.svelte.d.ts +4 -16
  108. package/dist/components/private/QDocs.svelte +67 -48
  109. package/dist/components/private/QDocs.svelte.d.ts +9 -20
  110. package/dist/components/private/QDocsSection.svelte +15 -14
  111. package/dist/components/private/QDocsSection.svelte.d.ts +7 -19
  112. package/dist/components/private/QIconSnippet.svelte +12 -0
  113. package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
  114. package/dist/components/progress/QCircularProgress.scss +63 -0
  115. package/dist/components/progress/QCircularProgress.svelte +104 -28
  116. package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
  117. package/dist/components/progress/QLinearProgress.scss +75 -0
  118. package/dist/components/progress/QLinearProgress.svelte +55 -13
  119. package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
  120. package/dist/components/progress/docs.props.js +138 -10
  121. package/dist/components/progress/props.d.ts +75 -12
  122. package/dist/components/radio/QRadio.svelte +14 -3
  123. package/dist/components/radio/QRadio.svelte.d.ts +2 -21
  124. package/dist/components/radio/docs.props.js +1 -1
  125. package/dist/components/radio/index.scss +3 -1
  126. package/dist/components/radio/props.d.ts +1 -3
  127. package/dist/components/radio/props.js +1 -8
  128. package/dist/components/railbar/QRailbar.scss +54 -0
  129. package/dist/components/railbar/QRailbar.svelte +43 -66
  130. package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
  131. package/dist/components/railbar/docs.props.js +4 -4
  132. package/dist/components/railbar/props.d.ts +3 -3
  133. package/dist/components/select/QSelect.svelte +121 -88
  134. package/dist/components/select/QSelect.svelte.d.ts +2 -34
  135. package/dist/components/select/docs.js +7 -0
  136. package/dist/components/select/docs.props.js +41 -1
  137. package/dist/components/select/index.scss +8 -6
  138. package/dist/components/select/props.d.ts +6 -12
  139. package/dist/components/select/props.js +1 -12
  140. package/dist/components/separator/QSeparator.scss +54 -0
  141. package/dist/components/separator/QSeparator.svelte +38 -45
  142. package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
  143. package/dist/components/separator/docs.props.js +4 -4
  144. package/dist/components/separator/props.d.ts +5 -7
  145. package/dist/components/separator/props.js +1 -9
  146. package/dist/components/switch/QSwitch.scss +305 -0
  147. package/dist/components/switch/QSwitch.svelte +96 -0
  148. package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
  149. package/dist/components/{toggle → switch}/docs.d.ts +1 -1
  150. package/dist/components/{toggle → switch}/docs.js +3 -3
  151. package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
  152. package/dist/components/{toggle → switch}/docs.props.js +30 -6
  153. package/dist/components/switch/props.d.ts +13 -0
  154. package/dist/components/switch/props.js +1 -0
  155. package/dist/components/table/QTable.svelte +99 -85
  156. package/dist/components/table/QTable.svelte.d.ts +3 -29
  157. package/dist/components/table/docs.props.js +9 -1
  158. package/dist/components/table/index.scss +3 -1
  159. package/dist/components/table/props.d.ts +10 -0
  160. package/dist/components/tabs/QTab.scss +71 -0
  161. package/dist/components/tabs/QTab.svelte +74 -90
  162. package/dist/components/tabs/QTab.svelte.d.ts +2 -25
  163. package/dist/components/tabs/QTabs.scss +40 -0
  164. package/dist/components/tabs/QTabs.svelte +110 -58
  165. package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
  166. package/dist/components/tabs/docs.props.js +3 -3
  167. package/dist/components/tabs/index.scss +4 -2
  168. package/dist/components/tabs/props.d.ts +5 -4
  169. package/dist/components/toolbar/QToolbar.svelte +15 -12
  170. package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
  171. package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
  172. package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
  173. package/dist/components/toolbar/docs.props.js +4 -4
  174. package/dist/components/toolbar/index.scss +12 -14
  175. package/dist/components/toolbar/props.d.ts +4 -5
  176. package/dist/components/tooltip/QTooltip.svelte +5 -9
  177. package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
  178. package/dist/components/tooltip/docs.props.js +1 -1
  179. package/dist/components/tooltip/index.scss +3 -1
  180. package/dist/components/tooltip/props.d.ts +1 -1
  181. package/dist/composables/index.d.ts +1 -1
  182. package/dist/composables/index.js +1 -1
  183. package/dist/composables/useSize.d.ts +10 -9
  184. package/dist/composables/useSize.js +32 -20
  185. package/dist/composables/useSizeLegacy.d.ts +9 -0
  186. package/dist/composables/useSizeLegacy.js +25 -0
  187. package/dist/css/_components.scss +31 -0
  188. package/dist/css/_disabled.scss +18 -0
  189. package/dist/css/{ripple.scss → _ripple.scss} +1 -1
  190. package/dist/css/_variables.scss +73 -0
  191. package/dist/css/classes/_design.scss +57 -0
  192. package/dist/css/classes/_flex.scss +62 -0
  193. package/dist/css/classes/_grid.scss +35 -0
  194. package/dist/css/classes/_index.scss +7 -0
  195. package/dist/css/classes/_overflow.scss +7 -0
  196. package/dist/css/classes/_position.scss +7 -0
  197. package/dist/css/classes/_select.scss +6 -0
  198. package/dist/css/classes/_spaces.scss +23 -0
  199. package/dist/css/index.css +1 -1
  200. package/dist/css/index.scss +15 -94
  201. package/dist/css/mixins/_design.scss +63 -0
  202. package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
  203. package/dist/css/mixins/_image.scss +63 -0
  204. package/dist/css/mixins/_index.scss +9 -0
  205. package/dist/css/mixins/_layout.scss +20 -0
  206. package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
  207. package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
  208. package/dist/css/mixins/_spaces.scss +36 -0
  209. package/dist/css/mixins/_typography.scss +7 -0
  210. package/dist/css/shared/q-field.scss +62 -32
  211. package/dist/css/theme/_colors.scss +173 -0
  212. package/dist/css/theme/css-variables.scss +5 -0
  213. package/dist/css/theme/page.scss +3 -3
  214. package/dist/css/theme/reset.scss +17 -1
  215. package/dist/css/theme/theme.scss +2 -3
  216. package/dist/css/theme/tokens.scss +0 -159
  217. package/dist/helpers/clickOutside.js +2 -1
  218. package/dist/helpers/ripple.d.ts +1 -1
  219. package/dist/helpers/ripple.js +13 -4
  220. package/dist/helpers/version.d.ts +1 -1
  221. package/dist/helpers/version.js +1 -1
  222. package/dist/index.d.ts +2 -1
  223. package/dist/index.js +2 -1
  224. package/dist/stores/index.d.ts +0 -2
  225. package/dist/stores/index.js +1 -2
  226. package/dist/utils/colors.d.ts +71 -0
  227. package/dist/utils/colors.js +101 -14
  228. package/dist/utils/dom.d.ts +2 -0
  229. package/dist/utils/dom.js +6 -0
  230. package/dist/utils/number.d.ts +2 -0
  231. package/dist/utils/number.js +9 -0
  232. package/dist/utils/props.js +3 -1
  233. package/dist/utils/router.d.ts +17 -0
  234. package/dist/utils/router.js +23 -0
  235. package/dist/utils/string.d.ts +1 -0
  236. package/dist/utils/string.js +3 -0
  237. package/dist/utils/types.d.ts +6 -1
  238. package/dist/utils/types.js +0 -3
  239. package/dist/utils/types.json +8 -5
  240. package/dist/utils/watchable.d.ts +0 -1
  241. package/package.json +40 -37
  242. package/dist/components/breadcrumbs/index.scss +0 -20
  243. package/dist/components/button/index.scss +0 -103
  244. package/dist/components/card/index.scss +0 -56
  245. package/dist/components/chip/index.scss +0 -103
  246. package/dist/components/drawer/index.scss +0 -59
  247. package/dist/components/footer/index.scss +0 -28
  248. package/dist/components/layout/index.scss +0 -387
  249. package/dist/components/list/index.scss +0 -144
  250. package/dist/components/progress/index.scss +0 -82
  251. package/dist/components/railbar/index.scss +0 -39
  252. package/dist/components/separator/index.scss +0 -52
  253. package/dist/components/toggle/QToggle.svelte +0 -34
  254. package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
  255. package/dist/components/toggle/index.scss +0 -31
  256. package/dist/components/toggle/props.d.ts +0 -9
  257. package/dist/components/toggle/props.js +0 -9
  258. package/dist/css/grid.scss +0 -50
  259. package/dist/css/mixins.scss +0 -137
  260. package/dist/css/states.scss +0 -75
  261. package/dist/css/theme/bridge.scss +0 -15
  262. package/dist/css/theme/theme.dark.scss +0 -39
  263. package/dist/css/theme/theme.light.scss +0 -39
  264. package/dist/css/variables-sass.scss +0 -16
  265. package/dist/stores/QTheme.d.ts +0 -42
  266. package/dist/stores/QTheme.js +0 -59
  267. package/dist/stores/Quaff.d.ts +0 -32
  268. package/dist/stores/Quaff.js +0 -58
  269. /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
@@ -1,72 +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}
62
+ bind:this={qBtn}
32
63
  use:ripple={{
33
- disable: noRipple || disable,
34
- color: flat || outline ? undefined : "var(--on-primary)",
64
+ disabled: noRipple || disabled,
65
+ color: rippleColorVar,
35
66
  }}
36
- bind:this={qBtn}
37
- aria-disabled={disable || undefined}
38
- class="q-btn {sizeClass} {userClasses}"
67
+ {...props}
68
+ class="q-btn{qSize.class ? ` ${qSize.class}` : ''}{props.class
69
+ ? ` ${props.class}`
70
+ : ''} q-btn--{design}"
39
71
  class:q-btn--unelevated={unelevated}
40
- class:q-btn--outlined={outline}
41
- class:q-btn--flat={flat}
42
72
  class:q-btn--rectangle={rectangle}
43
- class:q-btn--round={(!$$slots.default && !label) || round}
44
- href={to}
73
+ class:q-btn--round={round || (!children && !label)}
74
+ style:--q-btn-size={qSize.style}
75
+ style:--ripple-color={color}
76
+ {target}
45
77
  role={tag === "a" ? "button" : undefined}
46
- tabindex={disable ? -1 : 0}
47
- on:keydown={onKeyDown}
48
- on:click={stopIfDisabled}
49
- on:click
50
- {...$$restProps}
78
+ aria-disabled={disabled || undefined}
79
+ tabindex={disabled ? -1 : 0}
80
+ {onkeydown}
81
+ onclick={stopIfDisabled}
51
82
  >
52
83
  {#if icon && !loading}
53
- {#if icon.startsWith("img:")}
84
+ {#if src}
54
85
  <img
55
- src={icon.replace("img:", "")}
86
+ {src}
87
+ alt="q-btn leading icon"
56
88
  class="q-btn__img q-btn__img--responsive"
57
- alt="{label || 'Slotted'} button"
58
89
  />
59
90
  {:else}
60
- <QIcon name={icon} class="q-btn__icon" />
91
+ <QIcon name={icon as MaterialSymbol} {color} class="q-btn__icon" />
61
92
  {/if}
62
93
  {/if}
63
94
 
64
95
  {#if loading}
65
- <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
+ />
66
103
  {/if}
67
104
 
68
- {#if label}
69
- <span>{label}</span>
70
- {/if}
71
- <slot />
105
+ <span class="q-btn__label">
106
+ {#if label}
107
+ {label}
108
+ {:else}
109
+ {@render children?.()}
110
+ {/if}
111
+ </span>
72
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,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
23
  <article
9
- class="q-card {color} {userClasses}"
10
- class:q-card--bordered={bordered}
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
11
+ class:row={horizontal}
10
12
  >
11
- <slot />
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,12 +1,12 @@
1
1
  // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
- // @quaffHash 2ef1416c81c3c5c723220c0c102649eb
2
+ // @quaffHash 69f545f7cfb7825b2945621891e4b3e1
3
3
  export const QCardDocsProps = [
4
4
  {
5
5
  name: "bordered",
6
6
  type: "boolean",
7
7
  optional: true,
8
8
  clickableType: false,
9
- description: "Puts a border around the card.",
9
+ description: "Adds a border around the card.",
10
10
  default: "false",
11
11
  },
12
12
  {
@@ -15,32 +15,24 @@ export const QCardDocsProps = [
15
15
  optional: true,
16
16
  clickableType: false,
17
17
  description: "Defines the fill color of the card.",
18
- default: "undefined",
18
+ default: "false",
19
19
  },
20
20
  {
21
21
  name: "flat",
22
22
  type: "boolean",
23
23
  optional: true,
24
24
  clickableType: false,
25
- description: "Makes the card flat, removing its elevation.",
25
+ description: "Use the flat design for the card, removing its elevation.",
26
26
  default: "false",
27
27
  },
28
28
  {
29
- name: "round",
29
+ name: "rounded",
30
30
  type: "boolean",
31
31
  optional: true,
32
32
  clickableType: false,
33
- description: "Adds rounded corners to the card.",
33
+ description: "Adds border radius to the card to round its corners.",
34
34
  default: "false",
35
35
  },
36
- {
37
- name: "title",
38
- type: "string",
39
- optional: true,
40
- clickableType: false,
41
- description: "Sets the title of the card.",
42
- default: "undefined",
43
- },
44
36
  ];
45
37
  export const QCardSectionDocsProps = [
46
38
  {