@saasicat/ui-vue 0.22.2 → 0.24.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/README.md +1 -1
- package/dist/{chunk-LY52T4N4.js → chunk-TQQMKWN6.js} +58 -1
- package/dist/{chunk-XMMFN2WJ.js → chunk-VYMTWCTT.js} +51 -1
- package/dist/client/index.cjs +57 -0
- package/dist/client/index.d.cts +58 -1
- package/dist/client/index.d.ts +58 -1
- package/dist/client/index.js +15 -1
- package/dist/index.cjs +321 -159
- package/dist/index.d.cts +67 -4
- package/dist/index.d.ts +67 -4
- package/dist/index.js +72 -2
- package/dist/quasar/index.cjs +116 -20
- package/dist/quasar/index.d.cts +48 -3
- package/dist/quasar/index.d.ts +48 -3
- package/dist/quasar/index.js +58 -3
- package/dist/{use-super-admin-i18n-CgTuNi8h.d.cts → use-sa-theme-B5t7oXph.d.cts} +51 -1
- package/dist/{use-super-admin-i18n-CHNdsSlm.d.ts → use-sa-theme-OUBlaqgl.d.ts} +51 -1
- package/package.json +5 -2
- package/src/client/identity-accents.ts +129 -0
- package/src/client/index.ts +1 -0
- package/src/components/BundleVersionPublishDialog.vue +17 -17
- package/src/components/KvBlock.vue +6 -6
- package/src/components/MarketingPromotionsTab.vue +84 -80
- package/src/components/MfaPromptDialog.vue +2 -2
- package/src/components/TenantActionConfirmDialog.vue +5 -5
- package/src/components/VersionDiffPreview.vue +18 -18
- package/src/components/bundle-editor/BundleCreatePanel.vue +52 -52
- package/src/components/bundle-editor/BundleFeaturesEditor.vue +20 -20
- package/src/components/bundle-editor/BundlePlanCompatPicker.vue +33 -33
- package/src/components/bundle-editor/BundleQuotasEditor.vue +26 -26
- package/src/components/bundle-editor/BundleStatusBanner.vue +21 -21
- package/src/components/bundle-editor/BundleVersionInlineEditor.vue +49 -49
- package/src/components/bundle-editor/BundleVersionStrip.vue +30 -30
- package/src/components/dialogs/PilotCreateDialog.vue +20 -20
- package/src/components/dialogs/PilotEditDialog.vue +6 -6
- package/src/components/dialogs/PromoCodeCreateDialog.vue +9 -9
- package/src/components/dialogs/PromoCodeDialogFields.vue +64 -63
- package/src/components/dialogs/PromoCodeEditDialog.vue +11 -11
- package/src/components/dialogs/pilot-dialog.css +48 -48
- package/src/components/plan/PlanCycleToggle.vue +9 -16
- package/src/components/plan/PlanGrid.vue +30 -34
- package/src/components/plan/PriceSummary.vue +35 -35
- package/src/components/plan/PromoCodeInput.vue +26 -26
- package/src/components/plan/PublicBundleGrid.vue +32 -28
- package/src/components/plan-create-dialog/PlanCreateDialog.vue +50 -50
- package/src/components/plan-detail/PlanDetail.vue +178 -157
- package/src/components/plan-detail/PlanTitleEdit.vue +11 -11
- package/src/components/plan-list/PlanList.vue +116 -100
- package/src/components/plan-matrix/PlanMatrix.vue +97 -114
- package/src/components/plan-review/PlanReview.vue +61 -57
- package/src/components/plan-version-editor/PlanVersionEditor.vue +246 -203
- package/src/components/wizard-stepper/WizardStepper.vue +17 -17
- package/src/index.ts +1 -0
- package/src/pages-standard/AdminLayout.vue +58 -37
- package/src/pages-standard/AdminManifestErrorPage.vue +6 -6
- package/src/pages-standard/AuditPage.vue +3 -3
- package/src/pages-standard/BundlesPage.vue +37 -37
- package/src/pages-standard/DashboardPage.vue +22 -19
- package/src/pages-standard/DiscoveryPage.vue +55 -49
- package/src/pages-standard/EmailHistoryPage.vue +53 -71
- package/src/pages-standard/MarketingCatalogPage.vue +245 -221
- package/src/pages-standard/PilotsPage.vue +7 -6
- package/src/pages-standard/PlatformEmailPage.vue +18 -18
- package/src/pages-standard/PromoCodeDetailPage.vue +3 -3
- package/src/pages-standard/PromoCodesPage.vue +10 -7
- package/src/pages-standard/SuperAdminLoginPage.vue +39 -25
- package/src/pages-standard/SuperAdminSetupWizard.vue +44 -33
- package/src/pages-standard/TenantDetailPage.vue +7 -7
- package/src/pages-standard/TenantsPage.vue +16 -50
- package/src/pages-standard/bundles-page/BundleAccordionList.vue +13 -13
- package/src/pages-standard/discovery-page/CatalogEntryTransPanel.vue +24 -24
- package/src/pages-standard/discovery-page/DiscoveryCapList.vue +22 -22
- package/src/pages-standard/discovery-page/DiscoveryFeatureCard.vue +39 -39
- package/src/pages-standard/discovery-page/DiscoveryQuotaCard.vue +26 -26
- package/src/pages-standard/discovery-page/DiscoveryStatusControl.vue +1 -1
- package/src/pages-standard/discovery-page/discovery-ui.ts +10 -7
- package/src/pages-standard/marketing-catalog/MarketingCatalogAdmin.vue +2 -5
- package/src/pages-standard/plan-versions/PlanDiffCard.vue +27 -20
- package/src/pages-standard/plan-versions/PlanVersionsDiff.vue +24 -16
- package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +45 -45
- package/src/pages-standard/plans-page/PlanBundleOverview.vue +21 -15
- package/src/pages-standard/plans-page/PlanPublishDialog.vue +4 -4
- package/src/pages-standard/plans-page/PlansPageToast.vue +6 -6
- package/src/pages-standard/sa-theme.css +9 -687
- package/src/pages-standard/tenants/StatusPill.vue +13 -13
- package/src/pages-standard/tenants/format.ts +11 -12
- package/src/pages-tenant/LimitsRow.vue +4 -4
- package/src/pages-tenant/MySubscriptionBundlesPage.vue +70 -61
- package/src/pages-tenant/OnboardingConfigurator.vue +25 -25
- package/src/pages-tenant/PackageSnapshotPanel.vue +10 -16
- package/src/pages-tenant/PendingVersionBanner.vue +12 -12
- package/src/pages-tenant/PlanChangeWizard.vue +22 -76
- package/src/pages-tenant/TenantPlanSection.vue +19 -69
- package/src/pages-tenant/UsageBar.vue +7 -7
- package/src/pages-tenant/default-i18n.ts +113 -0
- package/src/pages-tenant/tenant-plan-section/BundlePreviewDialog.vue +14 -14
- package/src/pages-tenant/tenant-plan-section/TenantBundleStore.vue +10 -10
- package/src/pages-tenant/tenant-plan-section/TenantFeatureMatrix.vue +2 -2
- package/src/quasar/create-super-admin-app.ts +96 -1
- package/src/quasar/dark-bridge.ts +66 -0
- package/src/quasar/index.ts +1 -0
- package/src/ui/theme/_breakpoints.scss +34 -0
- package/src/ui/theme/base.css +50 -0
- package/src/ui/theme/components/body.css +23 -0
- package/src/ui/theme/components/button.css +158 -0
- package/src/ui/theme/components/card.css +74 -0
- package/src/ui/theme/components/field.css +38 -0
- package/src/ui/theme/components/hero.css +46 -0
- package/src/ui/theme/components/paginator.css +63 -0
- package/src/ui/theme/components/section.css +67 -0
- package/src/ui/theme/components/statistics.css +189 -0
- package/src/ui/theme/components/table.css +60 -0
- package/src/ui/theme/index.css +42 -0
- package/src/ui/theme/tokens.legacy.css +147 -0
- package/src/ui/theme/tokens.primitive.css +112 -0
- package/src/ui/theme/tokens.scale.css +103 -0
- package/src/ui/theme/tokens.semantic.dark.css +185 -0
- package/src/ui/theme/tokens.semantic.light.css +242 -0
- package/src/vue/use-sa-theme.ts +154 -0
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ own call: `i18n.locales` narrows the set, `i18n.additionalLocales` adds
|
|
|
98
98
|
languages the platform does not ship, `i18n.overrides` replaces individual
|
|
99
99
|
strings, and `i18n.switcher: false` drops the control entirely. Components read
|
|
100
100
|
the catalog via `useSaMessages('<namespace>')` / `useSuperAdminI18n()`.
|
|
101
|
-
See [handbook §8.
|
|
101
|
+
See [handbook §8.7](https://github.com/uelker70/saasicat/blob/main/docs/handbook.md#87-ui-language-i18n).
|
|
102
102
|
|
|
103
103
|
## Build
|
|
104
104
|
|
|
@@ -125,6 +125,60 @@ function useSaMessages(namespace) {
|
|
|
125
125
|
return computed(() => messages.value[namespace]);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
// src/vue/use-sa-theme.ts
|
|
129
|
+
import {
|
|
130
|
+
computed as computed2,
|
|
131
|
+
inject as inject2,
|
|
132
|
+
isRef as isRef2,
|
|
133
|
+
ref as ref2,
|
|
134
|
+
watch as watch2
|
|
135
|
+
} from "vue";
|
|
136
|
+
var SCHEMES = ["light", "dark", "system"];
|
|
137
|
+
var STORAGE_KEY = "saasicat.theme.scheme";
|
|
138
|
+
function isScheme(value) {
|
|
139
|
+
return typeof value === "string" && SCHEMES.includes(value);
|
|
140
|
+
}
|
|
141
|
+
function systemScheme() {
|
|
142
|
+
const value = ref2("light");
|
|
143
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
144
|
+
return { value, unsubscribe: () => {
|
|
145
|
+
} };
|
|
146
|
+
}
|
|
147
|
+
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
148
|
+
value.value = query.matches ? "dark" : "light";
|
|
149
|
+
const onChange = (event) => {
|
|
150
|
+
value.value = event.matches ? "dark" : "light";
|
|
151
|
+
};
|
|
152
|
+
query.addEventListener("change", onChange);
|
|
153
|
+
return { value, unsubscribe: () => query.removeEventListener("change", onChange) };
|
|
154
|
+
}
|
|
155
|
+
function createSaTheme(options = {}) {
|
|
156
|
+
const storage = options.storage ?? defaultKvStore();
|
|
157
|
+
const persist = options.persist !== false;
|
|
158
|
+
const provided = options.scheme;
|
|
159
|
+
const appOwnsIt = isRef2(provided);
|
|
160
|
+
const stored = persist && !appOwnsIt ? storage.get(STORAGE_KEY) : null;
|
|
161
|
+
const scheme = isRef2(provided) ? provided : ref2(isScheme(stored) ? stored : provided ?? "system");
|
|
162
|
+
const { value: system, unsubscribe } = systemScheme();
|
|
163
|
+
const stopPersisting = persist && !appOwnsIt ? watch2(scheme, (next) => storage.set(STORAGE_KEY, next)) : null;
|
|
164
|
+
return {
|
|
165
|
+
scheme,
|
|
166
|
+
resolved: computed2(() => scheme.value === "system" ? system.value : scheme.value),
|
|
167
|
+
dispose: () => {
|
|
168
|
+
unsubscribe();
|
|
169
|
+
stopPersisting?.();
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
var SA_THEME_KEY = /* @__PURE__ */ Symbol.for("@saasicat/ui-vue/SA_THEME");
|
|
174
|
+
var fallbackTheme = null;
|
|
175
|
+
function useSaTheme() {
|
|
176
|
+
const injected = inject2(SA_THEME_KEY, null);
|
|
177
|
+
if (injected) return injected;
|
|
178
|
+
fallbackTheme ??= createSaTheme({ persist: false });
|
|
179
|
+
return fallbackTheme;
|
|
180
|
+
}
|
|
181
|
+
|
|
128
182
|
export {
|
|
129
183
|
SUPER_ADMIN_BRAND_KEY,
|
|
130
184
|
SUPER_ADMIN_ENDPOINTS_KEY,
|
|
@@ -140,5 +194,8 @@ export {
|
|
|
140
194
|
SUPER_ADMIN_I18N_KEY,
|
|
141
195
|
createSuperAdminI18n,
|
|
142
196
|
useSuperAdminI18n,
|
|
143
|
-
useSaMessages
|
|
197
|
+
useSaMessages,
|
|
198
|
+
createSaTheme,
|
|
199
|
+
SA_THEME_KEY,
|
|
200
|
+
useSaTheme
|
|
144
201
|
};
|
|
@@ -630,6 +630,49 @@ function countPlans(resolved) {
|
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
+
// src/client/identity-accents.ts
|
|
634
|
+
var IDENTITY_ACCENTS = [
|
|
635
|
+
"var(--sa-color-identity-1)",
|
|
636
|
+
"var(--sa-color-identity-2)",
|
|
637
|
+
"var(--sa-color-identity-3)",
|
|
638
|
+
"var(--sa-color-identity-4)",
|
|
639
|
+
"var(--sa-color-identity-5)",
|
|
640
|
+
"var(--sa-color-identity-6)"
|
|
641
|
+
];
|
|
642
|
+
var IDENTITY_ACCENT_VALUES = [
|
|
643
|
+
"#1d4ed8",
|
|
644
|
+
"#6d28d9",
|
|
645
|
+
"#047857",
|
|
646
|
+
"#b45309",
|
|
647
|
+
"#0369a1",
|
|
648
|
+
"#b91c1c"
|
|
649
|
+
];
|
|
650
|
+
var IDENTITY_NEUTRAL_VALUE = "#64748b";
|
|
651
|
+
var IDENTITY_NEUTRAL = "var(--sa-color-identity-neutral)";
|
|
652
|
+
function identityAccentAt(index) {
|
|
653
|
+
if (!Number.isFinite(index) || index < 0) return IDENTITY_NEUTRAL;
|
|
654
|
+
return IDENTITY_ACCENTS[Math.floor(index) % IDENTITY_ACCENTS.length];
|
|
655
|
+
}
|
|
656
|
+
var WELL_KNOWN = {
|
|
657
|
+
STARTER: IDENTITY_NEUTRAL,
|
|
658
|
+
BASIC: IDENTITY_NEUTRAL,
|
|
659
|
+
STANDARD: "var(--sa-color-identity-1)",
|
|
660
|
+
PRO: "var(--sa-color-identity-2)",
|
|
661
|
+
PROFESSIONAL: "var(--sa-color-identity-2)",
|
|
662
|
+
BUSINESS: "var(--sa-color-identity-5)",
|
|
663
|
+
ENTERPRISE: "var(--sa-color-identity-3)"
|
|
664
|
+
};
|
|
665
|
+
function identityAccentFor(key, overrides = {}, index = -1) {
|
|
666
|
+
return overrides[key] ?? WELL_KNOWN[key] ?? identityAccentAt(index);
|
|
667
|
+
}
|
|
668
|
+
function identityChipStyle(accent) {
|
|
669
|
+
return {
|
|
670
|
+
background: `color-mix(in srgb, ${accent} 8%, transparent)`,
|
|
671
|
+
color: accent,
|
|
672
|
+
borderColor: `color-mix(in srgb, ${accent} 20%, transparent)`
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
|
|
633
676
|
export {
|
|
634
677
|
ADMIN_UI_VERSION,
|
|
635
678
|
HttpJsonError,
|
|
@@ -658,5 +701,12 @@ export {
|
|
|
658
701
|
isFutureScheduled,
|
|
659
702
|
isExpired,
|
|
660
703
|
resolvePlans,
|
|
661
|
-
countPlans
|
|
704
|
+
countPlans,
|
|
705
|
+
IDENTITY_ACCENTS,
|
|
706
|
+
IDENTITY_ACCENT_VALUES,
|
|
707
|
+
IDENTITY_NEUTRAL_VALUE,
|
|
708
|
+
IDENTITY_NEUTRAL,
|
|
709
|
+
identityAccentAt,
|
|
710
|
+
identityAccentFor,
|
|
711
|
+
identityChipStyle
|
|
662
712
|
};
|
package/dist/client/index.cjs
CHANGED
|
@@ -30,6 +30,10 @@ __export(client_exports, {
|
|
|
30
30
|
DEFAULT_SA_LOCALE: () => DEFAULT_SA_LOCALE,
|
|
31
31
|
DEFAULT_STANDARD_PAGE_ROUTES: () => DEFAULT_STANDARD_PAGE_ROUTES,
|
|
32
32
|
HttpJsonError: () => HttpJsonError,
|
|
33
|
+
IDENTITY_ACCENTS: () => IDENTITY_ACCENTS,
|
|
34
|
+
IDENTITY_ACCENT_VALUES: () => IDENTITY_ACCENT_VALUES,
|
|
35
|
+
IDENTITY_NEUTRAL: () => IDENTITY_NEUTRAL,
|
|
36
|
+
IDENTITY_NEUTRAL_VALUE: () => IDENTITY_NEUTRAL_VALUE,
|
|
33
37
|
ManifestLoadError: () => ManifestLoadError,
|
|
34
38
|
ManifestLoader: () => ManifestLoader,
|
|
35
39
|
MissingHandlerError: () => MissingHandlerError,
|
|
@@ -49,6 +53,9 @@ __export(client_exports, {
|
|
|
49
53
|
formatCurrency: () => formatCurrency,
|
|
50
54
|
formatMessage: () => formatMessage,
|
|
51
55
|
getJson: () => getJson,
|
|
56
|
+
identityAccentAt: () => identityAccentAt,
|
|
57
|
+
identityAccentFor: () => identityAccentFor,
|
|
58
|
+
identityChipStyle: () => identityChipStyle,
|
|
52
59
|
isCurrentlyValid: () => isCurrentlyValid,
|
|
53
60
|
isExpired: () => isExpired,
|
|
54
61
|
isFutureScheduled: () => isFutureScheduled,
|
|
@@ -3856,6 +3863,49 @@ function countPlans(resolved) {
|
|
|
3856
3863
|
tenants: resolved.reduce((sum, p) => sum + p.tenantCount, 0)
|
|
3857
3864
|
};
|
|
3858
3865
|
}
|
|
3866
|
+
|
|
3867
|
+
// src/client/identity-accents.ts
|
|
3868
|
+
var IDENTITY_ACCENTS = [
|
|
3869
|
+
"var(--sa-color-identity-1)",
|
|
3870
|
+
"var(--sa-color-identity-2)",
|
|
3871
|
+
"var(--sa-color-identity-3)",
|
|
3872
|
+
"var(--sa-color-identity-4)",
|
|
3873
|
+
"var(--sa-color-identity-5)",
|
|
3874
|
+
"var(--sa-color-identity-6)"
|
|
3875
|
+
];
|
|
3876
|
+
var IDENTITY_ACCENT_VALUES = [
|
|
3877
|
+
"#1d4ed8",
|
|
3878
|
+
"#6d28d9",
|
|
3879
|
+
"#047857",
|
|
3880
|
+
"#b45309",
|
|
3881
|
+
"#0369a1",
|
|
3882
|
+
"#b91c1c"
|
|
3883
|
+
];
|
|
3884
|
+
var IDENTITY_NEUTRAL_VALUE = "#64748b";
|
|
3885
|
+
var IDENTITY_NEUTRAL = "var(--sa-color-identity-neutral)";
|
|
3886
|
+
function identityAccentAt(index) {
|
|
3887
|
+
if (!Number.isFinite(index) || index < 0) return IDENTITY_NEUTRAL;
|
|
3888
|
+
return IDENTITY_ACCENTS[Math.floor(index) % IDENTITY_ACCENTS.length];
|
|
3889
|
+
}
|
|
3890
|
+
var WELL_KNOWN = {
|
|
3891
|
+
STARTER: IDENTITY_NEUTRAL,
|
|
3892
|
+
BASIC: IDENTITY_NEUTRAL,
|
|
3893
|
+
STANDARD: "var(--sa-color-identity-1)",
|
|
3894
|
+
PRO: "var(--sa-color-identity-2)",
|
|
3895
|
+
PROFESSIONAL: "var(--sa-color-identity-2)",
|
|
3896
|
+
BUSINESS: "var(--sa-color-identity-5)",
|
|
3897
|
+
ENTERPRISE: "var(--sa-color-identity-3)"
|
|
3898
|
+
};
|
|
3899
|
+
function identityAccentFor(key, overrides = {}, index = -1) {
|
|
3900
|
+
return overrides[key] ?? WELL_KNOWN[key] ?? identityAccentAt(index);
|
|
3901
|
+
}
|
|
3902
|
+
function identityChipStyle(accent) {
|
|
3903
|
+
return {
|
|
3904
|
+
background: `color-mix(in srgb, ${accent} 8%, transparent)`,
|
|
3905
|
+
color: accent,
|
|
3906
|
+
borderColor: `color-mix(in srgb, ${accent} 20%, transparent)`
|
|
3907
|
+
};
|
|
3908
|
+
}
|
|
3859
3909
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3860
3910
|
0 && (module.exports = {
|
|
3861
3911
|
ADMIN_UI_VERSION,
|
|
@@ -3868,6 +3918,10 @@ function countPlans(resolved) {
|
|
|
3868
3918
|
DEFAULT_SA_LOCALE,
|
|
3869
3919
|
DEFAULT_STANDARD_PAGE_ROUTES,
|
|
3870
3920
|
HttpJsonError,
|
|
3921
|
+
IDENTITY_ACCENTS,
|
|
3922
|
+
IDENTITY_ACCENT_VALUES,
|
|
3923
|
+
IDENTITY_NEUTRAL,
|
|
3924
|
+
IDENTITY_NEUTRAL_VALUE,
|
|
3871
3925
|
ManifestLoadError,
|
|
3872
3926
|
ManifestLoader,
|
|
3873
3927
|
MissingHandlerError,
|
|
@@ -3887,6 +3941,9 @@ function countPlans(resolved) {
|
|
|
3887
3941
|
formatCurrency,
|
|
3888
3942
|
formatMessage,
|
|
3889
3943
|
getJson,
|
|
3944
|
+
identityAccentAt,
|
|
3945
|
+
identityAccentFor,
|
|
3946
|
+
identityChipStyle,
|
|
3890
3947
|
isCurrentlyValid,
|
|
3891
3948
|
isExpired,
|
|
3892
3949
|
isFutureScheduled,
|
package/dist/client/index.d.cts
CHANGED
|
@@ -389,4 +389,61 @@ interface PlanCounts {
|
|
|
389
389
|
}
|
|
390
390
|
declare function countPlans<P extends PlanRowLike, V extends PlanVersionLike>(resolved: readonly ResolvedPlan<P, V>[]): PlanCounts;
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
/**
|
|
393
|
+
* The categorical ramp, in the order an unnamed series should walk it.
|
|
394
|
+
*
|
|
395
|
+
* Seven entries, six of them hues plus the neutral. Long enough that a realistic
|
|
396
|
+
* plan list does not wrap, short enough that the colours stay tellable apart —
|
|
397
|
+
* a longer ramp is not a better one, it is a wheel of near-neighbours.
|
|
398
|
+
*/
|
|
399
|
+
declare const IDENTITY_ACCENTS: readonly string[];
|
|
400
|
+
/**
|
|
401
|
+
* The same ramp as concrete colours, for values that are STORED rather than
|
|
402
|
+
* painted.
|
|
403
|
+
*
|
|
404
|
+
* A promotion's colour is data: the operator picks it, it goes over the wire,
|
|
405
|
+
* a database column holds it, and `CreatePromotionDto` caps it at 16
|
|
406
|
+
* characters. `var(--sa-color-identity-1)` is 28 and would fail validation on
|
|
407
|
+
* every create — which is exactly what happened when the swatches above were
|
|
408
|
+
* pointed at the token form. A token is paint; this is a value.
|
|
409
|
+
*
|
|
410
|
+
* These are the LIGHT theme's values, because a stored colour has to mean one
|
|
411
|
+
* thing wherever it is later rendered. `identity-accents-match-theme.test.js`
|
|
412
|
+
* binds each one to its role, so the two halves of the ramp cannot drift.
|
|
413
|
+
*/
|
|
414
|
+
declare const IDENTITY_ACCENT_VALUES: readonly string[];
|
|
415
|
+
/** The stored counterpart of `IDENTITY_NEUTRAL`. */
|
|
416
|
+
declare const IDENTITY_NEUTRAL_VALUE = "#64748b";
|
|
417
|
+
/** For "no identity yet", and for the entry tier that should stay quiet. */
|
|
418
|
+
declare const IDENTITY_NEUTRAL = "var(--sa-color-identity-neutral)";
|
|
419
|
+
/**
|
|
420
|
+
* The accent for the nth member of a series, wrapping when the series is longer
|
|
421
|
+
* than the ramp.
|
|
422
|
+
*
|
|
423
|
+
* A negative or non-finite index yields the neutral rather than throwing:
|
|
424
|
+
* callers derive it from `findIndex`, which answers -1 for "not in the list",
|
|
425
|
+
* and a missing row is exactly the "no identity yet" case.
|
|
426
|
+
*/
|
|
427
|
+
declare function identityAccentAt(index: number): string;
|
|
428
|
+
/**
|
|
429
|
+
* The accent for a key, in the order the product decides it.
|
|
430
|
+
*
|
|
431
|
+
* 1. what the consumer supplied, because it is their brand;
|
|
432
|
+
* 2. the well-known tier, so `ENTERPRISE` is the same colour everywhere;
|
|
433
|
+
* 3. the ramp position, so an unknown key still gets a stable colour;
|
|
434
|
+
* 4. the neutral.
|
|
435
|
+
*/
|
|
436
|
+
declare function identityAccentFor(key: string, overrides?: Readonly<Record<string, string>>, index?: number): string;
|
|
437
|
+
/**
|
|
438
|
+
* The three-part chip style every one of these sites was hand-rolling: a wash
|
|
439
|
+
* of the accent, the accent as text, a firmer edge of it.
|
|
440
|
+
*
|
|
441
|
+
* `color-mix()` rather than the `accent + '15'` string concatenation it
|
|
442
|
+
* replaces. That trick only worked on a six-digit hex — it silently produced
|
|
443
|
+
* garbage for `rgb()`, for a named colour and for anything a consumer might
|
|
444
|
+
* reasonably pass — and it could never have worked for a `var()`, which is why
|
|
445
|
+
* these palettes could not follow the theme in the first place.
|
|
446
|
+
*/
|
|
447
|
+
declare function identityChipStyle(accent: string): Record<string, string>;
|
|
448
|
+
|
|
449
|
+
export { ADMIN_UI_VERSION, type AdminPromoListFilter, type AdminPromoListRow, type AdminResourceClientOptions, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, IDENTITY_ACCENTS, IDENTITY_ACCENT_VALUES, IDENTITY_NEUTRAL, IDENTITY_NEUTRAL_VALUE, KvStore, type LoginBootProject, type LoginBrandFallback, type LoginBranding, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, type PlanCounts, type PlanRowLike, type PlanVersionLike, type ResolvePlansInput, type ResolvedPlan, SaLocale, type SidebarItem, type SidebarSection, buildRoutes, buildSidebar, countPlans, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, identityAccentAt, identityAccentFor, identityChipStyle, isCurrentlyValid, isExpired, isFutureScheduled, isProductionBoot, postJson, resolveExtension, resolveLoginBranding, resolvePlans, todayIsoDate, trimTrailingSlashes };
|
package/dist/client/index.d.ts
CHANGED
|
@@ -389,4 +389,61 @@ interface PlanCounts {
|
|
|
389
389
|
}
|
|
390
390
|
declare function countPlans<P extends PlanRowLike, V extends PlanVersionLike>(resolved: readonly ResolvedPlan<P, V>[]): PlanCounts;
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
/**
|
|
393
|
+
* The categorical ramp, in the order an unnamed series should walk it.
|
|
394
|
+
*
|
|
395
|
+
* Seven entries, six of them hues plus the neutral. Long enough that a realistic
|
|
396
|
+
* plan list does not wrap, short enough that the colours stay tellable apart —
|
|
397
|
+
* a longer ramp is not a better one, it is a wheel of near-neighbours.
|
|
398
|
+
*/
|
|
399
|
+
declare const IDENTITY_ACCENTS: readonly string[];
|
|
400
|
+
/**
|
|
401
|
+
* The same ramp as concrete colours, for values that are STORED rather than
|
|
402
|
+
* painted.
|
|
403
|
+
*
|
|
404
|
+
* A promotion's colour is data: the operator picks it, it goes over the wire,
|
|
405
|
+
* a database column holds it, and `CreatePromotionDto` caps it at 16
|
|
406
|
+
* characters. `var(--sa-color-identity-1)` is 28 and would fail validation on
|
|
407
|
+
* every create — which is exactly what happened when the swatches above were
|
|
408
|
+
* pointed at the token form. A token is paint; this is a value.
|
|
409
|
+
*
|
|
410
|
+
* These are the LIGHT theme's values, because a stored colour has to mean one
|
|
411
|
+
* thing wherever it is later rendered. `identity-accents-match-theme.test.js`
|
|
412
|
+
* binds each one to its role, so the two halves of the ramp cannot drift.
|
|
413
|
+
*/
|
|
414
|
+
declare const IDENTITY_ACCENT_VALUES: readonly string[];
|
|
415
|
+
/** The stored counterpart of `IDENTITY_NEUTRAL`. */
|
|
416
|
+
declare const IDENTITY_NEUTRAL_VALUE = "#64748b";
|
|
417
|
+
/** For "no identity yet", and for the entry tier that should stay quiet. */
|
|
418
|
+
declare const IDENTITY_NEUTRAL = "var(--sa-color-identity-neutral)";
|
|
419
|
+
/**
|
|
420
|
+
* The accent for the nth member of a series, wrapping when the series is longer
|
|
421
|
+
* than the ramp.
|
|
422
|
+
*
|
|
423
|
+
* A negative or non-finite index yields the neutral rather than throwing:
|
|
424
|
+
* callers derive it from `findIndex`, which answers -1 for "not in the list",
|
|
425
|
+
* and a missing row is exactly the "no identity yet" case.
|
|
426
|
+
*/
|
|
427
|
+
declare function identityAccentAt(index: number): string;
|
|
428
|
+
/**
|
|
429
|
+
* The accent for a key, in the order the product decides it.
|
|
430
|
+
*
|
|
431
|
+
* 1. what the consumer supplied, because it is their brand;
|
|
432
|
+
* 2. the well-known tier, so `ENTERPRISE` is the same colour everywhere;
|
|
433
|
+
* 3. the ramp position, so an unknown key still gets a stable colour;
|
|
434
|
+
* 4. the neutral.
|
|
435
|
+
*/
|
|
436
|
+
declare function identityAccentFor(key: string, overrides?: Readonly<Record<string, string>>, index?: number): string;
|
|
437
|
+
/**
|
|
438
|
+
* The three-part chip style every one of these sites was hand-rolling: a wash
|
|
439
|
+
* of the accent, the accent as text, a firmer edge of it.
|
|
440
|
+
*
|
|
441
|
+
* `color-mix()` rather than the `accent + '15'` string concatenation it
|
|
442
|
+
* replaces. That trick only worked on a six-digit hex — it silently produced
|
|
443
|
+
* garbage for `rgb()`, for a named colour and for anything a consumer might
|
|
444
|
+
* reasonably pass — and it could never have worked for a `var()`, which is why
|
|
445
|
+
* these palettes could not follow the theme in the first place.
|
|
446
|
+
*/
|
|
447
|
+
declare function identityChipStyle(accent: string): Record<string, string>;
|
|
448
|
+
|
|
449
|
+
export { ADMIN_UI_VERSION, type AdminPromoListFilter, type AdminPromoListRow, type AdminResourceClientOptions, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, IDENTITY_ACCENTS, IDENTITY_ACCENT_VALUES, IDENTITY_NEUTRAL, IDENTITY_NEUTRAL_VALUE, KvStore, type LoginBootProject, type LoginBrandFallback, type LoginBranding, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, type PlanCounts, type PlanRowLike, type PlanVersionLike, type ResolvePlansInput, type ResolvedPlan, SaLocale, type SidebarItem, type SidebarSection, buildRoutes, buildSidebar, countPlans, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, identityAccentAt, identityAccentFor, identityChipStyle, isCurrentlyValid, isExpired, isFutureScheduled, isProductionBoot, postJson, resolveExtension, resolveLoginBranding, resolvePlans, todayIsoDate, trimTrailingSlashes };
|
package/dist/client/index.js
CHANGED
|
@@ -8,6 +8,10 @@ import {
|
|
|
8
8
|
BootLoader,
|
|
9
9
|
DEFAULT_STANDARD_PAGE_ROUTES,
|
|
10
10
|
HttpJsonError,
|
|
11
|
+
IDENTITY_ACCENTS,
|
|
12
|
+
IDENTITY_ACCENT_VALUES,
|
|
13
|
+
IDENTITY_NEUTRAL,
|
|
14
|
+
IDENTITY_NEUTRAL_VALUE,
|
|
11
15
|
ManifestLoadError,
|
|
12
16
|
ManifestLoader,
|
|
13
17
|
MissingHandlerError,
|
|
@@ -17,6 +21,9 @@ import {
|
|
|
17
21
|
createAdminResourceClient,
|
|
18
22
|
defaultSectionOrder,
|
|
19
23
|
getJson,
|
|
24
|
+
identityAccentAt,
|
|
25
|
+
identityAccentFor,
|
|
26
|
+
identityChipStyle,
|
|
20
27
|
isCurrentlyValid,
|
|
21
28
|
isExpired,
|
|
22
29
|
isFutureScheduled,
|
|
@@ -27,7 +34,7 @@ import {
|
|
|
27
34
|
resolvePlans,
|
|
28
35
|
todayIsoDate,
|
|
29
36
|
trimTrailingSlashes
|
|
30
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-VYMTWCTT.js";
|
|
31
38
|
import {
|
|
32
39
|
DEFAULT_SA_LOCALE,
|
|
33
40
|
SA_INTL_LOCALES,
|
|
@@ -55,6 +62,10 @@ export {
|
|
|
55
62
|
DEFAULT_SA_LOCALE,
|
|
56
63
|
DEFAULT_STANDARD_PAGE_ROUTES,
|
|
57
64
|
HttpJsonError,
|
|
65
|
+
IDENTITY_ACCENTS,
|
|
66
|
+
IDENTITY_ACCENT_VALUES,
|
|
67
|
+
IDENTITY_NEUTRAL,
|
|
68
|
+
IDENTITY_NEUTRAL_VALUE,
|
|
58
69
|
ManifestLoadError,
|
|
59
70
|
ManifestLoader,
|
|
60
71
|
MissingHandlerError,
|
|
@@ -74,6 +85,9 @@ export {
|
|
|
74
85
|
formatCurrency,
|
|
75
86
|
formatMessage,
|
|
76
87
|
getJson,
|
|
88
|
+
identityAccentAt,
|
|
89
|
+
identityAccentFor,
|
|
90
|
+
identityChipStyle,
|
|
77
91
|
isCurrentlyValid,
|
|
78
92
|
isExpired,
|
|
79
93
|
isFutureScheduled,
|