@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/README.md +6 -6
  2. package/dist/classes/QContext.svelte.d.ts +42 -0
  3. package/dist/classes/QContext.svelte.js +63 -0
  4. package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
  5. package/dist/classes/QScrollObserver.svelte.js +95 -0
  6. package/dist/classes/QTheme.svelte.d.ts +11 -0
  7. package/dist/classes/QTheme.svelte.js +49 -0
  8. package/dist/classes/Quaff.svelte.d.ts +14 -0
  9. package/dist/classes/Quaff.svelte.js +35 -0
  10. package/dist/components/avatar/QAvatar.scss +97 -0
  11. package/dist/components/avatar/QAvatar.svelte +35 -50
  12. package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
  13. package/dist/components/avatar/docs.d.ts +1 -1
  14. package/dist/components/avatar/docs.js +1 -1
  15. package/dist/components/avatar/docs.props.js +21 -5
  16. package/dist/components/avatar/index.scss +5 -3
  17. package/dist/components/avatar/props.d.ts +24 -7
  18. package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
  19. package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
  20. package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
  21. package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
  22. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
  23. package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
  24. package/dist/components/breadcrumbs/docs.d.ts +1 -1
  25. package/dist/components/breadcrumbs/docs.js +1 -1
  26. package/dist/components/breadcrumbs/docs.props.js +27 -27
  27. package/dist/components/breadcrumbs/props.d.ts +25 -24
  28. package/dist/components/button/QBtn.scss +133 -0
  29. package/dist/components/button/QBtn.svelte +89 -46
  30. package/dist/components/button/QBtn.svelte.d.ts +2 -33
  31. package/dist/components/button/docs.d.ts +1 -1
  32. package/dist/components/button/docs.js +1 -1
  33. package/dist/components/button/docs.props.js +26 -18
  34. package/dist/components/button/props.d.ts +21 -15
  35. package/dist/components/card/QCard.scss +25 -0
  36. package/dist/components/card/QCard.svelte +26 -17
  37. package/dist/components/card/QCard.svelte.d.ts +2 -25
  38. package/dist/components/card/QCardActions.scss +10 -0
  39. package/dist/components/card/QCardActions.svelte +11 -8
  40. package/dist/components/card/QCardActions.svelte.d.ts +2 -21
  41. package/dist/components/card/QCardSection.scss +10 -0
  42. package/dist/components/card/QCardSection.svelte +9 -7
  43. package/dist/components/card/QCardSection.svelte.d.ts +2 -22
  44. package/dist/components/card/docs.d.ts +3 -3
  45. package/dist/components/card/docs.js +3 -3
  46. package/dist/components/card/docs.props.js +6 -14
  47. package/dist/components/card/props.d.ts +9 -15
  48. package/dist/components/checkbox/QCheckbox.svelte +6 -5
  49. package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
  50. package/dist/components/checkbox/docs.d.ts +1 -1
  51. package/dist/components/checkbox/docs.js +1 -1
  52. package/dist/components/checkbox/docs.props.js +1 -1
  53. package/dist/components/checkbox/index.scss +3 -1
  54. package/dist/components/checkbox/props.d.ts +1 -2
  55. package/dist/components/chip/QChip.scss +179 -0
  56. package/dist/components/chip/QChip.svelte +97 -69
  57. package/dist/components/chip/QChip.svelte.d.ts +2 -35
  58. package/dist/components/chip/docs.d.ts +1 -1
  59. package/dist/components/chip/docs.js +1 -1
  60. package/dist/components/chip/docs.props.js +23 -47
  61. package/dist/components/chip/props.d.ts +21 -34
  62. package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
  63. package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
  64. package/dist/components/codeBlock/docs.props.js +10 -2
  65. package/dist/components/codeBlock/props.d.ts +6 -1
  66. package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
  67. package/dist/components/dialog/QDialog.svelte +72 -70
  68. package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
  69. package/dist/components/dialog/docs.d.ts +1 -1
  70. package/dist/components/dialog/docs.js +1 -1
  71. package/dist/components/dialog/docs.props.d.ts +0 -8
  72. package/dist/components/dialog/docs.props.js +1 -131
  73. package/dist/components/dialog/props.d.ts +0 -16
  74. package/dist/components/drawer/QDrawer.scss +45 -0
  75. package/dist/components/drawer/QDrawer.svelte +87 -94
  76. package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
  77. package/dist/components/drawer/docs.d.ts +1 -1
  78. package/dist/components/drawer/docs.js +1 -1
  79. package/dist/components/drawer/docs.props.js +3 -3
  80. package/dist/components/drawer/props.d.ts +2 -2
  81. package/dist/components/footer/QFooter.scss +42 -0
  82. package/dist/components/footer/QFooter.svelte +65 -24
  83. package/dist/components/footer/QFooter.svelte.d.ts +2 -23
  84. package/dist/components/footer/docs.d.ts +1 -1
  85. package/dist/components/footer/docs.js +1 -1
  86. package/dist/components/footer/docs.props.js +14 -6
  87. package/dist/components/footer/props.d.ts +8 -5
  88. package/dist/components/header/QHeader.scss +54 -0
  89. package/dist/components/header/QHeader.svelte +52 -24
  90. package/dist/components/header/QHeader.svelte.d.ts +2 -23
  91. package/dist/components/header/docs.props.js +23 -7
  92. package/dist/components/header/props.d.ts +11 -3
  93. package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
  94. package/dist/components/icon/QIcon.svelte +29 -16
  95. package/dist/components/icon/QIcon.svelte.d.ts +2 -27
  96. package/dist/components/icon/docs.d.ts +1 -1
  97. package/dist/components/icon/docs.js +1 -1
  98. package/dist/components/icon/docs.props.js +5 -5
  99. package/dist/components/icon/props.d.ts +6 -6
  100. package/dist/components/index.d.ts +2 -2
  101. package/dist/components/index.js +2 -2
  102. package/dist/components/input/QInput.svelte +52 -25
  103. package/dist/components/input/QInput.svelte.d.ts +2 -32
  104. package/dist/components/input/docs.d.ts +1 -1
  105. package/dist/components/input/docs.js +1 -1
  106. package/dist/components/input/docs.props.js +33 -1
  107. package/dist/components/input/props.d.ts +5 -12
  108. package/dist/components/input/props.js +1 -12
  109. package/dist/components/layout/QLayout.scss +178 -0
  110. package/dist/components/layout/QLayout.svelte +100 -80
  111. package/dist/components/layout/QLayout.svelte.d.ts +16 -43
  112. package/dist/components/layout/docs.d.ts +1 -1
  113. package/dist/components/layout/docs.js +1 -1
  114. package/dist/components/layout/docs.props.js +57 -1
  115. package/dist/components/layout/props.d.ts +8 -0
  116. package/dist/components/list/QItem.scss +61 -0
  117. package/dist/components/list/QItem.svelte +65 -46
  118. package/dist/components/list/QItem.svelte.d.ts +2 -30
  119. package/dist/components/list/QItemSection.scss +45 -0
  120. package/dist/components/list/QItemSection.svelte +46 -34
  121. package/dist/components/list/QItemSection.svelte.d.ts +2 -24
  122. package/dist/components/list/QList.scss +30 -0
  123. package/dist/components/list/QList.svelte +28 -16
  124. package/dist/components/list/QList.svelte.d.ts +2 -28
  125. package/dist/components/list/docs.d.ts +1 -1
  126. package/dist/components/list/docs.js +1 -1
  127. package/dist/components/list/docs.props.js +36 -4
  128. package/dist/components/list/props.d.ts +9 -8
  129. package/dist/components/list/props.js +1 -25
  130. package/dist/components/private/ContextReseter.svelte +6 -11
  131. package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
  132. package/dist/components/private/QApi.svelte +118 -97
  133. package/dist/components/private/QApi.svelte.d.ts +4 -16
  134. package/dist/components/private/QDocs.svelte +67 -58
  135. package/dist/components/private/QDocs.svelte.d.ts +9 -20
  136. package/dist/components/private/QDocsSection.svelte +15 -22
  137. package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
  138. package/dist/components/private/QIconSnippet.svelte +12 -0
  139. package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
  140. package/dist/components/progress/QCircularProgress.scss +63 -0
  141. package/dist/components/progress/QCircularProgress.svelte +104 -28
  142. package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
  143. package/dist/components/progress/QLinearProgress.scss +75 -0
  144. package/dist/components/progress/QLinearProgress.svelte +55 -13
  145. package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
  146. package/dist/components/progress/docs.d.ts +1 -1
  147. package/dist/components/progress/docs.js +1 -1
  148. package/dist/components/progress/docs.props.js +138 -10
  149. package/dist/components/progress/props.d.ts +75 -12
  150. package/dist/components/radio/QRadio.svelte +14 -3
  151. package/dist/components/radio/QRadio.svelte.d.ts +2 -21
  152. package/dist/components/radio/docs.d.ts +1 -1
  153. package/dist/components/radio/docs.js +1 -1
  154. package/dist/components/radio/docs.props.js +2 -2
  155. package/dist/components/radio/index.scss +3 -1
  156. package/dist/components/radio/props.d.ts +2 -4
  157. package/dist/components/radio/props.js +1 -8
  158. package/dist/components/railbar/QRailbar.scss +54 -0
  159. package/dist/components/railbar/QRailbar.svelte +43 -66
  160. package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
  161. package/dist/components/railbar/docs.d.ts +1 -1
  162. package/dist/components/railbar/docs.js +1 -1
  163. package/dist/components/railbar/docs.props.js +4 -4
  164. package/dist/components/railbar/props.d.ts +3 -3
  165. package/dist/components/select/QSelect.svelte +121 -88
  166. package/dist/components/select/QSelect.svelte.d.ts +2 -34
  167. package/dist/components/select/docs.d.ts +1 -1
  168. package/dist/components/select/docs.js +8 -1
  169. package/dist/components/select/docs.props.js +41 -1
  170. package/dist/components/select/index.scss +8 -6
  171. package/dist/components/select/props.d.ts +6 -12
  172. package/dist/components/select/props.js +1 -12
  173. package/dist/components/separator/QSeparator.scss +54 -0
  174. package/dist/components/separator/QSeparator.svelte +38 -45
  175. package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
  176. package/dist/components/separator/docs.d.ts +1 -1
  177. package/dist/components/separator/docs.js +1 -1
  178. package/dist/components/separator/docs.props.js +4 -4
  179. package/dist/components/separator/props.d.ts +5 -7
  180. package/dist/components/separator/props.js +1 -9
  181. package/dist/components/switch/QSwitch.scss +305 -0
  182. package/dist/components/switch/QSwitch.svelte +96 -0
  183. package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
  184. package/dist/components/{toggle → switch}/docs.d.ts +1 -1
  185. package/dist/components/{toggle → switch}/docs.js +3 -3
  186. package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
  187. package/dist/components/{toggle → switch}/docs.props.js +30 -6
  188. package/dist/components/switch/props.d.ts +13 -0
  189. package/dist/components/switch/props.js +1 -0
  190. package/dist/components/table/QTable.svelte +99 -85
  191. package/dist/components/table/QTable.svelte.d.ts +3 -29
  192. package/dist/components/table/docs.d.ts +1 -1
  193. package/dist/components/table/docs.js +1 -1
  194. package/dist/components/table/docs.props.js +9 -1
  195. package/dist/components/table/index.scss +3 -1
  196. package/dist/components/table/props.d.ts +10 -0
  197. package/dist/components/tabs/QTab.scss +71 -0
  198. package/dist/components/tabs/QTab.svelte +75 -96
  199. package/dist/components/tabs/QTab.svelte.d.ts +2 -25
  200. package/dist/components/tabs/QTabs.scss +40 -0
  201. package/dist/components/tabs/QTabs.svelte +107 -59
  202. package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
  203. package/dist/components/tabs/docs.d.ts +1 -1
  204. package/dist/components/tabs/docs.js +1 -1
  205. package/dist/components/tabs/docs.props.js +3 -3
  206. package/dist/components/tabs/index.scss +4 -2
  207. package/dist/components/tabs/props.d.ts +5 -4
  208. package/dist/components/tabs/props.js +1 -1
  209. package/dist/components/toolbar/QToolbar.svelte +15 -12
  210. package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
  211. package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
  212. package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
  213. package/dist/components/toolbar/docs.d.ts +1 -1
  214. package/dist/components/toolbar/docs.js +1 -1
  215. package/dist/components/toolbar/docs.props.js +4 -4
  216. package/dist/components/toolbar/index.scss +12 -14
  217. package/dist/components/toolbar/props.d.ts +4 -5
  218. package/dist/components/tooltip/QTooltip.svelte +5 -9
  219. package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
  220. package/dist/components/tooltip/docs.d.ts +1 -1
  221. package/dist/components/tooltip/docs.js +1 -1
  222. package/dist/components/tooltip/docs.props.js +1 -1
  223. package/dist/components/tooltip/index.scss +3 -1
  224. package/dist/components/tooltip/props.d.ts +1 -1
  225. package/dist/composables/index.d.ts +3 -3
  226. package/dist/composables/index.js +3 -3
  227. package/dist/composables/useSize.d.ts +10 -0
  228. package/dist/composables/useSize.js +37 -0
  229. package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
  230. package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
  231. package/dist/css/_components.scss +31 -0
  232. package/dist/css/_disabled.scss +18 -0
  233. package/dist/css/{ripple.scss → _ripple.scss} +1 -1
  234. package/dist/css/_variables.scss +73 -0
  235. package/dist/css/classes/_design.scss +57 -0
  236. package/dist/css/classes/_flex.scss +62 -0
  237. package/dist/css/classes/_grid.scss +35 -0
  238. package/dist/css/classes/_index.scss +7 -0
  239. package/dist/css/classes/_overflow.scss +7 -0
  240. package/dist/css/classes/_position.scss +7 -0
  241. package/dist/css/classes/_select.scss +6 -0
  242. package/dist/css/classes/_spaces.scss +23 -0
  243. package/dist/css/fonts.scss +16 -3
  244. package/dist/css/index.css +1 -1
  245. package/dist/css/index.scss +15 -94
  246. package/dist/css/mixins/_design.scss +63 -0
  247. package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
  248. package/dist/css/mixins/_image.scss +63 -0
  249. package/dist/css/mixins/_index.scss +9 -0
  250. package/dist/css/mixins/_layout.scss +20 -0
  251. package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
  252. package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
  253. package/dist/css/mixins/_spaces.scss +36 -0
  254. package/dist/css/mixins/_typography.scss +7 -0
  255. package/dist/css/shared/q-field.scss +62 -32
  256. package/dist/css/theme/_colors.scss +173 -0
  257. package/dist/css/theme/css-variables.scss +5 -0
  258. package/dist/css/theme/page.scss +3 -3
  259. package/dist/css/theme/reset.scss +17 -1
  260. package/dist/css/theme/theme.scss +2 -3
  261. package/dist/css/theme/tokens.scss +0 -159
  262. package/dist/global.d.ts +1 -1
  263. package/dist/helpers/clickOutside.d.ts +2 -2
  264. package/dist/helpers/clickOutside.js +5 -4
  265. package/dist/helpers/ripple.d.ts +1 -1
  266. package/dist/helpers/ripple.js +14 -5
  267. package/dist/helpers/version.d.ts +1 -1
  268. package/dist/helpers/version.js +1 -1
  269. package/dist/index.d.ts +2 -1
  270. package/dist/index.js +2 -1
  271. package/dist/stores/index.d.ts +0 -2
  272. package/dist/stores/index.js +1 -2
  273. package/dist/utils/clipboard.js +2 -2
  274. package/dist/utils/colors.d.ts +71 -0
  275. package/dist/utils/colors.js +103 -15
  276. package/dist/utils/dom.d.ts +2 -0
  277. package/dist/utils/dom.js +10 -4
  278. package/dist/utils/number.d.ts +2 -0
  279. package/dist/utils/number.js +9 -0
  280. package/dist/utils/props.d.ts +2 -2
  281. package/dist/utils/props.js +8 -6
  282. package/dist/utils/router.d.ts +17 -0
  283. package/dist/utils/router.js +23 -0
  284. package/dist/utils/string.d.ts +1 -0
  285. package/dist/utils/string.js +4 -1
  286. package/dist/utils/types.d.ts +7 -2
  287. package/dist/utils/types.js +0 -3
  288. package/dist/utils/types.json +8 -5
  289. package/dist/utils/watchable.d.ts +0 -1
  290. package/dist/utils/watchable.js +1 -1
  291. package/package.json +42 -39
  292. package/dist/components/breadcrumbs/index.scss +0 -20
  293. package/dist/components/button/index.scss +0 -98
  294. package/dist/components/card/index.scss +0 -56
  295. package/dist/components/chip/index.scss +0 -103
  296. package/dist/components/drawer/index.scss +0 -59
  297. package/dist/components/footer/index.scss +0 -28
  298. package/dist/components/layout/index.scss +0 -387
  299. package/dist/components/list/index.scss +0 -144
  300. package/dist/components/progress/index.scss +0 -82
  301. package/dist/components/railbar/index.scss +0 -39
  302. package/dist/components/separator/index.scss +0 -52
  303. package/dist/components/toggle/QToggle.svelte +0 -34
  304. package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
  305. package/dist/components/toggle/index.scss +0 -31
  306. package/dist/components/toggle/props.d.ts +0 -9
  307. package/dist/components/toggle/props.js +0 -9
  308. package/dist/css/grid.scss +0 -50
  309. package/dist/css/mixins.scss +0 -137
  310. package/dist/css/states.scss +0 -75
  311. package/dist/css/theme/bridge.scss +0 -15
  312. package/dist/css/theme/theme.dark.scss +0 -39
  313. package/dist/css/theme/theme.light.scss +0 -39
  314. package/dist/css/variables-sass.scss +0 -16
  315. package/dist/stores/QTheme.d.ts +0 -42
  316. package/dist/stores/QTheme.js +0 -60
  317. package/dist/stores/Quaff.d.ts +0 -32
  318. package/dist/stores/Quaff.js +0 -58
  319. /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
  320. /package/dist/composables/{use-align.js → useAlign.js} +0 -0
  321. /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
  322. /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
  323. /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
@@ -1,68 +1,60 @@
1
1
  // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
- // @quaffHash 64a4b0e1fd969d51711b5f49c74fd317
2
+ // @quaffHash b77ea0d9cbe2991add2f2dccab50f658
3
3
  export const QChipDocsProps = [
4
4
  {
5
- name: "content",
6
- type: "string",
5
+ name: "kind",
6
+ type: "QChipKindOptions",
7
7
  optional: true,
8
- clickableType: false,
9
- description: "The content inside the chip. Will overwrite the default slot.",
8
+ clickableType: true,
9
+ description: "The chip's kind. It will control the chip's style and behavior.",
10
10
  default: "undefined",
11
11
  },
12
12
  {
13
- name: "icon",
13
+ name: "label",
14
14
  type: "string",
15
15
  optional: true,
16
16
  clickableType: false,
17
- description: 'Name of the leading icon to use for the chip. If starts with "img:", will be used as an image src instead.',
17
+ description: "The chip's text content. Will overwrite the default slot.",
18
18
  default: "undefined",
19
19
  },
20
20
  {
21
- name: "iconRight",
22
- type: "string",
21
+ name: "icon",
22
+ type: "MaterialSymbol | `img:${string}`",
23
23
  optional: true,
24
- clickableType: false,
25
- description: 'Name of the trailing icon to use for the chip. If starts with "img:", will be used as an image src instead.',
24
+ clickableType: true,
25
+ description: 'Name of the leading icon to use for the chip. If starts with "img:", will be used as an image src instead.',
26
26
  default: "undefined",
27
27
  },
28
28
  {
29
- name: "disable",
30
- type: "boolean",
31
- optional: true,
32
- clickableType: false,
33
- description: "Puts the chip in a disabled state, making it unclickable.",
34
- default: "false",
35
- },
36
- {
37
- name: "responsive",
38
- type: "boolean",
29
+ name: "trailingIcon",
30
+ type: "MaterialSymbol | `img:${string}`",
39
31
  optional: true,
40
- clickableType: false,
41
- description: "Makes leading and trailing images responsive, making them take more space.",
42
- default: "false",
32
+ clickableType: true,
33
+ description: "Only for filter and input chips. Name of the trailing icon to use for the chip.",
34
+ default: "undefined",
43
35
  },
44
36
  {
45
- name: "vertical",
37
+ name: "disabled",
46
38
  type: "boolean",
47
39
  optional: true,
48
40
  clickableType: false,
49
- description: "If true, the chip will display its content vertically.",
41
+ description: "Puts the chip in a disabled state, making it unactivable.",
50
42
  default: "false",
51
43
  },
52
44
  {
53
- name: "round",
45
+ name: "selected",
54
46
  type: "boolean",
55
47
  optional: true,
56
48
  clickableType: false,
57
- description: "Use round design for the chip, adding a large border-radius to it.",
49
+ description: "Only for filter chips. Controls wether the chip is selected or not.",
58
50
  default: "false",
59
51
  },
60
52
  {
61
- name: "outlined",
53
+ name: "elevated",
62
54
  type: "boolean",
63
55
  optional: true,
64
56
  clickableType: false,
65
- description: "Use outline design for the chip, adding a border around it.",
57
+ description: "Elevates the button, giving it box-shadow and a background color.",
66
58
  default: "false",
67
59
  },
68
60
  {
@@ -79,22 +71,6 @@ export const QChipDocsProps = [
79
71
  optional: true,
80
72
  clickableType: true,
81
73
  description: "Size of the chip.",
82
- default: "small",
83
- },
84
- {
85
- name: "tabindex",
86
- type: "number",
87
- optional: true,
88
- clickableType: false,
89
- description: "Tabindex of the chip.",
90
- default: "undefined",
91
- },
92
- {
93
- name: "href",
94
- type: "string",
95
- optional: true,
96
- clickableType: false,
97
- description: 'Makes the chip navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id").',
98
- default: "undefined",
74
+ default: "sm",
99
75
  },
100
76
  ];
@@ -1,47 +1,44 @@
1
- import type { QuaffSizes, NativeProps } from "../../utils";
1
+ import type { MaterialSymbol } from "material-symbols";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
- export type QChipSizeOptions = Exclude<QuaffSizes, "xs" | "xl">;
4
- export interface QChipProps extends NativeProps, HTMLAttributes<HTMLAnchorElement> {
3
+ export type QChipKindOptions = "assist" | "filter" | "input" | "suggestion";
4
+ export type QChipFillOptions = "primary" | "secondary" | "tertiary" | "neutral" | "neutral-variant" | "error";
5
+ export type QChipSizeOptions = Exclude<Q.Size, "xs" | "xl" | "none">;
6
+ export interface QChipProps extends HTMLAttributes<HTMLDivElement> {
5
7
  /**
6
- * The content inside the chip. Will overwrite the default slot.
8
+ * The chip's kind. It will control the chip's style and behavior.
7
9
  * @default undefined
8
10
  */
9
- content?: string;
11
+ kind?: QChipKindOptions;
10
12
  /**
11
- * Name of the leading icon to use for the chip. If starts with "img:", will be used as an image src instead.
13
+ * The chip's text content. Will overwrite the default slot.
12
14
  * @default undefined
13
15
  */
14
- icon?: string;
16
+ label?: string;
15
17
  /**
16
- * Name of the trailing icon to use for the chip. If starts with "img:", will be used as an image src instead.
18
+ * Name of the leading icon to use for the chip. If starts with "img:", will be used as an image src instead.
17
19
  * @default undefined
18
20
  */
19
- iconRight?: string;
21
+ icon?: MaterialSymbol | `img:${string}`;
20
22
  /**
21
- * Puts the chip in a disabled state, making it unclickable.
22
- * @default false
23
- */
24
- disable?: boolean;
25
- /**
26
- * Makes leading and trailing images responsive, making them take more space.
27
- * @default false
23
+ * Only for filter and input chips. Name of the trailing icon to use for the chip.
24
+ * @default undefined
28
25
  */
29
- responsive?: boolean;
26
+ trailingIcon?: MaterialSymbol | `img:${string}`;
30
27
  /**
31
- * If true, the chip will display its content vertically.
28
+ * Puts the chip in a disabled state, making it unactivable.
32
29
  * @default false
33
30
  */
34
- vertical?: boolean;
31
+ disabled?: boolean;
35
32
  /**
36
- * Use round design for the chip, adding a large border-radius to it.
33
+ * Only for filter chips. Controls wether the chip is selected or not.
37
34
  * @default false
38
35
  */
39
- round?: boolean;
36
+ selected?: boolean;
40
37
  /**
41
- * Use outline design for the chip, adding a border around it.
38
+ * Elevates the button, giving it box-shadow and a background color.
42
39
  * @default false
43
40
  */
44
- outlined?: boolean;
41
+ elevated?: boolean;
45
42
  /**
46
43
  * Disable the ripple effect for the chip.
47
44
  * @default false
@@ -49,17 +46,7 @@ export interface QChipProps extends NativeProps, HTMLAttributes<HTMLAnchorElemen
49
46
  noRipple?: boolean;
50
47
  /**
51
48
  * Size of the chip.
52
- * @default small
49
+ * @default sm
53
50
  */
54
51
  size?: QChipSizeOptions;
55
- /**
56
- * Tabindex of the chip.
57
- * @default undefined
58
- */
59
- tabindex?: number;
60
- /**
61
- * Makes the chip navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id").
62
- * @default undefined
63
- */
64
- href?: string;
65
52
  }
@@ -1,41 +1,58 @@
1
- <script>import Highlight from "svelte-highlight";
2
- import typescript from "svelte-highlight/languages/typescript";
3
- import { copy } from "../../utils";
4
- import { QBtn } from "../..";
5
- export let language, code = "/* No code found */", title = void 0, copiable = void 0;
6
- let btnContent = "Copy";
7
- let btnColor = "primary";
8
- function setBtn(type) {
9
- switch (type) {
10
- case "error":
11
- btnContent = "Error while copying...";
12
- btnColor = "error";
13
- break;
14
- case "success":
15
- btnContent = "Copied!";
16
- btnColor = "green";
17
- break;
18
- default:
19
- btnContent = "Copy";
20
- btnColor = "primary";
21
- break;
1
+ <script lang="ts">
2
+ import { codeToHtml } from "shiki";
3
+ import { copy } from "../../utils";
4
+ import { QBtn } from "../..";
5
+ let {
6
+ language,
7
+ theme = "github-dark-default",
8
+ code = "/* No code found */",
9
+ title = void 0,
10
+ copiable = void 0,
11
+ } = $props();
12
+ let btnContent = $state("Copy");
13
+ let btnColor = $state("primary");
14
+ const html = $derived.by(
15
+ async () =>
16
+ await codeToHtml(code, {
17
+ lang: language,
18
+ theme,
19
+ }),
20
+ );
21
+ function setBtn(type) {
22
+ switch (type) {
23
+ case "error":
24
+ btnContent = "Error while copying...";
25
+ btnColor = "error";
26
+ break;
27
+ case "success":
28
+ btnContent = "Copied!";
29
+ btnColor = "green";
30
+ break;
31
+ default:
32
+ btnContent = "Copy";
33
+ btnColor = "primary";
34
+ break;
35
+ }
36
+ }
37
+ async function copyCode() {
38
+ await copy(code).catch(() => {
39
+ setBtn("error");
40
+ setTimeout(() => setBtn("base"), 3e3);
41
+ });
42
+ setBtn("success");
43
+ setTimeout(() => {
44
+ setBtn("base");
45
+ }, 3e3);
22
46
  }
23
- }
24
- async function copyCode() {
25
- await copy(code).catch((_) => {
26
- setBtn("error");
27
- setTimeout(() => setBtn("base"), 3e3);
28
- });
29
- setBtn("success");
30
- setTimeout(() => {
31
- setBtn("base");
32
- }, 3e3);
33
- }
34
47
  </script>
35
48
 
36
49
  <div class="q-code-block">
37
50
  {#if copiable}
38
- <div class="flex justify-between {title ? 'items-center' : 'justify-end'} q-pb-sm">
51
+ <div
52
+ class="flex justify-between {title
53
+ ? 'items-center'
54
+ : 'justify-end'} q-pb-sm"
55
+ >
39
56
  {#if title}
40
57
  <h4 class="q-ma-none q-pr-lg">{title}</h4>
41
58
  {/if}
@@ -43,8 +60,8 @@ async function copyCode() {
43
60
  class="border-{btnColor} text-{btnColor}"
44
61
  size="sm"
45
62
  icon="content_copy"
46
- outline
47
- on:click={copyCode}
63
+ design="outlined"
64
+ onclick={copyCode}
48
65
  >
49
66
  {btnContent}
50
67
  </QBtn>
@@ -52,21 +69,22 @@ async function copyCode() {
52
69
  {:else if title}
53
70
  <h4>{title}</h4>
54
71
  {/if}
55
- <Highlight language={typescript} {code} />
72
+ {#await html}
73
+ <!-- waiting -->
74
+ {:then htmlContent}
75
+ {@html htmlContent}
76
+ {:catch error}
77
+ <pre>An error occurred: {error}</pre>
78
+ <!-- error -->
79
+ {/await}
56
80
  </div>
57
81
 
58
82
  <style>
59
83
  .q-code-block {
60
84
  border-radius: 0.5em;
61
- }
62
-
63
- pre {
64
- max-height: 400px;
65
- height: 100%;
66
- margin: 0;
67
- }
68
85
 
69
- code {
70
- white-space: pre-wrap;
86
+ :global(pre) {
87
+ white-space: break-spaces;
88
+ }
71
89
  }
72
90
  </style>
@@ -1,20 +1,3 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QCodeBlockProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- language: QCodeBlockProps["language"];
6
- code?: QCodeBlockProps["code"];
7
- title?: QCodeBlockProps["title"];
8
- copiable?: QCodeBlockProps["copiable"];
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {};
14
- };
15
- type QCodeBlockProps_ = typeof __propDef.props;
16
- export { QCodeBlockProps_ as QCodeBlockProps };
17
- export type QCodeBlockEvents = typeof __propDef.events;
18
- export type QCodeBlockSlots = typeof __propDef.slots;
19
- export default class QCodeBlock extends SvelteComponent<QCodeBlockProps, QCodeBlockEvents, QCodeBlockSlots> {
20
- }
2
+ declare const QCodeBlock: import("svelte").Component<QCodeBlockProps, {}, "">;
3
+ export default QCodeBlock;
@@ -1,14 +1,22 @@
1
1
  // AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
2
- // @quaffHash c12fedd812ba1e4b4a732b44d9624532
2
+ // @quaffHash 4fdac21bb131f4d8ac9d24b9f1dbe6eb
3
3
  export const QCodeBlockDocsProps = [
4
4
  {
5
5
  name: "language",
6
- type: "string",
6
+ type: "BundledLanguage | SpecialLanguage",
7
7
  optional: false,
8
8
  clickableType: false,
9
9
  description: "Language to use for highlighting.",
10
10
  default: "",
11
11
  },
12
+ {
13
+ name: "theme",
14
+ type: "BundledTheme",
15
+ optional: true,
16
+ clickableType: true,
17
+ description: "Theme to use for highlighting.",
18
+ default: "",
19
+ },
12
20
  {
13
21
  name: "code",
14
22
  type: "string",
@@ -1,9 +1,14 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
+ import type { SpecialLanguage, BundledLanguage, BundledTheme } from "shiki";
2
3
  export interface QCodeBlockProps extends HTMLAttributes<HTMLDivElement> {
3
4
  /**
4
5
  * Language to use for highlighting.
5
6
  */
6
- language: string;
7
+ language: BundledLanguage | SpecialLanguage;
8
+ /**
9
+ * Theme to use for highlighting.
10
+ */
11
+ theme?: BundledTheme;
7
12
  /**
8
13
  * Code to highlight.
9
14
  */
@@ -1,3 +1,6 @@
1
+ @use "$css/mixins";
2
+ @use "$css/variables";
3
+
1
4
  .q-dialog {
2
5
  display: block;
3
6
  border: none;
@@ -17,20 +20,19 @@
17
20
  overflow-x: hidden;
18
21
  overflow-y: auto;
19
22
  transition:
20
- var(--speed3) all,
23
+ variables.$speed3 all,
21
24
  0s background-color;
22
25
  transform: translate(-50%, -4rem);
23
26
  animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
24
- transform-origin: top left;
25
27
 
26
- &:is(&--active, [open]) {
28
+ &:is(&.active, [open]) {
27
29
  opacity: 1;
28
30
  visibility: visible;
29
31
  transform: translate(-50%, 0);
30
32
  }
31
33
 
32
34
  &::backdrop {
33
- visibility: hidden;
35
+ pointer-events: none;
34
36
  }
35
37
 
36
38
  &:not(&--left, &--right, &--top, &--bottom) {
@@ -153,11 +155,11 @@
153
155
  }
154
156
 
155
157
  &--modal::backdrop {
156
- visibility: visible;
157
- background-color: rgba(0, 0, 0, 0.5);
158
+ display: block;
159
+ background-color: mixins.with-alpha(var(--shadow), 50%);
158
160
  }
159
161
 
160
- &.animating {
162
+ &--animating {
161
163
  animation: shake 0.15s;
162
164
  }
163
165
  }
@@ -1,85 +1,87 @@
1
- <script>import { clickOutsideDialog } from "../../helpers";
2
- import { createEventDispatcher } from "svelte";
3
- import { QBtn } from "../..";
4
- export let button = false, buttonLabel = void 0, buttonProps = {}, position = "default", modal = false, fullscreen = false, persistent = false, userClasses = "", value = false;
5
- export { userClasses as class };
6
- const emit = createEventDispatcher();
7
- let dialogElement;
8
- const ANIMATION_DURATION = 300;
9
- $:
10
- if (dialogElement) {
1
+ <script lang="ts">
2
+ let {
3
+ value = $bindable(false),
4
+ position = "default",
5
+ modal = false,
6
+ fullscreen = false,
7
+ persistent = false,
8
+ children,
9
+ ...props
10
+ } = $props();
11
+ let dialogEl;
12
+ const canHide = $derived(value && !persistent);
13
+ $effect(() => {
11
14
  if (value) {
12
- dialogElement.style.visibility = "visible";
13
- modal ? dialogElement.showModal() : dialogElement.show();
15
+ dialogEl?.[modal ? "showModal" : "show"]();
16
+ setTimeout(() => {
17
+ window.addEventListener("click", tryCancel);
18
+ }, 150);
19
+ } else {
20
+ dialogEl?.close();
21
+ window.removeEventListener("click", tryCancel);
22
+ }
23
+ });
24
+ export function hide() {
25
+ if (dialogEl.open) {
26
+ value = false;
27
+ }
28
+ }
29
+ export function show() {
30
+ if (!dialogEl.open) {
31
+ value = true;
32
+ }
33
+ }
34
+ export function toggle() {
35
+ if (dialogEl.open) {
36
+ hide();
14
37
  } else {
15
- dialogElement.close();
38
+ show();
39
+ }
40
+ }
41
+ function addAnimation() {
42
+ if (persistent && value) {
43
+ dialogEl.classList.add("q-dialog--animating");
16
44
  setTimeout(() => {
17
- dialogElement.style.visibility = "hidden";
18
- }, ANIMATION_DURATION);
45
+ dialogEl.classList.remove("q-dialog--animating");
46
+ }, 150);
19
47
  }
20
48
  }
21
- $:
22
- canHideOnClickOutside = value && !persistent;
23
- export function hide() {
24
- value = false;
25
- }
26
- export function show() {
27
- value = true;
28
- }
29
- export function toggle(e) {
30
- value = !value;
31
- e?.stopPropagation();
32
- }
33
- function addAnimation() {
34
- if (persistent && value) {
35
- dialogElement?.classList.add("animating");
36
- setTimeout(() => {
37
- dialogElement?.classList.remove("animating");
38
- }, ANIMATION_DURATION);
49
+ function handleClickInside(e) {
50
+ e.stopPropagation();
39
51
  }
40
- }
41
- function handleKeyboardHide(e) {
42
- if (canHideOnClickOutside) {
43
- hide();
44
- } else {
45
- addAnimation();
46
- e.preventDefault();
52
+ function onkeydown(e) {
53
+ if (e.key === "Escape") {
54
+ tryCancel(e);
55
+ }
47
56
  }
48
- }
49
- function handleClickHide() {
50
- if (canHideOnClickOutside) {
51
- hide();
52
- } else {
53
- addAnimation();
57
+ function tryCancel(e) {
58
+ if (canHide) {
59
+ hide();
60
+ } else {
61
+ addAnimation();
62
+ e.preventDefault();
63
+ }
54
64
  }
55
- }
56
65
  </script>
57
66
 
58
- {#if button}
59
- <QBtn
60
- {...buttonProps}
61
- label={buttonLabel}
62
- on:click={toggle}
63
- on:click={(event) => emit("buttonClick", event)}
64
- >
65
- <slot name="button" />
66
- </QBtn>
67
- {/if}
68
-
69
67
  <dialog
70
- use:clickOutsideDialog={handleClickHide}
71
- class="q-dialog {userClasses}"
68
+ bind:this={dialogEl}
69
+ {...props}
70
+ class="q-dialog{props.class ? ` ${props.class}` : ''}{[
71
+ 'top',
72
+ 'right',
73
+ 'bottom',
74
+ 'left',
75
+ ].includes(position)
76
+ ? ` q-dialog--${position}`
77
+ : ''}"
72
78
  class:q-dialog--active={value}
73
- class:q-dialog--top={position === "top"}
74
- class:q-dialog--right={position === "right"}
75
- class:q-dialog--bottom={position === "bottom"}
76
- class:q-dialog--left={position === "left"}
77
- class:q-dialog--modal={modal}
78
79
  class:q-dialog--fullscreen={fullscreen}
79
- class:q-dialog--persistent={persistent}
80
- {...$$restProps}
81
- bind:this={dialogElement}
82
- on:cancel={handleKeyboardHide}
80
+ class:q-dialog--modal={modal}
81
+ onclick={handleClickInside}
82
+ oncancel={tryCancel}
83
+ {onkeydown}
84
+ aria-hidden={!value || undefined}
83
85
  >
84
- <slot />
86
+ {@render children?.()}
85
87
  </dialog>
@@ -1,37 +1,7 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { QDialogProps } from "./props";
3
- declare const __propDef: {
4
- props: {
5
- [x: string]: any;
6
- button?: QDialogProps["button"];
7
- buttonLabel?: QDialogProps["buttonLabel"];
8
- buttonProps?: QDialogProps["buttonProps"];
9
- position?: QDialogProps["position"];
10
- modal?: QDialogProps["modal"];
11
- fullscreen?: QDialogProps["fullscreen"];
12
- persistent?: QDialogProps["persistent"];
13
- class?: string | null | undefined;
14
- value?: boolean | undefined;
15
- hide?: (() => void) | undefined;
16
- show?: (() => void) | undefined;
17
- toggle?: ((e?: MouseEvent) => void) | undefined;
18
- };
19
- events: {
20
- buttonClick: CustomEvent<any>;
21
- } & {
22
- [evt: string]: CustomEvent<any>;
23
- };
24
- slots: {
25
- button: {};
26
- default: {};
27
- };
28
- };
29
- type QDialogProps_ = typeof __propDef.props;
30
- export { QDialogProps_ as QDialogProps };
31
- export type QDialogEvents = typeof __propDef.events;
32
- export type QDialogSlots = typeof __propDef.slots;
33
- export default class QDialog extends SvelteComponent<QDialogProps, QDialogEvents, QDialogSlots> {
34
- get hide(): any;
35
- get show(): any;
36
- get toggle(): any;
37
- }
2
+ declare const QDialog: import("svelte").Component<QDialogProps, {
3
+ hide: () => void;
4
+ show: () => void;
5
+ toggle: () => void;
6
+ }, "value">;
7
+ export default QDialog;
@@ -1,2 +1,2 @@
1
1
  import type { QComponentDocs } from "../../utils";
2
- export declare let QDialogDocs: QComponentDocs;
2
+ export declare const QDialogDocs: QComponentDocs;
@@ -1,5 +1,5 @@
1
1
  import { QDialogDocsProps } from "./docs.props";
2
- export let QDialogDocs = {
2
+ export const QDialogDocs = {
3
3
  name: "QDialog",
4
4
  description: "Dialogs provide important prompts in a user flow.",
5
5
  docs: {