@quaffui/quaff 0.1.0-prealpha2 → 0.1.0-prealpha21
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 -41
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -26
- package/dist/components/avatar/docs.d.ts +2 -2
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +22 -4
- package/dist/components/avatar/index.scss +6 -1
- package/dist/components/avatar/props.d.ts +25 -7
- package/dist/components/avatar/props.js +1 -1
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +23 -14
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +64 -48
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +2 -2
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +28 -26
- package/dist/components/breadcrumbs/props.d.ts +26 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +94 -41
- package/dist/components/button/QBtn.svelte.d.ts +2 -31
- package/dist/components/button/docs.d.ts +2 -2
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +47 -13
- package/dist/components/button/props.d.ts +35 -13
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +27 -19
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +14 -15
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +11 -11
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +4 -4
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +9 -15
- package/dist/components/card/props.d.ts +11 -16
- package/dist/components/checkbox/QCheckbox.svelte +8 -9
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +2 -2
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +2 -0
- package/dist/components/checkbox/index.scss +7 -1
- package/dist/components/checkbox/props.d.ts +2 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +98 -55
- package/dist/components/chip/QChip.svelte.d.ts +2 -34
- package/dist/components/chip/docs.d.ts +2 -2
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +28 -42
- package/dist/components/chip/props.d.ts +25 -32
- package/dist/components/codeBlock/QCodeBlock.svelte +78 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -22
- package/dist/components/codeBlock/docs.props.js +11 -1
- package/dist/components/codeBlock/props.d.ts +8 -2
- package/dist/components/dialog/QDialog.scss +177 -0
- package/dist/components/dialog/QDialog.svelte +77 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +2 -2
- 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 +4 -108
- package/dist/components/dialog/props.d.ts +3 -18
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +91 -81
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -38
- package/dist/components/drawer/docs.d.ts +2 -2
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +4 -2
- package/dist/components/drawer/props.d.ts +4 -3
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +67 -12
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +2 -2
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +13 -3
- package/dist/components/footer/props.d.ts +9 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +56 -0
- package/dist/components/header/QHeader.svelte.d.ts +3 -0
- package/dist/components/header/docs.props.d.ts +24 -0
- package/dist/components/header/docs.props.js +88 -0
- package/dist/components/header/props.d.ts +23 -0
- package/dist/components/header/props.js +1 -0
- package/dist/components/icon/QIcon.scss +73 -0
- package/dist/components/icon/QIcon.svelte +32 -30
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +2 -2
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +11 -9
- package/dist/components/icon/props.d.ts +9 -8
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +5 -2
- package/dist/components/input/QInput.svelte +88 -72
- package/dist/components/input/QInput.svelte.d.ts +3 -32
- package/dist/components/input/docs.d.ts +2 -2
- package/dist/components/input/docs.js +2 -8
- package/dist/components/input/docs.props.js +39 -13
- package/dist/components/input/index.scss +1 -3
- package/dist/components/input/props.d.ts +13 -21
- package/dist/components/input/props.js +1 -13
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +101 -81
- package/dist/components/layout/QLayout.svelte.d.ts +17 -43
- package/dist/components/layout/docs.d.ts +2 -2
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +65 -7
- package/dist/components/layout/props.d.ts +18 -9
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +73 -51
- package/dist/components/list/QItem.svelte.d.ts +2 -33
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +50 -37
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +30 -20
- package/dist/components/list/QList.svelte.d.ts +2 -35
- package/dist/components/list/docs.d.ts +2 -0
- package/dist/components/list/docs.js +11 -0
- package/dist/components/list/docs.props.js +79 -29
- package/dist/components/list/props.d.ts +24 -20
- 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 +117 -93
- package/dist/components/private/QApi.svelte.d.ts +5 -17
- package/dist/components/private/QDocs.svelte +78 -41
- package/dist/components/private/QDocs.svelte.d.ts +10 -21
- package/dist/components/private/QDocsSection.svelte +16 -24
- 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 +106 -20
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -21
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +59 -17
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -21
- package/dist/components/progress/docs.d.ts +2 -0
- package/dist/components/progress/docs.js +11 -0
- package/dist/components/progress/docs.props.d.ts +8 -0
- package/dist/components/progress/docs.props.js +181 -9
- package/dist/components/progress/props.d.ts +98 -17
- package/dist/components/progress/props.js +1 -7
- package/dist/components/radio/QRadio.svelte +14 -9
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +2 -2
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +6 -4
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +5 -6
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +45 -49
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +2 -0
- package/dist/components/railbar/docs.js +11 -0
- package/dist/components/railbar/docs.props.js +10 -8
- package/dist/components/railbar/props.d.ts +15 -6
- package/dist/components/railbar/props.js +1 -7
- package/dist/components/select/QSelect.svelte +171 -140
- package/dist/components/select/QSelect.svelte.d.ts +2 -33
- package/dist/components/select/docs.d.ts +2 -2
- package/dist/components/select/docs.js +9 -8
- package/dist/components/select/docs.props.js +47 -13
- package/dist/components/select/index.scss +28 -7
- package/dist/components/select/props.d.ts +16 -20
- package/dist/components/select/props.js +1 -14
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +39 -57
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +2 -0
- package/dist/components/separator/docs.js +11 -0
- package/dist/components/separator/docs.props.js +16 -14
- package/dist/components/separator/props.d.ts +13 -14
- 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/switch/docs.d.ts +2 -0
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/switch/docs.props.js +68 -0
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -94
- package/dist/components/table/QTable.svelte.d.ts +2 -28
- package/dist/components/table/docs.d.ts +2 -2
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +11 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +14 -3
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +80 -66
- package/dist/components/tabs/QTab.svelte.d.ts +2 -27
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +114 -51
- package/dist/components/tabs/QTabs.svelte.d.ts +7 -22
- package/dist/components/tabs/docs.d.ts +2 -0
- package/dist/components/tabs/docs.js +11 -0
- package/dist/components/tabs/docs.props.js +10 -16
- package/dist/components/tabs/index.scss +71 -28
- package/dist/components/tabs/props.d.ts +9 -9
- package/dist/components/tabs/props.js +1 -13
- package/dist/components/toolbar/QToolbar.svelte +20 -37
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -22
- package/dist/components/toolbar/QToolbarTitle.svelte +11 -0
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +3 -0
- package/dist/components/toolbar/docs.d.ts +2 -0
- package/dist/components/toolbar/docs.js +11 -0
- package/dist/components/toolbar/docs.props.d.ts +8 -0
- package/dist/components/toolbar/docs.props.js +33 -5
- package/dist/components/toolbar/index.scss +34 -1
- package/dist/components/toolbar/props.d.ts +24 -5
- package/dist/components/toolbar/props.js +1 -6
- package/dist/components/tooltip/QTooltip.svelte +8 -12
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +2 -0
- package/dist/components/tooltip/docs.js +11 -0
- package/dist/components/tooltip/docs.props.js +3 -1
- package/dist/components/tooltip/index.scss +80 -2
- package/dist/components/tooltip/props.d.ts +4 -3
- package/dist/components/tooltip/props.js +1 -1
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +3 -1
- package/dist/composables/{use-align.d.ts → useAlign.d.ts} +1 -1
- package/dist/composables/useAlign.js +23 -0
- package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +3 -3
- package/dist/composables/{use-router-link.js → useRouterLink.js} +4 -5
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/useSizeLegacy.d.ts +9 -0
- package/dist/composables/useSizeLegacy.js +25 -0
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/_ripple.scss +49 -0
- 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/flex.scss +41 -0
- package/dist/css/fonts.scss +17 -0
- package/dist/css/index.css +1 -0
- package/dist/css/index.scss +15 -111
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/_field.scss +64 -0
- 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} +6 -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 +348 -0
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/colors.module.scss +261 -109
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/elevate.scss +57 -0
- package/dist/css/theme/page.scss +16 -0
- package/dist/css/theme/palette.scss +653 -0
- package/dist/css/theme/reset.scss +56 -0
- package/dist/css/theme/theme.scss +7 -2
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/css/theme/typography.scss +111 -0
- package/dist/global.d.ts +1 -2
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/ripple.d.ts +11 -0
- package/dist/helpers/ripple.js +90 -0
- package/dist/helpers/version.d.ts +2 -0
- package/dist/helpers/version.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/stores/index.d.ts +0 -0
- package/dist/stores/index.js +1 -0
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.js +3 -4
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/dom.js +81 -0
- package/dist/utils/events.d.ts +13 -0
- package/dist/utils/events.js +13 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -1
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +4 -4
- package/dist/utils/props.js +9 -7
- 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 +12 -4
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +27 -1
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +44 -34
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -78
- package/dist/components/card/index.scss +0 -53
- package/dist/components/chip/index.scss +0 -83
- package/dist/components/dialog/index.scss +0 -27
- package/dist/components/drawer/index.scss +0 -54
- package/dist/components/footer/index.scss +0 -5
- package/dist/components/icon/index.scss +0 -18
- package/dist/components/layout/index.scss +0 -370
- package/dist/components/list/index.scss +0 -114
- package/dist/components/progress/index.scss +0 -50
- package/dist/components/toggle/QToggle.svelte +0 -35
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/docs.d.ts +0 -2
- package/dist/components/toggle/docs.props.js +0 -42
- 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/composables/use-align.js +0 -12
- package/dist/composables/use-index.d.ts +0 -2
- package/dist/composables/use-index.js +0 -17
- package/dist/composables/use-size.d.ts +0 -11
- package/dist/composables/use-size.js +0 -13
- package/dist/css/grid.scss +0 -65
- package/dist/css/mixins/field.scss +0 -430
- package/dist/css/mixins.scss +0 -135
- package/dist/css/states.scss +0 -70
- package/dist/css/theme/theme.dark.scss +0 -36
- package/dist/css/theme/theme.light.scss +0 -36
- package/dist/helpers/activationHandler.d.ts +0 -9
- package/dist/helpers/activationHandler.js +0 -23
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -53
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -52
- package/dist/utils/fields.d.ts +0 -1
- package/dist/utils/fields.js +0 -14
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,90 +1,76 @@
|
|
|
1
|
+
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
+
// @quaffHash b77ea0d9cbe2991add2f2dccab50f658
|
|
1
3
|
export const QChipDocsProps = [
|
|
2
4
|
{
|
|
3
|
-
name: "
|
|
4
|
-
type: "
|
|
5
|
+
name: "kind",
|
|
6
|
+
type: "QChipKindOptions",
|
|
5
7
|
optional: true,
|
|
6
|
-
clickableType:
|
|
7
|
-
description: "The
|
|
8
|
+
clickableType: true,
|
|
9
|
+
description: "The chip's kind. It will control the chip's style and behavior.",
|
|
8
10
|
default: "undefined",
|
|
9
11
|
},
|
|
10
12
|
{
|
|
11
|
-
name: "
|
|
13
|
+
name: "label",
|
|
12
14
|
type: "string",
|
|
13
15
|
optional: true,
|
|
14
16
|
clickableType: false,
|
|
15
|
-
description: '
|
|
17
|
+
description: "The chip's text content. Will overwrite the default slot.",
|
|
16
18
|
default: "undefined",
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
|
-
name: "
|
|
20
|
-
type: "string",
|
|
21
|
+
name: "icon",
|
|
22
|
+
type: "MaterialSymbol | `img:${string}`",
|
|
21
23
|
optional: true,
|
|
22
|
-
clickableType:
|
|
23
|
-
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.',
|
|
24
26
|
default: "undefined",
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
|
-
name: "
|
|
28
|
-
type: "
|
|
29
|
+
name: "trailingIcon",
|
|
30
|
+
type: "MaterialSymbol | `img:${string}`",
|
|
29
31
|
optional: true,
|
|
30
|
-
clickableType:
|
|
31
|
-
description: "
|
|
32
|
-
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",
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
|
-
name: "
|
|
37
|
+
name: "disabled",
|
|
36
38
|
type: "boolean",
|
|
37
39
|
optional: true,
|
|
38
40
|
clickableType: false,
|
|
39
|
-
description: "
|
|
41
|
+
description: "Puts the chip in a disabled state, making it unactivable.",
|
|
40
42
|
default: "false",
|
|
41
43
|
},
|
|
42
44
|
{
|
|
43
|
-
name: "
|
|
45
|
+
name: "selected",
|
|
44
46
|
type: "boolean",
|
|
45
47
|
optional: true,
|
|
46
48
|
clickableType: false,
|
|
47
|
-
description: "
|
|
49
|
+
description: "Only for filter chips. Controls wether the chip is selected or not.",
|
|
48
50
|
default: "false",
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
|
-
name: "
|
|
53
|
+
name: "elevated",
|
|
52
54
|
type: "boolean",
|
|
53
55
|
optional: true,
|
|
54
56
|
clickableType: false,
|
|
55
|
-
description: "
|
|
57
|
+
description: "Elevates the button, giving it box-shadow and a background color.",
|
|
56
58
|
default: "false",
|
|
57
59
|
},
|
|
58
60
|
{
|
|
59
|
-
name: "
|
|
61
|
+
name: "noRipple",
|
|
60
62
|
type: "boolean",
|
|
61
63
|
optional: true,
|
|
62
64
|
clickableType: false,
|
|
63
|
-
description: "
|
|
65
|
+
description: "Disable the ripple effect for the chip.",
|
|
64
66
|
default: "false",
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
name: "size",
|
|
68
|
-
type:
|
|
70
|
+
type: "QChipSizeOptions",
|
|
69
71
|
optional: true,
|
|
70
|
-
clickableType:
|
|
72
|
+
clickableType: true,
|
|
71
73
|
description: "Size of the chip.",
|
|
72
|
-
default: "
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "tabindex",
|
|
76
|
-
type: "string | number",
|
|
77
|
-
optional: true,
|
|
78
|
-
clickableType: false,
|
|
79
|
-
description: "Tabindex of the chip.",
|
|
80
|
-
default: "undefined",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "href",
|
|
84
|
-
type: "string",
|
|
85
|
-
optional: true,
|
|
86
|
-
clickableType: false,
|
|
87
|
-
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").',
|
|
88
|
-
default: "undefined",
|
|
74
|
+
default: "sm",
|
|
89
75
|
},
|
|
90
76
|
];
|
|
@@ -1,59 +1,52 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
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> {
|
|
7
|
+
/**
|
|
8
|
+
* The chip's kind. It will control the chip's style and behavior.
|
|
6
9
|
* @default undefined
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
kind?: QChipKindOptions;
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* The chip's text content. Will overwrite the default slot.
|
|
11
14
|
* @default undefined
|
|
12
15
|
*/
|
|
13
|
-
|
|
16
|
+
label?: string;
|
|
14
17
|
/**
|
|
15
|
-
* 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.
|
|
16
19
|
* @default undefined
|
|
17
20
|
*/
|
|
18
|
-
|
|
21
|
+
icon?: MaterialSymbol | `img:${string}`;
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @default
|
|
23
|
+
* Only for filter and input chips. Name of the trailing icon to use for the chip.
|
|
24
|
+
* @default undefined
|
|
22
25
|
*/
|
|
23
|
-
|
|
26
|
+
trailingIcon?: MaterialSymbol | `img:${string}`;
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
28
|
+
* Puts the chip in a disabled state, making it unactivable.
|
|
26
29
|
* @default false
|
|
27
30
|
*/
|
|
28
|
-
|
|
31
|
+
disabled?: boolean;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* Only for filter chips. Controls wether the chip is selected or not.
|
|
31
34
|
* @default false
|
|
32
35
|
*/
|
|
33
|
-
|
|
36
|
+
selected?: boolean;
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
38
|
+
* Elevates the button, giving it box-shadow and a background color.
|
|
36
39
|
* @default false
|
|
37
40
|
*/
|
|
38
|
-
|
|
41
|
+
elevated?: boolean;
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
43
|
+
* Disable the ripple effect for the chip.
|
|
41
44
|
* @default false
|
|
42
45
|
*/
|
|
43
|
-
|
|
46
|
+
noRipple?: boolean;
|
|
44
47
|
/**
|
|
45
48
|
* Size of the chip.
|
|
46
|
-
* @default
|
|
49
|
+
* @default sm
|
|
47
50
|
*/
|
|
48
51
|
size?: QChipSizeOptions;
|
|
49
|
-
/**
|
|
50
|
-
* Tabindex of the chip.
|
|
51
|
-
* @default undefined
|
|
52
|
-
*/
|
|
53
|
-
tabindex?: number;
|
|
54
|
-
/**
|
|
55
|
-
* 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").
|
|
56
|
-
* @default undefined
|
|
57
|
-
*/
|
|
58
|
-
href?: string;
|
|
59
52
|
}
|
|
@@ -1,49 +1,81 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
await
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
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
|
+
let codeToHtml = async (str, opts) => "";
|
|
15
|
+
async function loadShiki() {
|
|
16
|
+
try {
|
|
17
|
+
const shikiPackage = "shiki";
|
|
18
|
+
const { codeToHtml: codeToHtmlShiki } = await import(
|
|
19
|
+
/* @vite-ignore */
|
|
20
|
+
shikiPackage
|
|
21
|
+
);
|
|
22
|
+
codeToHtml = codeToHtmlShiki;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error("error loading shiki, please make sure it is installed", e);
|
|
19
25
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}
|
|
27
|
+
const html = $derived.by(
|
|
28
|
+
async () =>
|
|
29
|
+
await codeToHtml(code, {
|
|
30
|
+
lang: language,
|
|
31
|
+
theme,
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
function setBtn(type) {
|
|
35
|
+
switch (type) {
|
|
36
|
+
case "error":
|
|
37
|
+
btnContent = "Error while copying...";
|
|
38
|
+
btnColor = "error";
|
|
39
|
+
break;
|
|
40
|
+
case "success":
|
|
41
|
+
btnContent = "Copied!";
|
|
42
|
+
btnColor = "green";
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
btnContent = "Copy";
|
|
46
|
+
btnColor = "primary";
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function copyCode() {
|
|
51
|
+
await copy(code).catch(() => {
|
|
52
|
+
setBtn("error");
|
|
53
|
+
setTimeout(() => setBtn("base"), 3e3);
|
|
54
|
+
});
|
|
55
|
+
setBtn("success");
|
|
29
56
|
setTimeout(() => {
|
|
30
|
-
|
|
31
|
-
btnColor = "primary";
|
|
57
|
+
setBtn("base");
|
|
32
58
|
}, 3e3);
|
|
33
59
|
}
|
|
34
|
-
|
|
60
|
+
onMount(() => loadShiki());
|
|
35
61
|
</script>
|
|
36
62
|
|
|
37
63
|
<div class="q-code-block">
|
|
38
64
|
{#if copiable}
|
|
39
|
-
<div
|
|
40
|
-
|
|
65
|
+
<div
|
|
66
|
+
class="flex justify-between {title
|
|
67
|
+
? 'items-center'
|
|
68
|
+
: 'justify-end'} q-pb-sm"
|
|
69
|
+
>
|
|
70
|
+
{#if title}
|
|
71
|
+
<h4 class="q-ma-none q-pr-lg">{title}</h4>
|
|
72
|
+
{/if}
|
|
41
73
|
<QBtn
|
|
42
|
-
class="{btnColor}-
|
|
74
|
+
class="border-{btnColor} text-{btnColor}"
|
|
43
75
|
size="sm"
|
|
44
76
|
icon="content_copy"
|
|
45
|
-
|
|
46
|
-
|
|
77
|
+
design="outlined"
|
|
78
|
+
onclick={copyCode}
|
|
47
79
|
>
|
|
48
80
|
{btnContent}
|
|
49
81
|
</QBtn>
|
|
@@ -51,21 +83,22 @@ async function copyCode() {
|
|
|
51
83
|
{:else if title}
|
|
52
84
|
<h4>{title}</h4>
|
|
53
85
|
{/if}
|
|
54
|
-
|
|
86
|
+
{#await html}
|
|
87
|
+
<!-- waiting -->
|
|
88
|
+
{:then htmlContent}
|
|
89
|
+
{@html htmlContent}
|
|
90
|
+
{:catch error}
|
|
91
|
+
<pre>An error occurred: {error}</pre>
|
|
92
|
+
<!-- error -->
|
|
93
|
+
{/await}
|
|
55
94
|
</div>
|
|
56
95
|
|
|
57
96
|
<style>
|
|
58
97
|
.q-code-block {
|
|
59
98
|
border-radius: 0.5em;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
pre {
|
|
63
|
-
max-height: 400px;
|
|
64
|
-
height: 100%;
|
|
65
|
-
margin: 0;
|
|
66
|
-
}
|
|
67
99
|
|
|
68
|
-
|
|
69
|
-
|
|
100
|
+
:global(pre) {
|
|
101
|
+
white-space: break-spaces;
|
|
102
|
+
}
|
|
70
103
|
}
|
|
71
104
|
</style>
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import "prismjs/themes/prism-twilight.css";
|
|
3
|
-
import "prismjs/components/prism-typescript";
|
|
4
|
-
import "prism-svelte";
|
|
5
1
|
import type { QCodeBlockProps } from "./props";
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
language: QCodeBlockProps["language"];
|
|
9
|
-
code?: QCodeBlockProps["code"];
|
|
10
|
-
title?: QCodeBlockProps["title"];
|
|
11
|
-
copiable?: QCodeBlockProps["copiable"];
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {};
|
|
17
|
-
};
|
|
18
|
-
type QCodeBlockProps_ = typeof __propDef.props;
|
|
19
|
-
export { QCodeBlockProps_ as QCodeBlockProps };
|
|
20
|
-
export type QCodeBlockEvents = typeof __propDef.events;
|
|
21
|
-
export type QCodeBlockSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QCodeBlock extends SvelteComponent<QCodeBlockProps, QCodeBlockEvents, QCodeBlockSlots> {
|
|
23
|
-
}
|
|
2
|
+
declare const QCodeBlock: import("svelte").Component<QCodeBlockProps, {}, "">;
|
|
3
|
+
export default QCodeBlock;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
+
// @quaffHash 4fdac21bb131f4d8ac9d24b9f1dbe6eb
|
|
1
3
|
export const QCodeBlockDocsProps = [
|
|
2
4
|
{
|
|
3
5
|
name: "language",
|
|
4
|
-
type: "
|
|
6
|
+
type: "BundledLanguage | SpecialLanguage",
|
|
5
7
|
optional: false,
|
|
6
8
|
clickableType: false,
|
|
7
9
|
description: "Language to use for highlighting.",
|
|
8
10
|
default: "",
|
|
9
11
|
},
|
|
12
|
+
{
|
|
13
|
+
name: "theme",
|
|
14
|
+
type: "BundledTheme",
|
|
15
|
+
optional: true,
|
|
16
|
+
clickableType: true,
|
|
17
|
+
description: "Theme to use for highlighting.",
|
|
18
|
+
default: "",
|
|
19
|
+
},
|
|
10
20
|
{
|
|
11
21
|
name: "code",
|
|
12
22
|
type: "string",
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { SpecialLanguage, BundledLanguage, BundledTheme } from "shiki";
|
|
3
|
+
export interface QCodeBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
2
4
|
/**
|
|
3
5
|
* Language to use for highlighting.
|
|
4
6
|
*/
|
|
5
|
-
language:
|
|
7
|
+
language: BundledLanguage | SpecialLanguage;
|
|
8
|
+
/**
|
|
9
|
+
* Theme to use for highlighting.
|
|
10
|
+
*/
|
|
11
|
+
theme?: BundledTheme;
|
|
6
12
|
/**
|
|
7
13
|
* Code to highlight.
|
|
8
14
|
*/
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
3
|
+
|
|
4
|
+
.q-dialog {
|
|
5
|
+
display: block;
|
|
6
|
+
border: none;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
visibility: hidden;
|
|
9
|
+
position: fixed;
|
|
10
|
+
box-shadow: var(--elevate2);
|
|
11
|
+
color: var(--on-surface);
|
|
12
|
+
background-color: var(--surface);
|
|
13
|
+
padding: 1rem;
|
|
14
|
+
z-index: 1000;
|
|
15
|
+
left: 50%;
|
|
16
|
+
top: 10%;
|
|
17
|
+
min-width: 20rem;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
max-height: 80%;
|
|
20
|
+
overflow-x: hidden;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
transition:
|
|
23
|
+
variables.$speed3 all,
|
|
24
|
+
0s background-color;
|
|
25
|
+
transform: translate(-50%, -4rem);
|
|
26
|
+
animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
27
|
+
|
|
28
|
+
&:is(&.active, [open]) {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
visibility: visible;
|
|
31
|
+
transform: translate(-50%, 0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&::backdrop {
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:not(&--left, &--right, &--top, &--bottom) {
|
|
39
|
+
border-radius: 0.75rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--small {
|
|
43
|
+
width: 25%;
|
|
44
|
+
height: 25%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--medium {
|
|
48
|
+
width: 50%;
|
|
49
|
+
height: 50%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--large {
|
|
53
|
+
width: 75%;
|
|
54
|
+
height: 75%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:is(&--active, [open]) {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
visibility: visible;
|
|
60
|
+
transform: translate(-50%, 0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:is(&--active, [open]):is(&--left, &--right, &--top, &--bottom, &--fullscreen) {
|
|
64
|
+
transform: translate(0, 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&--top {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
right: auto;
|
|
72
|
+
bottom: auto;
|
|
73
|
+
height: auto;
|
|
74
|
+
width: 100%;
|
|
75
|
+
min-width: auto;
|
|
76
|
+
max-height: 100%;
|
|
77
|
+
transform: translateY(-100%);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--left {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
right: auto;
|
|
85
|
+
bottom: auto;
|
|
86
|
+
width: auto;
|
|
87
|
+
height: 100%;
|
|
88
|
+
max-height: 100%;
|
|
89
|
+
transform: translateX(-100%);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&--right {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: auto;
|
|
96
|
+
right: 0;
|
|
97
|
+
bottom: auto;
|
|
98
|
+
width: auto;
|
|
99
|
+
height: 100%;
|
|
100
|
+
max-height: 100%;
|
|
101
|
+
transform: translateX(100%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--bottom {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
top: auto;
|
|
107
|
+
left: 0;
|
|
108
|
+
right: auto;
|
|
109
|
+
bottom: 0;
|
|
110
|
+
height: auto;
|
|
111
|
+
width: 100%;
|
|
112
|
+
min-width: auto;
|
|
113
|
+
max-height: 100%;
|
|
114
|
+
transform: translateY(100%);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--fullscreen {
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: auto;
|
|
121
|
+
bottom: auto;
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
max-height: 100%;
|
|
126
|
+
transform: translateY(4rem);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&--small:is(&--left, &--right) {
|
|
130
|
+
width: 20rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&--medium:is(&--left, &--right) {
|
|
134
|
+
width: 32rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&--large:is(&--left, &--right) {
|
|
138
|
+
width: 44rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&--small:is(&--top, &--bottom) {
|
|
142
|
+
height: 16rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--medium:is(&--top, &--bottom) {
|
|
146
|
+
height: 24rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&--large:is(&--top, &--bottom) {
|
|
150
|
+
height: 32rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&:is(&--left, &--right, &--top, &--bottom) {
|
|
154
|
+
border-radius: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--modal::backdrop {
|
|
158
|
+
display: block;
|
|
159
|
+
background-color: mixins.with-alpha(var(--shadow), 50%);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&--animating {
|
|
163
|
+
animation: shake 0.15s;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@keyframes shake {
|
|
168
|
+
0% {
|
|
169
|
+
scale: 1;
|
|
170
|
+
}
|
|
171
|
+
50% {
|
|
172
|
+
scale: 1.04;
|
|
173
|
+
}
|
|
174
|
+
100% {
|
|
175
|
+
scale: 1;
|
|
176
|
+
}
|
|
177
|
+
}
|