@nxgt/mail-ui 0.1.0
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 +21 -0
- package/README.md +311 -0
- package/components/alert.vue +75 -0
- package/components/avatar-fallback.vue +21 -0
- package/components/avatar-group.vue +44 -0
- package/components/avatar-image.vue +20 -0
- package/components/avatar.vue +29 -0
- package/components/badge.vue +47 -0
- package/components/banner.vue +57 -0
- package/components/breakdown-card.vue +27 -0
- package/components/card-content.vue +16 -0
- package/components/card-description.vue +16 -0
- package/components/card-footer.vue +16 -0
- package/components/card-header.vue +33 -0
- package/components/card-title.vue +20 -0
- package/components/card.vue +30 -0
- package/components/chip.vue +41 -0
- package/components/code.vue +26 -0
- package/components/compare-card.vue +63 -0
- package/components/description.vue +24 -0
- package/components/entity-header.vue +48 -0
- package/components/goal-card.vue +33 -0
- package/components/hero.vue +36 -0
- package/components/layout.vue +85 -0
- package/components/link.vue +19 -0
- package/components/list-tile.vue +80 -0
- package/components/nx-button.vue +91 -0
- package/components/progress.vue +66 -0
- package/components/ratio-card.vue +36 -0
- package/components/see-also.vue +53 -0
- package/components/separator.vue +27 -0
- package/components/stat-card.vue +43 -0
- package/components/status-indicator.vue +35 -0
- package/components/steps-item.vue +48 -0
- package/components/steps.vue +31 -0
- package/components/summary-data.vue +45 -0
- package/components/table-body.vue +11 -0
- package/components/table-caption.vue +16 -0
- package/components/table-cell.vue +28 -0
- package/components/table-empty.vue +23 -0
- package/components/table-footer.vue +11 -0
- package/components/table-head.vue +25 -0
- package/components/table-header.vue +11 -0
- package/components/table-row.vue +15 -0
- package/components/table.vue +25 -0
- package/components/timeline.vue +70 -0
- package/components/typography.vue +64 -0
- package/components/ui.ts +166 -0
- package/dist/catalogues.d.ts +56 -0
- package/dist/catalogues.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +214 -0
- package/dist/index.js.map +13 -0
- package/dist/packaged.d.ts +27 -0
- package/dist/packaged.d.ts.map +1 -0
- package/dist/plugin.d.ts +55 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/theme.d.ts +11 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/vue.d.ts +9 -0
- package/dist/vue.d.ts.map +1 -0
- package/docs/README.md +15 -0
- package/docs/guide/components.md +984 -0
- package/docs/guide/messages.md +156 -0
- package/docs/guide/plugin.md +365 -0
- package/docs/guide/theme.md +153 -0
- package/docs/roadmap.md +97 -0
- package/docs/troubleshooting.md +519 -0
- package/package.json +69 -0
- package/theme.css +292 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MaizzleConfig } from '@maizzle/framework';
|
|
2
|
+
/** A Vite plugin, as Maizzle's `vite.plugins` takes one. */
|
|
3
|
+
type VitePlugins = NonNullable<NonNullable<MaizzleConfig['vite']>['plugins']>;
|
|
4
|
+
/** A folder of components, and the prefix Maizzle gives their names, if any. */
|
|
5
|
+
export interface ComponentsFolder {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly prefix?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The first `.vue` file at the top of `folders`, in order, that Maizzle names
|
|
11
|
+
* `tag` — `button.vue` under the prefix `Nx`, or a project's `nx-button.vue`
|
|
12
|
+
* or `NxButton.vue`, for `<NxButton>`. Named, not guessed: `2fa.vue` under
|
|
13
|
+
* `Nx` is `<Nx2fa>`, which no case conversion of the tag gives back. A missing
|
|
14
|
+
* folder is skipped.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fileForTag(folders: readonly ComponentsFolder[], tag: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Maizzle resolves the tags of a template (`<NxButton>`, `<Container>`) with
|
|
19
|
+
* unplugin-vue-components, which skips every file under `node_modules` — so a
|
|
20
|
+
* component or a template installed from npm would render empty, and the
|
|
21
|
+
* build would pass. These plugins resolve the tags of those files the way
|
|
22
|
+
* Maizzle would: the project's `components/` first, then ours, then Maizzle's
|
|
23
|
+
* built-ins.
|
|
24
|
+
*/
|
|
25
|
+
export declare function packagedComponents(ours: ComponentsFolder): VitePlugins;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=packaged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packaged.d.ts","sourceRoot":"","sources":["../src/packaged.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,4DAA4D;AAC5D,KAAK,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAsC9E,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAcD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,GAAG,EAAE,MAAM,GACT,MAAM,GAAG,SAAS,CAYpB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CA0BtE"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type MailPlugin } from '@nxgt/mail-config';
|
|
2
|
+
/** Who sends the e-mail: the layout's header and footer. */
|
|
3
|
+
export interface Brand {
|
|
4
|
+
/** The name the header shows without a logo, and the footer always. */
|
|
5
|
+
readonly name: string;
|
|
6
|
+
/** Where the header and the footer link to, as `https://acme.example`. */
|
|
7
|
+
readonly url?: string;
|
|
8
|
+
/** The header's image, by absolute URL: a mail client loads nothing relative. */
|
|
9
|
+
readonly logo?: {
|
|
10
|
+
readonly src: string;
|
|
11
|
+
/** In pixels. Default 120. */
|
|
12
|
+
readonly width?: number;
|
|
13
|
+
/** Default the brand's name. */
|
|
14
|
+
readonly alt?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface UiOptions {
|
|
18
|
+
readonly brand: Brand;
|
|
19
|
+
/**
|
|
20
|
+
* Tokens of `theme.css` to override, named without their `--`:
|
|
21
|
+
* `{ 'color-primary': '#0f766e', 'radius-lg': '4px' }`. The tints of a
|
|
22
|
+
* colour follow it.
|
|
23
|
+
*/
|
|
24
|
+
readonly theme?: Readonly<Record<string, string>>;
|
|
25
|
+
}
|
|
26
|
+
/** What `NxLayout` injects: the brand and the theme's CSS. */
|
|
27
|
+
export interface UiContext {
|
|
28
|
+
readonly brand: Brand;
|
|
29
|
+
readonly css: string;
|
|
30
|
+
}
|
|
31
|
+
/** The `provide` key the components read the {@link UiContext} from. */
|
|
32
|
+
export declare const UI_CONTEXT = "nxgt:mail-ui";
|
|
33
|
+
/**
|
|
34
|
+
* Where the template types go, under the project: `.maizzle/*.d.ts` is in the
|
|
35
|
+
* starter's `tsconfig.json`, and `maizzle.config.ts` — which imports this
|
|
36
|
+
* package — is not, so an editor would not know `brand` without it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const TYPES_FILE = ".maizzle/nxgt-mail-ui.d.ts";
|
|
39
|
+
/** The components, beside `src/` and `dist/` in the package. */
|
|
40
|
+
export declare const COMPONENTS_DIR: string;
|
|
41
|
+
/**
|
|
42
|
+
* The components of `@nxgt/mail-ui`, for `defineMailConfig`:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* defineMailConfig({
|
|
46
|
+
* plugins: [ui({ brand: { name: 'Acme' } }), i18n({ locales: ['en', 'fr'] })],
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* It registers `NxLayout`, `NxButton`, … — a project's own
|
|
51
|
+
* `components/nx-button.vue` replaces ours — gives every template `brand`,
|
|
52
|
+
* and themes the layout with `theme.css` and the `theme` overrides.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ui(options: UiOptions): MailPlugin;
|
|
55
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAItE,4DAA4D;AAC5D,MAAM,WAAW,KAAK;IACrB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,CAAC,EAAE;QACf,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,8BAA8B;QAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,gCAAgC;QAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACF;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAED,8DAA8D;AAC9D,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED,wEAAwE;AACxE,eAAO,MAAM,UAAU,iBAAiB,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,UAAU,+BAA+B,CAAC;AAiBvD,gEAAgE;AAChE,eAAO,MAAM,cAAc,QAE1B,CAAC;AA8CF;;;;;;;;;;;;GAYG;AACH,wBAAgB,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,CAiCjD"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** `theme.css`, beside `src/` and `dist/` in the package. */
|
|
2
|
+
export declare const THEME_FILE: string;
|
|
3
|
+
/** The tokens `css` declares, without their `--`: `color-primary`, … */
|
|
4
|
+
export declare function declaredTokens(css: string): ReadonlySet<string>;
|
|
5
|
+
/**
|
|
6
|
+
* The CSS a layout puts under `@import "@maizzle/tailwindcss"`: the theme,
|
|
7
|
+
* then an `@theme` block of the project's overrides, which wins. A token the
|
|
8
|
+
* theme does not declare, or a value that is not one, **throws**.
|
|
9
|
+
*/
|
|
10
|
+
export declare function themeCss(theme: Readonly<Record<string, string>>): string;
|
|
11
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAGA,6DAA6D;AAC7D,eAAO,MAAM,UAAU,QAEtB,CAAC;AAWF,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAO/D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAoBxE"}
|
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Brand } from './plugin';
|
|
2
|
+
/** What a template gets from the ui plugin: `{{ brand.name }}`. */
|
|
3
|
+
declare module 'vue' {
|
|
4
|
+
interface ComponentCustomProperties {
|
|
5
|
+
/** The `brand` given to `ui()`. */
|
|
6
|
+
readonly brand: Brand;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,mEAAmE;AACnE,OAAO,QAAQ,KAAK,CAAC;IACpB,UAAU,yBAAyB;QAClC,mCAAmC;QACnC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;KACtB;CACD"}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @nxgt/mail-ui — documentation
|
|
2
|
+
|
|
3
|
+
The [README](../README.md) shows that it works. These pages show how, one area
|
|
4
|
+
at a time, with an example for every rule. The words they use (project,
|
|
5
|
+
template, component, plugin, placeholder, catalogue) are defined once, in the
|
|
6
|
+
[vocabulary](https://github.com/softistx/nxgt-mail/blob/develop/docs/vocabulary.md).
|
|
7
|
+
|
|
8
|
+
| Page | Read it when |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| [The plugin](guide/plugin.md) | You are adding `ui({ brand, theme })` to `maizzle.config.ts`: the brand, `brand` in templates and how the editor and `vue-tsc` learn its type, replacing one of the components with your own, how the tags of installed components and a package's templates are resolved, writing your own layout on `UI_CONTEXT`, and every `TypeError` it throws |
|
|
11
|
+
| [Components](guide/components.md) | You are writing `emails/*.vue` with the `Nx*` components: each one's props, defaults and slots, the material-vue component it mirrors, icons, spacing, and a complete template |
|
|
12
|
+
| [The theme](guide/theme.md) | You want your colours or radii: every token of `theme.css`, the tints that stand for material-vue's translucent colours, what an override changes, and why there is no dark mode |
|
|
13
|
+
| [Shared messages](guide/messages.md) | You translate with `@nxgt/mail-i18n`: the `common` messages `uiCatalogues` brings, overriding one, and a locale other than `en` and `fr` |
|
|
14
|
+
| [Troubleshooting](troubleshooting.md) | You have an error message and want its cause and its fix |
|
|
15
|
+
| [Roadmap](roadmap.md) | You want to know what is coming, what shipped, and what is deliberately not planned |
|