@zenit-hosting/zenit-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.
Files changed (36) hide show
  1. package/README.md +400 -0
  2. package/fesm2022/zenit-hosting-zenit-ui.mjs +11289 -0
  3. package/fesm2022/zenit-hosting-zenit-ui.mjs.map +1 -0
  4. package/llms-full.txt +5120 -0
  5. package/llms.txt +179 -0
  6. package/package.json +44 -0
  7. package/schematics/collection.json +15 -0
  8. package/schematics/migrate-material/component.js +241 -0
  9. package/schematics/migrate-material/index.js +463 -0
  10. package/schematics/migrate-material/report.js +125 -0
  11. package/schematics/migrate-material/schema.js +2 -0
  12. package/schematics/migrate-material/schema.json +32 -0
  13. package/schematics/migrate-material/tables.js +138 -0
  14. package/schematics/migrate-material/template.js +871 -0
  15. package/schematics/ng-add/html.js +151 -0
  16. package/schematics/ng-add/index.js +609 -0
  17. package/schematics/ng-add/init-script.js +108 -0
  18. package/schematics/ng-add/schema.js +2 -0
  19. package/schematics/ng-add/schema.json +34 -0
  20. package/schematics/package.json +3 -0
  21. package/styles/_daten.css +138 -0
  22. package/styles/_formulare.css +97 -0
  23. package/styles/_grundlage.css +424 -0
  24. package/styles/_konfigurator.css +216 -0
  25. package/styles/_navigation.css +179 -0
  26. package/styles/_overlays.css +86 -0
  27. package/styles/_rueckmeldung.css +100 -0
  28. package/styles/_werkzeuge.css +119 -0
  29. package/styles/themes/accents.css +91 -0
  30. package/styles/themes/base.css +26 -0
  31. package/styles/themes/contrast.css +67 -0
  32. package/styles/themes/light.css +74 -0
  33. package/styles/themes.css +21 -0
  34. package/styles/tokens.css +76 -0
  35. package/styles/zenit-ui.css +12 -0
  36. package/types/zenit-hosting-zenit-ui.d.ts +5957 -0
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ /**
3
+ * Static tables of the `migrate-material` schematic. The schematic has no type
4
+ * information, so everything here works on selector names as they are written
5
+ * in a template.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.STYLE_DEBT = exports.ZENIT_SYMBOLS = exports.MATERIAL_SYMBOLS = exports.TOOLTIP_OPTIONS = exports.BUTTON_VARIANTS = exports.MATERIAL_NAME = exports.RULES = void 0;
9
+ exports.replacementFor = replacementFor;
10
+ /** Rules that can be switched with `--rules`. */
11
+ exports.RULES = ['icon', 'button', 'tooltip', 'spinner', 'chip', 'imports'];
12
+ /** A tag or attribute name that belongs to Angular Material: `mat-icon`, `matTooltip`. */
13
+ exports.MATERIAL_NAME = /^mat(-|[A-Z])/;
14
+ /** What each button attribute of Material becomes; `null` has no counterpart. */
15
+ exports.BUTTON_VARIANTS = {
16
+ 'mat-button': { variant: 'ghost' },
17
+ 'mat-stroked-button': { variant: '' },
18
+ 'mat-flat-button': { variant: 'primary' },
19
+ 'mat-raised-button': { variant: 'primary' },
20
+ 'mat-icon-button': { variant: 'ghost', iconOnly: true },
21
+ 'mat-fab': null,
22
+ 'mat-mini-fab': null,
23
+ // The attribute API of Angular Material 20 and later is reported, not guessed.
24
+ matButton: null,
25
+ matIconButton: null,
26
+ matFab: null,
27
+ matMiniFab: null,
28
+ };
29
+ /** Inputs of `matTooltip` that `zTooltip` does not have. */
30
+ exports.TOOLTIP_OPTIONS = [
31
+ 'matTooltipPosition',
32
+ 'matTooltipPositionAtOrigin',
33
+ 'matTooltipShowDelay',
34
+ 'matTooltipHideDelay',
35
+ 'matTooltipClass',
36
+ 'matTooltipTouchGestures',
37
+ ];
38
+ /**
39
+ * Which template names keep a Material symbol in `imports` alive. A symbol is
40
+ * removed only when none of the names left in the template matches.
41
+ */
42
+ const ANY_BUTTON = /^(mat-(button|stroked-button|flat-button|raised-button)|matButton)$/;
43
+ const ICON_BUTTON = /^(mat-icon-button|matIconButton)$/;
44
+ const FAB = /^(mat-(mini-)?fab|mat(Mini)?Fab)$/;
45
+ const SPINNER = /^mat-(progress-)?spinner$/;
46
+ exports.MATERIAL_SYMBOLS = {
47
+ MatIconModule: /^mat-icon$/,
48
+ MatIcon: /^mat-icon$/,
49
+ MatButtonModule: new RegExp(`${ANY_BUTTON.source}|${ICON_BUTTON.source}|${FAB.source}`),
50
+ MatButton: ANY_BUTTON,
51
+ MatAnchor: ANY_BUTTON,
52
+ MatIconButton: ICON_BUTTON,
53
+ MatIconAnchor: ICON_BUTTON,
54
+ MatFabButton: FAB,
55
+ MatFabAnchor: FAB,
56
+ MatMiniFabButton: FAB,
57
+ MatMiniFabAnchor: FAB,
58
+ MatTooltipModule: /^matTooltip/,
59
+ MatTooltip: /^matTooltip/,
60
+ MatProgressSpinnerModule: SPINNER,
61
+ MatProgressSpinner: SPINNER,
62
+ MatSpinner: SPINNER,
63
+ MatChipsModule: /^(mat-(basic-)?chip|matChip)/,
64
+ MatChip: /^mat-(basic-)?chip$/,
65
+ MatChipSet: /^mat-chip-set$/,
66
+ MatChipListbox: /^mat-chip-listbox$/,
67
+ };
68
+ /** The zenit-ui symbol a template needs for a tag or an attribute it uses. */
69
+ exports.ZENIT_SYMBOLS = {
70
+ 'z-icon': 'ZIcon',
71
+ zBtn: 'ZButton',
72
+ zTooltip: 'ZTooltip',
73
+ 'z-spinner': 'ZSpinner',
74
+ 'z-badge': 'ZBadge',
75
+ };
76
+ /**
77
+ * The replacement named in the report for everything that stays. Mirrors the
78
+ * mapping table of `docs/migration-from-material.md`; the first match wins.
79
+ */
80
+ const REPLACEMENTS = [
81
+ [
82
+ /^\./,
83
+ 'a CSS class of Material: remove it, the look comes from the zenit-ui component and the tokens',
84
+ ],
85
+ [/^mat-toolbar/, 'z-app-header (3.1)'],
86
+ [/^mat-icon$/, 'z-icon (3.2)'],
87
+ [/^(mat-(mini-)?fab|mat(Mini)?Fab)$/, 'no counterpart: a button[zBtn] in the page flow (3.3)'],
88
+ [
89
+ /^(mat-(stroked-|flat-|raised-|icon-)?button|mat(Icon)?Button)$/,
90
+ 'button[zBtn] / a[zBtn] (3.3)',
91
+ ],
92
+ [/^mat-button-toggle/, 'z-segment (3.9)'],
93
+ [
94
+ /^(mat-form-field|mat-label|mat-hint|mat-error|matInput|matPrefix|matSuffix|matTextPrefix|matTextSuffix|matIconPrefix|matIconSuffix)$/,
95
+ 'z-field with input[zInput]; icons in fields through z-input-group (3.4)',
96
+ ],
97
+ [
98
+ /^(mat-select|mat-option|mat-optgroup|mat-select-trigger)$/,
99
+ 'z-select around a native <select> (3.5)',
100
+ ],
101
+ [/^mat-checkbox$/, 'z-checkbox (3.6)'],
102
+ [/^mat-slide-toggle$/, 'z-toggle, in a z-setting row (3.6)'],
103
+ [/^(mat-slider|matSliderThumb|matSliderStartThumb|matSliderEndThumb)$/, 'z-slider (3.7)'],
104
+ [/^(mat-tab(-|$)|matTab[A-Z])/, 'nav[zTabs] with a[zTab], one route per tab (3.8)'],
105
+ [/^mat-card/, 'z-panel (3.10)'],
106
+ [
107
+ /^(mat-(basic-)?chip|matChip)/,
108
+ 'z-badge for a static chip; an interactive chip has no counterpart (3.11)',
109
+ ],
110
+ [
111
+ /^(mat-table|mat-header|mat-footer|mat-row|mat-cell|mat-sort|mat-text-column|mat-no-data-row|matColumnDef|matHeaderCellDef|matCellDef|matFooterCellDef|matHeaderRowDef|matRowDef|matFooterRowDef|matSort|matNoDataRow)/,
112
+ 'z-table-container with table[zTable], cdk-table where a data source is needed (3.12)',
113
+ ],
114
+ [/^mat-paginator$/, 'z-pagination, 1-based (3.13)'],
115
+ [/^(mat-dialog|matDialog)/, 'z-dialog with [zDialogActions], opened through ZDialog (3.14)'],
116
+ [/^(mat-menu|matMenu)/, 'z-menu with button[zMenuItem] and [cdkMenuTriggerFor] (3.15)'],
117
+ [/^mat-divider$/, 'a 1px border in `border`, z-menu-separator inside a menu (never edited)'],
118
+ [/^matTooltip/, 'zTooltip (3.17)'],
119
+ [/^mat-(progress-)?spinner$/, 'z-spinner, or [loading] on the button (3.18)'],
120
+ [/^mat-progress-bar$/, 'z-metric with percent, or z-skeleton rows (3.18)'],
121
+ [/^(mat-expansion|mat-accordion)/, 'z-faq (3.19)'],
122
+ [
123
+ /^(mat-stepper|mat-step|mat-horizontal-stepper|mat-vertical-stepper|matStep)/,
124
+ 'z-stepper, display only (3.20)',
125
+ ],
126
+ ];
127
+ function replacementFor(name) {
128
+ return (REPLACEMENTS.find(([pattern]) => pattern.test(name))?.[1] ??
129
+ 'no counterpart in zenit-ui: decide per case (section 10 of docs/migration-from-material.md)');
130
+ }
131
+ /** Counted in stylesheets, never edited. The keys are the column names of the report. */
132
+ exports.STYLE_DEBT = {
133
+ 'mat-* element selectors': /(^|[\s,>+~(])mat-[a-z][a-z-]*(?=[\s,.:{[>+~)]|$)/gm,
134
+ '.mat-* / .mdc-* classes': /\.(mat|mdc)-[a-z]/g,
135
+ '--mat-* / --mdc-* properties': /--(mat|mdc)-[a-z]/g,
136
+ '::ng-deep': /::ng-deep|\/deep\/|>>>/g,
137
+ "@use '@angular/material'": /@(use|import)\s+['"]~?@angular\/material/g,
138
+ };