@quaffui/quaff 0.1.0-prealpha
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/LICENSE +9 -0
- package/README.md +43 -0
- package/dist/components/avatar/QAvatar.svelte +43 -0
- package/dist/components/avatar/QAvatar.svelte.d.ts +27 -0
- package/dist/components/avatar/docs.d.ts +2 -0
- package/dist/components/avatar/docs.js +22 -0
- package/dist/components/avatar/docs.props.d.ts +8 -0
- package/dist/components/avatar/docs.props.js +34 -0
- package/dist/components/avatar/index.scss +88 -0
- package/dist/components/avatar/props.d.ts +25 -0
- package/dist/components/avatar/props.js +1 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +18 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +23 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +59 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +26 -0
- package/dist/components/breadcrumbs/docs.d.ts +2 -0
- package/dist/components/breadcrumbs/docs.js +16 -0
- package/dist/components/breadcrumbs/docs.props.d.ts +16 -0
- package/dist/components/breadcrumbs/docs.props.js +84 -0
- package/dist/components/breadcrumbs/index.scss +20 -0
- package/dist/components/breadcrumbs/props.d.ts +56 -0
- package/dist/components/breadcrumbs/props.js +1 -0
- package/dist/components/button/QBtn.svelte +59 -0
- package/dist/components/button/QBtn.svelte.d.ts +32 -0
- package/dist/components/button/docs.d.ts +2 -0
- package/dist/components/button/docs.js +22 -0
- package/dist/components/button/docs.props.d.ts +8 -0
- package/dist/components/button/docs.props.js +82 -0
- package/dist/components/button/index.scss +78 -0
- package/dist/components/button/props.d.ts +54 -0
- package/dist/components/button/props.js +1 -0
- package/dist/components/card/QCard.svelte +23 -0
- package/dist/components/card/QCard.svelte.d.ts +26 -0
- package/dist/components/card/QCardActions.svelte +18 -0
- package/dist/components/card/QCardActions.svelte.d.ts +22 -0
- package/dist/components/card/QCardSection.svelte +14 -0
- package/dist/components/card/QCardSection.svelte.d.ts +23 -0
- package/dist/components/card/docs.d.ts +4 -0
- package/dist/components/card/docs.js +46 -0
- package/dist/components/card/docs.props.d.ts +24 -0
- package/dist/components/card/docs.props.js +62 -0
- package/dist/components/card/index.scss +53 -0
- package/dist/components/card/props.d.ts +44 -0
- package/dist/components/card/props.js +1 -0
- package/dist/components/checkbox/QCheckbox.svelte +14 -0
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +21 -0
- package/dist/components/checkbox/docs.d.ts +2 -0
- package/dist/components/checkbox/docs.js +17 -0
- package/dist/components/checkbox/docs.props.d.ts +8 -0
- package/dist/components/checkbox/docs.props.js +26 -0
- package/dist/components/checkbox/index.scss +3 -0
- package/dist/components/checkbox/props.d.ts +17 -0
- package/dist/components/checkbox/props.js +1 -0
- package/dist/components/chip/QChip.svelte +62 -0
- package/dist/components/chip/QChip.svelte.d.ts +35 -0
- package/dist/components/chip/docs.d.ts +2 -0
- package/dist/components/chip/docs.js +30 -0
- package/dist/components/chip/docs.props.d.ts +8 -0
- package/dist/components/chip/docs.props.js +90 -0
- package/dist/components/chip/index.scss +83 -0
- package/dist/components/chip/props.d.ts +59 -0
- package/dist/components/chip/props.js +1 -0
- package/dist/components/codeBlock/QCodeBlock.svelte +71 -0
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +23 -0
- package/dist/components/codeBlock/docs.props.d.ts +8 -0
- package/dist/components/codeBlock/docs.props.js +34 -0
- package/dist/components/codeBlock/props.d.ts +20 -0
- package/dist/components/codeBlock/props.js +1 -0
- package/dist/components/dialog/QDialog.svelte +80 -0
- package/dist/components/dialog/QDialog.svelte.d.ts +37 -0
- package/dist/components/dialog/docs.d.ts +2 -0
- package/dist/components/dialog/docs.js +11 -0
- package/dist/components/dialog/docs.props.d.ts +16 -0
- package/dist/components/dialog/docs.props.js +148 -0
- package/dist/components/dialog/index.scss +27 -0
- package/dist/components/dialog/props.d.ts +45 -0
- package/dist/components/dialog/props.js +1 -0
- package/dist/components/drawer/QDrawer.svelte +87 -0
- package/dist/components/drawer/QDrawer.svelte.d.ts +39 -0
- package/dist/components/drawer/docs.d.ts +2 -0
- package/dist/components/drawer/docs.js +11 -0
- package/dist/components/drawer/docs.props.d.ts +8 -0
- package/dist/components/drawer/docs.props.js +106 -0
- package/dist/components/drawer/index.scss +54 -0
- package/dist/components/drawer/props.d.ts +70 -0
- package/dist/components/drawer/props.js +1 -0
- package/dist/components/footer/QFooter.svelte +14 -0
- package/dist/components/footer/QFooter.svelte.d.ts +24 -0
- package/dist/components/footer/docs.d.ts +2 -0
- package/dist/components/footer/docs.js +11 -0
- package/dist/components/footer/docs.props.d.ts +8 -0
- package/dist/components/footer/docs.props.js +34 -0
- package/dist/components/footer/index.scss +5 -0
- package/dist/components/footer/props.d.ts +23 -0
- package/dist/components/footer/props.js +1 -0
- package/dist/components/icon/QIcon.svelte +40 -0
- package/dist/components/icon/QIcon.svelte.d.ts +28 -0
- package/dist/components/icon/docs.d.ts +2 -0
- package/dist/components/icon/docs.js +11 -0
- package/dist/components/icon/docs.props.d.ts +8 -0
- package/dist/components/icon/docs.props.js +66 -0
- package/dist/components/icon/index.scss +18 -0
- package/dist/components/icon/props.d.ts +45 -0
- package/dist/components/icon/props.js +1 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +29 -0
- package/dist/components/input/QInput.svelte +81 -0
- package/dist/components/input/QInput.svelte.d.ts +32 -0
- package/dist/components/input/docs.d.ts +2 -0
- package/dist/components/input/docs.js +83 -0
- package/dist/components/input/docs.props.d.ts +8 -0
- package/dist/components/input/docs.props.js +90 -0
- package/dist/components/input/index.scss +3 -0
- package/dist/components/input/props.d.ts +27 -0
- package/dist/components/input/props.js +13 -0
- package/dist/components/layout/QLayout.svelte +88 -0
- package/dist/components/layout/QLayout.svelte.d.ts +57 -0
- package/dist/components/layout/docs.d.ts +2 -0
- package/dist/components/layout/docs.js +11 -0
- package/dist/components/layout/docs.props.d.ts +8 -0
- package/dist/components/layout/docs.props.js +58 -0
- package/dist/components/layout/index.scss +370 -0
- package/dist/components/layout/props.d.ts +41 -0
- package/dist/components/layout/props.js +1 -0
- package/dist/components/list/QItem.svelte +60 -0
- package/dist/components/list/QItem.svelte.d.ts +34 -0
- package/dist/components/list/QItemSection.svelte +47 -0
- package/dist/components/list/QItemSection.svelte.d.ts +25 -0
- package/dist/components/list/QList.svelte +23 -0
- package/dist/components/list/QList.svelte.d.ts +36 -0
- package/dist/components/list/docs.props.d.ts +40 -0
- package/dist/components/list/docs.props.js +226 -0
- package/dist/components/list/index.scss +114 -0
- package/dist/components/list/props.d.ts +33 -0
- package/dist/components/list/props.js +25 -0
- package/dist/components/private/ContextReseter.svelte +13 -0
- package/dist/components/private/ContextReseter.svelte.d.ts +18 -0
- package/dist/components/private/QApi.svelte +142 -0
- package/dist/components/private/QApi.svelte.d.ts +17 -0
- package/dist/components/private/QDocs.svelte +66 -0
- package/dist/components/private/QDocs.svelte.d.ts +21 -0
- package/dist/components/private/QDocsSection.svelte +32 -0
- package/dist/components/private/QDocsSection.svelte.d.ts +29 -0
- package/dist/components/progress/QCircularProgress.svelte +26 -0
- package/dist/components/progress/QCircularProgress.svelte.d.ts +22 -0
- package/dist/components/progress/QLinearProgress.svelte +20 -0
- package/dist/components/progress/QLinearProgress.svelte.d.ts +22 -0
- package/dist/components/progress/docs.props.d.ts +8 -0
- package/dist/components/progress/docs.props.js +26 -0
- package/dist/components/progress/index.scss +50 -0
- package/dist/components/progress/props.d.ts +20 -0
- package/dist/components/progress/props.js +7 -0
- package/dist/components/radio/QRadio.svelte +14 -0
- package/dist/components/radio/QRadio.svelte.d.ts +22 -0
- package/dist/components/radio/docs.d.ts +2 -0
- package/dist/components/radio/docs.js +39 -0
- package/dist/components/radio/docs.props.d.ts +8 -0
- package/dist/components/radio/docs.props.js +34 -0
- package/dist/components/radio/index.scss +3 -0
- package/dist/components/radio/props.d.ts +8 -0
- package/dist/components/radio/props.js +8 -0
- package/dist/components/railbar/QRailbar.svelte +52 -0
- package/dist/components/railbar/QRailbar.svelte.d.ts +23 -0
- package/dist/components/railbar/docs.props.d.ts +8 -0
- package/dist/components/railbar/docs.props.js +26 -0
- package/dist/components/railbar/props.d.ts +7 -0
- package/dist/components/railbar/props.js +7 -0
- package/dist/components/select/QSelect.svelte +159 -0
- package/dist/components/select/QSelect.svelte.d.ts +34 -0
- package/dist/components/select/docs.d.ts +2 -0
- package/dist/components/select/docs.js +95 -0
- package/dist/components/select/docs.props.d.ts +8 -0
- package/dist/components/select/docs.props.js +106 -0
- package/dist/components/select/index.scss +34 -0
- package/dist/components/select/props.d.ts +33 -0
- package/dist/components/select/props.js +14 -0
- package/dist/components/separator/QSeparator.svelte +63 -0
- package/dist/components/separator/QSeparator.svelte.d.ts +25 -0
- package/dist/components/separator/docs.props.d.ts +16 -0
- package/dist/components/separator/docs.props.js +116 -0
- package/dist/components/separator/props.d.ts +22 -0
- package/dist/components/separator/props.js +9 -0
- package/dist/components/table/QTable.svelte +154 -0
- package/dist/components/table/QTable.svelte.d.ts +29 -0
- package/dist/components/table/docs.d.ts +2 -0
- package/dist/components/table/docs.js +11 -0
- package/dist/components/table/docs.props.d.ts +8 -0
- package/dist/components/table/docs.props.js +42 -0
- package/dist/components/table/index.scss +77 -0
- package/dist/components/table/props.d.ts +45 -0
- package/dist/components/table/props.js +1 -0
- package/dist/components/tabs/QTab.svelte +78 -0
- package/dist/components/tabs/QTab.svelte.d.ts +28 -0
- package/dist/components/tabs/QTabs.svelte +55 -0
- package/dist/components/tabs/QTabs.svelte.d.ts +23 -0
- package/dist/components/tabs/docs.props.d.ts +16 -0
- package/dist/components/tabs/docs.props.js +60 -0
- package/dist/components/tabs/index.scss +75 -0
- package/dist/components/tabs/props.d.ts +14 -0
- package/dist/components/tabs/props.js +13 -0
- package/dist/components/toggle/QToggle.svelte +35 -0
- package/dist/components/toggle/QToggle.svelte.d.ts +23 -0
- package/dist/components/toggle/docs.d.ts +2 -0
- package/dist/components/toggle/docs.js +47 -0
- package/dist/components/toggle/docs.props.d.ts +8 -0
- package/dist/components/toggle/docs.props.js +42 -0
- package/dist/components/toggle/index.scss +31 -0
- package/dist/components/toggle/props.d.ts +9 -0
- package/dist/components/toggle/props.js +9 -0
- package/dist/components/toolbar/QToolbar.svelte +39 -0
- package/dist/components/toolbar/QToolbar.svelte.d.ts +23 -0
- package/dist/components/toolbar/docs.props.d.ts +8 -0
- package/dist/components/toolbar/docs.props.js +18 -0
- package/dist/components/toolbar/index.scss +7 -0
- package/dist/components/toolbar/props.d.ts +6 -0
- package/dist/components/toolbar/props.js +6 -0
- package/dist/components/tooltip/QTooltip.svelte +15 -0
- package/dist/components/tooltip/QTooltip.svelte.d.ts +22 -0
- package/dist/components/tooltip/docs.props.d.ts +8 -0
- package/dist/components/tooltip/docs.props.js +18 -0
- package/dist/components/tooltip/index.scss +7 -0
- package/dist/components/tooltip/props.d.ts +6 -0
- package/dist/components/tooltip/props.js +6 -0
- package/dist/composables/index.d.ts +0 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-align.d.ts +8 -0
- package/dist/composables/use-align.js +12 -0
- package/dist/composables/use-index.d.ts +2 -0
- package/dist/composables/use-index.js +17 -0
- package/dist/composables/use-router-link.d.ts +18 -0
- package/dist/composables/use-router-link.js +27 -0
- package/dist/composables/use-size.d.ts +11 -0
- package/dist/composables/use-size.js +13 -0
- package/dist/css/grid.scss +65 -0
- package/dist/css/index.scss +119 -0
- package/dist/css/mixins/field.scss +430 -0
- package/dist/css/mixins/menu.scss +70 -0
- package/dist/css/mixins/selection.scss +184 -0
- package/dist/css/mixins/table.scss +36 -0
- package/dist/css/mixins.scss +135 -0
- package/dist/css/states.scss +70 -0
- package/dist/css/theme/colors.module.scss +180 -0
- package/dist/css/theme/theme.dark.scss +36 -0
- package/dist/css/theme/theme.light.scss +36 -0
- package/dist/css/theme/theme.scss +5 -0
- package/dist/css/theme/tokens.scss +266 -0
- package/dist/css/theme/typography.module.scss +150 -0
- package/dist/global.d.ts +10 -0
- package/dist/helpers/activationHandler.d.ts +9 -0
- package/dist/helpers/activationHandler.js +23 -0
- package/dist/helpers/clickOutside.d.ts +6 -0
- package/dist/helpers/clickOutside.js +34 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/stores/QTheme.d.ts +41 -0
- package/dist/stores/QTheme.js +53 -0
- package/dist/stores/Quaff.d.ts +31 -0
- package/dist/stores/Quaff.js +52 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +11 -0
- package/dist/utils/colors.d.ts +10 -0
- package/dist/utils/colors.js +102 -0
- package/dist/utils/fields.d.ts +1 -0
- package/dist/utils/fields.js +14 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/props.d.ts +9 -0
- package/dist/utils/props.js +31 -0
- package/dist/utils/string.d.ts +10 -0
- package/dist/utils/string.js +78 -0
- package/dist/utils/types.d.ts +42 -0
- package/dist/utils/types.js +7 -0
- package/dist/utils/types.json +1 -0
- package/dist/utils/watchable.d.ts +2 -0
- package/dist/utils/watchable.js +22 -0
- package/package.json +66 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
body.light {
|
|
2
|
+
--primary: rgba(var(--primary-light));
|
|
3
|
+
--on-primary: rgba(var(--on-primary-light));
|
|
4
|
+
--primary-container: rgba(var(--primary-container-light));
|
|
5
|
+
--on-primary-container: rgba(var(--on-primary-container-light));
|
|
6
|
+
--secondary: rgba(var(--secondary-light));
|
|
7
|
+
--on-secondary: rgba(var(--on-secondary-light));
|
|
8
|
+
--secondary-container: rgba(var(--secondary-container-light));
|
|
9
|
+
--on-secondary-container: rgba(var(--on-secondary-container-light));
|
|
10
|
+
--tertiary: rgba(var(--tertiary-light));
|
|
11
|
+
--on-tertiary: rgba(var(--on-tertiary-light));
|
|
12
|
+
--tertiary-container: rgba(var(--tertiary-container-light));
|
|
13
|
+
--on-tertiary-container: rgba(var(--on-tertiary-container-light));
|
|
14
|
+
--error: rgba(var(--error-light));
|
|
15
|
+
--error-container: rgba(var(--error-container-light));
|
|
16
|
+
--on-error: rgba(var(--on-error-light));
|
|
17
|
+
--on-error-container: rgba(var(--on-error-container-light));
|
|
18
|
+
--background: rgba(var(--background-light));
|
|
19
|
+
--on-background: rgba(var(--on-background-light));
|
|
20
|
+
--surface: rgba(var(--surface-light));
|
|
21
|
+
--on-surface: rgba(var(--on-surface-light));
|
|
22
|
+
--on-surface-2: rgba(var(--on-surface-light), 0.08);
|
|
23
|
+
--on-surface-4: rgba(var(--on-surface-light), 0.12);
|
|
24
|
+
--surface-variant: rgba(var(--surface-variant-light));
|
|
25
|
+
--on-surface-variant: rgba(var(--on-surface-variant-light));
|
|
26
|
+
--on-surface-variant-2: rgba(var(--on-surface-variant-light), 0.08);
|
|
27
|
+
--on-surface-variant-4: rgba(var(--on-surface-variant-light), 0.12);
|
|
28
|
+
--outline: rgba(var(--outline-light));
|
|
29
|
+
--inverse-on-surface: rgba(var(--inverse-on-surface-light));
|
|
30
|
+
--inverse-surface: rgba(var(--inverse-surface-light));
|
|
31
|
+
--inverse-primary: rgba(var(--inverse-primary-light));
|
|
32
|
+
--shadow: rgba(var(--shadow-light));
|
|
33
|
+
--surface-tint: rgba(var(--surface-tint-light));
|
|
34
|
+
--outline-variant: rgba(var(--outline-variant-light));
|
|
35
|
+
--scrim: rgba(var(--scrim-light));
|
|
36
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--md-source: 255, 183, 123;
|
|
3
|
+
/* primary */
|
|
4
|
+
--palette-primary0: 0, 0, 0;
|
|
5
|
+
--palette-primary10: 46, 21, 0;
|
|
6
|
+
--palette-primary20: 77, 39, 0;
|
|
7
|
+
--palette-primary25: 93, 48, 0;
|
|
8
|
+
--palette-primary30: 109, 57, 0;
|
|
9
|
+
--palette-primary35: 126, 67, 0;
|
|
10
|
+
--palette-primary40: 144, 77, 0;
|
|
11
|
+
--palette-primary50: 176, 100, 20;
|
|
12
|
+
--palette-primary60: 207, 125, 45;
|
|
13
|
+
--palette-primary70: 239, 150, 69;
|
|
14
|
+
--palette-primary80: 255, 183, 124;
|
|
15
|
+
--palette-primary90: 255, 220, 194;
|
|
16
|
+
--palette-primary95: 255, 237, 226;
|
|
17
|
+
--palette-primary98: 255, 248, 245;
|
|
18
|
+
--palette-primary99: 255, 251, 255;
|
|
19
|
+
--palette-primary100: 255, 255, 255;
|
|
20
|
+
/* secondary */
|
|
21
|
+
--palette-secondary0: 0, 0, 0;
|
|
22
|
+
--palette-secondary10: 42, 23, 7;
|
|
23
|
+
--palette-secondary20: 65, 44, 25;
|
|
24
|
+
--palette-secondary25: 78, 55, 35;
|
|
25
|
+
--palette-secondary30: 90, 66, 46;
|
|
26
|
+
--palette-secondary35: 103, 77, 57;
|
|
27
|
+
--palette-secondary40: 116, 89, 68;
|
|
28
|
+
--palette-secondary50: 142, 113, 91;
|
|
29
|
+
--palette-secondary60: 170, 139, 115;
|
|
30
|
+
--palette-secondary70: 198, 165, 140;
|
|
31
|
+
--palette-secondary80: 227, 192, 166;
|
|
32
|
+
--palette-secondary90: 255, 220, 194;
|
|
33
|
+
--palette-secondary95: 255, 237, 226;
|
|
34
|
+
--palette-secondary98: 255, 248, 245;
|
|
35
|
+
--palette-secondary99: 255, 251, 255;
|
|
36
|
+
--palette-secondary100: 255, 255, 255;
|
|
37
|
+
/* tertiary */
|
|
38
|
+
--palette-tertiary0: 0, 0, 0;
|
|
39
|
+
--palette-tertiary10: 25, 30, 0;
|
|
40
|
+
--palette-tertiary20: 46, 51, 13;
|
|
41
|
+
--palette-tertiary25: 57, 62, 23;
|
|
42
|
+
--palette-tertiary30: 68, 74, 34;
|
|
43
|
+
--palette-tertiary35: 80, 86, 44;
|
|
44
|
+
--palette-tertiary40: 92, 98, 55;
|
|
45
|
+
--palette-tertiary50: 116, 123, 77;
|
|
46
|
+
--palette-tertiary60: 142, 149, 101;
|
|
47
|
+
--palette-tertiary70: 169, 175, 125;
|
|
48
|
+
--palette-tertiary80: 196, 203, 151;
|
|
49
|
+
--palette-tertiary90: 224, 231, 177;
|
|
50
|
+
--palette-tertiary95: 239, 245, 190;
|
|
51
|
+
--palette-tertiary98: 247, 254, 198;
|
|
52
|
+
--palette-tertiary99: 252, 255, 220;
|
|
53
|
+
--palette-tertiary100: 255, 255, 255;
|
|
54
|
+
/* neutral */
|
|
55
|
+
--palette-neutral0: 0, 0, 0;
|
|
56
|
+
--palette-neutral10: 32, 27, 23;
|
|
57
|
+
--palette-neutral20: 53, 47, 43;
|
|
58
|
+
--palette-neutral25: 65, 58, 54;
|
|
59
|
+
--palette-neutral30: 76, 69, 65;
|
|
60
|
+
--palette-neutral35: 88, 81, 76;
|
|
61
|
+
--palette-neutral40: 101, 93, 88;
|
|
62
|
+
--palette-neutral50: 126, 117, 112;
|
|
63
|
+
--palette-neutral60: 152, 143, 137;
|
|
64
|
+
--palette-neutral70: 179, 169, 163;
|
|
65
|
+
--palette-neutral80: 207, 196, 190;
|
|
66
|
+
--palette-neutral90: 236, 224, 218;
|
|
67
|
+
--palette-neutral95: 250, 238, 232;
|
|
68
|
+
--palette-neutral98: 255, 248, 245;
|
|
69
|
+
--palette-neutral99: 255, 251, 255;
|
|
70
|
+
--palette-neutral100: 255, 255, 255;
|
|
71
|
+
/* neutral-variant */
|
|
72
|
+
--palette-neutral-variant0: 0, 0, 0;
|
|
73
|
+
--palette-neutral-variant10: 36, 26, 18;
|
|
74
|
+
--palette-neutral-variant20: 58, 46, 37;
|
|
75
|
+
--palette-neutral-variant25: 69, 57, 48;
|
|
76
|
+
--palette-neutral-variant30: 81, 68, 59;
|
|
77
|
+
--palette-neutral-variant35: 93, 80, 70;
|
|
78
|
+
--palette-neutral-variant40: 106, 92, 81;
|
|
79
|
+
--palette-neutral-variant50: 132, 116, 105;
|
|
80
|
+
--palette-neutral-variant60: 158, 142, 130;
|
|
81
|
+
--palette-neutral-variant70: 186, 168, 156;
|
|
82
|
+
--palette-neutral-variant80: 214, 195, 182;
|
|
83
|
+
--palette-neutral-variant90: 243, 223, 210;
|
|
84
|
+
--palette-neutral-variant95: 255, 237, 226;
|
|
85
|
+
--palette-neutral-variant98: 255, 248, 245;
|
|
86
|
+
--palette-neutral-variant99: 255, 251, 255;
|
|
87
|
+
--palette-neutral-variant100: 255, 255, 255;
|
|
88
|
+
/* error */
|
|
89
|
+
--palette-error0: 0, 0, 0;
|
|
90
|
+
--palette-error10: 65, 0, 2;
|
|
91
|
+
--palette-error20: 105, 0, 5;
|
|
92
|
+
--palette-error25: 126, 0, 7;
|
|
93
|
+
--palette-error30: 147, 0, 10;
|
|
94
|
+
--palette-error35: 168, 7, 16;
|
|
95
|
+
--palette-error40: 186, 26, 26;
|
|
96
|
+
--palette-error50: 222, 55, 48;
|
|
97
|
+
--palette-error60: 255, 84, 73;
|
|
98
|
+
--palette-error70: 255, 137, 125;
|
|
99
|
+
--palette-error80: 255, 180, 171;
|
|
100
|
+
--palette-error90: 255, 218, 214;
|
|
101
|
+
--palette-error95: 255, 237, 234;
|
|
102
|
+
--palette-error98: 255, 248, 247;
|
|
103
|
+
--palette-error99: 255, 251, 255;
|
|
104
|
+
--palette-error100: 255, 255, 255;
|
|
105
|
+
/* light */
|
|
106
|
+
--primary-light: 0, 98, 159;
|
|
107
|
+
--on-primary-light: 255, 255, 255;
|
|
108
|
+
--primary-container-light: 206, 229, 255;
|
|
109
|
+
--on-primary-container-light: 18, 28, 39;
|
|
110
|
+
--secondary-light: 82, 96, 112;
|
|
111
|
+
--on-secondary-light: 255, 255, 255;
|
|
112
|
+
--secondary-container-light: 214, 228, 247;
|
|
113
|
+
--on-secondary-container-light: 15, 29, 42;
|
|
114
|
+
--tertiary-light: 105, 88, 121;
|
|
115
|
+
--on-tertiary-light: 255, 255, 255;
|
|
116
|
+
--tertiary-container-light: 241, 219, 255;
|
|
117
|
+
--on-tertiary-container-light: 36, 21, 51;
|
|
118
|
+
--error-light: 186, 27, 27;
|
|
119
|
+
--error-container-light: 255, 218, 212;
|
|
120
|
+
--on-error-light: 255, 255, 255;
|
|
121
|
+
--on-error-container-light: 65, 0, 1;
|
|
122
|
+
--background-light: 253, 252, 255;
|
|
123
|
+
--on-background-light: 26, 28, 30;
|
|
124
|
+
--surface-light: 253, 252, 255;
|
|
125
|
+
--on-surface-light: 26, 28, 30;
|
|
126
|
+
--surface-variant-light: 223, 227, 236;
|
|
127
|
+
--on-surface-variant-light: 66, 71, 78;
|
|
128
|
+
--outline-light: 114, 119, 127;
|
|
129
|
+
--inverse-on-surface-light: 240, 240, 243;
|
|
130
|
+
--inverse-surface-light: 47, 48, 51;
|
|
131
|
+
--inverse-primary-light: 151, 203, 255;
|
|
132
|
+
--shadow-light: 0, 0, 0;
|
|
133
|
+
/* dark */
|
|
134
|
+
--primary-dark: 151, 203, 255;
|
|
135
|
+
--on-primary-dark: 0, 51, 85;
|
|
136
|
+
--primary-container-dark: 0, 74, 122;
|
|
137
|
+
--on-primary-container-dark: 206, 229, 255;
|
|
138
|
+
--secondary-dark: 186, 200, 218;
|
|
139
|
+
--on-secondary-dark: 36, 50, 64;
|
|
140
|
+
--secondary-container-dark: 59, 72, 87;
|
|
141
|
+
--on-secondary-container-dark: 214, 228, 247;
|
|
142
|
+
--tertiary-dark: 212, 190, 230;
|
|
143
|
+
--on-tertiary-dark: 57, 42, 72;
|
|
144
|
+
--tertiary-container-dark: 81, 64, 97;
|
|
145
|
+
--on-tertiary-container-dark: 241, 219, 255;
|
|
146
|
+
--error-dark: 255, 180, 169;
|
|
147
|
+
--error-container-dark: 147, 0, 6;
|
|
148
|
+
--on-error-dark: 104, 0, 3;
|
|
149
|
+
--on-error-container-dark: 255, 218, 212;
|
|
150
|
+
--background-dark: 26, 28, 30;
|
|
151
|
+
--on-background-dark: 226, 226, 230;
|
|
152
|
+
--surface-dark: 26, 28, 30;
|
|
153
|
+
--on-surface-dark: 226, 226, 230;
|
|
154
|
+
--surface-variant-dark: 66, 71, 78;
|
|
155
|
+
--on-surface-variant-dark: 195, 199, 207;
|
|
156
|
+
--outline-dark: 140, 145, 153;
|
|
157
|
+
--inverse-on-surface-dark: 26, 28, 30;
|
|
158
|
+
--inverse-surface-dark: 226, 226, 230;
|
|
159
|
+
--inverse-primary-dark: 0, 98, 159;
|
|
160
|
+
--shadow-dark: 0, 0, 0;
|
|
161
|
+
/* display - large */
|
|
162
|
+
--typescale-display-large-font-family-name: Roboto, sans-serif;
|
|
163
|
+
--typescale-display-large-font-family-style: Regular;
|
|
164
|
+
--typescale-display-large-font-weight: 400px;
|
|
165
|
+
--typescale-display-large-font-size: 57px;
|
|
166
|
+
--typescale-display-large-line-height: 64px;
|
|
167
|
+
--typescale-display-large-letter-spacing: -0.25px;
|
|
168
|
+
/* display - medium */
|
|
169
|
+
--typescale-display-medium-font-family-name: Roboto, sans-serif;
|
|
170
|
+
--typescale-display-medium-font-family-style: Regular;
|
|
171
|
+
--typescale-display-medium-font-weight: 400px;
|
|
172
|
+
--typescale-display-medium-font-size: 45px;
|
|
173
|
+
--typescale-display-medium-line-height: 52px;
|
|
174
|
+
--typescale-display-medium-letter-spacing: 0px;
|
|
175
|
+
/* display - small */
|
|
176
|
+
--typescale-display-small-font-family-name: Roboto, sans-serif;
|
|
177
|
+
--typescale-display-small-font-family-style: Regular;
|
|
178
|
+
--typescale-display-small-font-weight: 400px;
|
|
179
|
+
--typescale-display-small-font-size: 36px;
|
|
180
|
+
--typescale-display-small-line-height: 44px;
|
|
181
|
+
--typescale-display-small-letter-spacing: 0px;
|
|
182
|
+
/* headline - large */
|
|
183
|
+
--typescale-headline-large-font-family-name: Roboto, sans-serif;
|
|
184
|
+
--typescale-headline-large-font-family-style: Regular;
|
|
185
|
+
--typescale-headline-large-font-weight: 400px;
|
|
186
|
+
--typescale-headline-large-font-size: 32px;
|
|
187
|
+
--typescale-headline-large-line-height: 40px;
|
|
188
|
+
--typescale-headline-large-letter-spacing: 0px;
|
|
189
|
+
/* headline - medium */
|
|
190
|
+
--typescale-headline-medium-font-family-name: Roboto, sans-serif;
|
|
191
|
+
--typescale-headline-medium-font-family-style: Regular;
|
|
192
|
+
--typescale-headline-medium-font-weight: 400px;
|
|
193
|
+
--typescale-headline-medium-font-size: 28px;
|
|
194
|
+
--typescale-headline-medium-line-height: 36px;
|
|
195
|
+
--typescale-headline-medium-letter-spacing: 0px;
|
|
196
|
+
/* headline - small */
|
|
197
|
+
--typescale-headline-small-font-family-name: Roboto, sans-serif;
|
|
198
|
+
--typescale-headline-small-font-family-style: Regular;
|
|
199
|
+
--typescale-headline-small-font-weight: 400px;
|
|
200
|
+
--typescale-headline-small-font-size: 24px;
|
|
201
|
+
--typescale-headline-small-line-height: 32px;
|
|
202
|
+
--typescale-headline-small-letter-spacing: 0px;
|
|
203
|
+
/* body - large */
|
|
204
|
+
--typescale-body-large-font-family-name: Roboto, sans-serif;
|
|
205
|
+
--typescale-body-large-font-family-style: Regular;
|
|
206
|
+
--typescale-body-large-font-weight: 400px;
|
|
207
|
+
--typescale-body-large-font-size: 16px;
|
|
208
|
+
--typescale-body-large-line-height: 24px;
|
|
209
|
+
--typescale-body-large-letter-spacing: 0.5px;
|
|
210
|
+
/* body - medium */
|
|
211
|
+
--typescale-body-medium-font-family-name: Roboto, sans-serif;
|
|
212
|
+
--typescale-body-medium-font-family-style: Regular;
|
|
213
|
+
--typescale-body-medium-font-weight: 400px;
|
|
214
|
+
--typescale-body-medium-font-size: 14px;
|
|
215
|
+
--typescale-body-medium-line-height: 20px;
|
|
216
|
+
--typescale-body-medium-letter-spacing: 0.25px;
|
|
217
|
+
/* body - small */
|
|
218
|
+
--typescale-body-small-font-family-name: Roboto, sans-serif;
|
|
219
|
+
--typescale-body-small-font-family-style: Regular;
|
|
220
|
+
--typescale-body-small-font-weight: 400px;
|
|
221
|
+
--typescale-body-small-font-size: 12px;
|
|
222
|
+
--typescale-body-small-line-height: 16px;
|
|
223
|
+
--typescale-body-small-letter-spacing: 0.4px;
|
|
224
|
+
/* label - large */
|
|
225
|
+
--typescale-label-large-font-family-name: Roboto, sans-serif;
|
|
226
|
+
--typescale-label-large-font-family-style: Medium;
|
|
227
|
+
--typescale-label-large-font-weight: 500px;
|
|
228
|
+
--typescale-label-large-font-size: 14px;
|
|
229
|
+
--typescale-label-large-line-height: 20px;
|
|
230
|
+
--typescale-label-large-letter-spacing: 0.1px;
|
|
231
|
+
/* label - medium */
|
|
232
|
+
--typescale-label-medium-font-family-name: Roboto, sans-serif;
|
|
233
|
+
--typescale-label-medium-font-family-style: Medium;
|
|
234
|
+
--typescale-label-medium-font-weight: 500px;
|
|
235
|
+
--typescale-label-medium-font-size: 12px;
|
|
236
|
+
--typescale-label-medium-line-height: 16px;
|
|
237
|
+
--typescale-label-medium-letter-spacing: 0.5px;
|
|
238
|
+
/* label - small */
|
|
239
|
+
--typescale-label-small-font-family-name: Roboto, sans-serif;
|
|
240
|
+
--typescale-label-small-font-family-style: Medium;
|
|
241
|
+
--typescale-label-small-font-weight: 500px;
|
|
242
|
+
--typescale-label-small-font-size: 11px;
|
|
243
|
+
--typescale-label-small-line-height: 16px;
|
|
244
|
+
--typescale-label-small-letter-spacing: 0.5px;
|
|
245
|
+
/* title - large */
|
|
246
|
+
--typescale-title-large-font-family-name: Roboto, sans-serif;
|
|
247
|
+
--typescale-title-large-font-family-style: Regular;
|
|
248
|
+
--typescale-title-large-font-weight: 400px;
|
|
249
|
+
--typescale-title-large-font-size: 22px;
|
|
250
|
+
--typescale-title-large-line-height: 28px;
|
|
251
|
+
--typescale-title-large-letter-spacing: 0px;
|
|
252
|
+
/* title - medium */
|
|
253
|
+
--typescale-title-medium-font-family-name: Roboto, sans-serif;
|
|
254
|
+
--typescale-title-medium-font-family-style: Medium;
|
|
255
|
+
--typescale-title-medium-font-weight: 500px;
|
|
256
|
+
--typescale-title-medium-font-size: 16px;
|
|
257
|
+
--typescale-title-medium-line-height: 24px;
|
|
258
|
+
--typescale-title-medium-letter-spacing: 0.15px;
|
|
259
|
+
/* title - small */
|
|
260
|
+
--typescale-title-small-font-family-name: Roboto, sans-serif;
|
|
261
|
+
--typescale-title-small-font-family-style: Medium;
|
|
262
|
+
--typescale-title-small-font-weight: 500px;
|
|
263
|
+
--typescale-title-small-font-size: 14px;
|
|
264
|
+
--typescale-title-small-line-height: 20px;
|
|
265
|
+
--typescale-title-small-letter-spacing: 0.1px;
|
|
266
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
.display-large {
|
|
2
|
+
font-family: var(--typescale-display-large-font-family-name);
|
|
3
|
+
font-style: var(--typescale-display-large-font-family-style);
|
|
4
|
+
font-weight: var(--typescale-display-large-font-weight);
|
|
5
|
+
font-size: var(--typescale-display-large-font-size);
|
|
6
|
+
letter-spacing: var(--typescale-display-large-tracking);
|
|
7
|
+
line-height: var(--typescale-display-large-height);
|
|
8
|
+
text-transform: var(--typescale-display-large-text-transform);
|
|
9
|
+
text-decoration: var(--typescale-display-large-text-decoration);
|
|
10
|
+
}
|
|
11
|
+
.display-medium {
|
|
12
|
+
font-family: var(--typescale-display-medium-font-family-name);
|
|
13
|
+
font-style: var(--typescale-display-medium-font-family-style);
|
|
14
|
+
font-weight: var(--typescale-display-medium-font-weight);
|
|
15
|
+
font-size: var(--typescale-display-medium-font-size);
|
|
16
|
+
letter-spacing: var(--typescale-display-medium-tracking);
|
|
17
|
+
line-height: var(--typescale-display-medium-height);
|
|
18
|
+
text-transform: var(--typescale-display-medium-text-transform);
|
|
19
|
+
text-decoration: var(--typescale-display-medium-text-decoration);
|
|
20
|
+
}
|
|
21
|
+
.display-small {
|
|
22
|
+
font-family: var(--typescale-display-small-font-family-name);
|
|
23
|
+
font-style: var(--typescale-display-small-font-family-style);
|
|
24
|
+
font-weight: var(--typescale-display-small-font-weight);
|
|
25
|
+
font-size: var(--typescale-display-small-font-size);
|
|
26
|
+
letter-spacing: var(--typescale-display-small-tracking);
|
|
27
|
+
line-height: var(--typescale-display-small-height);
|
|
28
|
+
text-transform: var(--typescale-display-small-text-transform);
|
|
29
|
+
text-decoration: var(--typescale-display-small-text-decoration);
|
|
30
|
+
}
|
|
31
|
+
.headline-large {
|
|
32
|
+
font-family: var(--typescale-headline-large-font-family-name);
|
|
33
|
+
font-style: var(--typescale-headline-large-font-family-style);
|
|
34
|
+
font-weight: var(--typescale-headline-large-font-weight);
|
|
35
|
+
font-size: var(--typescale-headline-large-font-size);
|
|
36
|
+
letter-spacing: var(--typescale-headline-large-tracking);
|
|
37
|
+
line-height: var(--typescale-headline-large-height);
|
|
38
|
+
text-transform: var(--typescale-headline-large-text-transform);
|
|
39
|
+
text-decoration: var(--typescale-headline-large-text-decoration);
|
|
40
|
+
}
|
|
41
|
+
.headline-medium {
|
|
42
|
+
font-family: var(--typescale-headline-medium-font-family-name);
|
|
43
|
+
font-style: var(--typescale-headline-medium-font-family-style);
|
|
44
|
+
font-weight: var(--typescale-headline-medium-font-weight);
|
|
45
|
+
font-size: var(--typescale-headline-medium-font-size);
|
|
46
|
+
letter-spacing: var(--typescale-headline-medium-tracking);
|
|
47
|
+
line-height: var(--typescale-headline-medium-height);
|
|
48
|
+
text-transform: var(--typescale-headline-medium-text-transform);
|
|
49
|
+
text-decoration: var(--typescale-headline-medium-text-decoration);
|
|
50
|
+
}
|
|
51
|
+
.headline-small {
|
|
52
|
+
font-family: var(--typescale-headline-small-font-family-name);
|
|
53
|
+
font-style: var(--typescale-headline-small-font-family-style);
|
|
54
|
+
font-weight: var(--typescale-headline-small-font-weight);
|
|
55
|
+
font-size: var(--typescale-headline-small-font-size);
|
|
56
|
+
letter-spacing: var(--typescale-headline-small-tracking);
|
|
57
|
+
line-height: var(--typescale-headline-small-height);
|
|
58
|
+
text-transform: var(--typescale-headline-small-text-transform);
|
|
59
|
+
text-decoration: var(--typescale-headline-small-text-decoration);
|
|
60
|
+
}
|
|
61
|
+
.body-large {
|
|
62
|
+
font-family: var(--typescale-body-large-font-family-name);
|
|
63
|
+
font-style: var(--typescale-body-large-font-family-style);
|
|
64
|
+
font-weight: var(--typescale-body-large-font-weight);
|
|
65
|
+
font-size: var(--typescale-body-large-font-size);
|
|
66
|
+
letter-spacing: var(--typescale-body-large-tracking);
|
|
67
|
+
line-height: var(--typescale-body-large-height);
|
|
68
|
+
text-transform: var(--typescale-body-large-text-transform);
|
|
69
|
+
text-decoration: var(--typescale-body-large-text-decoration);
|
|
70
|
+
}
|
|
71
|
+
.body-medium {
|
|
72
|
+
font-family: var(--typescale-body-medium-font-family-name);
|
|
73
|
+
font-style: var(--typescale-body-medium-font-family-style);
|
|
74
|
+
font-weight: var(--typescale-body-medium-font-weight);
|
|
75
|
+
font-size: var(--typescale-body-medium-font-size);
|
|
76
|
+
letter-spacing: var(--typescale-body-medium-tracking);
|
|
77
|
+
line-height: var(--typescale-body-medium-height);
|
|
78
|
+
text-transform: var(--typescale-body-medium-text-transform);
|
|
79
|
+
text-decoration: var(--typescale-body-medium-text-decoration);
|
|
80
|
+
}
|
|
81
|
+
.body-small {
|
|
82
|
+
font-family: var(--typescale-body-small-font-family-name);
|
|
83
|
+
font-style: var(--typescale-body-small-font-family-style);
|
|
84
|
+
font-weight: var(--typescale-body-small-font-weight);
|
|
85
|
+
font-size: var(--typescale-body-small-font-size);
|
|
86
|
+
letter-spacing: var(--typescale-body-small-tracking);
|
|
87
|
+
line-height: var(--typescale-body-small-height);
|
|
88
|
+
text-transform: var(--typescale-body-small-text-transform);
|
|
89
|
+
text-decoration: var(--typescale-body-small-text-decoration);
|
|
90
|
+
}
|
|
91
|
+
.label-large {
|
|
92
|
+
font-family: var(--typescale-label-large-font-family-name);
|
|
93
|
+
font-style: var(--typescale-label-large-font-family-style);
|
|
94
|
+
font-weight: var(--typescale-label-large-font-weight);
|
|
95
|
+
font-size: var(--typescale-label-large-font-size);
|
|
96
|
+
letter-spacing: var(--typescale-label-large-tracking);
|
|
97
|
+
line-height: var(--typescale-label-large-height);
|
|
98
|
+
text-transform: var(--typescale-label-large-text-transform);
|
|
99
|
+
text-decoration: var(--typescale-label-large-text-decoration);
|
|
100
|
+
}
|
|
101
|
+
.label-medium {
|
|
102
|
+
font-family: var(--typescale-label-medium-font-family-name);
|
|
103
|
+
font-style: var(--typescale-label-medium-font-family-style);
|
|
104
|
+
font-weight: var(--typescale-label-medium-font-weight);
|
|
105
|
+
font-size: var(--typescale-label-medium-font-size);
|
|
106
|
+
letter-spacing: var(--typescale-label-medium-tracking);
|
|
107
|
+
line-height: var(--typescale-label-medium-height);
|
|
108
|
+
text-transform: var(--typescale-label-medium-text-transform);
|
|
109
|
+
text-decoration: var(--typescale-label-medium-text-decoration);
|
|
110
|
+
}
|
|
111
|
+
.label-small {
|
|
112
|
+
font-family: var(--typescale-label-small-font-family-name);
|
|
113
|
+
font-style: var(--typescale-label-small-font-family-style);
|
|
114
|
+
font-weight: var(--typescale-label-small-font-weight);
|
|
115
|
+
font-size: var(--typescale-label-small-font-size);
|
|
116
|
+
letter-spacing: var(--typescale-label-small-tracking);
|
|
117
|
+
line-height: var(--typescale-label-small-height);
|
|
118
|
+
text-transform: var(--typescale-label-small-text-transform);
|
|
119
|
+
text-decoration: var(--typescale-label-small-text-decoration);
|
|
120
|
+
}
|
|
121
|
+
.title-large {
|
|
122
|
+
font-family: var(--typescale-title-large-font-family-name);
|
|
123
|
+
font-style: var(--typescale-title-large-font-family-style);
|
|
124
|
+
font-weight: var(--typescale-title-large-font-weight);
|
|
125
|
+
font-size: var(--typescale-title-large-font-size);
|
|
126
|
+
letter-spacing: var(--typescale-title-large-tracking);
|
|
127
|
+
line-height: var(--typescale-title-large-height);
|
|
128
|
+
text-transform: var(--typescale-title-large-text-transform);
|
|
129
|
+
text-decoration: var(--typescale-title-large-text-decoration);
|
|
130
|
+
}
|
|
131
|
+
.title-medium {
|
|
132
|
+
font-family: var(--typescale-title-medium-font-family-name);
|
|
133
|
+
font-style: var(--typescale-title-medium-font-family-style);
|
|
134
|
+
font-weight: var(--typescale-title-medium-font-weight);
|
|
135
|
+
font-size: var(--typescale-title-medium-font-size);
|
|
136
|
+
letter-spacing: var(--typescale-title-medium-tracking);
|
|
137
|
+
line-height: var(--typescale-title-medium-height);
|
|
138
|
+
text-transform: var(--typescale-title-medium-text-transform);
|
|
139
|
+
text-decoration: var(--typescale-title-medium-text-decoration);
|
|
140
|
+
}
|
|
141
|
+
.title-small {
|
|
142
|
+
font-family: var(--typescale-title-small-font-family-name);
|
|
143
|
+
font-style: var(--typescale-title-small-font-family-style);
|
|
144
|
+
font-weight: var(--typescale-title-small-font-weight);
|
|
145
|
+
font-size: var(--typescale-title-small-font-size);
|
|
146
|
+
letter-spacing: var(--typescale-title-small-tracking);
|
|
147
|
+
line-height: var(--typescale-title-small-height);
|
|
148
|
+
text-transform: var(--typescale-title-small-text-transform);
|
|
149
|
+
text-decoration: var(--typescale-title-small-text-decoration);
|
|
150
|
+
}
|
package/dist/global.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Event = MouseEvent | KeyboardEvent;
|
|
2
|
+
interface Options {
|
|
3
|
+
disable: boolean | undefined;
|
|
4
|
+
callback: (e: Event) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function activationHandler(node: HTMLElement, { disable, callback }: Options): {
|
|
7
|
+
destroy(): void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function activationHandler(node, { disable, callback }) {
|
|
2
|
+
function handleEvent(event) {
|
|
3
|
+
if (disable) {
|
|
4
|
+
event.preventDefault();
|
|
5
|
+
event.stopPropagation();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (event instanceof KeyboardEvent) {
|
|
9
|
+
if (!["Enter", "Space"].includes(event.code))
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
callback(event);
|
|
14
|
+
}
|
|
15
|
+
node.addEventListener("click", handleEvent);
|
|
16
|
+
node.addEventListener("keydown", handleEvent);
|
|
17
|
+
return {
|
|
18
|
+
destroy() {
|
|
19
|
+
node.removeEventListener("click", handleEvent);
|
|
20
|
+
node.removeEventListener("keydown", handleEvent);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function clickOutside(node, onEventFunction) {
|
|
2
|
+
const handleClick = (event) => {
|
|
3
|
+
let path = event.composedPath();
|
|
4
|
+
if (!path.includes(node)) {
|
|
5
|
+
onEventFunction();
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
document.addEventListener("click", handleClick);
|
|
9
|
+
return {
|
|
10
|
+
destroy() {
|
|
11
|
+
document.removeEventListener("click", handleClick);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function clickOutsideDialog(node, onEventFunction) {
|
|
16
|
+
const handleClick = (event) => {
|
|
17
|
+
if (!node.open)
|
|
18
|
+
return;
|
|
19
|
+
let rect = node.getBoundingClientRect();
|
|
20
|
+
let isInDialog = rect.top <= event.clientY &&
|
|
21
|
+
event.clientY <= rect.top + rect.height &&
|
|
22
|
+
rect.left <= event.clientX &&
|
|
23
|
+
event.clientX <= rect.left + rect.width;
|
|
24
|
+
if (isInDialog === false && node.open === true) {
|
|
25
|
+
onEventFunction();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
document.addEventListener("click", handleClick);
|
|
29
|
+
return {
|
|
30
|
+
destroy() {
|
|
31
|
+
document.removeEventListener("click", handleClick);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "$components";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface IMaterialDynamicColorsThemeColorFormatted {
|
|
2
|
+
primary: string;
|
|
3
|
+
"on-primary": string;
|
|
4
|
+
"primary-container": string;
|
|
5
|
+
"on-primary-container": string;
|
|
6
|
+
secondary: string;
|
|
7
|
+
"on-secondary": string;
|
|
8
|
+
"secondary-container": string;
|
|
9
|
+
"on-secondary-container": string;
|
|
10
|
+
tertiary: string;
|
|
11
|
+
"on-tertiary": string;
|
|
12
|
+
"tertiary-container": string;
|
|
13
|
+
"on-tertiary-container": string;
|
|
14
|
+
error: string;
|
|
15
|
+
"error-container": string;
|
|
16
|
+
"on-error": string;
|
|
17
|
+
"on-error-container": string;
|
|
18
|
+
background: string;
|
|
19
|
+
"on-background": string;
|
|
20
|
+
surface: string;
|
|
21
|
+
"on-surface": string;
|
|
22
|
+
"surface-variant": string;
|
|
23
|
+
"on-surface-variant": string;
|
|
24
|
+
outline: string;
|
|
25
|
+
"inverse-on-surface": string;
|
|
26
|
+
"inverse-surface": string;
|
|
27
|
+
"inverse-primary": string;
|
|
28
|
+
shadow: string;
|
|
29
|
+
}
|
|
30
|
+
interface IMaterialDynamicColorsThemeFormatted {
|
|
31
|
+
light: IMaterialDynamicColorsThemeColorFormatted;
|
|
32
|
+
dark: IMaterialDynamicColorsThemeColorFormatted;
|
|
33
|
+
}
|
|
34
|
+
type CSSDynamicColor = `${keyof IMaterialDynamicColorsThemeColorFormatted}-${keyof IMaterialDynamicColorsThemeFormatted}`;
|
|
35
|
+
export declare const QTheme: {
|
|
36
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<"error-dark" | "error-light" | "outline-dark" | "outline-light" | "primary-dark" | "primary-light" | "secondary-dark" | "secondary-light" | "tertiary-dark" | "tertiary-light" | "surface-dark" | "surface-light" | "surface-variant-dark" | "surface-variant-light" | "on-primary-dark" | "on-primary-light" | "primary-container-dark" | "primary-container-light" | "on-primary-container-dark" | "on-primary-container-light" | "on-secondary-dark" | "on-secondary-light" | "secondary-container-dark" | "secondary-container-light" | "on-secondary-container-dark" | "on-secondary-container-light" | "on-tertiary-dark" | "on-tertiary-light" | "tertiary-container-dark" | "tertiary-container-light" | "on-tertiary-container-dark" | "on-tertiary-container-light" | "error-container-dark" | "error-container-light" | "on-error-dark" | "on-error-light" | "on-error-container-dark" | "on-error-container-light" | "background-dark" | "background-light" | "on-background-dark" | "on-background-light" | "on-surface-dark" | "on-surface-light" | "on-surface-variant-dark" | "on-surface-variant-light" | "inverse-on-surface-dark" | "inverse-on-surface-light" | "inverse-surface-dark" | "inverse-surface-light" | "inverse-primary-dark" | "inverse-primary-light" | "shadow-dark" | "shadow-light", string>>, invalidate?: ((value?: Record<"error-dark" | "error-light" | "outline-dark" | "outline-light" | "primary-dark" | "primary-light" | "secondary-dark" | "secondary-light" | "tertiary-dark" | "tertiary-light" | "surface-dark" | "surface-light" | "surface-variant-dark" | "surface-variant-light" | "on-primary-dark" | "on-primary-light" | "primary-container-dark" | "primary-container-light" | "on-primary-container-dark" | "on-primary-container-light" | "on-secondary-dark" | "on-secondary-light" | "secondary-container-dark" | "secondary-container-light" | "on-secondary-container-dark" | "on-secondary-container-light" | "on-tertiary-dark" | "on-tertiary-light" | "tertiary-container-dark" | "tertiary-container-light" | "on-tertiary-container-dark" | "on-tertiary-container-light" | "error-container-dark" | "error-container-light" | "on-error-dark" | "on-error-light" | "on-error-container-dark" | "on-error-container-light" | "background-dark" | "background-light" | "on-background-dark" | "on-background-light" | "on-surface-dark" | "on-surface-light" | "on-surface-variant-dark" | "on-surface-variant-light" | "inverse-on-surface-dark" | "inverse-on-surface-light" | "inverse-surface-dark" | "inverse-surface-light" | "inverse-primary-dark" | "inverse-primary-light" | "shadow-dark" | "shadow-light", string> | undefined) => void) | undefined) => import("svelte/store").Unsubscriber;
|
|
37
|
+
setThemeColors: (from: string) => Promise<void>;
|
|
38
|
+
updateThemeColor: (color: CSSDynamicColor, newValue: string) => void;
|
|
39
|
+
apply: () => void;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import materialDynamicColors from "material-dynamic-colors";
|
|
3
|
+
import { convertCase } from "../utils/string";
|
|
4
|
+
import QColors from "../utils/colors";
|
|
5
|
+
async function prepareThemeColors(from) {
|
|
6
|
+
let theme = await materialDynamicColors(from);
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
const themeColors = {};
|
|
9
|
+
let mode;
|
|
10
|
+
for (mode in theme) {
|
|
11
|
+
let color;
|
|
12
|
+
for (color in theme[mode]) {
|
|
13
|
+
let colorFormatted = convertCase(color, "camel", "kebab");
|
|
14
|
+
let cssColor = `${colorFormatted}-${mode}`;
|
|
15
|
+
themeColors[cssColor] = theme[mode][color];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return themeColors;
|
|
19
|
+
}
|
|
20
|
+
/* const defaultThemeColors = await prepareThemeColors("/cocktail.jpg"); */
|
|
21
|
+
const defaultThemeColors = await prepareThemeColors("#3499E7");
|
|
22
|
+
function themeBuilder() {
|
|
23
|
+
const { subscribe, set, update } = writable(defaultThemeColors);
|
|
24
|
+
const setThemeColors = async (from) => {
|
|
25
|
+
let newTheme = await prepareThemeColors(from);
|
|
26
|
+
set(newTheme);
|
|
27
|
+
};
|
|
28
|
+
const updateThemeColor = (color, newValue) => {
|
|
29
|
+
update(($themeColors) => {
|
|
30
|
+
$themeColors[color] = newValue;
|
|
31
|
+
return $themeColors;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const apply = () => {
|
|
35
|
+
let root = document.documentElement;
|
|
36
|
+
if (root === null)
|
|
37
|
+
return;
|
|
38
|
+
update(($themeColors) => {
|
|
39
|
+
let colorName;
|
|
40
|
+
for (colorName in $themeColors) {
|
|
41
|
+
root.style.setProperty(`--${colorName}`, QColors.hexToRgb($themeColors[colorName]).join(", "));
|
|
42
|
+
}
|
|
43
|
+
return $themeColors;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
subscribe,
|
|
48
|
+
setThemeColors,
|
|
49
|
+
updateThemeColor,
|
|
50
|
+
apply,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export const QTheme = themeBuilder();
|