@quaffui/quaff 1.0.0-beta4 → 1.0.0-beta6

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.
@@ -0,0 +1,280 @@
1
+ // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
+ // @quaffHash ccfbfbd518f70dccf3dc979f494134eb
3
+ export const QExpansionItemDocsProps = [
4
+ {
5
+ isArray: false,
6
+ optional: true,
7
+ isSnippet: false,
8
+ name: "value",
9
+ type: {
10
+ name: "boolean",
11
+ isClickable: false,
12
+ },
13
+ description: "The value of the expansion item, used to define the expansion state of the item.",
14
+ default: "",
15
+ },
16
+ {
17
+ isArray: false,
18
+ optional: true,
19
+ isSnippet: false,
20
+ name: "label",
21
+ type: {
22
+ name: "string",
23
+ isClickable: false,
24
+ },
25
+ description: "The label of the expansion item, displayed in the header.",
26
+ default: "",
27
+ },
28
+ {
29
+ isArray: false,
30
+ optional: true,
31
+ isSnippet: false,
32
+ name: "icon",
33
+ type: {
34
+ name: "MaterialSymbol",
35
+ isClickable: false,
36
+ },
37
+ description: "The icon to display in the header of the expansion item.",
38
+ default: "",
39
+ },
40
+ {
41
+ isArray: false,
42
+ optional: true,
43
+ isSnippet: false,
44
+ name: "caption",
45
+ type: {
46
+ name: "string",
47
+ isClickable: false,
48
+ },
49
+ description: "The caption, displayed below the label in the header.",
50
+ default: "",
51
+ },
52
+ {
53
+ isArray: false,
54
+ optional: true,
55
+ isSnippet: false,
56
+ name: "expandIcon",
57
+ type: {
58
+ name: "MaterialSymbol",
59
+ isClickable: false,
60
+ },
61
+ description: "The icon to use as the toggle icon for the expansion item.\nIf not provided, a chevron icon will be used.",
62
+ default: '"chevron_down"',
63
+ },
64
+ {
65
+ isArray: false,
66
+ optional: true,
67
+ isSnippet: false,
68
+ name: "expandedIcon",
69
+ type: {
70
+ name: "MaterialSymbol",
71
+ isClickable: false,
72
+ },
73
+ description: "The icon to use as the collapse icon for the expanded item.\nIf not provided, the expandIcon will be rotated 180 degrees when the item is expanded.",
74
+ default: "",
75
+ },
76
+ {
77
+ isArray: false,
78
+ optional: true,
79
+ isSnippet: false,
80
+ name: "defaultOpened",
81
+ type: {
82
+ name: "boolean",
83
+ isClickable: false,
84
+ },
85
+ description: "Whether the expansion item is initially expanded.",
86
+ default: "false",
87
+ },
88
+ {
89
+ isArray: false,
90
+ optional: true,
91
+ isSnippet: false,
92
+ name: "dense",
93
+ type: {
94
+ name: "boolean",
95
+ isClickable: false,
96
+ },
97
+ description: "Use the dense style for the expansion item, reducing its height.",
98
+ default: "false",
99
+ },
100
+ {
101
+ isArray: false,
102
+ optional: true,
103
+ isSnippet: false,
104
+ name: "duration",
105
+ type: {
106
+ name: "number",
107
+ isClickable: false,
108
+ },
109
+ description: "Duration for the expansion animation in milliseconds.",
110
+ default: "300",
111
+ },
112
+ {
113
+ isArray: false,
114
+ optional: true,
115
+ isSnippet: false,
116
+ name: "hideExpandIcon",
117
+ type: {
118
+ name: "boolean",
119
+ isClickable: false,
120
+ },
121
+ description: "Whether to hide the expand icon.",
122
+ default: "false",
123
+ },
124
+ {
125
+ isArray: false,
126
+ optional: true,
127
+ isSnippet: false,
128
+ name: "name",
129
+ type: {
130
+ name: "string",
131
+ isClickable: false,
132
+ },
133
+ description: 'Register the expansion item into a group, closing other items in the group when this one is opened.\nThis is often called "accordion" behavior. This name is used to identify the group of items\nand should thus be unique.',
134
+ default: "",
135
+ },
136
+ {
137
+ isArray: false,
138
+ optional: true,
139
+ isSnippet: false,
140
+ name: "toggleAriaLabel",
141
+ type: {
142
+ name: "string",
143
+ isClickable: false,
144
+ },
145
+ description: "The aria-label for the toggle button of the expansion item for accessibility.",
146
+ default: '"Open details"',
147
+ },
148
+ {
149
+ isArray: false,
150
+ optional: true,
151
+ isSnippet: false,
152
+ name: "expandIconToggle",
153
+ type: {
154
+ name: "boolean",
155
+ isClickable: false,
156
+ },
157
+ description: "Makes the toggle icon the trigger for the expansion item instead of the whole header.\nThis is useful when using the expansion item as link, so the icon allows to expand/collapse the item\nwhile the header changes the route.",
158
+ default: "false",
159
+ },
160
+ {
161
+ isArray: false,
162
+ optional: true,
163
+ isSnippet: false,
164
+ name: "to",
165
+ type: {
166
+ name: "string",
167
+ isClickable: false,
168
+ },
169
+ description: "Make the expansion item navigational, allowing it to be used as a link.\nIt can be used interchangeably with the `href` prop.\nIf both `href` and `to` are provided, the `to` prop will take precedence.",
170
+ default: "",
171
+ },
172
+ {
173
+ isArray: false,
174
+ optional: true,
175
+ isSnippet: false,
176
+ name: "href",
177
+ type: {
178
+ name: "string",
179
+ isClickable: false,
180
+ },
181
+ description: "The URL to navigate to when the expansion item is clicked.\nIt can be used interchangeably with the `to` prop.\nIf both `href` and `to` are provided, the `to` prop will take precedence.",
182
+ default: "",
183
+ },
184
+ {
185
+ isArray: false,
186
+ optional: true,
187
+ isSnippet: false,
188
+ name: "noRotateExpandIcon",
189
+ type: {
190
+ name: "boolean",
191
+ isClickable: false,
192
+ },
193
+ description: "Prevents the rotation of the expand icon when the item is expanded.\nThis is useful when using a custom icon that does not need to be rotated.",
194
+ default: "false",
195
+ },
196
+ {
197
+ isArray: false,
198
+ optional: true,
199
+ isSnippet: false,
200
+ name: "disabled",
201
+ type: {
202
+ name: "boolean",
203
+ isClickable: false,
204
+ },
205
+ description: "Whether the expansion item is disabled.",
206
+ default: "false",
207
+ },
208
+ {
209
+ isArray: false,
210
+ optional: true,
211
+ isSnippet: false,
212
+ name: "noRipple",
213
+ type: {
214
+ name: "boolean",
215
+ isClickable: false,
216
+ },
217
+ description: "Disables the ripple effect on the expansion item.\nThis is useful when the item is used as a link and you want to prevent the ripple effect.",
218
+ default: "false",
219
+ },
220
+ {
221
+ isArray: false,
222
+ optional: true,
223
+ isSnippet: false,
224
+ name: "onExpandIconClick",
225
+ type: {
226
+ name: "MouseEventHandler<HTMLElement>",
227
+ isClickable: false,
228
+ },
229
+ description: "Event triggered when the expansion icon is clicked.",
230
+ default: "",
231
+ },
232
+ {
233
+ isArray: false,
234
+ optional: true,
235
+ isSnippet: false,
236
+ name: "onclick",
237
+ type: {
238
+ name: "MouseEventHandler<HTMLElement>",
239
+ isClickable: false,
240
+ },
241
+ description: "Event triggered when the expansion item is clicked.",
242
+ default: "",
243
+ },
244
+ ];
245
+ export const QExpansionItemDocsSnippets = [
246
+ {
247
+ isArray: false,
248
+ optional: true,
249
+ isSnippet: true,
250
+ name: "summary",
251
+ type: [
252
+ {
253
+ propName: "expanded",
254
+ isClickable: false,
255
+ optional: false,
256
+ name: "boolean",
257
+ },
258
+ {
259
+ propName: "show",
260
+ isClickable: false,
261
+ optional: false,
262
+ name: "() => void",
263
+ },
264
+ {
265
+ propName: "hide",
266
+ isClickable: false,
267
+ optional: false,
268
+ name: "() => void",
269
+ },
270
+ {
271
+ propName: "toggle",
272
+ isClickable: false,
273
+ optional: false,
274
+ name: "() => void",
275
+ },
276
+ ],
277
+ description: "The summary snippet, to override the default header.\nAs the header uses QItem, you can easily use QItemSection components to customize the header layout.",
278
+ default: "",
279
+ },
280
+ ];
@@ -0,0 +1,129 @@
1
+ import { MaterialSymbol } from "material-symbols";
2
+ import { Snippet } from "svelte";
3
+ import { HTMLDetailsAttributes, MouseEventHandler } from "svelte/elements";
4
+ export interface QExpansionItemProps extends HTMLDetailsAttributes {
5
+ /**
6
+ * The value of the expansion item, used to define the expansion state of the item.
7
+ */
8
+ value?: boolean;
9
+ /**
10
+ * The label of the expansion item, displayed in the header.
11
+ */
12
+ label?: string;
13
+ /**
14
+ * The icon to display in the header of the expansion item.
15
+ */
16
+ icon?: MaterialSymbol;
17
+ /**
18
+ * The caption, displayed below the label in the header.
19
+ */
20
+ caption?: string;
21
+ /**
22
+ * The icon to use as the toggle icon for the expansion item.
23
+ * If not provided, a chevron icon will be used.
24
+ *
25
+ * @default "chevron_down"
26
+ */
27
+ expandIcon?: MaterialSymbol;
28
+ /**
29
+ * The icon to use as the collapse icon for the expanded item.
30
+ * If not provided, the expandIcon will be rotated 180 degrees when the item is expanded.
31
+ */
32
+ expandedIcon?: MaterialSymbol;
33
+ /**
34
+ * Whether the expansion item is initially expanded.
35
+ *
36
+ * @default false
37
+ */
38
+ defaultOpened?: boolean;
39
+ /**
40
+ * Use the dense style for the expansion item, reducing its height.
41
+ *
42
+ * @default false
43
+ */
44
+ dense?: boolean;
45
+ /**
46
+ * Duration for the expansion animation in milliseconds.
47
+ *
48
+ * @default 300
49
+ */
50
+ duration?: number;
51
+ /**
52
+ * Whether to hide the expand icon.
53
+ *
54
+ * @default false
55
+ */
56
+ hideExpandIcon?: boolean;
57
+ /**
58
+ * Register the expansion item into a group, closing other items in the group when this one is opened.
59
+ * This is often called "accordion" behavior. This name is used to identify the group of items
60
+ * and should thus be unique.
61
+ */
62
+ name?: string;
63
+ /**
64
+ * The aria-label for the toggle button of the expansion item for accessibility.
65
+ *
66
+ * @default "Open details"
67
+ */
68
+ toggleAriaLabel?: string;
69
+ /**
70
+ * Makes the toggle icon the trigger for the expansion item instead of the whole header.
71
+ * This is useful when using the expansion item as link, so the icon allows to expand/collapse the item
72
+ * while the header changes the route.
73
+ *
74
+ * @default false
75
+ */
76
+ expandIconToggle?: boolean;
77
+ /**
78
+ * Make the expansion item navigational, allowing it to be used as a link.
79
+ * It can be used interchangeably with the `href` prop.
80
+ * If both `href` and `to` are provided, the `to` prop will take precedence.
81
+ */
82
+ to?: string;
83
+ /**
84
+ * The URL to navigate to when the expansion item is clicked.
85
+ * It can be used interchangeably with the `to` prop.
86
+ * If both `href` and `to` are provided, the `to` prop will take precedence.
87
+ */
88
+ href?: string;
89
+ /**
90
+ * Prevents the rotation of the expand icon when the item is expanded.
91
+ * This is useful when using a custom icon that does not need to be rotated.
92
+ *
93
+ * @default false
94
+ */
95
+ noRotateExpandIcon?: boolean;
96
+ /**
97
+ * Whether the expansion item is disabled.
98
+ *
99
+ * @default false
100
+ */
101
+ disabled?: boolean;
102
+ /**
103
+ * Disables the ripple effect on the expansion item.
104
+ * This is useful when the item is used as a link and you want to prevent the ripple effect.
105
+ *
106
+ * @default false
107
+ */
108
+ noRipple?: boolean;
109
+ /**
110
+ * The summary snippet, to override the default header.
111
+ * As the header uses QItem, you can easily use QItemSection components to customize the header layout.
112
+ */
113
+ summary?: Snippet<[
114
+ {
115
+ expanded: boolean;
116
+ show: () => void;
117
+ hide: () => void;
118
+ toggle: () => void;
119
+ }
120
+ ]>;
121
+ /**
122
+ * Event triggered when the expansion icon is clicked.
123
+ */
124
+ onExpandIconClick?: MouseEventHandler<HTMLElement>;
125
+ /**
126
+ * Event triggered when the expansion item is clicked.
127
+ */
128
+ onclick?: MouseEventHandler<HTMLElement>;
129
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -11,6 +11,7 @@ import QCircularProgress from "./progress/QCircularProgress.svelte";
11
11
  import QCodeBlock from "./codeBlock/QCodeBlock.svelte";
12
12
  import QDialog from "./dialog/QDialog.svelte";
13
13
  import QDrawer from "./drawer/QDrawer.svelte";
14
+ import QExpansionItem from "./expansion-item/QExpansionItem.svelte";
14
15
  import QFooter from "./footer/QFooter.svelte";
15
16
  import QHeader from "./header/QHeader.svelte";
16
17
  import QIcon from "./icon/QIcon.svelte";
@@ -31,4 +32,4 @@ import QSwitch from "./switch/QSwitch.svelte";
31
32
  import QToolbar from "./toolbar/QToolbar.svelte";
32
33
  import QToolbarTitle from "./toolbar/QToolbarTitle.svelte";
33
34
  import QTooltip from "./tooltip/QTooltip.svelte";
34
- export { QAvatar, QBreadcrumbs, QBreadcrumbsEl, QBtn, QCard, QCardSection, QCardActions, QCheckbox, QChip, QCircularProgress, QCodeBlock, QDialog, QDrawer, QFooter, QHeader, QIcon, QInput, QSelect, QLayout, QList, QItem, QItemSection, QLinearProgress, QRadio, QRailbar, QSeparator, QTabs, QTab, QTable, QSwitch, QToolbar, QToolbarTitle, QTooltip, };
35
+ export { QAvatar, QBreadcrumbs, QBreadcrumbsEl, QBtn, QCard, QCardSection, QCardActions, QCheckbox, QChip, QCircularProgress, QCodeBlock, QDialog, QDrawer, QExpansionItem, QFooter, QHeader, QIcon, QInput, QSelect, QLayout, QList, QItem, QItemSection, QLinearProgress, QRadio, QRailbar, QSeparator, QTabs, QTab, QTable, QSwitch, QToolbar, QToolbarTitle, QTooltip, };
@@ -11,6 +11,7 @@ import QCircularProgress from "./progress/QCircularProgress.svelte";
11
11
  import QCodeBlock from "./codeBlock/QCodeBlock.svelte";
12
12
  import QDialog from "./dialog/QDialog.svelte";
13
13
  import QDrawer from "./drawer/QDrawer.svelte";
14
+ import QExpansionItem from "./expansion-item/QExpansionItem.svelte";
14
15
  import QFooter from "./footer/QFooter.svelte";
15
16
  import QHeader from "./header/QHeader.svelte";
16
17
  import QIcon from "./icon/QIcon.svelte";
@@ -31,4 +32,4 @@ import QSwitch from "./switch/QSwitch.svelte";
31
32
  import QToolbar from "./toolbar/QToolbar.svelte";
32
33
  import QToolbarTitle from "./toolbar/QToolbarTitle.svelte";
33
34
  import QTooltip from "./tooltip/QTooltip.svelte";
34
- export { QAvatar, QBreadcrumbs, QBreadcrumbsEl, QBtn, QCard, QCardSection, QCardActions, QCheckbox, QChip, QCircularProgress, QCodeBlock, QDialog, QDrawer, QFooter, QHeader, QIcon, QInput, QSelect, QLayout, QList, QItem, QItemSection, QLinearProgress, QRadio, QRailbar, QSeparator, QTabs, QTab, QTable, QSwitch, QToolbar, QToolbarTitle, QTooltip, };
35
+ export { QAvatar, QBreadcrumbs, QBreadcrumbsEl, QBtn, QCard, QCardSection, QCardActions, QCheckbox, QChip, QCircularProgress, QCodeBlock, QDialog, QDrawer, QExpansionItem, QFooter, QHeader, QIcon, QInput, QSelect, QLayout, QList, QItem, QItemSection, QLinearProgress, QRadio, QRailbar, QSeparator, QTabs, QTab, QTable, QSwitch, QToolbar, QToolbarTitle, QTooltip, };
@@ -88,6 +88,7 @@
88
88
  {:else}
89
89
  <svelte:element
90
90
  this={tag}
91
+ use:ripple={{ disabled: !isClickable || noRipple }}
91
92
  {...props}
92
93
  class={[
93
94
  "q-item",
@@ -9,6 +9,7 @@
9
9
  @forward "$components/chip/QChip.scss";
10
10
  @forward "$components/dialog/QDialog.scss";
11
11
  @forward "$components/drawer/QDrawer.scss";
12
+ @forward "$components/expansion-item/QExpansionItem.scss";
12
13
  @forward "$components/footer/QFooter.scss";
13
14
  @forward "$components/header/QHeader.scss";
14
15
  @forward "$components/icon/QIcon.scss";