@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.
- package/README.md +6 -6
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
- package/dist/classes/QScrollObserver.svelte.js +95 -0
- package/dist/classes/QTheme.svelte.d.ts +11 -0
- package/dist/classes/QTheme.svelte.js +49 -0
- package/dist/classes/Quaff.svelte.d.ts +14 -0
- package/dist/classes/Quaff.svelte.js +35 -0
- package/dist/components/avatar/QAvatar.scss +97 -0
- package/dist/components/avatar/QAvatar.svelte +35 -50
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +21 -5
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +24 -7
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +27 -27
- package/dist/components/breadcrumbs/props.d.ts +25 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +89 -46
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +26 -18
- package/dist/components/button/props.d.ts +21 -15
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +26 -17
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +11 -8
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +9 -7
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +3 -3
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +6 -5
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +1 -1
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +1 -1
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +1 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +97 -69
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
- package/dist/components/codeBlock/docs.props.js +10 -2
- package/dist/components/codeBlock/props.d.ts +6 -1
- package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
- package/dist/components/dialog/QDialog.svelte +72 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.js +1 -1
- package/dist/components/dialog/docs.props.d.ts +0 -8
- package/dist/components/dialog/docs.props.js +1 -131
- package/dist/components/dialog/props.d.ts +0 -16
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +87 -94
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +3 -3
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +65 -24
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +1 -1
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +14 -6
- package/dist/components/footer/props.d.ts +8 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +52 -24
- package/dist/components/header/QHeader.svelte.d.ts +2 -23
- package/dist/components/header/docs.props.js +23 -7
- package/dist/components/header/props.d.ts +11 -3
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +29 -16
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +5 -5
- package/dist/components/icon/props.d.ts +6 -6
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/input/QInput.svelte +52 -25
- package/dist/components/input/QInput.svelte.d.ts +2 -32
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/docs.js +1 -1
- package/dist/components/input/docs.props.js +33 -1
- package/dist/components/input/props.d.ts +5 -12
- package/dist/components/input/props.js +1 -12
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +100 -80
- package/dist/components/layout/QLayout.svelte.d.ts +16 -43
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +57 -1
- package/dist/components/layout/props.d.ts +8 -0
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +65 -46
- package/dist/components/list/QItem.svelte.d.ts +2 -30
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +46 -34
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +28 -16
- package/dist/components/list/QList.svelte.d.ts +2 -28
- package/dist/components/list/docs.d.ts +1 -1
- package/dist/components/list/docs.js +1 -1
- package/dist/components/list/docs.props.js +36 -4
- package/dist/components/list/props.d.ts +9 -8
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +118 -97
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -58
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -22
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
- package/dist/components/private/QIconSnippet.svelte +12 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +104 -28
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +55 -13
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
- package/dist/components/progress/docs.d.ts +1 -1
- package/dist/components/progress/docs.js +1 -1
- package/dist/components/progress/docs.props.js +138 -10
- package/dist/components/progress/props.d.ts +75 -12
- package/dist/components/radio/QRadio.svelte +14 -3
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +1 -1
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +2 -2
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +2 -4
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +43 -66
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +1 -1
- package/dist/components/railbar/docs.js +1 -1
- package/dist/components/railbar/docs.props.js +4 -4
- package/dist/components/railbar/props.d.ts +3 -3
- package/dist/components/select/QSelect.svelte +121 -88
- package/dist/components/select/QSelect.svelte.d.ts +2 -34
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.js +8 -1
- package/dist/components/select/docs.props.js +41 -1
- package/dist/components/select/index.scss +8 -6
- package/dist/components/select/props.d.ts +6 -12
- package/dist/components/select/props.js +1 -12
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +38 -45
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +1 -1
- package/dist/components/separator/docs.js +1 -1
- package/dist/components/separator/docs.props.js +4 -4
- package/dist/components/separator/props.d.ts +5 -7
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +96 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
- package/dist/components/{toggle → switch}/docs.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.props.js +30 -6
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -85
- package/dist/components/table/QTable.svelte.d.ts +3 -29
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +9 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +10 -0
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +75 -96
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +107 -59
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- package/dist/components/tabs/docs.d.ts +1 -1
- package/dist/components/tabs/docs.js +1 -1
- package/dist/components/tabs/docs.props.js +3 -3
- package/dist/components/tabs/index.scss +4 -2
- package/dist/components/tabs/props.d.ts +5 -4
- package/dist/components/tabs/props.js +1 -1
- package/dist/components/toolbar/QToolbar.svelte +15 -12
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
- package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
- package/dist/components/toolbar/docs.d.ts +1 -1
- package/dist/components/toolbar/docs.js +1 -1
- package/dist/components/toolbar/docs.props.js +4 -4
- package/dist/components/toolbar/index.scss +12 -14
- package/dist/components/toolbar/props.d.ts +4 -5
- package/dist/components/tooltip/QTooltip.svelte +5 -9
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +1 -1
- package/dist/components/tooltip/docs.js +1 -1
- package/dist/components/tooltip/docs.props.js +1 -1
- package/dist/components/tooltip/index.scss +3 -1
- package/dist/components/tooltip/props.d.ts +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +3 -3
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
- package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/{ripple.scss → _ripple.scss} +1 -1
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/classes/_flex.scss +62 -0
- package/dist/css/classes/_grid.scss +35 -0
- package/dist/css/classes/_index.scss +7 -0
- package/dist/css/classes/_overflow.scss +7 -0
- package/dist/css/classes/_position.scss +7 -0
- package/dist/css/classes/_select.scss +6 -0
- package/dist/css/classes/_spaces.scss +23 -0
- package/dist/css/fonts.scss +16 -3
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +15 -94
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
- package/dist/css/mixins/_image.scss +63 -0
- package/dist/css/mixins/_index.scss +9 -0
- package/dist/css/mixins/_layout.scss +20 -0
- package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
- package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +62 -32
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/page.scss +3 -3
- package/dist/css/theme/reset.scss +17 -1
- package/dist/css/theme/theme.scss +2 -3
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/global.d.ts +1 -1
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +14 -5
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.js +1 -2
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +10 -4
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +2 -2
- package/dist/utils/props.js +8 -6
- package/dist/utils/router.d.ts +17 -0
- package/dist/utils/router.js +23 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +4 -1
- package/dist/utils/types.d.ts +7 -2
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +42 -39
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -98
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -103
- package/dist/components/drawer/index.scss +0 -59
- package/dist/components/footer/index.scss +0 -28
- package/dist/components/layout/index.scss +0 -387
- package/dist/components/list/index.scss +0 -144
- package/dist/components/progress/index.scss +0 -82
- package/dist/components/railbar/index.scss +0 -39
- package/dist/components/separator/index.scss +0 -52
- package/dist/components/toggle/QToggle.svelte +0 -34
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/index.scss +0 -31
- package/dist/components/toggle/props.d.ts +0 -9
- package/dist/components/toggle/props.js +0 -9
- package/dist/css/grid.scss +0 -50
- package/dist/css/mixins.scss +0 -137
- package/dist/css/states.scss +0 -75
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/theme.dark.scss +0 -39
- package/dist/css/theme/theme.light.scss +0 -39
- package/dist/css/variables-sass.scss +0 -16
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -60
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
- /package/dist/composables/{use-align.js → useAlign.js} +0 -0
- /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
- /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
- /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
|
|
2
|
+
// @quaffHash b77ea0d9cbe2991add2f2dccab50f658
|
|
3
3
|
export const QChipDocsProps = [
|
|
4
4
|
{
|
|
5
|
-
name: "
|
|
6
|
-
type: "
|
|
5
|
+
name: "kind",
|
|
6
|
+
type: "QChipKindOptions",
|
|
7
7
|
optional: true,
|
|
8
|
-
clickableType:
|
|
9
|
-
description: "The
|
|
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: "
|
|
13
|
+
name: "label",
|
|
14
14
|
type: "string",
|
|
15
15
|
optional: true,
|
|
16
16
|
clickableType: false,
|
|
17
|
-
description: '
|
|
17
|
+
description: "The chip's text content. Will overwrite the default slot.",
|
|
18
18
|
default: "undefined",
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
name: "
|
|
22
|
-
type: "string",
|
|
21
|
+
name: "icon",
|
|
22
|
+
type: "MaterialSymbol | `img:${string}`",
|
|
23
23
|
optional: true,
|
|
24
|
-
clickableType:
|
|
25
|
-
description: 'Name of the
|
|
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: "
|
|
30
|
-
type: "
|
|
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:
|
|
41
|
-
description: "
|
|
42
|
-
default: "
|
|
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: "
|
|
37
|
+
name: "disabled",
|
|
46
38
|
type: "boolean",
|
|
47
39
|
optional: true,
|
|
48
40
|
clickableType: false,
|
|
49
|
-
description: "
|
|
41
|
+
description: "Puts the chip in a disabled state, making it unactivable.",
|
|
50
42
|
default: "false",
|
|
51
43
|
},
|
|
52
44
|
{
|
|
53
|
-
name: "
|
|
45
|
+
name: "selected",
|
|
54
46
|
type: "boolean",
|
|
55
47
|
optional: true,
|
|
56
48
|
clickableType: false,
|
|
57
|
-
description: "
|
|
49
|
+
description: "Only for filter chips. Controls wether the chip is selected or not.",
|
|
58
50
|
default: "false",
|
|
59
51
|
},
|
|
60
52
|
{
|
|
61
|
-
name: "
|
|
53
|
+
name: "elevated",
|
|
62
54
|
type: "boolean",
|
|
63
55
|
optional: true,
|
|
64
56
|
clickableType: false,
|
|
65
|
-
description: "
|
|
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: "
|
|
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 {
|
|
1
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
export type
|
|
4
|
-
export
|
|
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
|
|
8
|
+
* The chip's kind. It will control the chip's style and behavior.
|
|
7
9
|
* @default undefined
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
kind?: QChipKindOptions;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* The chip's text content. Will overwrite the default slot.
|
|
12
14
|
* @default undefined
|
|
13
15
|
*/
|
|
14
|
-
|
|
16
|
+
label?: string;
|
|
15
17
|
/**
|
|
16
|
-
* Name of the
|
|
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
|
-
|
|
21
|
+
icon?: MaterialSymbol | `img:${string}`;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @default
|
|
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
|
-
|
|
26
|
+
trailingIcon?: MaterialSymbol | `img:${string}`;
|
|
30
27
|
/**
|
|
31
|
-
*
|
|
28
|
+
* Puts the chip in a disabled state, making it unactivable.
|
|
32
29
|
* @default false
|
|
33
30
|
*/
|
|
34
|
-
|
|
31
|
+
disabled?: boolean;
|
|
35
32
|
/**
|
|
36
|
-
*
|
|
33
|
+
* Only for filter chips. Controls wether the chip is selected or not.
|
|
37
34
|
* @default false
|
|
38
35
|
*/
|
|
39
|
-
|
|
36
|
+
selected?: boolean;
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
38
|
+
* Elevates the button, giving it box-shadow and a background color.
|
|
42
39
|
* @default false
|
|
43
40
|
*/
|
|
44
|
-
|
|
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
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { copy } from "../../utils";
|
|
4
|
-
import { QBtn } from "../..";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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
|
|
4
|
-
|
|
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
|
|
2
|
+
// @quaffHash 4fdac21bb131f4d8ac9d24b9f1dbe6eb
|
|
3
3
|
export const QCodeBlockDocsProps = [
|
|
4
4
|
{
|
|
5
5
|
name: "language",
|
|
6
|
-
type: "
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
157
|
-
background-color:
|
|
158
|
+
display: block;
|
|
159
|
+
background-color: mixins.with-alpha(var(--shadow), 50%);
|
|
158
160
|
}
|
|
159
161
|
|
|
160
|
-
|
|
162
|
+
&--animating {
|
|
161
163
|
animation: shake 0.15s;
|
|
162
164
|
}
|
|
163
165
|
}
|
|
@@ -1,85 +1,87 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
38
|
+
show();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function addAnimation() {
|
|
42
|
+
if (persistent && value) {
|
|
43
|
+
dialogEl.classList.add("q-dialog--animating");
|
|
16
44
|
setTimeout(() => {
|
|
17
|
-
|
|
18
|
-
},
|
|
45
|
+
dialogEl.classList.remove("q-dialog--animating");
|
|
46
|
+
}, 150);
|
|
19
47
|
}
|
|
20
48
|
}
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} else {
|
|
45
|
-
addAnimation();
|
|
46
|
-
e.preventDefault();
|
|
52
|
+
function onkeydown(e) {
|
|
53
|
+
if (e.key === "Escape") {
|
|
54
|
+
tryCancel(e);
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
71
|
-
|
|
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--
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
class:q-dialog--modal={modal}
|
|
81
|
+
onclick={handleClickInside}
|
|
82
|
+
oncancel={tryCancel}
|
|
83
|
+
{onkeydown}
|
|
84
|
+
aria-hidden={!value || undefined}
|
|
83
85
|
>
|
|
84
|
-
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
2
|
+
export declare const QDialogDocs: QComponentDocs;
|