@quaffui/quaff 0.1.0-prealpha12 → 0.1.0-prealpha15

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 (188) hide show
  1. package/dist/components/avatar/QAvatar.svelte +37 -29
  2. package/dist/components/avatar/QAvatar.svelte.d.ts +0 -1
  3. package/dist/components/avatar/docs.d.ts +1 -1
  4. package/dist/components/avatar/docs.props.js +2 -0
  5. package/dist/components/avatar/props.d.ts +1 -1
  6. package/dist/components/breadcrumbs/QBreadcrumbs.svelte +3 -8
  7. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +12 -20
  8. package/dist/components/breadcrumbs/docs.d.ts +1 -1
  9. package/dist/components/breadcrumbs/docs.props.js +2 -0
  10. package/dist/components/breadcrumbs/props.d.ts +1 -1
  11. package/dist/components/button/QBtn.svelte +23 -27
  12. package/dist/components/button/docs.d.ts +1 -1
  13. package/dist/components/button/docs.props.js +18 -0
  14. package/dist/components/button/props.d.ts +1 -1
  15. package/dist/components/card/QCard.svelte +8 -9
  16. package/dist/components/card/QCardActions.svelte +7 -11
  17. package/dist/components/card/QCardSection.svelte +7 -9
  18. package/dist/components/card/docs.d.ts +1 -1
  19. package/dist/components/card/docs.props.js +3 -1
  20. package/dist/components/card/props.d.ts +2 -2
  21. package/dist/components/checkbox/QCheckbox.svelte +6 -8
  22. package/dist/components/checkbox/docs.d.ts +1 -1
  23. package/dist/components/checkbox/docs.props.js +2 -0
  24. package/dist/components/checkbox/props.d.ts +1 -1
  25. package/dist/components/chip/QChip.svelte +39 -30
  26. package/dist/components/chip/QChip.svelte.d.ts +2 -1
  27. package/dist/components/chip/docs.d.ts +1 -1
  28. package/dist/components/chip/docs.props.js +10 -0
  29. package/dist/components/chip/index.scss +18 -1
  30. package/dist/components/chip/props.d.ts +6 -1
  31. package/dist/components/codeBlock/QCodeBlock.svelte +24 -22
  32. package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +0 -1
  33. package/dist/components/codeBlock/docs.props.js +2 -0
  34. package/dist/components/dialog/QDialog.svelte +40 -49
  35. package/dist/components/dialog/QDialog.svelte.d.ts +6 -5
  36. package/dist/components/dialog/docs.d.ts +1 -1
  37. package/dist/components/dialog/docs.props.js +22 -4
  38. package/dist/components/dialog/index.scss +5 -4
  39. package/dist/components/dialog/props.d.ts +5 -5
  40. package/dist/components/drawer/QDrawer.svelte +3 -3
  41. package/dist/components/drawer/docs.d.ts +1 -1
  42. package/dist/components/drawer/docs.props.js +3 -1
  43. package/dist/components/drawer/props.d.ts +1 -1
  44. package/dist/components/footer/QFooter.svelte +3 -3
  45. package/dist/components/footer/docs.d.ts +1 -1
  46. package/dist/components/footer/docs.props.js +6 -4
  47. package/dist/components/footer/props.d.ts +1 -1
  48. package/dist/components/header/QHeader.svelte +2 -2
  49. package/dist/components/header/docs.props.d.ts +24 -0
  50. package/dist/components/header/docs.props.js +72 -0
  51. package/dist/components/icon/QIcon.svelte +10 -19
  52. package/dist/components/icon/QIcon.svelte.d.ts +0 -1
  53. package/dist/components/icon/docs.d.ts +1 -1
  54. package/dist/components/icon/docs.props.js +6 -4
  55. package/dist/components/icon/props.d.ts +1 -1
  56. package/dist/components/index.d.ts +2 -1
  57. package/dist/components/index.js +2 -1
  58. package/dist/components/input/QInput.svelte +62 -73
  59. package/dist/components/input/QInput.svelte.d.ts +3 -2
  60. package/dist/components/input/docs.d.ts +1 -1
  61. package/dist/components/input/docs.js +1 -7
  62. package/dist/components/input/docs.props.js +7 -13
  63. package/dist/components/input/index.scss +1 -3
  64. package/dist/components/input/props.d.ts +1 -3
  65. package/dist/components/input/props.js +0 -1
  66. package/dist/components/layout/QLayout.svelte +6 -6
  67. package/dist/components/layout/QLayout.svelte.d.ts +2 -2
  68. package/dist/components/layout/docs.d.ts +1 -1
  69. package/dist/components/layout/docs.props.js +9 -7
  70. package/dist/components/layout/index.scss +2 -6
  71. package/dist/components/layout/props.d.ts +1 -1
  72. package/dist/components/list/QItem.svelte +29 -29
  73. package/dist/components/list/QItemSection.svelte +12 -15
  74. package/dist/components/list/QList.svelte +12 -13
  75. package/dist/components/list/docs.d.ts +1 -1
  76. package/dist/components/list/docs.props.js +45 -27
  77. package/dist/components/list/index.scss +1 -0
  78. package/dist/components/list/props.d.ts +1 -1
  79. package/dist/components/list/props.js +1 -1
  80. package/dist/components/private/QApi.svelte +2 -2
  81. package/dist/components/private/QApi.svelte.d.ts +1 -1
  82. package/dist/components/private/QDocs.svelte +2 -2
  83. package/dist/components/private/QDocs.svelte.d.ts +1 -1
  84. package/dist/components/private/QDocsSection.svelte +2 -3
  85. package/dist/components/progress/QCircularProgress.svelte +14 -11
  86. package/dist/components/progress/QLinearProgress.svelte +17 -23
  87. package/dist/components/progress/QLinearProgress.svelte.d.ts +0 -1
  88. package/dist/components/progress/docs.d.ts +1 -1
  89. package/dist/components/progress/docs.props.js +17 -15
  90. package/dist/components/progress/index.scss +20 -3
  91. package/dist/components/progress/props.d.ts +1 -1
  92. package/dist/components/radio/QRadio.svelte +2 -8
  93. package/dist/components/radio/docs.d.ts +1 -1
  94. package/dist/components/radio/docs.props.js +5 -3
  95. package/dist/components/radio/props.d.ts +1 -1
  96. package/dist/components/radio/props.js +1 -1
  97. package/dist/components/railbar/QRailbar.svelte +3 -3
  98. package/dist/components/railbar/docs.d.ts +1 -1
  99. package/dist/components/railbar/docs.props.js +9 -7
  100. package/dist/components/railbar/props.d.ts +1 -1
  101. package/dist/components/select/QSelect.svelte +87 -93
  102. package/dist/components/select/QSelect.svelte.d.ts +2 -1
  103. package/dist/components/select/docs.d.ts +1 -1
  104. package/dist/components/select/docs.js +1 -7
  105. package/dist/components/select/docs.props.js +6 -12
  106. package/dist/components/select/index.scss +17 -4
  107. package/dist/components/select/props.d.ts +1 -3
  108. package/dist/components/select/props.js +0 -1
  109. package/dist/components/separator/QSeparator.svelte +39 -50
  110. package/dist/components/separator/QSeparator.svelte.d.ts +0 -1
  111. package/dist/components/separator/docs.d.ts +1 -1
  112. package/dist/components/separator/docs.props.js +15 -13
  113. package/dist/components/separator/index.scss +52 -0
  114. package/dist/components/separator/props.d.ts +3 -3
  115. package/dist/components/table/QTable.svelte +8 -17
  116. package/dist/components/table/QTable.svelte.d.ts +1 -2
  117. package/dist/components/table/docs.d.ts +1 -1
  118. package/dist/components/table/docs.props.js +3 -1
  119. package/dist/components/table/props.d.ts +1 -1
  120. package/dist/components/tabs/QTab.svelte +50 -43
  121. package/dist/components/tabs/QTab.svelte.d.ts +1 -1
  122. package/dist/components/tabs/QTabs.svelte +61 -42
  123. package/dist/components/tabs/QTabs.svelte.d.ts +11 -1
  124. package/dist/components/tabs/docs.d.ts +1 -1
  125. package/dist/components/tabs/docs.props.js +5 -3
  126. package/dist/components/tabs/index.scss +30 -21
  127. package/dist/components/tabs/props.d.ts +2 -4
  128. package/dist/components/tabs/props.js +1 -13
  129. package/dist/components/toggle/QToggle.svelte +7 -16
  130. package/dist/components/toggle/docs.d.ts +1 -1
  131. package/dist/components/toggle/docs.props.js +2 -0
  132. package/dist/components/toggle/props.d.ts +1 -1
  133. package/dist/components/toggle/props.js +1 -1
  134. package/dist/components/toolbar/QToolbar.svelte +12 -16
  135. package/dist/components/toolbar/QToolbar.svelte.d.ts +0 -1
  136. package/dist/components/toolbar/QToolbarTitle.svelte +1 -1
  137. package/dist/components/toolbar/docs.d.ts +1 -1
  138. package/dist/components/toolbar/docs.props.js +26 -8
  139. package/dist/components/toolbar/props.d.ts +1 -1
  140. package/dist/components/tooltip/QTooltip.svelte +10 -8
  141. package/dist/components/tooltip/docs.d.ts +1 -1
  142. package/dist/components/tooltip/docs.props.js +3 -1
  143. package/dist/components/tooltip/index.scss +1 -0
  144. package/dist/components/tooltip/props.d.ts +1 -1
  145. package/dist/components/tooltip/props.js +1 -1
  146. package/dist/composables/index.d.ts +3 -0
  147. package/dist/composables/index.js +3 -1
  148. package/dist/composables/use-align.d.ts +1 -1
  149. package/dist/composables/use-align.js +1 -1
  150. package/dist/composables/use-router-link.d.ts +1 -1
  151. package/dist/composables/use-router-link.js +2 -2
  152. package/dist/composables/use-size.d.ts +1 -1
  153. package/dist/composables/use-size.js +2 -2
  154. package/dist/css/index.css +1 -1
  155. package/dist/css/index.scss +1 -0
  156. package/dist/css/mixins/field-mixins.scss +53 -0
  157. package/dist/css/mixins.scss +5 -4
  158. package/dist/css/ripple.scss +8 -1
  159. package/dist/css/shared/q-field.scss +318 -0
  160. package/dist/css/theme/colors.module.scss +261 -109
  161. package/dist/css/theme/palette.scss +8 -2
  162. package/dist/helpers/index.d.ts +1 -1
  163. package/dist/helpers/index.js +1 -1
  164. package/dist/helpers/ripple.js +12 -10
  165. package/dist/helpers/version.d.ts +1 -1
  166. package/dist/helpers/version.js +1 -1
  167. package/dist/stores/QTheme.d.ts +8 -7
  168. package/dist/stores/QTheme.js +3 -3
  169. package/dist/stores/Quaff.js +1 -1
  170. package/dist/stores/index.d.ts +2 -0
  171. package/dist/stores/index.js +2 -0
  172. package/dist/utils/clipboard.d.ts +1 -1
  173. package/dist/utils/clipboard.js +1 -2
  174. package/dist/utils/dom.d.ts +1 -0
  175. package/dist/utils/dom.js +4 -0
  176. package/dist/utils/index.d.ts +8 -0
  177. package/dist/utils/index.js +8 -1
  178. package/dist/utils/props.d.ts +1 -1
  179. package/dist/utils/types.d.ts +1 -1
  180. package/dist/utils/types.json +24 -1
  181. package/package.json +23 -24
  182. package/dist/composables/use-index.d.ts +0 -2
  183. package/dist/composables/use-index.js +0 -17
  184. package/dist/css/mixins/field.scss +0 -432
  185. package/dist/helpers/activationHandler.d.ts +0 -9
  186. package/dist/helpers/activationHandler.js +0 -23
  187. package/dist/utils/fields.d.ts +0 -1
  188. package/dist/utils/fields.js +0 -14
@@ -1,44 +1,52 @@
1
- <script>import { useSize } from "../../composables/use-size";
2
- import { createClasses, createStyles } from "../../utils/props";
3
- export let shape = "circle", size = "md", src = void 0, video = false, userClasses = void 0, userStyles = void 0;
1
+ <script>import { useSize } from "../../composables";
2
+ export let shape = "circle", size = "md", src = void 0, video = false, userClasses = "";
4
3
  export { userClasses as class };
5
- export { userStyles as style };
6
4
  $:
7
5
  sizeObj = useSize(size);
8
- $:
9
- shapeClass = createClasses([
10
- shape === "circle" && "circle",
11
- shape === "rounded" && "round",
12
- shape.includes("top") && "top-round",
13
- shape.includes("bottom") && "bottom-round",
14
- shape.includes("left") && "left-round",
15
- shape.includes("right") && "right-round"
16
- ]);
17
- $:
18
- classes = createClasses([shapeClass, sizeObj.class], {
19
- component: "q-avatar",
20
- userClasses
21
- });
22
- $:
23
- style = createStyles(
24
- {
25
- width: sizeObj.style,
26
- height: sizeObj.style
27
- },
28
- userStyles
29
- );
30
6
  </script>
31
7
 
32
8
  {#if video === true}
33
9
  <!-- svelte-ignore a11y-media-has-caption -->
34
- <video class={classes} {style} autoplay loop playsinline {...$$restProps} on:click>
10
+ <video
11
+ class="q-avatar {sizeObj.class ? `q-avatar--${sizeObj.class}` : ''} {userClasses}"
12
+ class:q-avatar--circle={shape === "circle"}
13
+ class:q-avatar--round={shape === "rounded"}
14
+ class:q-avatar--top-round={shape?.includes("top")}
15
+ class:q-avatar--bottom-round={shape?.includes("bottom")}
16
+ class:q-avatar--left-round={shape?.includes("left")}
17
+ class:q-avatar--right-round={shape?.includes("right")}
18
+ style:width={sizeObj.style}
19
+ style:height={sizeObj.style}
20
+ autoplay loop playsinline {...$$restProps} on:click>
35
21
  <source {src} type="video/mp4" />
36
22
  </video>
37
23
  {:else if src !== undefined}
38
24
  <!-- svelte-ignore a11y-missing-attribute -->
39
- <img class={classes} {style} {src} {...$$restProps} on:click />
25
+ <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
26
+ <img
27
+ class="q-avatar {sizeObj.class ? `q-avatar--${sizeObj.class}` : ''} {userClasses}"
28
+ class:q-avatar--circle={shape === "circle"}
29
+ class:q-avatar--round={shape === "rounded"}
30
+ class:q-avatar--top-round={shape?.includes("top")}
31
+ class:q-avatar--bottom-round={shape?.includes("bottom")}
32
+ class:q-avatar--left-round={shape?.includes("left")}
33
+ class:q-avatar--right-round={shape?.includes("right")}
34
+ style:width={sizeObj.style}
35
+ style:height={sizeObj.style}
36
+ {src} {...$$restProps} on:click />
40
37
  {:else}
41
- <div class={classes} {style} {...$$restProps} on:click>
38
+ <!-- svelte-ignore a11y-no-static-element-interactions -->
39
+ <div
40
+ class="q-avatar {sizeObj.class ? `q-avatar--${sizeObj.class}` : ''} {userClasses}"
41
+ class:q-avatar--circle={shape === "circle"}
42
+ class:q-avatar--round={shape === "rounded"}
43
+ class:q-avatar--top-round={shape?.includes("top")}
44
+ class:q-avatar--bottom-round={shape?.includes("bottom")}
45
+ class:q-avatar--left-round={shape?.includes("left")}
46
+ class:q-avatar--right-round={shape?.includes("right")}
47
+ style:width={sizeObj.style}
48
+ style:height={sizeObj.style}
49
+ {...$$restProps} on:click>
42
50
  <slot />
43
51
  </div>
44
52
  {/if}
@@ -8,7 +8,6 @@ declare const __propDef: {
8
8
  src?: QAvatarProps["src"];
9
9
  video?: QAvatarProps["video"];
10
10
  class?: string | null | undefined;
11
- style?: string | null | undefined;
12
11
  };
13
12
  events: {
14
13
  click: MouseEvent;
@@ -1,2 +1,2 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QAvatarDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 24254a62ac601e8b6e85a3b74a7b3297
1
3
  export const QAvatarDocsProps = [
2
4
  {
3
5
  name: "shape",
@@ -1,4 +1,4 @@
1
- import type { QuaffSizes, CssValue, NativeProps } from "../../utils/types";
1
+ import type { QuaffSizes, CssValue, NativeProps } from "../../utils";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  export type QAvatarShapeOptions = "circle" | "rounded" | "top-round" | "left-round" | "right-round" | "bottom-round" | "top-left-round" | "top-right-round" | "bottom-left-round" | "bottom-right-round";
4
4
  export type QAvatarSizeOptions = QuaffSizes | CssValue | number;
@@ -1,18 +1,13 @@
1
- <script>import { createClasses } from "../../utils/props";
1
+ <script>import { createClasses } from "../../utils";
2
2
  import { onMount, setContext } from "svelte";
3
- export let separator = "/", gutter = "sm", activeColor = "primary", separatorColor = "outline", userClasses = void 0;
3
+ export let separator = "/", gutter = "sm", activeColor = "primary", separatorColor = "outline", userClasses = "";
4
4
  export { userClasses as class };
5
5
  let breadcrumbElement;
6
6
  onMount(() => breadcrumbElement.firstChild?.remove());
7
7
  setContext("activeColor", activeColor);
8
8
  setContext("separator", { type: separator, color: separatorColor, gutter });
9
- $:
10
- classes = createClasses([], {
11
- component: "q-breadcrumbs",
12
- userClasses
13
- });
14
9
  </script>
15
10
 
16
- <div class={classes} bind:this={breadcrumbElement}>
11
+ <div class="q-breadcrumbs {userClasses}" bind:this={breadcrumbElement}>
17
12
  <slot />
18
13
  </div>
@@ -1,30 +1,18 @@
1
- <script>import { getContext } from "svelte";
2
- import QIcon from "../icon/QIcon.svelte";
3
- import { createClasses } from "../../utils/props";
4
- import { isRouteActive } from "../../composables/use-router-link";
1
+ <script>import { isRouteActive } from "../../composables";
5
2
  import { Quaff } from "../../stores/Quaff";
6
- export let label = "", icon = void 0, tag = "div", to = void 0, href = void 0, activeClass = "active", userClasses = void 0;
3
+ import { getContext } from "svelte";
4
+ import { QIcon } from "../..";
5
+ export let label = "", icon = void 0, tag = "div", to = void 0, href = void 0, activeClass = "q-breadcrumbs__el--active", userClasses = "";
7
6
  export { userClasses as class };
8
7
  const activeColor = getContext("activeColor");
9
8
  const separator = getContext("separator");
10
9
  $:
11
10
  isActive = isRouteActive($Quaff.router, href || to);
12
11
  $:
13
- classes = createClasses([isActive && activeClass], {
14
- component: "q-breadcrumbs",
15
- element: "el",
16
- quaffClasses: [isActive && `${activeColor}-text`],
17
- userClasses
18
- });
19
- $:
20
- separatorClasses = createClasses([], {
21
- component: "q-breadcrumbs",
22
- element: "separator",
23
- quaffClasses: [`q-px-${separator.gutter}`]
24
- });
12
+ activeClasses = isActive ? `${activeClass} text-${activeColor}` : "";
25
13
  </script>
26
14
 
27
- <div class={separatorClasses}>
15
+ <div class="q-breadcrumbs__separator q-px-{separator.gutter}">
28
16
  {#if separator.type.startsWith("icon:")}
29
17
  <QIcon name={separator.type.replace("icon:", "")} size="1rem" />
30
18
  {:else}
@@ -33,7 +21,9 @@ $:
33
21
  </div>
34
22
 
35
23
  {#if href !== undefined || to !== undefined}
36
- <a href={href || to} class={classes}>
24
+ <a href={href || to}
25
+ class="q-breadcrumb__el {activeClasses} {userClasses}"
26
+ >
37
27
  {#if icon !== undefined}
38
28
  <QIcon name={icon} size="1rem" />
39
29
  {:else if $$slots.icon}
@@ -45,7 +35,9 @@ $:
45
35
  </slot>
46
36
  </a>
47
37
  {:else}
48
- <svelte:element this={tag} class={classes}>
38
+ <svelte:element this={tag}
39
+ class="q-breadcrumb__el {activeClasses} {userClasses}"
40
+ >
49
41
  {#if icon !== undefined}
50
42
  <QIcon name={icon} size="1rem" />
51
43
  {:else if $$slots.icon}
@@ -1,2 +1,2 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QBreadcrumbsDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 0e657b47b135caa98d094a90819b9c4e
1
3
  export const QBreadcrumbsDocsProps = [
2
4
  {
3
5
  name: "separator",
@@ -1,4 +1,4 @@
1
- import type { NativeProps } from "../../utils/types";
1
+ import type { NativeProps } from "../../utils";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  export type QBreadcrumbsGutterOptions = "none" | "sm" | "md" | "lg";
4
4
  export interface QBreadcrumbsProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
@@ -1,11 +1,8 @@
1
- <script>import { createClasses } from "../../utils/props";
2
- import { createEventDispatcher, onMount } from "svelte";
3
- import QIcon from "../icon/QIcon.svelte";
4
- import QCircularProgress from "../progress/QCircularProgress.svelte";
5
- import { useSize } from "../../composables/use-size";
6
- import { isActivationKey } from "../../utils/events";
7
- import { ripple } from "../../helpers/ripple";
8
- 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 = void 0;
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 = "";
9
6
  export { userClasses as class };
10
7
  let qBtn;
11
8
  let tag;
@@ -14,20 +11,13 @@ $:
14
11
  $:
15
12
  sizeObj = useSize(size);
16
13
  $:
17
- classes = createClasses(
18
- [
19
- unelevated && "unelevated",
20
- rectangle && "rectangle",
21
- outline && "outlined",
22
- flat && "flat",
23
- (!$$slots.default && !label || round) && "round",
24
- size !== "md" && sizeObj.class
25
- ],
26
- {
27
- component: "q-btn",
28
- userClasses
29
- }
30
- );
14
+ sizeClass = sizeObj.class && sizeObj.class !== "md" ? `q-btn--${sizeObj.class}` : "";
15
+ function stopIfDisabled(e) {
16
+ if (disable) {
17
+ e.preventDefault();
18
+ e.stopImmediatePropagation();
19
+ }
20
+ }
31
21
  function onKeyDown(e) {
32
22
  if (!isActivationKey(e))
33
23
  return;
@@ -39,15 +29,21 @@ function onKeyDown(e) {
39
29
 
40
30
  <svelte:element
41
31
  this={tag}
42
- bind:this={qBtn}
43
32
  use:ripple={{ disable: noRipple || disable }}
44
- role={tag === "a" ? "button" : undefined}
45
- href={to}
46
- class={classes}
33
+ bind:this={qBtn}
47
34
  aria-disabled={disable || undefined}
35
+ class="q-btn {sizeClass} {userClasses}"
36
+ class:q-btn--unelevated={unelevated}
37
+ class:q-btn--outlined={outline}
38
+ class:q-btn--flat={flat}
39
+ class:q-btn--rectangle={rectangle}
40
+ class:q-btn--round={(!$$slots.default && !label) || round}
41
+ href={to}
42
+ role={tag === "a" ? "button" : undefined}
48
43
  tabindex={disable ? -1 : 0}
49
- on:click
50
44
  on:keydown={onKeyDown}
45
+ on:click={stopIfDisabled}
46
+ on:click
51
47
  {...$$restProps}
52
48
  >
53
49
  {#if icon && !loading}
@@ -1,2 +1,2 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QBtnDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 721c97430442b5c05c756e2473f45aeb
1
3
  export const QBtnDocsProps = [
2
4
  {
3
5
  name: "disable",
@@ -55,6 +57,14 @@ export const QBtnDocsProps = [
55
57
  description: "Use rectangle design for the button, removing the large border-radius.",
56
58
  default: "false",
57
59
  },
60
+ {
61
+ name: "noRipple",
62
+ type: "boolean",
63
+ optional: true,
64
+ clickableType: false,
65
+ description: "Disable the ripple effect for the button.",
66
+ default: "false",
67
+ },
58
68
  {
59
69
  name: "round",
60
70
  type: "boolean",
@@ -87,4 +97,12 @@ export const QBtnDocsProps = [
87
97
  description: "Size of the button.",
88
98
  default: "md",
89
99
  },
100
+ {
101
+ name: "target",
102
+ type: 'HTMLAnchorAttributes["target"]',
103
+ optional: true,
104
+ clickableType: true,
105
+ description: 'For "a" (anchor) tag only, apply the target attribute.',
106
+ default: "undefined",
107
+ },
90
108
  ];
@@ -1,4 +1,4 @@
1
- import type { NativeProps, QuaffSizes } from "../../utils/types";
1
+ import type { NativeProps, QuaffSizes } from "../../utils";
2
2
  import type { HTMLAnchorAttributes, HTMLAttributes } from "svelte/elements";
3
3
  export type QBtnSizeOptions = Exclude<QuaffSizes, "xs">;
4
4
  export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
@@ -1,18 +1,17 @@
1
- <script>import { createClasses } from "../../utils/props";
2
- export let bordered = false, fill = void 0, flat = false, round = false, title = void 0, userClasses = void 0;
1
+ <script>export let bordered = false, fill = void 0, flat = false, round = false, title = void 0, userClasses = "";
3
2
  export { userClasses as class };
4
3
  const colorOptions = ["primary", "secondary", "tertiary"];
5
4
  $:
6
5
  color = !fill ? "surface" : colorOptions.includes(fill) ? `${fill}-container` : "surface-variant";
7
- $:
8
- classes = createClasses([bordered && "bordered", flat && "flat", round && "rounded"], {
9
- component: "q-card",
10
- quaffClasses: [`${color} on-${color}-text`],
11
- userClasses
12
- });
13
6
  </script>
14
7
 
15
- <article class={classes} {...$$restProps}>
8
+ <article
9
+ class="q-card {color} {userClasses}"
10
+ class:q-card--bordered={bordered}
11
+ class:q-card--flat={flat}
12
+ class:q-card--rounded={round}
13
+ {...$$restProps}
14
+ >
16
15
  {#if $$slots.title}
17
16
  <slot name="title" />
18
17
  {:else if title !== undefined}
@@ -1,18 +1,14 @@
1
- <script>import useAlign from "../../composables/use-align";
2
- import { createClasses } from "../../utils/props";
3
- export let align = void 0, vertical = false, userClasses = void 0;
1
+ <script>import { useAlign } from "../../composables";
2
+ export let align = void 0, vertical = false, userClasses = "";
4
3
  export { userClasses as class };
5
4
  $:
6
5
  alignClass = useAlign(align);
7
- $:
8
- classes = createClasses([vertical && "vertical"], {
9
- component: "q-card",
10
- element: "actions",
11
- quaffClasses: [alignClass],
12
- userClasses
13
- });
14
6
  </script>
15
7
 
16
- <nav class={classes} {...$$restProps}>
8
+ <nav
9
+ class="q-card__actions {alignClass} {userClasses}"
10
+ class:q-card__actions--vertical={vertical}
11
+ {...$$restProps}
12
+ >
17
13
  <slot />
18
14
  </nav>
@@ -1,14 +1,12 @@
1
- <script>import { createClasses } from "../../utils/props";
2
- export let horizontal = false, userClasses = void 0;
1
+ <script>export let horizontal = false, userClasses = "";
3
2
  export { userClasses as class };
4
- $:
5
- classes = createClasses([horizontal && "horizontal"], {
6
- component: "q-card",
7
- element: "section",
8
- userClasses
9
- });
10
3
  </script>
11
4
 
12
- <div class={classes} {...$$restProps} on:scroll>
5
+ <div
6
+ class="q-card__section {userClasses}"
7
+ class:q-card__section--horizontal={horizontal}
8
+ {...$$restProps}
9
+ on:scroll
10
+ >
13
11
  <slot />
14
12
  </div>
@@ -1,4 +1,4 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QCardDocs: QComponentDocs;
3
3
  export declare let QCardSectionDocs: QComponentDocs;
4
4
  export declare let QCardActionsDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 2ef1416c81c3c5c723220c0c102649eb
1
3
  export const QCardDocsProps = [
2
4
  {
3
5
  name: "bordered",
@@ -54,7 +56,7 @@ export const QCardActionsDocsProps = [
54
56
  {
55
57
  name: "vertical",
56
58
  type: "boolean",
57
- optional: false,
59
+ optional: true,
58
60
  clickableType: false,
59
61
  description: "Lays out the action items vertically.",
60
62
  default: "false",
@@ -1,5 +1,5 @@
1
- import type { UseAlignProps } from "../../composables/use-align";
2
- import type { NativeProps } from "../../utils/types";
1
+ import type { UseAlignProps } from "../../composables";
2
+ import type { NativeProps } from "../../utils";
3
3
  import type { HTMLAttributes } from "svelte/elements";
4
4
  export type QCardFillColors = "primary" | "secondary" | "tertiary";
5
5
  export interface QCardProps extends NativeProps, HTMLAttributes<HTMLElement> {
@@ -1,14 +1,12 @@
1
- <script>import { createClasses } from "../../utils/props";
2
- export let value = false, label = "", disable = false, userClasses = void 0;
1
+ <script>export let value = false, label = "", disable = false, userClasses = "";
3
2
  export { userClasses as class };
4
- $:
5
- classes = createClasses([disable && "disabled"], {
6
- component: "q-checkbox",
7
- userClasses
8
- });
9
3
  </script>
10
4
 
11
- <label class={classes} {...$$restProps}>
5
+ <label
6
+ class="q-checkbox {userClasses}"
7
+ class:q-checkbox--disabled={disable}
8
+ {...$$restProps}
9
+ >
12
10
  <input type="checkbox" bind:checked={value} disabled={disable} />
13
11
  <span>{label}</span>
14
12
  </label>
@@ -1,2 +1,2 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QCheckboxDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 9a5ee048cd1eb382844ca517e4e3e645
1
3
  export const QCheckboxDocsProps = [
2
4
  {
3
5
  name: "value",
@@ -1,4 +1,4 @@
1
- import type { NativeProps } from "../../utils/types";
1
+ import type { NativeProps } from "../../utils";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
  export interface QCheckboxProps extends NativeProps, HTMLAttributes<HTMLLabelElement> {
4
4
  /**
@@ -1,51 +1,59 @@
1
- <script>import { activationHandler } from "../../helpers/activationHandler";
2
- import { createClasses } from "../../utils/props";
3
- import { createEventDispatcher } from "svelte";
4
- import QIcon from "../icon/QIcon.svelte";
5
- import { useSize } from "../../composables/use-size";
6
- export let content = void 0, icon = void 0, iconRight = void 0, disable = false, responsive = false, vertical = false, round = false, outlined = false, size = "md", tabindex = void 0, href = void 0, userClasses = void 0;
1
+ <script>import { useSize } from "../../composables";
2
+ import { ripple } from "../../helpers";
3
+ import { isActivationKey } from "../../utils";
4
+ import { QIcon } from "../..";
5
+ export let content = void 0, icon = void 0, iconRight = void 0, disable = false, responsive = false, vertical = false, round = false, outlined = false, noRipple = false, size = "md", tabindex = void 0, href = void 0, userClasses = "";
7
6
  export { userClasses as class };
8
- const emit = createEventDispatcher();
7
+ let qChip;
9
8
  $:
10
9
  img = icon?.startsWith("img:") ? icon.slice(4) : void 0;
11
10
  $:
12
11
  imgRight = iconRight?.startsWith("img:") ? iconRight.slice(4) : void 0;
13
12
  $:
14
13
  sizeObj = useSize(size);
15
- $:
16
- classes = createClasses(
17
- [
18
- vertical && "vertical",
19
- round && "rounded",
20
- (outlined || disable) && "bordered",
21
- size !== "md" && sizeObj.class
22
- ],
23
- {
24
- component: "q-chip",
25
- userClasses
26
- }
27
- );
28
- $:
29
- imgClass = createClasses([responsive && "responsive"], {
30
- component: "q-chip",
31
- element: "img"
32
- });
33
14
  $:
34
15
  tab = disable ? -1 : tabindex ?? 0;
16
+ function stopIfDisabled(e) {
17
+ if (disable) {
18
+ e.preventDefault();
19
+ e.stopImmediatePropagation();
20
+ }
21
+ }
22
+ function onKeyDown(e) {
23
+ if (!isActivationKey(e))
24
+ return;
25
+ e.preventDefault();
26
+ let click = new MouseEvent("click");
27
+ qChip.dispatchEvent(click);
28
+ }
35
29
  </script>
36
30
 
37
31
  <a
38
- use:activationHandler={{ disable, callback: (e) => emit("activated", e) }}
32
+ bind:this={qChip}
33
+ use:ripple={{ disable: noRipple || disable }}
34
+ aria-disabled={disable || undefined}
35
+ class="q-chip {sizeObj.class && sizeObj.class !== 'md'
36
+ ? `q-chip--${sizeObj.class}`
37
+ : ''} {userClasses}"
38
+ class:q-chip--vertical={vertical}
39
+ class:q-chip--rounded={round}
40
+ class:q-chip--bordered={outlined || disable}
39
41
  {href}
40
- class={classes}
41
42
  tabindex={tab}
43
+ on:keydown={onKeyDown}
44
+ on:click={stopIfDisabled}
45
+ on:click
42
46
  {...$$restProps}
43
- aria-disabled={disable || undefined}
44
47
  >
45
48
  {#if $$slots.leading}
46
49
  <slot name="leading" />
47
50
  {:else if img}
48
- <img class={imgClass} src={img} alt="{content || 'Slotted'} chip" />
51
+ <img
52
+ class="q-chip__img"
53
+ class:q-chip__img--responsive={responsive}
54
+ src={img}
55
+ alt="{content || 'Slotted'} chip"
56
+ />
49
57
  {:else if icon}
50
58
  <QIcon name={icon} class="q-chip__icon" />
51
59
  {/if}
@@ -58,7 +66,8 @@ $:
58
66
  <slot name="trailing" />
59
67
  {:else if imgRight}
60
68
  <img
61
- class="{imgClass} q-chip__img--trailing"
69
+ class="q-chip__img q-chip__img--trailing"
70
+ class:q-chip__img--responsive={responsive}
62
71
  src={imgRight}
63
72
  alt="{content || 'Slotted'} chip"
64
73
  />
@@ -11,13 +11,14 @@ declare const __propDef: {
11
11
  vertical?: QChipProps["vertical"];
12
12
  round?: QChipProps["round"];
13
13
  outlined?: QChipProps["outlined"];
14
+ noRipple?: QChipProps["noRipple"];
14
15
  size?: QChipProps["size"];
15
16
  tabindex?: QChipProps["tabindex"];
16
17
  href?: QChipProps["href"];
17
18
  class?: string | null | undefined;
18
19
  };
19
20
  events: {
20
- activated: CustomEvent<any>;
21
+ click: MouseEvent;
21
22
  } & {
22
23
  [evt: string]: CustomEvent<any>;
23
24
  };
@@ -1,2 +1,2 @@
1
- import type { QComponentDocs } from "../../utils/types";
1
+ import type { QComponentDocs } from "../../utils";
2
2
  export declare let QChipDocs: QComponentDocs;
@@ -1,3 +1,5 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash 64a4b0e1fd969d51711b5f49c74fd317
1
3
  export const QChipDocsProps = [
2
4
  {
3
5
  name: "content",
@@ -63,6 +65,14 @@ export const QChipDocsProps = [
63
65
  description: "Use outline design for the chip, adding a border around it.",
64
66
  default: "false",
65
67
  },
68
+ {
69
+ name: "noRipple",
70
+ type: "boolean",
71
+ optional: true,
72
+ clickableType: false,
73
+ description: "Disable the ripple effect for the chip.",
74
+ default: "false",
75
+ },
66
76
  {
67
77
  name: "size",
68
78
  type: "QChipSizeOptions",
@@ -21,7 +21,6 @@
21
21
  cursor: pointer;
22
22
  border: none;
23
23
 
24
- @extend .ripple;
25
24
  @extend .no-select;
26
25
  @include padding("x", "md");
27
26
  @include margin("x");
@@ -77,6 +76,24 @@
77
76
  border-color: var(--on-surface);
78
77
  }
79
78
  }
79
+
80
+ &:is(:hover, :focus):not([aria-disabled])::after {
81
+ content: "";
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ background-color: var(--on-primary);
88
+ }
89
+
90
+ &:hover:not([aria-disabled])::after {
91
+ opacity: 0.08;
92
+ }
93
+
94
+ &:focus:not([aria-disabled])::after {
95
+ opacity: 0.16;
96
+ }
80
97
  }
81
98
 
82
99
  // QChip icons