@quaffui/quaff 0.1.0-prealpha11 → 0.1.0-prealpha12

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 (85) hide show
  1. package/dist/components/avatar/QAvatar.svelte.d.ts +2 -2
  2. package/dist/components/avatar/props.d.ts +2 -1
  3. package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +1 -1
  4. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +1 -1
  5. package/dist/components/breadcrumbs/props.d.ts +3 -2
  6. package/dist/components/button/QBtn.svelte +2 -2
  7. package/dist/components/button/QBtn.svelte.d.ts +2 -1
  8. package/dist/components/button/props.d.ts +12 -1
  9. package/dist/components/card/QCard.svelte.d.ts +1 -1
  10. package/dist/components/card/QCardActions.svelte.d.ts +1 -1
  11. package/dist/components/card/QCardSection.svelte.d.ts +1 -1
  12. package/dist/components/card/props.d.ts +4 -3
  13. package/dist/components/checkbox/QCheckbox.svelte.d.ts +1 -1
  14. package/dist/components/checkbox/props.d.ts +2 -1
  15. package/dist/components/chip/QChip.svelte.d.ts +1 -1
  16. package/dist/components/chip/props.d.ts +2 -1
  17. package/dist/components/codeBlock/props.d.ts +2 -1
  18. package/dist/components/dialog/QDialog.svelte.d.ts +1 -1
  19. package/dist/components/dialog/props.d.ts +2 -1
  20. package/dist/components/drawer/QDrawer.svelte.d.ts +2 -2
  21. package/dist/components/drawer/props.d.ts +2 -1
  22. package/dist/components/footer/QFooter.svelte.d.ts +2 -2
  23. package/dist/components/footer/props.d.ts +2 -1
  24. package/dist/components/header/QHeader.svelte.d.ts +2 -2
  25. package/dist/components/header/props.d.ts +2 -2
  26. package/dist/components/icon/QIcon.svelte +1 -1
  27. package/dist/components/icon/QIcon.svelte.d.ts +3 -2
  28. package/dist/components/icon/props.d.ts +2 -1
  29. package/dist/components/input/QInput.svelte.d.ts +1 -1
  30. package/dist/components/input/props.d.ts +2 -1
  31. package/dist/components/layout/QLayout.svelte +1 -1
  32. package/dist/components/layout/QLayout.svelte.d.ts +3 -2
  33. package/dist/components/layout/index.scss +8 -4
  34. package/dist/components/layout/props.d.ts +2 -1
  35. package/dist/components/list/QItem.svelte +22 -19
  36. package/dist/components/list/QItem.svelte.d.ts +4 -7
  37. package/dist/components/list/QItemSection.svelte +23 -19
  38. package/dist/components/list/QItemSection.svelte.d.ts +1 -1
  39. package/dist/components/list/QList.svelte +9 -10
  40. package/dist/components/list/QList.svelte.d.ts +1 -1
  41. package/dist/components/list/index.scss +27 -5
  42. package/dist/components/list/props.d.ts +8 -5
  43. package/dist/components/list/props.js +1 -1
  44. package/dist/components/progress/QCircularProgress.svelte +7 -1
  45. package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -1
  46. package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -2
  47. package/dist/components/progress/props.d.ts +3 -2
  48. package/dist/components/radio/QRadio.svelte.d.ts +1 -1
  49. package/dist/components/radio/props.d.ts +2 -1
  50. package/dist/components/railbar/QRailbar.svelte.d.ts +2 -2
  51. package/dist/components/railbar/props.d.ts +2 -1
  52. package/dist/components/select/QSelect.svelte +4 -2
  53. package/dist/components/select/QSelect.svelte.d.ts +1 -1
  54. package/dist/components/select/props.d.ts +6 -2
  55. package/dist/components/separator/QSeparator.svelte +2 -2
  56. package/dist/components/separator/QSeparator.svelte.d.ts +3 -2
  57. package/dist/components/separator/props.d.ts +2 -1
  58. package/dist/components/table/QTable.svelte +1 -1
  59. package/dist/components/table/QTable.svelte.d.ts +2 -1
  60. package/dist/components/table/props.d.ts +2 -1
  61. package/dist/components/tabs/QTab.svelte.d.ts +1 -1
  62. package/dist/components/tabs/QTabs.svelte.d.ts +2 -2
  63. package/dist/components/tabs/index.scss +3 -2
  64. package/dist/components/tabs/props.d.ts +3 -2
  65. package/dist/components/toggle/QToggle.svelte +9 -1
  66. package/dist/components/toggle/QToggle.svelte.d.ts +1 -1
  67. package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -2
  68. package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -2
  69. package/dist/components/toolbar/props.d.ts +3 -2
  70. package/dist/components/tooltip/QTooltip.svelte.d.ts +1 -1
  71. package/dist/components/tooltip/props.d.ts +2 -1
  72. package/dist/composables/use-router-link.d.ts +2 -2
  73. package/dist/composables/use-router-link.js +2 -2
  74. package/dist/css/index.css +1 -1
  75. package/dist/css/ripple.scss +1 -1
  76. package/dist/css/theme/theme.dark.scss +3 -1
  77. package/dist/css/theme/theme.light.scss +3 -1
  78. package/dist/helpers/ripple.d.ts +1 -0
  79. package/dist/helpers/ripple.js +1 -1
  80. package/dist/helpers/version.d.ts +1 -1
  81. package/dist/helpers/version.js +1 -1
  82. package/dist/stores/Quaff.js +18 -13
  83. package/dist/utils/props.d.ts +1 -1
  84. package/dist/utils/types.d.ts +2 -2
  85. package/package.json +1 -1
@@ -7,8 +7,8 @@ declare const __propDef: {
7
7
  size?: QAvatarProps["size"];
8
8
  src?: QAvatarProps["src"];
9
9
  video?: QAvatarProps["video"];
10
- class?: string | undefined;
11
- style?: string | undefined;
10
+ class?: string | null | undefined;
11
+ style?: string | null | undefined;
12
12
  };
13
13
  events: {
14
14
  click: MouseEvent;
@@ -1,7 +1,8 @@
1
1
  import type { QuaffSizes, CssValue, NativeProps } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
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";
3
4
  export type QAvatarSizeOptions = QuaffSizes | CssValue | number;
4
- export interface QAvatarProps extends NativeProps {
5
+ export interface QAvatarProps extends NativeProps, HTMLAttributes<HTMLElement> {
5
6
  /**
6
7
  * Shape of the avatar.
7
8
  * @default circle
@@ -6,7 +6,7 @@ declare const __propDef: {
6
6
  gutter?: QBreadcrumbsProps["gutter"];
7
7
  activeColor?: QBreadcrumbsProps["activeColor"];
8
8
  separatorColor?: QBreadcrumbsProps["separatorColor"];
9
- class?: string | undefined;
9
+ class?: string | null | undefined;
10
10
  };
11
11
  events: {
12
12
  [evt: string]: CustomEvent<any>;
@@ -8,7 +8,7 @@ declare const __propDef: {
8
8
  to?: QBreadcrumbsElProps["to"];
9
9
  href?: QBreadcrumbsElProps["href"];
10
10
  activeClass?: QBreadcrumbsElProps["activeClass"];
11
- class?: string | undefined;
11
+ class?: string | null | undefined;
12
12
  };
13
13
  events: {
14
14
  [evt: string]: CustomEvent<any>;
@@ -1,6 +1,7 @@
1
1
  import type { NativeProps } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  export type QBreadcrumbsGutterOptions = "none" | "sm" | "md" | "lg";
3
- export interface QBreadcrumbsProps extends NativeProps {
4
+ export interface QBreadcrumbsProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
4
5
  /**
5
6
  * Separator to use between the breadcrumb elements. To use an icon, prefix with "icon:" followed by the name of the icon.
6
7
  * @default /
@@ -22,7 +23,7 @@ export interface QBreadcrumbsProps extends NativeProps {
22
23
  */
23
24
  separatorColor?: string;
24
25
  }
25
- export interface QBreadcrumbsElProps extends NativeProps {
26
+ export interface QBreadcrumbsElProps extends NativeProps, HTMLAttributes<HTMLElement> {
26
27
  /**
27
28
  * Text to use for the breadcrumb element. If default slot is defined, the label will be overwritten by it.
28
29
  * @default ""
@@ -5,7 +5,7 @@ import QCircularProgress from "../progress/QCircularProgress.svelte";
5
5
  import { useSize } from "../../composables/use-size";
6
6
  import { isActivationKey } from "../../utils/events";
7
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, flat = false, to = void 0, size = void 0, userClasses = void 0;
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;
9
9
  export { userClasses as class };
10
10
  let qBtn;
11
11
  let tag;
@@ -40,7 +40,7 @@ function onKeyDown(e) {
40
40
  <svelte:element
41
41
  this={tag}
42
42
  bind:this={qBtn}
43
- use:ripple
43
+ use:ripple={{ disable: noRipple || disable }}
44
44
  role={tag === "a" ? "button" : undefined}
45
45
  href={to}
46
46
  class={classes}
@@ -11,10 +11,11 @@ declare const __propDef: {
11
11
  outline?: QBtnProps["outline"];
12
12
  round?: QBtnProps["round"];
13
13
  rectangle?: QBtnProps["rectangle"];
14
+ noRipple?: QBtnProps["noRipple"];
14
15
  flat?: QBtnProps["flat"];
15
16
  to?: QBtnProps["to"];
16
17
  size?: QBtnProps["size"];
17
- class?: string | undefined;
18
+ class?: string | null | undefined;
18
19
  };
19
20
  events: {
20
21
  click: MouseEvent;
@@ -1,6 +1,7 @@
1
1
  import type { NativeProps, QuaffSizes } from "../../utils/types";
2
+ import type { HTMLAnchorAttributes, HTMLAttributes } from "svelte/elements";
2
3
  export type QBtnSizeOptions = Exclude<QuaffSizes, "xs">;
3
- export interface QBtnProps extends NativeProps {
4
+ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
4
5
  /**
5
6
  * Puts the button in a disabled state, making it unclickable.
6
7
  * @default false
@@ -36,6 +37,11 @@ export interface QBtnProps extends NativeProps {
36
37
  * @default false
37
38
  */
38
39
  rectangle?: boolean;
40
+ /**
41
+ * Disable the ripple effect for the button.
42
+ * @default false
43
+ */
44
+ noRipple?: boolean;
39
45
  /**
40
46
  * Use round design for the button, giving it a circular shape.
41
47
  * @default false
@@ -56,4 +62,9 @@ export interface QBtnProps extends NativeProps {
56
62
  * @default md
57
63
  */
58
64
  size?: QBtnSizeOptions;
65
+ /**
66
+ * For "a" (anchor) tag only, apply the target attribute.
67
+ * @default undefined
68
+ */
69
+ target?: HTMLAnchorAttributes["target"];
59
70
  }
@@ -8,7 +8,7 @@ declare const __propDef: {
8
8
  flat?: QCardProps["flat"];
9
9
  round?: QCardProps["round"];
10
10
  title?: QCardProps["title"];
11
- class?: string | undefined;
11
+ class?: string | null | undefined;
12
12
  };
13
13
  events: {
14
14
  [evt: string]: CustomEvent<any>;
@@ -5,7 +5,7 @@ declare const __propDef: {
5
5
  [x: string]: any;
6
6
  align?: QCardActionsProps["align"];
7
7
  vertical?: QCardActionsProps["vertical"];
8
- class?: string | undefined;
8
+ class?: string | null | undefined;
9
9
  };
10
10
  events: {
11
11
  [evt: string]: CustomEvent<any>;
@@ -4,7 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  horizontal?: QCardSectionProps["horizontal"];
7
- class?: string | undefined;
7
+ class?: string | null | undefined;
8
8
  };
9
9
  events: {
10
10
  scroll: Event;
@@ -1,7 +1,8 @@
1
1
  import type { UseAlignProps } from "../../composables/use-align";
2
2
  import type { NativeProps } from "../../utils/types";
3
+ import type { HTMLAttributes } from "svelte/elements";
3
4
  export type QCardFillColors = "primary" | "secondary" | "tertiary";
4
- export interface QCardProps extends NativeProps {
5
+ export interface QCardProps extends NativeProps, HTMLAttributes<HTMLElement> {
5
6
  /**
6
7
  * Puts a border around the card.
7
8
  * @default false
@@ -28,14 +29,14 @@ export interface QCardProps extends NativeProps {
28
29
  */
29
30
  title?: string;
30
31
  }
31
- export interface QCardSectionProps extends NativeProps {
32
+ export interface QCardSectionProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
32
33
  /**
33
34
  * Lays out the section content horizontally.
34
35
  * @default false
35
36
  */
36
37
  horizontal?: boolean;
37
38
  }
38
- export interface QCardActionsProps extends UseAlignProps, NativeProps {
39
+ export interface QCardActionsProps extends UseAlignProps, NativeProps, HTMLAttributes<HTMLElement> {
39
40
  /**
40
41
  * Lays out the action items vertically.
41
42
  * @default false
@@ -6,7 +6,7 @@ declare const __propDef: {
6
6
  value?: boolean | undefined;
7
7
  label?: QCheckboxProps["label"];
8
8
  disable?: QCheckboxProps["disable"];
9
- class?: string | undefined;
9
+ class?: string | null | undefined;
10
10
  };
11
11
  events: {
12
12
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,6 @@
1
1
  import type { NativeProps } from "../../utils/types";
2
- export interface QCheckboxProps extends NativeProps {
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ export interface QCheckboxProps extends NativeProps, HTMLAttributes<HTMLLabelElement> {
3
4
  /**
4
5
  * Controls the checked state of the checkbox.
5
6
  */
@@ -14,7 +14,7 @@ declare const __propDef: {
14
14
  size?: QChipProps["size"];
15
15
  tabindex?: QChipProps["tabindex"];
16
16
  href?: QChipProps["href"];
17
- class?: string | undefined;
17
+ class?: string | null | undefined;
18
18
  };
19
19
  events: {
20
20
  activated: CustomEvent<any>;
@@ -1,6 +1,7 @@
1
1
  import type { NativeProps, QuaffSizes } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  export type QChipSizeOptions = Exclude<QuaffSizes, "xs" | "xl">;
3
- export interface QChipProps extends NativeProps {
4
+ export interface QChipProps extends NativeProps, HTMLAttributes<HTMLAnchorElement> {
4
5
  /**
5
6
  * The content inside the chip. Will overwrite the default slot.
6
7
  * @default undefined
@@ -1,4 +1,5 @@
1
- export interface QCodeBlockProps {
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ export interface QCodeBlockProps extends HTMLAttributes<HTMLDivElement> {
2
3
  /**
3
4
  * Language to use for highlighting.
4
5
  */
@@ -10,7 +10,7 @@ declare const __propDef: {
10
10
  modal?: QDialogProps["modal"];
11
11
  fullscreen?: QDialogProps["fullscreen"];
12
12
  persistent?: QDialogProps["persistent"];
13
- class?: string | undefined;
13
+ class?: string | null | undefined;
14
14
  hide?: (() => void) | undefined;
15
15
  show?: (() => void) | undefined;
16
16
  toggle?: ((e: MouseEvent) => void) | undefined;
@@ -1,7 +1,8 @@
1
1
  import type { NativeProps } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  import type { QBtnProps } from "../button/props";
3
4
  export type QDialogPositionOptions = "default" | "top" | "right" | "bottom" | "left";
4
- export interface QDialogProps extends NativeProps {
5
+ export interface QDialogProps extends NativeProps, HTMLAttributes<HTMLDialogElement> {
5
6
  /**
6
7
  * The value indicating whether the dialog is visible or hidden.
7
8
  * @default true
@@ -16,8 +16,8 @@ declare const __propDef: {
16
16
  noSwipeOpen?: QDrawerProps["noSwipeOpen"];
17
17
  noSwipeClose?: QDrawerProps["noSwipeClose"];
18
18
  noSwipeBackdrop?: QDrawerProps["noSwipeBackdrop"];
19
- class?: string | undefined;
20
- style?: string | undefined;
19
+ class?: string | null | undefined;
20
+ style?: string | null | undefined;
21
21
  show?: ((e?: MouseEvent) => void) | undefined;
22
22
  hide?: (() => void) | undefined;
23
23
  toggle?: ((e?: MouseEvent) => void) | undefined;
@@ -1,7 +1,8 @@
1
1
  import type { CssValue, NativeProps } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  export type QDrawerSideOptions = "left" | "right";
3
4
  export type QDrawerBehaviorOptions = "default" | "desktop" | "mobile";
4
- export interface QDrawerProps extends NativeProps {
5
+ export interface QDrawerProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
5
6
  /**
6
7
  * The value indicating whether the drawer is visible or hidden.
7
8
  * @default true
@@ -6,8 +6,8 @@ declare const __propDef: {
6
6
  border?: QFooterProps["border"];
7
7
  elevate?: QFooterProps["elevate"];
8
8
  height?: QFooterProps["height"];
9
- class?: string | undefined;
10
- style?: string | undefined;
9
+ class?: string | null | undefined;
10
+ style?: string | null | undefined;
11
11
  };
12
12
  events: {
13
13
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,6 @@
1
1
  import type { CssValue, NativeProps } from "../../utils/types";
2
- export interface QFooterProps extends NativeProps {
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ export interface QFooterProps extends NativeProps, HTMLAttributes<HTMLElement> {
3
4
  /**
4
5
  * The value indicating whether the footer is visible or hidden. (not supported yet)
5
6
  * @default true
@@ -6,8 +6,8 @@ declare const __propDef: {
6
6
  inset?: QHeaderProps["inset"];
7
7
  elevate?: QHeaderProps["elevate"];
8
8
  border?: QHeaderProps["border"];
9
- class?: string | undefined;
10
- style?: string | undefined;
9
+ class?: string | null | undefined;
10
+ style?: string | null | undefined;
11
11
  };
12
12
  events: {
13
13
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,5 @@
1
- import type { NativeProps } from "../../utils/types";
2
- export interface QHeaderProps extends NativeProps {
1
+ import type { QToolbarProps } from "../toolbar/props";
2
+ export interface QHeaderProps extends QToolbarProps {
3
3
  /**
4
4
  * @default false
5
5
  */
@@ -26,7 +26,7 @@ $:
26
26
  };
27
27
  </script>
28
28
 
29
- <i class={classes} {style}>
29
+ <i class={classes} {style} {...$$restProps}>
30
30
  {#if name !== undefined}
31
31
  {name}
32
32
  {:else if img !== undefined}
@@ -2,6 +2,7 @@ import { SvelteComponent } from "svelte";
2
2
  import type { QIconProps } from "./props";
3
3
  declare const __propDef: {
4
4
  props: {
5
+ [x: string]: any;
5
6
  size?: QIconProps["size"];
6
7
  name?: QIconProps["name"];
7
8
  type?: QIconProps["type"];
@@ -10,8 +11,8 @@ declare const __propDef: {
10
11
  img?: QIconProps["img"];
11
12
  imgAttributes?: QIconProps["imgAttributes"];
12
13
  color?: QIconProps["color"];
13
- class?: string | undefined;
14
- style?: string | undefined;
14
+ class?: string | null | undefined;
15
+ style?: string | null | undefined;
15
16
  };
16
17
  events: {
17
18
  [evt: string]: CustomEvent<any>;
@@ -1,7 +1,8 @@
1
1
  import type { CssValue, NativeProps, QuaffSizes } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  export type QIconSizeOptions = QuaffSizes | CssValue | number;
3
4
  export type QIconTypeOptions = "outlined" | "sharp" | "rounded";
4
- export interface QIconProps extends NativeProps {
5
+ export interface QIconProps extends NativeProps, HTMLAttributes<HTMLElement> {
5
6
  /**
6
7
  * The size of the icon. Can be specified with CSS units. If no unit is specified, "px" will be used.
7
8
  * @default md
@@ -14,7 +14,7 @@ declare const __propDef: {
14
14
  outlined?: QInputProps["outlined"];
15
15
  rounded?: QInputProps["rounded"];
16
16
  value: QInputProps["value"];
17
- class?: string | undefined;
17
+ class?: string | null | undefined;
18
18
  };
19
19
  events: {
20
20
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,6 @@
1
1
  import type { NativeProps } from "../../utils/types";
2
- export interface QInputProps extends NativeProps {
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ export interface QInputProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
3
4
  bordered?: boolean;
4
5
  dense?: boolean;
5
6
  disable?: boolean;
@@ -63,7 +63,7 @@ $:
63
63
  setContext("layout", ctx);
64
64
  </script>
65
65
 
66
- <div class={classes} {style} on:scroll on:resize>
66
+ <div class={classes} {style} {...$$restProps} on:scroll on:resize>
67
67
  {#if $$slots.railbarLeft}
68
68
  <slot name="railbarLeft" />
69
69
  {/if}
@@ -23,6 +23,7 @@ import type { QLayoutProps } from "./props";
23
23
  import type { Readable } from "svelte/store";
24
24
  declare const __propDef: {
25
25
  props: {
26
+ [x: string]: any;
26
27
  view?: QLayoutProps["view"];
27
28
  headerHeight?: QLayoutProps["headerHeight"];
28
29
  footerHeight?: QLayoutProps["footerHeight"];
@@ -30,8 +31,8 @@ declare const __propDef: {
30
31
  rightDrawerWidth?: QLayoutProps["rightDrawerWidth"];
31
32
  leftRailbarWidth?: QLayoutProps["leftRailbarWidth"];
32
33
  rightRailbarWidth?: QLayoutProps["rightDrawerWidth"];
33
- class?: string | undefined;
34
- style?: string | undefined;
34
+ class?: string | null | undefined;
35
+ style?: string | null | undefined;
35
36
  };
36
37
  events: {
37
38
  scroll: Event;
@@ -117,6 +117,10 @@ $contentSlot: ":not(.q-header, .q-footer, .q-railbar, .q-drawer)";
117
117
  }
118
118
  }
119
119
 
120
+ & > .q-list {
121
+ gap: 0.5rem;
122
+ }
123
+
120
124
  & > .q-list > .q-item {
121
125
  flex-direction: column;
122
126
  border-radius: 2rem;
@@ -125,7 +129,7 @@ $contentSlot: ":not(.q-header, .q-footer, .q-railbar, .q-drawer)";
125
129
  padding: 0 8px;
126
130
  gap: 0.25em;
127
131
 
128
- &.wave::after {
132
+ &.q-link::after {
129
133
  all: unset;
130
134
  }
131
135
 
@@ -135,13 +139,13 @@ $contentSlot: ":not(.q-header, .q-footer, .q-railbar, .q-drawer)";
135
139
 
136
140
  & > i {
137
141
  transition: var(--speed1) padding linear;
138
- padding-inline: 0.25em;
142
+ padding: 0.25rem;
139
143
  }
140
144
 
141
- &:is(:hover, :focus, .active) > i {
145
+ &:is(:hover, :focus, &--active) > i {
142
146
  background-color: var(--secondary-container);
143
147
  color: var(--on-secondary-container);
144
- padding: 0 1rem;
148
+ padding-inline: 1.5rem;
145
149
  font-variation-settings:
146
150
  "FILL" 1,
147
151
  "wght" 400,
@@ -1,6 +1,7 @@
1
1
  import type { NativeProps } from "../../utils/types";
2
+ import type { HTMLAttributes } from "svelte/elements";
2
3
  export type QLayoutViewOptions = `${"l" | "h"}${"h" | "H"}${"r" | "h"} ${"l" | "L"}${"p"}${"r" | "R"} ${"l" | "f"}${"f" | "F"}${"r" | "f"}`;
3
- export interface QLayoutProps extends NativeProps {
4
+ export interface QLayoutProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
4
5
  /**
5
6
  * The layout view configuration, which defines how layout components (header, railbars, drawers, footer) should be displayed on screen.
6
7
  * See <a href="https://quasar.dev/layout/layout/#understanding-the-view-prop" target="_blank">Quasar's explanation on the view prop</a>.
@@ -4,10 +4,11 @@ import { createClasses } from "../../utils/props";
4
4
  import { getContext, setContext } from "svelte";
5
5
  import { Quaff } from "../../stores/Quaff";
6
6
  import { writable } from "svelte/store";
7
- export let tag = "div", active = false, clickable = false, dense = false, tabindex = 0, href = void 0, to = void 0, disable = false, activeClass = void 0, replace = false, userClasses = void 0;
7
+ import { ripple } from "../../helpers/ripple";
8
+ export let tag = "div", active = false, clickable = false, dense = false, tabindex = 0, href = void 0, to = void 0, disable = false, activeClass = void 0, replace = false, noRipple = false, userClasses = void 0;
8
9
  export { userClasses as class };
9
- let hasMultiplLines = writable(false);
10
- setContext("hasMultipleLines", hasMultiplLines);
10
+ let hasMultipleLines = writable(false);
11
+ setContext("hasMultipleLines", hasMultipleLines);
11
12
  $:
12
13
  ({ hasLink, linkAttributes, linkClasses } = useRouterLink({
13
14
  href,
@@ -19,23 +20,25 @@ $:
19
20
  $:
20
21
  separatorOptions = getContext("separator");
21
22
  $:
22
- isActionable = clickable === true || hasLink === true || tag === "label";
23
+ isActionable = clickable || hasLink || tag === "label";
23
24
  $:
24
- isClickable = disable !== true && isActionable === true;
25
+ isClickable = isActionable && !disable;
25
26
  $:
26
27
  isActive = isRouteActive($Quaff.router, to);
27
28
  $:
28
- classes = createClasses([
29
- "q-item flex items-center",
30
- $hasMultiplLines && "multiline",
31
- dense && "dense",
32
- hasLink && active && "q-item--active",
33
- hasLink && active && activeClass,
34
- isActive && "active",
35
- isClickable && "wave",
36
- linkClasses,
37
- userClasses
38
- ]);
29
+ classes = createClasses(
30
+ [
31
+ $hasMultipleLines && "multiline",
32
+ dense && "dense",
33
+ (isActive || hasLink && active) && activeClass,
34
+ (isActive || hasLink && active) && "active"
35
+ ],
36
+ {
37
+ component: "q-item",
38
+ quaffClasses: [linkClasses],
39
+ userClasses
40
+ }
41
+ );
39
42
  $:
40
43
  attributes = {
41
44
  class: classes,
@@ -50,11 +53,11 @@ $:
50
53
  {/if}
51
54
  {#if linkAttributes.href !== undefined}
52
55
  <!-- svelte-ignore a11y-missing-attribute -->
53
- <a {...attributes} {...linkAttributes} {...$$restProps} on:mouseenter on:mouseleave on:click>
56
+ <a use:ripple={{ disable: !isClickable || noRipple }} {...attributes} {...linkAttributes}>
54
57
  <slot />
55
58
  </a>
56
59
  {:else}
57
- <div {...attributes} {...$$restProps} on:mouseenter on:mouseleave on:click>
60
+ <svelte:element this={tag} {...attributes}>
58
61
  <slot />
59
- </div>
62
+ </svelte:element>
60
63
  {/if}
@@ -10,16 +10,13 @@ declare const __propDef: {
10
10
  tabindex?: QItemProps["tabindex"];
11
11
  href?: QItemProps["href"];
12
12
  to?: QItemProps["to"];
13
- disable?: boolean | undefined;
13
+ disable?: QItemProps["disable"];
14
14
  activeClass?: QItemProps["activeClass"];
15
- replace?: boolean | undefined;
16
- class?: string | undefined;
15
+ replace?: QItemProps["replace"];
16
+ noRipple?: QItemProps["noRipple"];
17
+ class?: string | null | undefined;
17
18
  };
18
19
  events: {
19
- mouseenter: MouseEvent;
20
- mouseleave: MouseEvent;
21
- click: MouseEvent;
22
- } & {
23
20
  [evt: string]: CustomEvent<any>;
24
21
  };
25
22
  slots: {
@@ -9,33 +9,37 @@ $:
9
9
  $ctx = $$slots.headline && [$$slots.line1, $$slots.line2, $$slots.line3].filter(Boolean).length >= 2;
10
10
  }
11
11
  $:
12
- classes = createClasses([`q-item__section `, `q-item__section--${type}`, userClasses]);
12
+ classes = createClasses([type], {
13
+ component: "q-item__section",
14
+ userClasses
15
+ });
13
16
  </script>
14
17
 
15
18
  <div class={classes} {...$$restProps}>
16
19
  {#if type === "content"}
17
- {#if [$$slots.headline, $$slots.line2, $$slots.line2, $$slots.line3].some(Boolean) === false}
20
+ {#if [$$slots.headline, $$slots.line2, $$slots.line2, $$slots.line3].every(Boolean) === false}
18
21
  <slot />
19
- {/if}
20
- {#if $$slots.headline}
21
- <div class="body-large on-surface-text">
22
- <slot name="headline" />
23
- </div>
24
- {/if}
25
- <div class="body-medium on-surface-variant-text">
26
- {#if $$slots.line1}
27
- <slot name="line1" />
22
+ {:else}
23
+ {#if $$slots.headline}
24
+ <div class="body-large on-surface-text">
25
+ <slot name="headline" />
26
+ </div>
28
27
  {/if}
29
- </div>
30
- {#if $$slots.line2}
31
28
  <div class="body-medium on-surface-variant-text">
32
- <slot name="line2" />
33
- </div>
34
- {/if}
35
- {#if $$slots.line3}
36
- <div class="body-medium on-surface-variant-text">
37
- <slot name="line3" />
29
+ {#if $$slots.line1}
30
+ <slot name="line1" />
31
+ {/if}
38
32
  </div>
33
+ {#if $$slots.line2}
34
+ <div class="body-medium on-surface-variant-text">
35
+ <slot name="line2" />
36
+ </div>
37
+ {/if}
38
+ {#if $$slots.line3}
39
+ <div class="body-medium on-surface-variant-text">
40
+ <slot name="line3" />
41
+ </div>
42
+ {/if}
39
43
  {/if}
40
44
  {:else if type === "trailingText"}
41
45
  <div class="label-small on-surface-variant-text">
@@ -4,7 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  type?: QItemSectionProps["type"];
7
- class?: string | undefined;
7
+ class?: string | null | undefined;
8
8
  };
9
9
  events: {
10
10
  [evt: string]: CustomEvent<any>;