@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
package/dist/utils/colors.js
CHANGED
|
@@ -1,10 +1,88 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { argbFromHex, hexFromArgb, themeFromSourceColor, } from "@material/material-color-utilities";
|
|
2
|
+
import { isNumeric } from "./number.js";
|
|
3
|
+
import { convertCase } from "./string.js";
|
|
4
|
+
const COLOR_TONES = {
|
|
5
|
+
background: { fromColor: "neutral", light: 98, dark: 6 },
|
|
6
|
+
"inverse-on-surface": { fromColor: "neutral", light: 95, dark: 20 },
|
|
7
|
+
"inverse-primary": { fromColor: "primary", light: 80, dark: 40 },
|
|
8
|
+
"inverse-surface": { fromColor: "neutral", light: 20, dark: 90 },
|
|
9
|
+
"on-background": { fromColor: "neutral", light: 10, dark: 90 },
|
|
10
|
+
"on-primary-fixed": { fromColor: "primary", light: 10, dark: 10 },
|
|
11
|
+
"on-primary-fixed-variant": { fromColor: "primary", light: 30, dark: 30 },
|
|
12
|
+
"on-secondary-fixed": { fromColor: "secondary", light: 10, dark: 10 },
|
|
13
|
+
"on-secondary-fixed-variant": { fromColor: "secondary", light: 30, dark: 30 },
|
|
14
|
+
"on-surface": { fromColor: "neutral", light: 10, dark: 90 },
|
|
15
|
+
"on-surface-variant": { fromColor: "neutralVariant", light: 30, dark: 80 },
|
|
16
|
+
"on-tertiary-fixed": { fromColor: "tertiary", light: 10, dark: 10 },
|
|
17
|
+
"on-tertiary-fixed-variant": { fromColor: "tertiary", light: 30, dark: 30 },
|
|
18
|
+
outline: { fromColor: "neutralVariant", light: 50, dark: 60 },
|
|
19
|
+
"outline-variant": { fromColor: "neutralVariant", light: 80, dark: 30 },
|
|
20
|
+
"primary-fixed": { fromColor: "primary", light: 90, dark: 90 },
|
|
21
|
+
"primary-fixed-dim": { fromColor: "primary", light: 80, dark: 80 },
|
|
22
|
+
scrim: { fromColor: "neutral", light: 0, dark: 0 },
|
|
23
|
+
"secondary-fixed": { fromColor: "secondary", light: 90, dark: 90 },
|
|
24
|
+
"secondary-fixed-dim": { fromColor: "secondary", light: 80, dark: 80 },
|
|
25
|
+
shadow: { fromColor: "neutral", light: 0, dark: 0 },
|
|
26
|
+
surface: { fromColor: "neutral", light: 98, dark: 6 },
|
|
27
|
+
"surface-bright": { fromColor: "neutral", light: 98, dark: 24 },
|
|
28
|
+
"surface-container": { fromColor: "neutral", light: 94, dark: 12 },
|
|
29
|
+
"surface-container-high": { fromColor: "neutral", light: 92, dark: 17 },
|
|
30
|
+
"surface-container-highest": { fromColor: "neutral", light: 90, dark: 22 },
|
|
31
|
+
"surface-container-low": { fromColor: "neutral", light: 96, dark: 10 },
|
|
32
|
+
"surface-container-lowest": { fromColor: "neutral", light: 100, dark: 4 },
|
|
33
|
+
"surface-dim": { fromColor: "neutral", light: 87, dark: 6 },
|
|
34
|
+
"surface-tint": { fromColor: "primary", light: 40, dark: 80 },
|
|
35
|
+
"surface-variant": { fromColor: "neutral", light: 90, dark: 30 },
|
|
36
|
+
"tertiary-fixed": { fromColor: "tertiary", light: 90, dark: 90 },
|
|
37
|
+
"tertiary-fixed-dim": { fromColor: "tertiary", light: 80, dark: 80 },
|
|
38
|
+
};
|
|
39
|
+
export function generateColors(from) {
|
|
40
|
+
const argb = argbFromHex(from);
|
|
41
|
+
const palettes = themeFromSourceColor(argb).palettes;
|
|
42
|
+
return {
|
|
43
|
+
light: getColors(palettes, "light"),
|
|
44
|
+
dark: getColors(palettes, "dark"),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getColors(palettes, mode) {
|
|
48
|
+
const tones = mode === "light"
|
|
49
|
+
? {
|
|
50
|
+
base: 40,
|
|
51
|
+
onBase: 100,
|
|
52
|
+
baseContainer: 90,
|
|
53
|
+
onBaseContainer: 10,
|
|
54
|
+
}
|
|
55
|
+
: {
|
|
56
|
+
base: 80,
|
|
57
|
+
onBase: 20,
|
|
58
|
+
baseContainer: 30,
|
|
59
|
+
onBaseContainer: 90,
|
|
60
|
+
};
|
|
61
|
+
const getColor = (color, palette) => {
|
|
62
|
+
color = convertCase(color, "pascal", "kebab");
|
|
63
|
+
return [
|
|
64
|
+
[color, palette.tone(tones.base)],
|
|
65
|
+
[`on-${color}`, palette.tone(tones.onBase)],
|
|
66
|
+
[`${color}-container`, palette.tone(tones.baseContainer)],
|
|
67
|
+
[`on-${color}-container`, palette.tone(tones.onBaseContainer)],
|
|
68
|
+
];
|
|
69
|
+
};
|
|
70
|
+
const results = Object.fromEntries(Object.entries(palettes)
|
|
71
|
+
.map(([color, palette]) => getColor(color, palette))
|
|
72
|
+
.flat(1));
|
|
73
|
+
let toneColor;
|
|
74
|
+
for (toneColor in COLOR_TONES) {
|
|
75
|
+
const toneInfo = COLOR_TONES[toneColor];
|
|
76
|
+
results[toneColor] = palettes[toneInfo.fromColor].tone(toneInfo[mode]);
|
|
77
|
+
}
|
|
78
|
+
return Object.fromEntries(Object.entries(results).map(([color, value]) => [color, hexFromArgb(value)]));
|
|
79
|
+
}
|
|
2
80
|
class QColors {
|
|
3
81
|
static hexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
4
82
|
static isValidRgb(r, g, b) {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
|
|
83
|
+
return (isNumeric(r) &&
|
|
84
|
+
isNumeric(g) &&
|
|
85
|
+
isNumeric(b) &&
|
|
8
86
|
+r >= 0 &&
|
|
9
87
|
+r <= 255 &&
|
|
10
88
|
+g >= 0 &&
|
|
@@ -13,9 +91,9 @@ class QColors {
|
|
|
13
91
|
+b <= 255);
|
|
14
92
|
}
|
|
15
93
|
static isValidHsl(h, s, l) {
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
94
|
+
return (isNumeric(h) &&
|
|
95
|
+
isNumeric(s) &&
|
|
96
|
+
isNumeric(l) &&
|
|
19
97
|
+h >= 0 &&
|
|
20
98
|
+h <= 360 &&
|
|
21
99
|
+s >= 0 &&
|
|
@@ -42,9 +120,12 @@ class QColors {
|
|
|
42
120
|
if (!QColors.isValidRgb(r, g, b)) {
|
|
43
121
|
throw new Error("Invalid RGB values. They should be in the range 0-255.");
|
|
44
122
|
}
|
|
45
|
-
|
|
123
|
+
r = +r / 255;
|
|
124
|
+
g = +g / 255;
|
|
125
|
+
b = +b / 255;
|
|
46
126
|
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
47
|
-
|
|
127
|
+
const l = (max + min) / 2;
|
|
128
|
+
let h, s;
|
|
48
129
|
if (max === min) {
|
|
49
130
|
h = s = 0; // achromatic
|
|
50
131
|
}
|
|
@@ -72,22 +153,29 @@ class QColors {
|
|
|
72
153
|
throw new Error("Invalid HSL values. Hue should be in the range 0-360, saturation and lightness in the range 0-100.");
|
|
73
154
|
}
|
|
74
155
|
let r, g, b;
|
|
75
|
-
|
|
156
|
+
h = +h / 360;
|
|
157
|
+
s = +s / 100;
|
|
158
|
+
l = +l / 100;
|
|
76
159
|
if (s === 0) {
|
|
77
160
|
r = g = b = l; // achromatic
|
|
78
161
|
}
|
|
79
162
|
else {
|
|
80
163
|
const hue2rgb = (p, q, t) => {
|
|
81
|
-
if (t < 0)
|
|
164
|
+
if (t < 0) {
|
|
82
165
|
t += 1;
|
|
83
|
-
|
|
166
|
+
}
|
|
167
|
+
if (t > 1) {
|
|
84
168
|
t -= 1;
|
|
85
|
-
|
|
169
|
+
}
|
|
170
|
+
if (t < 1 / 6) {
|
|
86
171
|
return p + (q - p) * 6 * t;
|
|
87
|
-
|
|
172
|
+
}
|
|
173
|
+
if (t < 1 / 2) {
|
|
88
174
|
return q;
|
|
89
|
-
|
|
175
|
+
}
|
|
176
|
+
if (t < 2 / 3) {
|
|
90
177
|
return p + (q - p) * (2 / 3 - t) * 6;
|
|
178
|
+
}
|
|
91
179
|
return p;
|
|
92
180
|
};
|
|
93
181
|
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Direction } from "./events";
|
|
2
|
+
export declare function getParentElement(el: HTMLElement): HTMLElement;
|
|
3
|
+
export declare function getAllChildren(el: HTMLElement): HTMLElement[];
|
|
4
|
+
export declare function isFocusable(el: HTMLElement): boolean;
|
|
5
|
+
export declare function getFocusableChildren<T extends HTMLElement>(el: T): T[];
|
|
6
|
+
export declare function getClosestFocusableChild(el: HTMLElement): HTMLElement;
|
|
7
|
+
export declare function getClosestFocusableSibling<T extends HTMLElement>(el: T, direction: Direction): HTMLElement;
|
|
8
|
+
export declare function getClosestFocusableBlock(el: HTMLElement, direction: Direction): HTMLElement;
|
|
9
|
+
export declare function movementDirection(from: HTMLElement, to: HTMLElement): Direction;
|
|
10
|
+
export declare function shouldReduceMotion(): boolean;
|
|
11
|
+
export declare function elFromSelector<T extends HTMLElement>(selector: string | T | null | typeof window | Document): Document | (Window & typeof globalThis) | T | null;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export function getParentElement(el) {
|
|
2
|
+
let parent = el.parentNode;
|
|
3
|
+
while (parent && parent.nodeType !== 1) {
|
|
4
|
+
parent = parent.parentNode;
|
|
5
|
+
}
|
|
6
|
+
return parent;
|
|
7
|
+
}
|
|
8
|
+
export function getAllChildren(el) {
|
|
9
|
+
return Array.from(el.querySelectorAll("*"));
|
|
10
|
+
}
|
|
11
|
+
// Focus utils
|
|
12
|
+
const focusableElements = ':is(a, button, input, [tabindex]:not([tabindex="-1"])):not([disabled], [aria-disabled="true"])';
|
|
13
|
+
export function isFocusable(el) {
|
|
14
|
+
return (el.offsetWidth > 0 &&
|
|
15
|
+
el.offsetHeight > 0 &&
|
|
16
|
+
(el.style.opacity === "" || +el.style.opacity > 0) &&
|
|
17
|
+
el.style.display !== "none" &&
|
|
18
|
+
el.tabIndex >= 0);
|
|
19
|
+
}
|
|
20
|
+
export function getFocusableChildren(el) {
|
|
21
|
+
return Array.from(el.querySelectorAll(focusableElements));
|
|
22
|
+
}
|
|
23
|
+
export function getClosestFocusableChild(el) {
|
|
24
|
+
const children = Array.from(el.querySelectorAll(focusableElements));
|
|
25
|
+
const focusableChildren = children.filter(isFocusable);
|
|
26
|
+
return focusableChildren[0] || null;
|
|
27
|
+
}
|
|
28
|
+
export function getClosestFocusableSibling(el, direction) {
|
|
29
|
+
const parent = getParentElement(el);
|
|
30
|
+
const allSiblings = Array.from(parent.childNodes);
|
|
31
|
+
const filtered = allSiblings.filter(isFocusable);
|
|
32
|
+
const indexOfEl = filtered.indexOf(el);
|
|
33
|
+
if (direction === "next") {
|
|
34
|
+
const i = indexOfEl + 1 === filtered.length ? 0 : indexOfEl + 1;
|
|
35
|
+
if (filtered[i].hasAttribute("aria-current")) {
|
|
36
|
+
// The target element is active, it shouldn't have focus
|
|
37
|
+
return i + 1 === filtered.length ? filtered[0] : filtered[i + 1];
|
|
38
|
+
}
|
|
39
|
+
return filtered[i];
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const i = indexOfEl - 1 === -1 ? filtered.length - 1 : indexOfEl - 1;
|
|
43
|
+
if (filtered[i].hasAttribute("aria-current")) {
|
|
44
|
+
// The target element is active, it shouldn't have focus
|
|
45
|
+
return i - 1 === -1 ? filtered.at(-1) : filtered[i - 1];
|
|
46
|
+
}
|
|
47
|
+
return filtered[i];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function getClosestFocusableBlock(el, direction) {
|
|
51
|
+
const parent = getParentElement(el);
|
|
52
|
+
const parentFocusableChildren = getFocusableChildren(parent);
|
|
53
|
+
function getNextFocusableBlock(parentBlock) {
|
|
54
|
+
const grandParent = getParentElement(parentBlock);
|
|
55
|
+
const grandParentChildren = getAllChildren(grandParent);
|
|
56
|
+
const indexOfEl = grandParentChildren.indexOf(el);
|
|
57
|
+
const sliced = direction === "next"
|
|
58
|
+
? grandParentChildren.slice(indexOfEl)
|
|
59
|
+
: grandParentChildren.slice(0, indexOfEl);
|
|
60
|
+
const filtered = sliced.filter((element) => isFocusable(element) && !parentFocusableChildren.includes(element));
|
|
61
|
+
if (!filtered.length) {
|
|
62
|
+
return getNextFocusableBlock(grandParent);
|
|
63
|
+
}
|
|
64
|
+
return direction === "next" ? filtered[0] : filtered.at(-1);
|
|
65
|
+
}
|
|
66
|
+
let targetBlock = getNextFocusableBlock(parent);
|
|
67
|
+
if (targetBlock.hasAttribute("aria-current")) {
|
|
68
|
+
targetBlock = getClosestFocusableSibling(targetBlock, direction);
|
|
69
|
+
}
|
|
70
|
+
return targetBlock;
|
|
71
|
+
}
|
|
72
|
+
export function movementDirection(from, to) {
|
|
73
|
+
const relativePosition = from.compareDocumentPosition(to);
|
|
74
|
+
return relativePosition === 2 ? "previous" : "next";
|
|
75
|
+
}
|
|
76
|
+
export function shouldReduceMotion() {
|
|
77
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
78
|
+
}
|
|
79
|
+
export function elFromSelector(selector) {
|
|
80
|
+
return typeof selector === "string" ? document.querySelector(selector) : selector;
|
|
81
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Direction = "previous" | "next";
|
|
2
|
+
export declare function isActivationKey(e: KeyboardEvent): e is KeyboardEvent & {
|
|
3
|
+
code: "Enter" | "Space";
|
|
4
|
+
};
|
|
5
|
+
export declare function isArrowKey(e: KeyboardEvent): e is KeyboardEvent & {
|
|
6
|
+
code: "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight";
|
|
7
|
+
};
|
|
8
|
+
export declare function isTabKey(e: KeyboardEvent): e is KeyboardEvent & {
|
|
9
|
+
code: "Tab";
|
|
10
|
+
};
|
|
11
|
+
export declare function getDirection(e: KeyboardEvent & {
|
|
12
|
+
code: "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight";
|
|
13
|
+
}): Direction;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Keyboard events
|
|
2
|
+
export function isActivationKey(e) {
|
|
3
|
+
return e.code === "Enter" || e.code === "Space";
|
|
4
|
+
}
|
|
5
|
+
export function isArrowKey(e) {
|
|
6
|
+
return e.code.startsWith("Arrow");
|
|
7
|
+
}
|
|
8
|
+
export function isTabKey(e) {
|
|
9
|
+
return e.code === "Tab";
|
|
10
|
+
}
|
|
11
|
+
export function getDirection(e) {
|
|
12
|
+
return ["ArrowDown", "ArrowRight"].includes(e.code) ? "next" : "previous";
|
|
13
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function isNumeric(input) {
|
|
2
|
+
return typeof input === "number" || !isNaN(Number(input));
|
|
3
|
+
}
|
|
4
|
+
export function between(value, min, max) {
|
|
5
|
+
if (max < min) {
|
|
6
|
+
console.warn(`max (${max}) should not be smaller than min (${min}).`);
|
|
7
|
+
}
|
|
8
|
+
return max <= min ? min : Math.min(max, Math.max(min, value));
|
|
9
|
+
}
|
package/dist/utils/props.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare function createStyles(styleObj: Record<string, string | number | null | undefined>, userStyles?: string): string | null;
|
|
1
|
+
export declare function createStyles(styleObj: Record<string, string | number | boolean | null | undefined>, userStyles?: string | null): string | null;
|
|
2
2
|
interface CreateClassesOptions {
|
|
3
3
|
component?: string;
|
|
4
4
|
element?: string;
|
|
5
|
-
userClasses?: string;
|
|
6
|
-
quaffClasses?:
|
|
5
|
+
userClasses?: string | null;
|
|
6
|
+
quaffClasses?: unknown[];
|
|
7
7
|
}
|
|
8
|
-
export declare function createClasses(modifiers:
|
|
8
|
+
export declare function createClasses(modifiers: unknown[], options?: CreateClassesOptions): string;
|
|
9
9
|
export {};
|
package/dist/utils/props.js
CHANGED
|
@@ -2,14 +2,15 @@ import { convertCase } from "./string";
|
|
|
2
2
|
export function createStyles(styleObj, userStyles) {
|
|
3
3
|
const stylesArray = Object.entries(styleObj);
|
|
4
4
|
const toJoin = [];
|
|
5
|
-
for (
|
|
6
|
-
if (styleVal === undefined || styleVal === null) {
|
|
5
|
+
for (const [styleName, styleVal] of stylesArray) {
|
|
6
|
+
if (styleVal === undefined || styleVal === null || styleVal === false) {
|
|
7
7
|
continue;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
toJoin.push(`${convertCase(styleName, "camel", "kebab")}: ${styleVal}`);
|
|
10
|
+
}
|
|
11
|
+
if (userStyles) {
|
|
12
|
+
toJoin.push(userStyles);
|
|
11
13
|
}
|
|
12
|
-
userStyles && toJoin.push(userStyles);
|
|
13
14
|
if (toJoin.length === 0) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -19,12 +20,13 @@ export function createClasses(modifiers, options = { userClasses: "", quaffClass
|
|
|
19
20
|
const userClasses = options.userClasses?.trim();
|
|
20
21
|
const quaffClasses = options.quaffClasses?.length && createClasses(options.quaffClasses);
|
|
21
22
|
const baseClasses = `${quaffClasses || ""} ${userClasses || ""}`.trim();
|
|
22
|
-
|
|
23
|
+
const component = options.component;
|
|
24
|
+
let element;
|
|
23
25
|
if (component && options.element) {
|
|
24
26
|
element = `${component}__${options.element}`;
|
|
25
27
|
}
|
|
26
28
|
const filteredModifiers = modifiers.filter(Boolean);
|
|
27
|
-
|
|
29
|
+
const withModifiers = component
|
|
28
30
|
? filteredModifiers.map((modifier) => `${element || component}--${modifier}`)
|
|
29
31
|
: filteredModifiers;
|
|
30
32
|
return [element || component, ...withModifiers, baseClasses].filter(Boolean).join(" ").trim();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Readable } from "svelte/store";
|
|
2
|
+
export interface RouterProps {
|
|
3
|
+
activeClass?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
href?: string;
|
|
6
|
+
replace?: boolean;
|
|
7
|
+
to?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const isRouteActive: Readable<(route?: string) => boolean>;
|
|
10
|
+
export declare function getRouterInfo<T extends RouterProps>(props: T): {
|
|
11
|
+
hasLink: boolean;
|
|
12
|
+
linkAttributes: {
|
|
13
|
+
href: string | undefined;
|
|
14
|
+
"data-sveltekit-reload": boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
linkClasses: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { derived } from "svelte/store";
|
|
2
|
+
import { page } from "$app/stores";
|
|
3
|
+
export const isRouteActive = derived(page, ($page) => {
|
|
4
|
+
return (route) => {
|
|
5
|
+
if (!route) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return $page.url.pathname === route || $page.url.pathname.startsWith(`${route}/`);
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
export function getRouterInfo(props) {
|
|
12
|
+
const hasLink = [props.to, props.href].some((entry) => entry !== undefined);
|
|
13
|
+
const linkClasses = `${hasLink ? "q-link" : ""} ${props.disabled ? "disabled" : ""}`.trim();
|
|
14
|
+
const linkAttributes = {
|
|
15
|
+
href: props.to || props.href,
|
|
16
|
+
"data-sveltekit-reload": props.replace ? true : undefined,
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
hasLink,
|
|
20
|
+
linkAttributes,
|
|
21
|
+
linkClasses,
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/utils/string.d.ts
CHANGED
package/dist/utils/string.js
CHANGED
|
@@ -31,6 +31,7 @@ function convertToKebabSnakeCase(str, caseType) {
|
|
|
31
31
|
.join("");
|
|
32
32
|
}
|
|
33
33
|
export function convertCase(str, fromCase, toCase) {
|
|
34
|
+
const uncap = uncapitalize(str);
|
|
34
35
|
switch (fromCase) {
|
|
35
36
|
case "camel":
|
|
36
37
|
if (toCase === "pascal") {
|
|
@@ -41,7 +42,6 @@ export function convertCase(str, fromCase, toCase) {
|
|
|
41
42
|
}
|
|
42
43
|
break;
|
|
43
44
|
case "pascal":
|
|
44
|
-
let uncap = uncapitalize(str);
|
|
45
45
|
if (toCase === "camel") {
|
|
46
46
|
return uncap;
|
|
47
47
|
}
|
|
@@ -76,3 +76,6 @@ export function convertCase(str, fromCase, toCase) {
|
|
|
76
76
|
}
|
|
77
77
|
return str;
|
|
78
78
|
}
|
|
79
|
+
export function extractImgSrc(prop) {
|
|
80
|
+
return prop?.startsWith("img:") ? prop.slice(4) : undefined;
|
|
81
|
+
}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export interface NativeProps {
|
|
2
|
-
userClasses?: string;
|
|
3
|
-
userStyles?: string;
|
|
2
|
+
userClasses?: string | null;
|
|
3
|
+
userStyles?: string | null;
|
|
4
4
|
}
|
|
5
5
|
export declare const NativePropsDefaults: NativeProps;
|
|
6
|
+
export type QuaffSizes = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
|
+
export type CssUnit = "px" | "%" | "em" | "ex" | "ch" | "rem" | "vw" | "vh" | "vmin" | "vmax";
|
|
8
|
+
export type CssValue = `${number}${CssUnit}`;
|
|
6
9
|
export interface QComponentDocs {
|
|
7
10
|
name: string;
|
|
8
11
|
description: string;
|
|
@@ -16,7 +19,7 @@ export interface QComponentDocs {
|
|
|
16
19
|
export interface QComponentProp {
|
|
17
20
|
name: string;
|
|
18
21
|
type: string;
|
|
19
|
-
default?:
|
|
22
|
+
default?: unknown;
|
|
20
23
|
description: string;
|
|
21
24
|
clickableType?: boolean;
|
|
22
25
|
optional?: boolean;
|
|
@@ -39,4 +42,9 @@ export interface QComponentMethod {
|
|
|
39
42
|
type: string;
|
|
40
43
|
description: string;
|
|
41
44
|
}
|
|
42
|
-
export
|
|
45
|
+
export type Entries<T> = {
|
|
46
|
+
[K in keyof T]: [K, T[K]];
|
|
47
|
+
}[keyof T][];
|
|
48
|
+
export type QEvent<T, E> = T & {
|
|
49
|
+
currentTarget: EventTarget & E;
|
|
50
|
+
};
|
package/dist/utils/types.js
CHANGED
package/dist/utils/types.json
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"QAvatarShapeOptions": "type QAvatarShapeOptions =\n | \"circle\"\n | \"rounded\"\n | \"top-round\"\n | \"left-round\"\n | \"right-round\"\n | \"bottom-round\"\n | \"top-left-round\"\n | \"top-right-round\"\n | \"bottom-left-round\"\n | \"bottom-right-round\"",
|
|
3
|
+
"QAvatarSizeOptions": "type QAvatarSizeOptions = Q.Size | Q.CssValue | number",
|
|
4
|
+
"QBreadcrumbsGutterOptions": "type QBreadcrumbsGutterOptions = Exclude<Q.Size, \"xs\" | \"xl\">",
|
|
5
|
+
"QBtnDesignOptions": "type QBtnDesignOptions = \"elevated\" | \"filled\" | \"tonal\" | \"outlined\" | \"flat\"",
|
|
6
|
+
"QBtnSizeOptions": "type QBtnSizeOptions = Exclude<Q.Size, \"xs\">",
|
|
7
|
+
"QCardFillColors": "type QCardFillColors = \"primary\" | \"secondary\" | \"tertiary\"",
|
|
8
|
+
"QChipFillOptions": "type QChipFillOptions =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"neutral\"\n | \"neutral-variant\"\n | \"error\"",
|
|
9
|
+
"QChipKindOptions": "type QChipKindOptions = \"assist\" | \"filter\" | \"input\" | \"suggestion\"",
|
|
10
|
+
"QChipSizeOptions": "type QChipSizeOptions = Exclude<Q.Size, \"xs\" | \"xl\" | \"none\">",
|
|
11
|
+
"QDialogPositionOptions": "type QDialogPositionOptions = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\"",
|
|
12
|
+
"QDrawerBehaviorOptions": "type QDrawerBehaviorOptions = \"default\" | \"desktop\" | \"mobile\"",
|
|
13
|
+
"QDrawerSideOptions": "type QDrawerSideOptions = \"left\" | \"right\"",
|
|
14
|
+
"QIconSizeOptions": "type QIconSizeOptions = Q.Size | Q.CssValue | number",
|
|
15
|
+
"QIconTypeOptions": "type QIconTypeOptions = \"outlined\" | \"sharp\" | \"rounded\"",
|
|
16
|
+
"QItemSectionTypes": "type QItemSectionTypes =\n | \"thumbnail\"\n | \"video\"\n | \"avatar\"\n | \"toggle\"\n | \"icon\"\n | \"trailingIcon\"\n | \"trailingText\"\n | \"content\"",
|
|
17
|
+
"QLayoutEvents": "type QLayoutEvents = \"resize\" | \"scroll\" | \"scrollHeight\"",
|
|
18
|
+
"QLayoutViewOptions": "type QLayoutViewOptions = `${\"l\"|\"h\"}${\"h\"|\"H\"}${\"r\"|\"h\"} ${\"l\"|\"L\"}${\"p\"}${\"r\"|\"R\"} ${\"l\"|\"f\"}${\"f\"|\"F\"}${\"r\"|\"f\"}`",
|
|
19
|
+
"QSelectMultipleValue": "type QSelectMultipleValue = QSelectSingleValue[]",
|
|
20
|
+
"QSelectOption": "type QSelectOption = string | { label: string, value: string }",
|
|
21
|
+
"QSelectSingleValue": "type QSelectSingleValue = string | number",
|
|
22
|
+
"QSelectValue": "type QSelectValue = QSelectSingleValue | QSelectMultipleValue",
|
|
23
|
+
"QTableColumn": "type QTableColumn = {\n name: string\n required?: boolean;\n label: string;\n align?: \"left\" | \"center\" | \"right\";\n field: string | ((row: QTableRow) => string);\n format?: (val: string) => string;\n sortable?: boolean;\n sort?: (a: string, b: string) => number;\n};",
|
|
24
|
+
"QTableRow": "type QTableRow = {\n [key: string]: string | number\n};",
|
|
25
|
+
"QTableSort": "type QTableSort = {\n columnField: string | ((row: QTableRow) => string)\n type: \"asc\" | \"desc\";\n} | null;",
|
|
26
|
+
"QTabsVariants": "type QTabsVariants = \"primary\" | \"secondary\" | \"vertical\""
|
|
27
|
+
}
|
package/dist/utils/watchable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { derived, writable } from "svelte/store";
|
|
2
2
|
export function watchable(value) {
|
|
3
|
-
|
|
3
|
+
const values = writable([value, null]);
|
|
4
4
|
const subscribe = derived(values, ($values) => $values[0]).subscribe;
|
|
5
5
|
const update = (fn, isEqual = (a, b) => a === b) => {
|
|
6
6
|
values.update(($values) => {
|
package/package.json
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quaffui/quaff",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-prealpha21",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"open": "vite dev --open",
|
|
7
|
-
"build": "vite build &&
|
|
7
|
+
"build": "vite build && bun run package && bun run build:css",
|
|
8
|
+
"build:css": "vite build --config vite.config.scss.ts",
|
|
8
9
|
"preview": "vite preview",
|
|
9
10
|
"package": "svelte-kit sync && svelte-package && publint",
|
|
10
|
-
"prepublishOnly": "
|
|
11
|
+
"prepublishOnly": "bun run build",
|
|
11
12
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
12
13
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
13
14
|
"test:unit": "vitest",
|
|
14
|
-
"lint": "prettier --plugin-
|
|
15
|
-
"format": "prettier --plugin-
|
|
16
|
-
"docgen": "
|
|
17
|
-
"
|
|
15
|
+
"lint": "prettier --plugin prettier-plugin-svelte . --check . && eslint .",
|
|
16
|
+
"format": "prettier --plugin prettier-plugin-svelte . --write . && eslint . --fix",
|
|
17
|
+
"docgen-props": "bun scripts/docgenProps.ts",
|
|
18
|
+
"colorgen": "bun scripts/colorgen.ts",
|
|
19
|
+
"docgen-snippets": "bun scripts/docgenSnippets.ts",
|
|
20
|
+
"write-version": "bun scripts/writeVersion.ts"
|
|
18
21
|
},
|
|
19
22
|
"exports": {
|
|
20
23
|
".": {
|
|
21
24
|
"types": "./dist/index.d.ts",
|
|
22
25
|
"svelte": "./dist/index.js"
|
|
23
|
-
}
|
|
26
|
+
},
|
|
27
|
+
"./css/*": "./dist/css/*"
|
|
24
28
|
},
|
|
25
29
|
"files": [
|
|
26
30
|
"dist",
|
|
@@ -28,39 +32,45 @@
|
|
|
28
32
|
"!dist/**/*.spec.*"
|
|
29
33
|
],
|
|
30
34
|
"peerDependencies": {
|
|
35
|
+
"shiki": "^1.21.0",
|
|
31
36
|
"svelte": "^4.0.0"
|
|
32
37
|
},
|
|
33
38
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@sveltejs/
|
|
36
|
-
"@sveltejs/
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"eslint": "^8.
|
|
43
|
-
"eslint
|
|
44
|
-
"eslint
|
|
45
|
-
"prettier": "^
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
39
|
+
"@fontsource/roboto": "^5.1.0",
|
|
40
|
+
"@sveltejs/adapter-auto": "^3.2.5",
|
|
41
|
+
"@sveltejs/kit": "^2.5.28",
|
|
42
|
+
"@sveltejs/package": "^2.3.5",
|
|
43
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
|
44
|
+
"@types/bun": "^1.1.11",
|
|
45
|
+
"@types/prettier": "^3.0.0",
|
|
46
|
+
"@types/prismjs": "^1.26.4",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
|
48
|
+
"@typescript-eslint/parser": "^8.7.0",
|
|
49
|
+
"eslint": "^9.11.1",
|
|
50
|
+
"eslint-config-prettier": "^9.1.0",
|
|
51
|
+
"eslint-plugin-import-x": "^4.3.0",
|
|
52
|
+
"eslint-plugin-svelte": "^2.44.0",
|
|
53
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
54
|
+
"estree-walker": "^3.0.3",
|
|
55
|
+
"globals": "^15.9.0",
|
|
56
|
+
"magic-string": "^0.30.11",
|
|
57
|
+
"material-symbols": "^0.23.0",
|
|
58
|
+
"prettier": "^3.3.3",
|
|
59
|
+
"prettier-plugin-svelte": "^3.2.6",
|
|
60
|
+
"publint": "^0.2.11",
|
|
61
|
+
"sass": "^1.79.3",
|
|
62
|
+
"svelte": "5.0.0-next.257",
|
|
63
|
+
"svelte-check": "^4.0.3",
|
|
64
|
+
"svelte-eslint-parser": "^0.41.1",
|
|
65
|
+
"tslib": "^2.7.0",
|
|
66
|
+
"typescript": "^5.6.2",
|
|
67
|
+
"vite": "^5.4.7",
|
|
68
|
+
"vitest": "^2.1.1"
|
|
56
69
|
},
|
|
57
70
|
"svelte": "./dist/index.js",
|
|
58
71
|
"types": "./dist/index.d.ts",
|
|
59
72
|
"type": "module",
|
|
60
73
|
"dependencies": {
|
|
61
|
-
"
|
|
62
|
-
"material-dynamic-colors": "^1.0.1",
|
|
63
|
-
"prism-svelte": "0.5.0",
|
|
64
|
-
"prismjs": "^1.29.0"
|
|
74
|
+
"@material/material-color-utilities": "^0.3.0"
|
|
65
75
|
}
|
|
66
76
|
}
|