@noxlovette/material 0.8.0 → 0.8.1
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.
|
@@ -98,10 +98,7 @@ It combines a Material 3 Textfield with a TimepickerInput for intuitive time sel
|
|
|
98
98
|
<div {...wrapperProps}>
|
|
99
99
|
<div
|
|
100
100
|
{...props}
|
|
101
|
-
class={[
|
|
102
|
-
props.class,
|
|
103
|
-
'max-h-(--bits-floating-available-height) min-w-(--bits-floating-anchor-width) overflow-auto'
|
|
104
|
-
]}
|
|
101
|
+
class={[props.class, 'min-w-(--bits-floating-anchor-width)']}
|
|
105
102
|
{@attach presence(() => open, enterExit.scale)}
|
|
106
103
|
>
|
|
107
104
|
<TimepickerInput
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Optional, for `<App iconProviderProps={{ selfHosted: true }}>`. Google's stylesheet normally
|
|
3
|
+
binds each `.material-symbols-*` class to its font family; a self-hoster imports this instead and
|
|
4
|
+
writes only the `@font-face` rules (variable, with the opsz, wght, FILL and GRAD axes).
|
|
5
|
+
The rest of the class metrics (line-height, ligatures, smoothing…) ship in `./styles`.
|
|
6
|
+
*/
|
|
7
|
+
.material-symbols-rounded {
|
|
8
|
+
font-family: 'Material Symbols Rounded';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.material-symbols-outlined {
|
|
12
|
+
font-family: 'Material Symbols Outlined';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.material-symbols-sharp {
|
|
16
|
+
font-family: 'Material Symbols Sharp';
|
|
17
|
+
}
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
@component
|
|
3
3
|
A helper that handles google icons. Should not be used directly.
|
|
4
4
|
Use the App.svelte component instead
|
|
5
|
+
|
|
6
|
+
With `selfHosted` it renders nothing, so no request goes to fonts.googleapis.com. The consumer then
|
|
7
|
+
supplies the `@font-face` rules; see `@noxlovette/material/styles/icon-font.css`.
|
|
5
8
|
-->
|
|
6
9
|
<script lang="ts">
|
|
7
10
|
import { baseIcons } from './base-icons.js';
|
|
8
11
|
import type { MaterialSymbolsProviderProps } from './types.js';
|
|
9
12
|
|
|
10
13
|
const {
|
|
14
|
+
selfHosted = false,
|
|
11
15
|
extraIcons = [],
|
|
12
16
|
display = 'swap',
|
|
13
17
|
subset = true,
|
|
@@ -41,5 +45,7 @@ Use the App.svelte component instead
|
|
|
41
45
|
</script>
|
|
42
46
|
|
|
43
47
|
<svelte:head>
|
|
44
|
-
|
|
48
|
+
{#if !selfHosted}
|
|
49
|
+
<link rel="stylesheet" {href} />
|
|
50
|
+
{/if}
|
|
45
51
|
</svelte:head>
|
|
@@ -2,6 +2,9 @@ import type { MaterialSymbolsProviderProps } from './types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* A helper that handles google icons. Should not be used directly.
|
|
4
4
|
* Use the App.svelte component instead
|
|
5
|
+
*
|
|
6
|
+
* With `selfHosted` it renders nothing, so no request goes to fonts.googleapis.com. The consumer then
|
|
7
|
+
* supplies the `@font-face` rules; see `@noxlovette/material/styles/icon-font.css`.
|
|
5
8
|
*/
|
|
6
9
|
declare const MaterialSymbolsProvider: import("svelte").Component<MaterialSymbolsProviderProps, {}, "">;
|
|
7
10
|
type MaterialSymbolsProvider = ReturnType<typeof MaterialSymbolsProvider>;
|
|
@@ -59,6 +59,17 @@ export type LoadingIndicatorProps = HTMLAttributes<SVGAElement> & LoadingIndicat
|
|
|
59
59
|
center?: boolean;
|
|
60
60
|
};
|
|
61
61
|
export type MaterialSymbolsProviderProps = {
|
|
62
|
+
/**
|
|
63
|
+
* Skip the Google Fonts `<link>` so the page makes no request to `fonts.googleapis.com`, and
|
|
64
|
+
* supply the font yourself. Define an `@font-face` for each family in use (`"Material Symbols
|
|
65
|
+
* Rounded"`, `"Material Symbols Outlined"`, `"Material Symbols Sharp"`), variable, with the
|
|
66
|
+
* `opsz`, `wght`, `FILL` and `GRAD` axes that `Icon` sets through `font-variation-settings`, and
|
|
67
|
+
* import `@noxlovette/material/styles/icon-font.css` for the `font-family` of each
|
|
68
|
+
* `.material-symbols-*` class. The remaining class metrics ship with `@noxlovette/material/styles`.
|
|
69
|
+
* With this set, `icons`, `extraIcons`, `subset`, `families` and `display` have no effect.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
selfHosted?: boolean;
|
|
62
73
|
icons?: MaterialSymbolName[];
|
|
63
74
|
/** Icon names to load on top of `baseIcons`. Ignored when `subset` is false. */
|
|
64
75
|
extraIcons?: MaterialSymbolName[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxlovette/material",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Material Design 3 component library for Svelte, built on Bits UI.",
|
|
6
6
|
"keywords": [
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"svelte": "./dist/index.js"
|
|
58
58
|
},
|
|
59
59
|
"./styles": "./dist/index.css",
|
|
60
|
+
"./styles/icon-font.css": "./dist/styles/icon-font.css",
|
|
60
61
|
"./theme/*": "./dist/styles/theme/*.css"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|