mlform 0.1.2 → 0.1.4
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 +241 -88
- package/dist/design-system-CrrSGfFB.js +1352 -0
- package/dist/engine-nnhWPT2L.js +5301 -0
- package/dist/kit-Dt_1Fxlc.js +76 -0
- package/dist/mlform/design-system.mjs +2 -0
- package/dist/mlform/engine.mjs +3 -0
- package/dist/mlform/kit.mjs +3 -0
- package/dist/mlform/primitives.mjs +2 -0
- package/dist/mlform/questionnaire.mjs +640 -0
- package/dist/mlform/transport.mjs +2 -0
- package/dist/mlform.mjs +4 -709
- package/dist/primitives-Pi-ztAr6.js +5063 -0
- package/dist/transport-A1RsnZhD.js +2143 -0
- package/dist/types/src/design-system/constants.d.ts +34 -0
- package/dist/types/src/design-system/contract/component-keys.d.ts +2 -0
- package/dist/types/src/design-system/contract/component-tokens.d.ts +5 -0
- package/dist/types/src/design-system/contract/global-tokens.d.ts +7 -0
- package/dist/types/src/design-system/contract/index.d.ts +4 -0
- package/dist/types/src/design-system/contract/token-keys.d.ts +12 -0
- package/dist/types/src/design-system/index.d.ts +8 -0
- package/dist/types/src/design-system/recipes/contrast.d.ts +2 -0
- package/dist/types/src/design-system/recipes/default.d.ts +2 -0
- package/dist/types/src/design-system/recipes/index.d.ts +4 -0
- package/dist/types/src/design-system/recipes/minimal.d.ts +2 -0
- package/dist/types/src/design-system/recipes/soft.d.ts +2 -0
- package/dist/types/src/design-system/registry/builtins.d.ts +5 -0
- package/dist/types/src/design-system/registry/create-registry.d.ts +2 -0
- package/dist/types/src/design-system/registry/deep-freeze.d.ts +5 -0
- package/dist/types/src/design-system/registry/define-recipe.d.ts +2 -0
- package/dist/types/src/design-system/registry/define-theme.d.ts +2 -0
- package/dist/types/src/design-system/registry/define-token-maps.d.ts +6 -0
- package/dist/types/src/design-system/registry/index.d.ts +5 -0
- package/dist/types/src/design-system/resolve/diagnostics.d.ts +9 -0
- package/dist/types/src/design-system/resolve/index.d.ts +5 -0
- package/dist/types/src/design-system/resolve/merge-config.d.ts +2 -0
- package/dist/types/src/design-system/resolve/migrate-tokens.d.ts +44 -0
- package/dist/types/src/design-system/resolve/resolve-mode.d.ts +6 -0
- package/dist/types/src/design-system/resolve/resolve-recipe.d.ts +2 -0
- package/dist/types/src/design-system/resolve/resolve-theme.d.ts +2 -0
- package/dist/types/src/design-system/resolve/resolve-tokens.d.ts +2 -0
- package/dist/types/src/design-system/runtime/apply-tokens.d.ts +4 -0
- package/dist/types/src/design-system/runtime/attach-design-system.d.ts +11 -0
- package/dist/types/src/design-system/runtime/create-stylesheet.d.ts +11 -0
- package/dist/types/src/design-system/runtime/declarations.d.ts +5 -0
- package/dist/types/src/design-system/runtime/design-system-controller.d.ts +9 -0
- package/dist/types/src/design-system/runtime/host-state.d.ts +3 -0
- package/dist/types/src/design-system/runtime/hydrate-design-system.d.ts +25 -0
- package/dist/types/src/design-system/runtime/index.d.ts +8 -0
- package/dist/types/src/design-system/themes/cobalt.d.ts +2 -0
- package/dist/types/src/design-system/themes/graphite.d.ts +2 -0
- package/dist/types/src/design-system/themes/index.d.ts +5 -0
- package/dist/types/src/design-system/themes/neutral.d.ts +2 -0
- package/dist/types/src/design-system/themes/sage.d.ts +2 -0
- package/dist/types/src/design-system/themes/sunset.d.ts +2 -0
- package/dist/types/src/design-system/tokens/base.d.ts +5 -0
- package/dist/types/src/design-system/tokens/contrast.d.ts +8 -0
- package/dist/types/src/design-system/tokens/density.d.ts +9 -0
- package/dist/types/src/design-system/tokens/forced-colors.d.ts +12 -0
- package/dist/types/src/design-system/tokens/index.d.ts +5 -0
- package/dist/types/src/design-system/tokens/motion.d.ts +2 -0
- package/dist/types/src/design-system/types.d.ts +225 -0
- package/dist/types/src/engine/builtins/fields/boolean.d.ts +8 -0
- package/dist/types/src/engine/builtins/fields/category.d.ts +11 -0
- package/dist/types/src/engine/builtins/fields/date.d.ts +9 -0
- package/dist/types/src/engine/builtins/fields/long-text.d.ts +10 -0
- package/dist/types/src/engine/builtins/fields/multi-choice.d.ts +12 -0
- package/dist/types/src/engine/builtins/fields/number.d.ts +11 -0
- package/dist/types/src/engine/builtins/fields/rating.d.ts +9 -0
- package/dist/types/src/engine/builtins/fields/series.d.ts +20 -0
- package/dist/types/src/engine/builtins/fields/single-choice.d.ts +12 -0
- package/dist/types/src/engine/builtins/fields/text.d.ts +10 -0
- package/dist/types/src/engine/builtins/index.d.ts +97 -0
- package/dist/types/src/engine/builtins/reports/classifier.d.ts +8 -0
- package/dist/types/src/engine/builtins/reports/regressor.d.ts +8 -0
- package/dist/types/src/engine/builtins/shared.d.ts +49 -0
- package/dist/types/src/engine/comparison.d.ts +2 -0
- package/dist/types/src/engine/constants.d.ts +51 -0
- package/dist/types/src/engine/declarative/explanation.d.ts +2 -0
- package/dist/types/src/engine/declarative/field.d.ts +2 -0
- package/dist/types/src/engine/declarative/presentation.d.ts +61 -0
- package/dist/types/src/engine/declarative/report.d.ts +2 -0
- package/dist/types/src/engine/equality.d.ts +4 -0
- package/dist/types/src/engine/errors.d.ts +28 -0
- package/dist/types/src/engine/explanations/controller.d.ts +13 -0
- package/dist/types/src/engine/explanations/index.d.ts +1 -0
- package/dist/types/src/engine/fields/controller.d.ts +30 -0
- package/dist/types/src/engine/fields/index.d.ts +1 -0
- package/dist/types/src/engine/form.d.ts +2 -0
- package/dist/types/src/engine/index.d.ts +11 -0
- package/dist/types/src/engine/paths.d.ts +2 -0
- package/dist/types/src/engine/registry/index.d.ts +26 -0
- package/dist/types/src/engine/reports/controller.d.ts +19 -0
- package/dist/types/src/engine/reports/index.d.ts +1 -0
- package/dist/types/src/engine/schema/index.d.ts +7 -0
- package/dist/types/src/engine/state/engine.d.ts +60 -0
- package/dist/types/src/engine/state/index.d.ts +3 -0
- package/dist/types/src/engine/state/snapshots.d.ts +5 -0
- package/dist/types/src/engine/state/store.d.ts +13 -0
- package/dist/types/src/engine/submission/abort.d.ts +15 -0
- package/dist/types/src/engine/submission/explanations.d.ts +2 -0
- package/dist/types/src/engine/submission/index.d.ts +5 -0
- package/dist/types/src/engine/submission/lifecycle.d.ts +16 -0
- package/dist/types/src/engine/submission/pipeline.d.ts +2 -0
- package/dist/types/src/engine/submission/reports.d.ts +12 -0
- package/dist/types/src/engine/submission/request.d.ts +23 -0
- package/dist/types/src/engine/submission/result.d.ts +4 -0
- package/dist/types/src/engine/submission/submitter.d.ts +40 -0
- package/dist/types/src/engine/types/explanation.d.ts +109 -0
- package/dist/types/src/engine/types/field.d.ts +172 -0
- package/dist/types/src/engine/types/form.d.ts +120 -0
- package/dist/types/src/engine/types/index.d.ts +9 -0
- package/dist/types/src/engine/types/pipeline.d.ts +31 -0
- package/dist/types/src/engine/types/registry.d.ts +17 -0
- package/dist/types/src/engine/types/report.d.ts +87 -0
- package/dist/types/src/engine/types/transport.d.ts +41 -0
- package/dist/types/src/engine/utils.d.ts +9 -0
- package/dist/types/src/engine/validation/conditions.d.ts +11 -0
- package/dist/types/src/engine/validation/field.d.ts +29 -0
- package/dist/types/src/engine/validation/form.d.ts +35 -0
- package/dist/types/src/engine/validation/index.d.ts +3 -0
- package/dist/types/src/engine/values.d.ts +2 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/kit/constants.d.ts +4 -0
- package/dist/types/src/kit/defaults.d.ts +11 -0
- package/dist/types/src/kit/index.d.ts +4 -0
- package/dist/types/src/kit/mount-form.d.ts +3 -0
- package/dist/types/src/kit/types.d.ts +52 -0
- package/dist/types/src/primitives/base-async-report-element.d.ts +19 -0
- package/dist/types/src/primitives/base-explanation-element.d.ts +21 -0
- package/dist/types/src/primitives/base-field-element.d.ts +21 -0
- package/dist/types/src/primitives/base-report-element.d.ts +15 -0
- package/dist/types/src/primitives/components/declarative-explanation.d.ts +5 -0
- package/dist/types/src/primitives/components/declarative-field.d.ts +6 -0
- package/dist/types/src/primitives/components/declarative-report.d.ts +5 -0
- package/dist/types/src/primitives/components/explanation-panel.d.ts +22 -0
- package/dist/types/src/primitives/components/field-frame.d.ts +21 -0
- package/dist/types/src/primitives/components/form-errors.d.ts +19 -0
- package/dist/types/src/primitives/components/form-root.d.ts +29 -0
- package/dist/types/src/primitives/components/presentation.d.ts +4 -0
- package/dist/types/src/primitives/components/report-frame.d.ts +22 -0
- package/dist/types/src/primitives/components/submit-button.d.ts +21 -0
- package/dist/types/src/primitives/components/unsupported-component.d.ts +14 -0
- package/dist/types/src/primitives/constants.d.ts +94 -0
- package/dist/types/src/primitives/controller-binding.d.ts +32 -0
- package/dist/types/src/primitives/fields/boolean-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/category-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/date-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/long-text-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/multi-choice-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/number-field.d.ts +8 -0
- package/dist/types/src/primitives/fields/rating-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/series-field.d.ts +8 -0
- package/dist/types/src/primitives/fields/single-choice-field.d.ts +6 -0
- package/dist/types/src/primitives/fields/text-field.d.ts +6 -0
- package/dist/types/src/primitives/index.d.ts +8 -0
- package/dist/types/src/primitives/mount-form.d.ts +4 -0
- package/dist/types/src/primitives/register.d.ts +0 -0
- package/dist/types/src/primitives/registry.d.ts +3 -0
- package/dist/types/src/primitives/reports/classifier-report.d.ts +5 -0
- package/dist/types/src/primitives/reports/regressor-report.d.ts +5 -0
- package/dist/types/src/primitives/types.d.ts +128 -0
- package/dist/types/src/primitives/utils.d.ts +3 -0
- package/dist/types/src/questionnaire/constants.d.ts +31 -0
- package/dist/types/src/questionnaire/defaults.d.ts +8 -0
- package/dist/types/src/questionnaire/engine/controller.d.ts +12 -0
- package/dist/types/src/questionnaire/engine/schema.d.ts +9 -0
- package/dist/types/src/questionnaire/errors.d.ts +3 -0
- package/dist/types/src/questionnaire/index.d.ts +6 -0
- package/dist/types/src/questionnaire/mount.d.ts +3 -0
- package/dist/types/src/questionnaire/primitives/components/questionnaire-root.d.ts +23 -0
- package/dist/types/src/questionnaire/primitives/components/step-indicator.d.ts +14 -0
- package/dist/types/src/questionnaire/primitives/register.d.ts +0 -0
- package/dist/types/src/questionnaire/types.d.ts +69 -0
- package/dist/types/src/shared/errors.d.ts +3 -0
- package/dist/types/src/shared/index.d.ts +1 -0
- package/dist/types/src/transport/capabilities.d.ts +7 -0
- package/dist/types/src/transport/clone.d.ts +6 -0
- package/dist/types/src/transport/composition/fallback.d.ts +2 -0
- package/dist/types/src/transport/composition/fanout.d.ts +3 -0
- package/dist/types/src/transport/composition/hedged.d.ts +2 -0
- package/dist/types/src/transport/composition/index.d.ts +7 -0
- package/dist/types/src/transport/composition/load-balancing.d.ts +2 -0
- package/dist/types/src/transport/composition/pipeline.d.ts +2 -0
- package/dist/types/src/transport/composition/racing.d.ts +2 -0
- package/dist/types/src/transport/composition/routing.d.ts +3 -0
- package/dist/types/src/transport/constants.d.ts +34 -0
- package/dist/types/src/transport/errors.d.ts +36 -0
- package/dist/types/src/transport/index.d.ts +9 -0
- package/dist/types/src/transport/internal.d.ts +110 -0
- package/dist/types/src/transport/middleware/auth.d.ts +2 -0
- package/dist/types/src/transport/middleware/cache.d.ts +2 -0
- package/dist/types/src/transport/middleware/circuit-breaker.d.ts +2 -0
- package/dist/types/src/transport/middleware/dedup.d.ts +2 -0
- package/dist/types/src/transport/middleware/index.d.ts +12 -0
- package/dist/types/src/transport/middleware/logging.d.ts +2 -0
- package/dist/types/src/transport/middleware/metrics.d.ts +2 -0
- package/dist/types/src/transport/middleware/pipe.d.ts +2 -0
- package/dist/types/src/transport/middleware/rate-limit.d.ts +2 -0
- package/dist/types/src/transport/middleware/retry.d.ts +2 -0
- package/dist/types/src/transport/middleware/timeout.d.ts +2 -0
- package/dist/types/src/transport/middleware/tracing.d.ts +2 -0
- package/dist/types/src/transport/middleware/transform.d.ts +3 -0
- package/dist/types/src/transport/policy-context.d.ts +3 -0
- package/dist/types/src/transport/protocols/graphql.d.ts +2 -0
- package/dist/types/src/transport/protocols/grpc.d.ts +5 -0
- package/dist/types/src/transport/protocols/index.d.ts +5 -0
- package/dist/types/src/transport/protocols/json.d.ts +2 -0
- package/dist/types/src/transport/protocols/sse.d.ts +2 -0
- package/dist/types/src/transport/protocols/websocket.d.ts +2 -0
- package/dist/types/src/transport/runtime.d.ts +4 -0
- package/dist/types/src/transport/state/cache-store.d.ts +2 -0
- package/dist/types/src/transport/state/circuit-breaker.d.ts +2 -0
- package/dist/types/src/transport/state/health.d.ts +2 -0
- package/dist/types/src/transport/state/index.d.ts +5 -0
- package/dist/types/src/transport/state/rate-limiter.d.ts +2 -0
- package/dist/types/src/transport/state/session.d.ts +2 -0
- package/dist/types/src/transport/types/capabilities.d.ts +35 -0
- package/dist/types/src/transport/types/core.d.ts +57 -0
- package/dist/types/src/transport/types/events.d.ts +50 -0
- package/dist/types/src/transport/types/index.d.ts +7 -0
- package/dist/types/src/transport/types/middleware.d.ts +3 -0
- package/dist/types/src/transport/types/options.d.ts +258 -0
- package/dist/types/src/transport/types/session.d.ts +48 -0
- package/dist/types/src/transport/types/state.d.ts +46 -0
- package/package.json +93 -37
- package/dist/FieldStrategy-pPekBtH-.js +0 -2318
- package/dist/ModelTypes-B9_veCKB.js +0 -5
- package/dist/ReportStrategy-DY3GC_mJ.js +0 -23
- package/dist/boolean-field-Cd3uhIPj.js +0 -104
- package/dist/category-field-D_Ms1x9u.js +0 -73
- package/dist/classifier-prediction-C5QzorTo.js +0 -193
- package/dist/custom-element-ttkHUa8w.js +0 -13
- package/dist/date-field-Cg_ja679.js +0 -162
- package/dist/error-card-BwjPChwf.js +0 -195
- package/dist/field-wrapper-DqIQl76d.js +0 -177
- package/dist/ml-layout-Dx63KKf7.js +0 -332
- package/dist/mlform/extensions.mjs +0 -38
- package/dist/mlform/strategies.mjs +0 -292
- package/dist/number-field-CC2DrVEb.js +0 -165
- package/dist/property-jKFNMQpR.js +0 -561
- package/dist/range-field-Cr7LEtsJ.js +0 -98
- package/dist/regressor-prediction-C18dHlfK.js +0 -236
- package/dist/src/core/app/DescriptorItem.d.ts +0 -6
- package/dist/src/core/app/DescriptorRegistry.d.ts +0 -13
- package/dist/src/core/app/DescriptorService.d.ts +0 -22
- package/dist/src/core/app/DescriptorStrategy.d.ts +0 -11
- package/dist/src/core/app/index.d.ts +0 -4
- package/dist/src/core/domain/index.d.ts +0 -24
- package/dist/src/core/index.d.ts +0 -3
- package/dist/src/core/ui/error-card.d.ts +0 -38
- package/dist/src/core/ui/field-wrapper.d.ts +0 -23
- package/dist/src/core/ui/index.d.ts +0 -3
- package/dist/src/core/ui/ml-layout.d.ts +0 -23
- package/dist/src/extensions/app/FieldStrategy.d.ts +0 -10
- package/dist/src/extensions/app/ReportStrategy.d.ts +0 -9
- package/dist/src/extensions/app/index.d.ts +0 -2
- package/dist/src/extensions/domain/BaseField.d.ts +0 -7
- package/dist/src/extensions/domain/BaseModel.d.ts +0 -6
- package/dist/src/extensions/domain/index.d.ts +0 -2
- package/dist/src/extensions/index.d.ts +0 -3
- package/dist/src/extensions/ui/field-element.d.ts +0 -9
- package/dist/src/extensions/ui/index.d.ts +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/mlform/index.d.ts +0 -1
- package/dist/src/mlform/mlform.d.ts +0 -27
- package/dist/src/mlform/mlform.types.d.ts +0 -11
- package/dist/src/strategies/app/BooleanStrategy.d.ts +0 -12
- package/dist/src/strategies/app/CategoryStrategy.d.ts +0 -13
- package/dist/src/strategies/app/ClassifierStrategy.d.ts +0 -15
- package/dist/src/strategies/app/DateStrategy.d.ts +0 -15
- package/dist/src/strategies/app/NumberStrategy.d.ts +0 -29
- package/dist/src/strategies/app/RegressorStrategy.d.ts +0 -15
- package/dist/src/strategies/app/TextStrategy.d.ts +0 -16
- package/dist/src/strategies/app/index.d.ts +0 -7
- package/dist/src/strategies/domain/BooleanField.d.ts +0 -10
- package/dist/src/strategies/domain/CategoryField.d.ts +0 -11
- package/dist/src/strategies/domain/ClassifierModel.d.ts +0 -11
- package/dist/src/strategies/domain/DateField.d.ts +0 -13
- package/dist/src/strategies/domain/FieldTypes.d.ts +0 -7
- package/dist/src/strategies/domain/ModelTypes.d.ts +0 -4
- package/dist/src/strategies/domain/NumberField.d.ts +0 -15
- package/dist/src/strategies/domain/RegressorModel.d.ts +0 -11
- package/dist/src/strategies/domain/TextField.d.ts +0 -14
- package/dist/src/strategies/domain/index.d.ts +0 -9
- package/dist/src/strategies/index.d.ts +0 -1
- package/dist/src/strategies/ui/boolean-field.d.ts +0 -13
- package/dist/src/strategies/ui/category-field.d.ts +0 -14
- package/dist/src/strategies/ui/classifier-prediction.d.ts +0 -39
- package/dist/src/strategies/ui/date-field.d.ts +0 -18
- package/dist/src/strategies/ui/index.d.ts +0 -8
- package/dist/src/strategies/ui/number-field.d.ts +0 -19
- package/dist/src/strategies/ui/range-field.d.ts +0 -17
- package/dist/src/strategies/ui/regressor-prediction.d.ts +0 -29
- package/dist/src/strategies/ui/text-field.d.ts +0 -17
- package/dist/state-CLlTRyl1.js +0 -12
- package/dist/test/_fixtures/DummyField.d.ts +0 -9
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/unit/DummyField.test.d.ts +0 -1
- package/dist/text-field-DwP-Fa1w.js +0 -114
|
@@ -0,0 +1,1352 @@
|
|
|
1
|
+
//#region src/design-system/contract/component-keys.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"shell",
|
|
4
|
+
"hero",
|
|
5
|
+
"field",
|
|
6
|
+
"report",
|
|
7
|
+
"input",
|
|
8
|
+
"submit",
|
|
9
|
+
"error",
|
|
10
|
+
"toggle",
|
|
11
|
+
"status",
|
|
12
|
+
"chart"
|
|
13
|
+
], t = {
|
|
14
|
+
shell: { tokens: {
|
|
15
|
+
"--mlf-shell-color": "var(--mlf-color-text)",
|
|
16
|
+
"--mlf-shell-bg": "transparent",
|
|
17
|
+
"--mlf-shell-overlay": "linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 0%, transparent), var(--mlf-color-overlay) 50%)",
|
|
18
|
+
"--mlf-shell-panel-bg": "var(--mlf-color-surface)",
|
|
19
|
+
"--mlf-shell-panel-border": "var(--mlf-color-border)",
|
|
20
|
+
"--mlf-shell-panel-shadow-soft": "var(--mlf-shadow-sm)",
|
|
21
|
+
"--mlf-shell-panel-shadow": "var(--mlf-shadow-md)",
|
|
22
|
+
"--mlf-shell-header-bg": "color-mix(in srgb, var(--mlf-color-surface) 76%, transparent)",
|
|
23
|
+
"--mlf-shell-header-blur": "3px",
|
|
24
|
+
"--mlf-shell-action-bg": "var(--mlf-color-surface-muted)",
|
|
25
|
+
"--mlf-shell-left-min-width": "22rem",
|
|
26
|
+
"--mlf-shell-left-max-width": "48rem",
|
|
27
|
+
"--mlf-shell-right-min-width": "24rem"
|
|
28
|
+
} },
|
|
29
|
+
hero: { tokens: {
|
|
30
|
+
"--mlf-hero-bg": "radial-gradient(circle at top left, var(--mlf-color-accent-soft), transparent 34%), linear-gradient(135deg, color-mix(in srgb, var(--mlf-color-surface) 95%, transparent), color-mix(in srgb, var(--mlf-color-surface) 95%, var(--mlf-color-surface-muted)))",
|
|
31
|
+
"--mlf-hero-border": "color-mix(in srgb, var(--mlf-color-border) 90%, var(--mlf-color-surface))",
|
|
32
|
+
"--mlf-hero-shadow": "var(--mlf-shadow-lg)",
|
|
33
|
+
"--mlf-hero-radius": "var(--mlf-radius-xl)",
|
|
34
|
+
"--mlf-hero-eyebrow-color": "var(--mlf-color-text-muted)",
|
|
35
|
+
"--mlf-hero-status-bg": "var(--mlf-color-accent-soft)"
|
|
36
|
+
} },
|
|
37
|
+
field: { tokens: {
|
|
38
|
+
"--mlf-field-bg": "radial-gradient(circle at top left, color-mix(in srgb, var(--mlf-color-accent) 8%, transparent), transparent 38%), linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 96%, transparent), color-mix(in srgb, var(--mlf-color-surface) 98%, var(--mlf-color-surface-muted)))",
|
|
39
|
+
"--mlf-field-border": "var(--mlf-color-border)",
|
|
40
|
+
"--mlf-field-border-invalid": "color-mix(in srgb, var(--mlf-color-danger) 34%, transparent)",
|
|
41
|
+
"--mlf-field-shadow": "var(--mlf-shadow-md)",
|
|
42
|
+
"--mlf-field-radius": "var(--mlf-radius-lg)",
|
|
43
|
+
"--mlf-field-label-color": "var(--mlf-color-text)",
|
|
44
|
+
"--mlf-field-description-color": "var(--mlf-color-text-muted)",
|
|
45
|
+
"--mlf-field-meta-bg": "var(--mlf-color-accent-soft)",
|
|
46
|
+
"--mlf-field-meta-color": "var(--mlf-color-text-muted)",
|
|
47
|
+
"--mlf-field-error-bg": "var(--mlf-color-danger-soft)",
|
|
48
|
+
"--mlf-field-error-color": "var(--mlf-color-danger)"
|
|
49
|
+
} },
|
|
50
|
+
report: { tokens: {
|
|
51
|
+
"--mlf-report-bg": "radial-gradient(circle at top right, color-mix(in srgb, var(--mlf-color-accent) 10%, transparent), transparent 34%), linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 96%, transparent), color-mix(in srgb, var(--mlf-color-surface) 98%, var(--mlf-color-surface-muted)))",
|
|
52
|
+
"--mlf-report-border": "var(--mlf-color-border)",
|
|
53
|
+
"--mlf-report-shadow": "var(--mlf-shadow-md)",
|
|
54
|
+
"--mlf-report-radius": "var(--mlf-radius-lg)",
|
|
55
|
+
"--mlf-report-label-color": "var(--mlf-color-text)",
|
|
56
|
+
"--mlf-report-description-color": "var(--mlf-color-text-muted)",
|
|
57
|
+
"--mlf-report-meta-bg": "var(--mlf-color-accent-soft)",
|
|
58
|
+
"--mlf-report-meta-color": "var(--mlf-color-text-muted)",
|
|
59
|
+
"--mlf-report-empty-bg": "color-mix(in srgb, var(--mlf-color-accent) 6%, transparent)",
|
|
60
|
+
"--mlf-report-empty-color": "var(--mlf-color-text-muted)",
|
|
61
|
+
"--mlf-report-hero-bg": "linear-gradient(135deg, color-mix(in srgb, var(--mlf-color-accent) 12%, transparent), color-mix(in srgb, var(--mlf-color-accent) 6%, transparent))",
|
|
62
|
+
"--mlf-report-error-bg": "var(--mlf-color-danger-soft)",
|
|
63
|
+
"--mlf-report-error-color": "var(--mlf-color-danger)"
|
|
64
|
+
} },
|
|
65
|
+
input: { tokens: {
|
|
66
|
+
"--mlf-input-bg": "var(--mlf-color-surface-elevated)",
|
|
67
|
+
"--mlf-input-bg-disabled": "var(--mlf-color-surface-muted)",
|
|
68
|
+
"--mlf-input-border": "var(--mlf-color-border)",
|
|
69
|
+
"--mlf-input-border-focus": "var(--mlf-color-accent)",
|
|
70
|
+
"--mlf-input-text": "var(--mlf-color-text)",
|
|
71
|
+
"--mlf-input-placeholder": "var(--mlf-color-text-muted)",
|
|
72
|
+
"--mlf-input-radius": "var(--mlf-radius-md)",
|
|
73
|
+
"--mlf-input-shadow-focus": "0 0 0 var(--mlf-ring-width) var(--mlf-color-focus-ring)"
|
|
74
|
+
} },
|
|
75
|
+
submit: { tokens: {
|
|
76
|
+
"--mlf-submit-bg": "linear-gradient(135deg, var(--mlf-color-accent), color-mix(in srgb, var(--mlf-color-accent) 70%, #0f8cff))",
|
|
77
|
+
"--mlf-submit-bg-hover": "linear-gradient(135deg, var(--mlf-color-accent-hover), color-mix(in srgb, var(--mlf-color-accent-hover) 75%, #0f8cff))",
|
|
78
|
+
"--mlf-submit-color": "var(--mlf-color-text-inverse)",
|
|
79
|
+
"--mlf-submit-shadow": "0 18px 32px color-mix(in srgb, var(--mlf-color-accent) 28%, transparent)",
|
|
80
|
+
"--mlf-submit-shadow-hover": "0 24px 36px color-mix(in srgb, var(--mlf-color-accent) 34%, transparent)",
|
|
81
|
+
"--mlf-submit-radius": "var(--mlf-radius-md)",
|
|
82
|
+
"--mlf-submit-focus-ring": "0 0 0 var(--mlf-ring-width) color-mix(in srgb, var(--mlf-color-accent) 18%, transparent)"
|
|
83
|
+
} },
|
|
84
|
+
error: { tokens: {
|
|
85
|
+
"--mlf-error-bg": "radial-gradient(circle at top left, color-mix(in srgb, var(--mlf-color-danger) 14%, transparent), transparent 55%), linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 94%, transparent), color-mix(in srgb, var(--mlf-color-surface) 88%, transparent))",
|
|
86
|
+
"--mlf-error-border": "color-mix(in srgb, var(--mlf-color-danger) 20%, transparent)",
|
|
87
|
+
"--mlf-error-color": "var(--mlf-color-danger)"
|
|
88
|
+
} },
|
|
89
|
+
toggle: { tokens: {
|
|
90
|
+
"--mlf-toggle-bg": "var(--mlf-input-bg)",
|
|
91
|
+
"--mlf-toggle-border": "var(--mlf-input-border)",
|
|
92
|
+
"--mlf-toggle-text": "var(--mlf-color-text)",
|
|
93
|
+
"--mlf-toggle-accent": "var(--mlf-color-accent)"
|
|
94
|
+
} },
|
|
95
|
+
status: { tokens: {
|
|
96
|
+
"--mlf-status-bg": "var(--mlf-color-accent-soft)",
|
|
97
|
+
"--mlf-status-color": "var(--mlf-color-text-muted)"
|
|
98
|
+
} },
|
|
99
|
+
chart: { tokens: {
|
|
100
|
+
"--mlf-chart-track-bg": "var(--mlf-color-chart-track)",
|
|
101
|
+
"--mlf-chart-fill-bg": "linear-gradient(90deg, var(--mlf-color-accent), color-mix(in srgb, var(--mlf-color-accent) 72%, #0f8cff))"
|
|
102
|
+
} }
|
|
103
|
+
}, n = {
|
|
104
|
+
"--mlf-color-bg": "#f6f3ee",
|
|
105
|
+
"--mlf-color-surface": "#fffdf9",
|
|
106
|
+
"--mlf-color-surface-muted": "#f1ece4",
|
|
107
|
+
"--mlf-color-surface-elevated": "#ffffff",
|
|
108
|
+
"--mlf-color-text": "#1f2933",
|
|
109
|
+
"--mlf-color-text-muted": "#5b6673",
|
|
110
|
+
"--mlf-color-text-inverse": "#ffffff",
|
|
111
|
+
"--mlf-color-border": "#ddd4c7",
|
|
112
|
+
"--mlf-color-border-strong": "#c6baa9",
|
|
113
|
+
"--mlf-color-accent": "#145c9e",
|
|
114
|
+
"--mlf-color-accent-hover": "#0f4d84",
|
|
115
|
+
"--mlf-color-accent-soft": "rgba(20, 92, 158, 0.12)",
|
|
116
|
+
"--mlf-color-success": "#1f8a5b",
|
|
117
|
+
"--mlf-color-warning": "#c17c1f",
|
|
118
|
+
"--mlf-color-danger": "#be3a34",
|
|
119
|
+
"--mlf-color-danger-soft": "rgba(190, 58, 52, 0.12)",
|
|
120
|
+
"--mlf-color-focus-ring": "rgba(20, 92, 158, 0.24)",
|
|
121
|
+
"--mlf-color-overlay": "rgba(255, 253, 249, 0.82)",
|
|
122
|
+
"--mlf-color-hover-surface": "#ebe2d4",
|
|
123
|
+
"--mlf-color-chart-track": "rgba(96, 120, 168, 0.12)"
|
|
124
|
+
}, r = {
|
|
125
|
+
"--mlf-font-family-body": "\"Iowan Old Style\", \"Palatino Linotype\", \"Book Antiqua\", Palatino, \"Times New Roman\", serif",
|
|
126
|
+
"--mlf-font-family-heading": "\"Iowan Old Style\", \"Palatino Linotype\", \"Book Antiqua\", Palatino, \"Times New Roman\", serif",
|
|
127
|
+
"--mlf-font-family-ui": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif",
|
|
128
|
+
"--mlf-font-family-mono": "ui-monospace, \"SFMono-Regular\", \"SF Mono\", Consolas, \"Liberation Mono\", monospace",
|
|
129
|
+
"--mlf-font-size-xs": "0.72rem",
|
|
130
|
+
"--mlf-font-size-sm": "0.84rem",
|
|
131
|
+
"--mlf-font-size-md": "1rem",
|
|
132
|
+
"--mlf-font-size-lg": "1.125rem",
|
|
133
|
+
"--mlf-font-size-xl": "1.55rem",
|
|
134
|
+
"--mlf-font-size-2xl": "2.15rem",
|
|
135
|
+
"--mlf-line-height-tight": "1.12",
|
|
136
|
+
"--mlf-line-height-normal": "1.5",
|
|
137
|
+
"--mlf-space-1": "0.25rem",
|
|
138
|
+
"--mlf-space-2": "0.5rem",
|
|
139
|
+
"--mlf-space-3": "0.75rem",
|
|
140
|
+
"--mlf-space-4": "1rem",
|
|
141
|
+
"--mlf-space-5": "1.25rem",
|
|
142
|
+
"--mlf-space-6": "1.5rem",
|
|
143
|
+
"--mlf-space-7": "2rem",
|
|
144
|
+
"--mlf-space-8": "3rem",
|
|
145
|
+
"--mlf-radius-sm": "12px",
|
|
146
|
+
"--mlf-radius-md": "16px",
|
|
147
|
+
"--mlf-radius-lg": "22px",
|
|
148
|
+
"--mlf-radius-xl": "28px",
|
|
149
|
+
"--mlf-radius-pill": "999px",
|
|
150
|
+
"--mlf-border-width": "1px",
|
|
151
|
+
"--mlf-ring-width": "4px",
|
|
152
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(17, 24, 39, 0.08)",
|
|
153
|
+
"--mlf-shadow-md": "0 14px 30px rgba(17, 24, 39, 0.08)",
|
|
154
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(17, 24, 39, 0.12)",
|
|
155
|
+
"--mlf-motion-fast": "140ms ease",
|
|
156
|
+
"--mlf-motion-base": "180ms ease",
|
|
157
|
+
"--mlf-motion-slow": "260ms ease",
|
|
158
|
+
"--mlf-transition-duration": "200ms",
|
|
159
|
+
"--mlf-transition-easing": "ease-in-out",
|
|
160
|
+
"--mlf-layout-gap": "1rem",
|
|
161
|
+
"--mlf-section-gap": "1rem",
|
|
162
|
+
"--mlf-pane-gap": "1rem",
|
|
163
|
+
"--mlf-shell-gap": "1.2rem",
|
|
164
|
+
"--mlf-control-height": "3rem",
|
|
165
|
+
"--mlf-control-padding-inline": "0.92rem",
|
|
166
|
+
"--mlf-control-padding-block": "0.78rem",
|
|
167
|
+
"--mlf-pane-min-width": "20rem",
|
|
168
|
+
...n
|
|
169
|
+
}, i = /* @__PURE__ */ "--mlf-font-family-body.--mlf-font-family-heading.--mlf-font-family-ui.--mlf-font-family-mono.--mlf-font-size-xs.--mlf-font-size-sm.--mlf-font-size-md.--mlf-font-size-lg.--mlf-font-size-xl.--mlf-font-size-2xl.--mlf-line-height-tight.--mlf-line-height-normal.--mlf-space-1.--mlf-space-2.--mlf-space-3.--mlf-space-4.--mlf-space-5.--mlf-space-6.--mlf-space-7.--mlf-space-8.--mlf-radius-sm.--mlf-radius-md.--mlf-radius-lg.--mlf-radius-xl.--mlf-radius-pill.--mlf-border-width.--mlf-ring-width.--mlf-shadow-sm.--mlf-shadow-md.--mlf-shadow-lg.--mlf-motion-fast.--mlf-motion-base.--mlf-motion-slow.--mlf-transition-duration.--mlf-transition-easing.--mlf-layout-gap.--mlf-section-gap.--mlf-pane-gap.--mlf-shell-gap.--mlf-control-height.--mlf-control-padding-inline.--mlf-control-padding-block.--mlf-pane-min-width.--mlf-color-bg.--mlf-color-surface.--mlf-color-surface-muted.--mlf-color-surface-elevated.--mlf-color-text.--mlf-color-text-muted.--mlf-color-text-inverse.--mlf-color-border.--mlf-color-border-strong.--mlf-color-accent.--mlf-color-accent-hover.--mlf-color-accent-soft.--mlf-color-success.--mlf-color-warning.--mlf-color-danger.--mlf-color-danger-soft.--mlf-color-focus-ring.--mlf-color-overlay.--mlf-color-hover-surface.--mlf-color-chart-track.--mlf-shell-color.--mlf-shell-bg.--mlf-shell-overlay.--mlf-shell-panel-bg.--mlf-shell-panel-border.--mlf-shell-panel-shadow-soft.--mlf-shell-panel-shadow.--mlf-shell-header-bg.--mlf-shell-header-blur.--mlf-shell-action-bg.--mlf-shell-left-min-width.--mlf-shell-left-max-width.--mlf-shell-right-min-width.--mlf-hero-bg.--mlf-hero-border.--mlf-hero-shadow.--mlf-hero-radius.--mlf-hero-eyebrow-color.--mlf-hero-status-bg.--mlf-field-bg.--mlf-field-border.--mlf-field-border-invalid.--mlf-field-shadow.--mlf-field-radius.--mlf-field-label-color.--mlf-field-description-color.--mlf-field-meta-bg.--mlf-field-meta-color.--mlf-field-error-bg.--mlf-field-error-color.--mlf-report-bg.--mlf-report-border.--mlf-report-shadow.--mlf-report-radius.--mlf-report-label-color.--mlf-report-description-color.--mlf-report-meta-bg.--mlf-report-meta-color.--mlf-report-empty-bg.--mlf-report-empty-color.--mlf-report-hero-bg.--mlf-report-error-bg.--mlf-report-error-color.--mlf-input-bg.--mlf-input-bg-disabled.--mlf-input-border.--mlf-input-border-focus.--mlf-input-text.--mlf-input-placeholder.--mlf-input-radius.--mlf-input-shadow-focus.--mlf-submit-bg.--mlf-submit-bg-hover.--mlf-submit-color.--mlf-submit-shadow.--mlf-submit-shadow-hover.--mlf-submit-radius.--mlf-submit-focus-ring.--mlf-error-bg.--mlf-error-border.--mlf-error-color.--mlf-toggle-bg.--mlf-toggle-border.--mlf-toggle-text.--mlf-toggle-accent.--mlf-status-bg.--mlf-status-color.--mlf-chart-track-bg.--mlf-chart-fill-bg".split("."), a = {
|
|
170
|
+
id: "contrast",
|
|
171
|
+
label: "Contrast",
|
|
172
|
+
density: "spacious",
|
|
173
|
+
motion: "standard",
|
|
174
|
+
tokens: {
|
|
175
|
+
"--mlf-border-width": "1.5px",
|
|
176
|
+
"--mlf-color-border-strong": "var(--mlf-color-text)"
|
|
177
|
+
},
|
|
178
|
+
components: {
|
|
179
|
+
field: { tokens: { "--mlf-field-border": "var(--mlf-color-border-strong)" } },
|
|
180
|
+
report: { tokens: { "--mlf-report-border": "var(--mlf-color-border-strong)" } },
|
|
181
|
+
input: { tokens: { "--mlf-input-border": "var(--mlf-color-border-strong)" } },
|
|
182
|
+
submit: { tokens: { "--mlf-submit-radius": "var(--mlf-radius-sm)" } }
|
|
183
|
+
}
|
|
184
|
+
}, o = {
|
|
185
|
+
id: "default",
|
|
186
|
+
label: "Default",
|
|
187
|
+
density: "comfortable",
|
|
188
|
+
motion: "subtle",
|
|
189
|
+
tokens: { "--mlf-shell-bg": "transparent" }
|
|
190
|
+
}, s = {
|
|
191
|
+
id: "minimal",
|
|
192
|
+
label: "Minimal",
|
|
193
|
+
density: "compact",
|
|
194
|
+
motion: "none",
|
|
195
|
+
tokens: {
|
|
196
|
+
"--mlf-shadow-md": "none",
|
|
197
|
+
"--mlf-shadow-lg": "none"
|
|
198
|
+
},
|
|
199
|
+
components: {
|
|
200
|
+
hero: { tokens: {
|
|
201
|
+
"--mlf-hero-bg": "var(--mlf-color-surface)",
|
|
202
|
+
"--mlf-hero-shadow": "none"
|
|
203
|
+
} },
|
|
204
|
+
field: { tokens: {
|
|
205
|
+
"--mlf-field-bg": "var(--mlf-color-surface)",
|
|
206
|
+
"--mlf-field-shadow": "none"
|
|
207
|
+
} },
|
|
208
|
+
report: { tokens: {
|
|
209
|
+
"--mlf-report-bg": "var(--mlf-color-surface)",
|
|
210
|
+
"--mlf-report-shadow": "none"
|
|
211
|
+
} },
|
|
212
|
+
submit: { tokens: {
|
|
213
|
+
"--mlf-submit-shadow": "none",
|
|
214
|
+
"--mlf-submit-shadow-hover": "none"
|
|
215
|
+
} }
|
|
216
|
+
}
|
|
217
|
+
}, c = {
|
|
218
|
+
id: "soft",
|
|
219
|
+
label: "Soft",
|
|
220
|
+
density: "comfortable",
|
|
221
|
+
motion: "subtle",
|
|
222
|
+
components: {
|
|
223
|
+
hero: { tokens: { "--mlf-hero-bg": "radial-gradient(circle at top left, color-mix(in srgb, var(--mlf-color-accent) 10%, transparent), transparent 42%), linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 92%, var(--mlf-color-surface-elevated)), color-mix(in srgb, var(--mlf-color-surface-muted) 88%, var(--mlf-color-surface-elevated)))" } },
|
|
224
|
+
field: { tokens: { "--mlf-field-bg": "linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 96%, var(--mlf-color-surface-elevated)), color-mix(in srgb, var(--mlf-color-surface-muted) 94%, var(--mlf-color-surface-elevated)))" } },
|
|
225
|
+
report: { tokens: { "--mlf-report-bg": "linear-gradient(180deg, color-mix(in srgb, var(--mlf-color-surface) 95%, var(--mlf-color-surface-elevated)), color-mix(in srgb, var(--mlf-color-surface-muted) 92%, var(--mlf-color-surface-elevated)))" } }
|
|
226
|
+
}
|
|
227
|
+
}, l = {
|
|
228
|
+
id: "cobalt",
|
|
229
|
+
label: "Cobalt",
|
|
230
|
+
schemes: {
|
|
231
|
+
light: {
|
|
232
|
+
colorScheme: "light",
|
|
233
|
+
tokens: {
|
|
234
|
+
"--mlf-color-bg": "#eef4fb",
|
|
235
|
+
"--mlf-color-surface": "#ffffff",
|
|
236
|
+
"--mlf-color-surface-muted": "#e5eef8",
|
|
237
|
+
"--mlf-color-surface-elevated": "#ffffff",
|
|
238
|
+
"--mlf-color-text": "#11243a",
|
|
239
|
+
"--mlf-color-text-muted": "#49627d",
|
|
240
|
+
"--mlf-color-border": "#c6d7ea",
|
|
241
|
+
"--mlf-color-border-strong": "#afc6dd",
|
|
242
|
+
"--mlf-color-accent": "#1f5eff",
|
|
243
|
+
"--mlf-color-accent-hover": "#174fdc",
|
|
244
|
+
"--mlf-color-accent-soft": "rgba(31, 94, 255, 0.12)",
|
|
245
|
+
"--mlf-color-success": "#198754",
|
|
246
|
+
"--mlf-color-warning": "#d4861b",
|
|
247
|
+
"--mlf-color-danger": "#d64545",
|
|
248
|
+
"--mlf-color-danger-soft": "rgba(214, 69, 69, 0.12)",
|
|
249
|
+
"--mlf-color-focus-ring": "rgba(31, 94, 255, 0.24)",
|
|
250
|
+
"--mlf-color-overlay": "rgba(255, 255, 255, 0.78)",
|
|
251
|
+
"--mlf-color-hover-surface": "#d8e5f6",
|
|
252
|
+
"--mlf-color-chart-track": "rgba(17, 36, 58, 0.12)"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
dark: {
|
|
256
|
+
colorScheme: "dark",
|
|
257
|
+
tokens: {
|
|
258
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(0, 0, 0, 0.45)",
|
|
259
|
+
"--mlf-shadow-md": "0 14px 30px rgba(0, 0, 0, 0.35)",
|
|
260
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(0, 0, 0, 0.28)",
|
|
261
|
+
"--mlf-color-bg": "#0d1524",
|
|
262
|
+
"--mlf-color-surface": "#111c30",
|
|
263
|
+
"--mlf-color-surface-muted": "#16233b",
|
|
264
|
+
"--mlf-color-surface-elevated": "#1a2944",
|
|
265
|
+
"--mlf-color-text": "#edf4ff",
|
|
266
|
+
"--mlf-color-text-muted": "#a3b5cf",
|
|
267
|
+
"--mlf-color-border": "#243552",
|
|
268
|
+
"--mlf-color-border-strong": "#304465",
|
|
269
|
+
"--mlf-color-accent": "#68a0ff",
|
|
270
|
+
"--mlf-color-accent-hover": "#8ab7ff",
|
|
271
|
+
"--mlf-color-accent-soft": "rgba(104, 160, 255, 0.16)",
|
|
272
|
+
"--mlf-color-success": "#3ad38a",
|
|
273
|
+
"--mlf-color-warning": "#ffbb5d",
|
|
274
|
+
"--mlf-color-danger": "#ff7f86",
|
|
275
|
+
"--mlf-color-danger-soft": "rgba(255, 127, 134, 0.14)",
|
|
276
|
+
"--mlf-color-focus-ring": "rgba(104, 160, 255, 0.3)",
|
|
277
|
+
"--mlf-color-overlay": "rgba(13, 21, 36, 0.82)",
|
|
278
|
+
"--mlf-color-hover-surface": "#1f3151",
|
|
279
|
+
"--mlf-color-chart-track": "rgba(163, 181, 207, 0.18)"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, u = {
|
|
284
|
+
id: "graphite",
|
|
285
|
+
label: "Graphite",
|
|
286
|
+
schemes: {
|
|
287
|
+
light: {
|
|
288
|
+
colorScheme: "light",
|
|
289
|
+
tokens: {
|
|
290
|
+
"--mlf-color-bg": "#f1f4f7",
|
|
291
|
+
"--mlf-color-surface": "#ffffff",
|
|
292
|
+
"--mlf-color-surface-muted": "#e6ebf1",
|
|
293
|
+
"--mlf-color-surface-elevated": "#ffffff",
|
|
294
|
+
"--mlf-color-text": "#202934",
|
|
295
|
+
"--mlf-color-text-muted": "#5d6977",
|
|
296
|
+
"--mlf-color-border": "#cfd7e1",
|
|
297
|
+
"--mlf-color-border-strong": "#bbc6d3",
|
|
298
|
+
"--mlf-color-accent": "#375a7f",
|
|
299
|
+
"--mlf-color-accent-hover": "#27445f",
|
|
300
|
+
"--mlf-color-accent-soft": "rgba(55, 90, 127, 0.12)",
|
|
301
|
+
"--mlf-color-success": "#1f8a5b",
|
|
302
|
+
"--mlf-color-warning": "#c17c1f",
|
|
303
|
+
"--mlf-color-danger": "#be3a34",
|
|
304
|
+
"--mlf-color-danger-soft": "rgba(190, 58, 52, 0.12)",
|
|
305
|
+
"--mlf-color-focus-ring": "rgba(55, 90, 127, 0.24)",
|
|
306
|
+
"--mlf-color-overlay": "rgba(255, 255, 255, 0.78)",
|
|
307
|
+
"--mlf-color-hover-surface": "#dbe2ea",
|
|
308
|
+
"--mlf-color-chart-track": "rgba(32, 41, 52, 0.12)"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
dark: {
|
|
312
|
+
colorScheme: "dark",
|
|
313
|
+
tokens: {
|
|
314
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(0, 0, 0, 0.45)",
|
|
315
|
+
"--mlf-shadow-md": "0 14px 30px rgba(0, 0, 0, 0.35)",
|
|
316
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(0, 0, 0, 0.28)",
|
|
317
|
+
"--mlf-color-bg": "#0f1318",
|
|
318
|
+
"--mlf-color-surface": "#171c22",
|
|
319
|
+
"--mlf-color-surface-muted": "#202731",
|
|
320
|
+
"--mlf-color-surface-elevated": "#24303d",
|
|
321
|
+
"--mlf-color-text": "#ebf1f7",
|
|
322
|
+
"--mlf-color-text-muted": "#9ca8b5",
|
|
323
|
+
"--mlf-color-border": "#2c3642",
|
|
324
|
+
"--mlf-color-border-strong": "#3b4754",
|
|
325
|
+
"--mlf-color-accent": "#4ea1ff",
|
|
326
|
+
"--mlf-color-accent-hover": "#82bbff",
|
|
327
|
+
"--mlf-color-accent-soft": "rgba(78, 161, 255, 0.18)",
|
|
328
|
+
"--mlf-color-success": "#37c78b",
|
|
329
|
+
"--mlf-color-warning": "#ffb454",
|
|
330
|
+
"--mlf-color-danger": "#ff6a61",
|
|
331
|
+
"--mlf-color-danger-soft": "rgba(255, 106, 97, 0.14)",
|
|
332
|
+
"--mlf-color-focus-ring": "rgba(78, 161, 255, 0.34)",
|
|
333
|
+
"--mlf-color-overlay": "rgba(23, 28, 34, 0.84)",
|
|
334
|
+
"--mlf-color-hover-surface": "#24303d",
|
|
335
|
+
"--mlf-color-chart-track": "rgba(156, 168, 181, 0.18)"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}, d = {
|
|
340
|
+
id: "neutral",
|
|
341
|
+
label: "Neutral",
|
|
342
|
+
schemes: {
|
|
343
|
+
light: {
|
|
344
|
+
colorScheme: "light",
|
|
345
|
+
tokens: n
|
|
346
|
+
},
|
|
347
|
+
dark: {
|
|
348
|
+
colorScheme: "dark",
|
|
349
|
+
tokens: {
|
|
350
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(0, 0, 0, 0.45)",
|
|
351
|
+
"--mlf-shadow-md": "0 14px 30px rgba(0, 0, 0, 0.35)",
|
|
352
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(0, 0, 0, 0.28)",
|
|
353
|
+
"--mlf-color-bg": "#12161c",
|
|
354
|
+
"--mlf-color-surface": "#181d24",
|
|
355
|
+
"--mlf-color-surface-muted": "#212832",
|
|
356
|
+
"--mlf-color-surface-elevated": "#202731",
|
|
357
|
+
"--mlf-color-text": "#ebf1f7",
|
|
358
|
+
"--mlf-color-text-muted": "#a5b1bd",
|
|
359
|
+
"--mlf-color-border": "#313a47",
|
|
360
|
+
"--mlf-color-border-strong": "#414b58",
|
|
361
|
+
"--mlf-color-accent": "#71a7ff",
|
|
362
|
+
"--mlf-color-accent-hover": "#93bdff",
|
|
363
|
+
"--mlf-color-accent-soft": "rgba(113, 167, 255, 0.16)",
|
|
364
|
+
"--mlf-color-success": "#42c88e",
|
|
365
|
+
"--mlf-color-warning": "#ffbe5c",
|
|
366
|
+
"--mlf-color-danger": "#ff7a72",
|
|
367
|
+
"--mlf-color-danger-soft": "rgba(255, 122, 114, 0.14)",
|
|
368
|
+
"--mlf-color-focus-ring": "rgba(113, 167, 255, 0.3)",
|
|
369
|
+
"--mlf-color-overlay": "rgba(18, 22, 28, 0.84)",
|
|
370
|
+
"--mlf-color-hover-surface": "#2a3440",
|
|
371
|
+
"--mlf-color-chart-track": "rgba(165, 177, 189, 0.18)"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}, f = {
|
|
376
|
+
id: "sage",
|
|
377
|
+
label: "Sage",
|
|
378
|
+
schemes: {
|
|
379
|
+
light: {
|
|
380
|
+
colorScheme: "light",
|
|
381
|
+
tokens: {
|
|
382
|
+
"--mlf-color-bg": "#f2f6f1",
|
|
383
|
+
"--mlf-color-surface": "#fbfdfb",
|
|
384
|
+
"--mlf-color-surface-muted": "#e8efe6",
|
|
385
|
+
"--mlf-color-surface-elevated": "#ffffff",
|
|
386
|
+
"--mlf-color-text": "#203126",
|
|
387
|
+
"--mlf-color-text-muted": "#5e7264",
|
|
388
|
+
"--mlf-color-border": "#cfdbcf",
|
|
389
|
+
"--mlf-color-border-strong": "#bbccbc",
|
|
390
|
+
"--mlf-color-accent": "#2f7d57",
|
|
391
|
+
"--mlf-color-accent-hover": "#256847",
|
|
392
|
+
"--mlf-color-accent-soft": "rgba(47, 125, 87, 0.12)",
|
|
393
|
+
"--mlf-color-success": "#2d8a57",
|
|
394
|
+
"--mlf-color-warning": "#bd7d29",
|
|
395
|
+
"--mlf-color-danger": "#b94a48",
|
|
396
|
+
"--mlf-color-danger-soft": "rgba(185, 74, 72, 0.12)",
|
|
397
|
+
"--mlf-color-focus-ring": "rgba(47, 125, 87, 0.24)",
|
|
398
|
+
"--mlf-color-overlay": "rgba(251, 253, 251, 0.78)",
|
|
399
|
+
"--mlf-color-hover-surface": "#dde9db",
|
|
400
|
+
"--mlf-color-chart-track": "rgba(32, 49, 38, 0.12)"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
dark: {
|
|
404
|
+
colorScheme: "dark",
|
|
405
|
+
tokens: {
|
|
406
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(0, 0, 0, 0.45)",
|
|
407
|
+
"--mlf-shadow-md": "0 14px 30px rgba(0, 0, 0, 0.35)",
|
|
408
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(0, 0, 0, 0.28)",
|
|
409
|
+
"--mlf-color-bg": "#121a15",
|
|
410
|
+
"--mlf-color-surface": "#182119",
|
|
411
|
+
"--mlf-color-surface-muted": "#203024",
|
|
412
|
+
"--mlf-color-surface-elevated": "#24372a",
|
|
413
|
+
"--mlf-color-text": "#edf5ef",
|
|
414
|
+
"--mlf-color-text-muted": "#a8b9aa",
|
|
415
|
+
"--mlf-color-border": "#304234",
|
|
416
|
+
"--mlf-color-border-strong": "#3f5544",
|
|
417
|
+
"--mlf-color-accent": "#59b07d",
|
|
418
|
+
"--mlf-color-accent-hover": "#74c492",
|
|
419
|
+
"--mlf-color-accent-soft": "rgba(89, 176, 125, 0.16)",
|
|
420
|
+
"--mlf-color-success": "#67d595",
|
|
421
|
+
"--mlf-color-warning": "#efbb67",
|
|
422
|
+
"--mlf-color-danger": "#ff8e8a",
|
|
423
|
+
"--mlf-color-danger-soft": "rgba(255, 142, 138, 0.14)",
|
|
424
|
+
"--mlf-color-focus-ring": "rgba(89, 176, 125, 0.3)",
|
|
425
|
+
"--mlf-color-overlay": "rgba(18, 26, 21, 0.84)",
|
|
426
|
+
"--mlf-color-hover-surface": "#2a3d30",
|
|
427
|
+
"--mlf-color-chart-track": "rgba(168, 185, 170, 0.18)"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, p = {
|
|
432
|
+
id: "sunset",
|
|
433
|
+
label: "Sunset",
|
|
434
|
+
schemes: {
|
|
435
|
+
light: {
|
|
436
|
+
colorScheme: "light",
|
|
437
|
+
tokens: {
|
|
438
|
+
"--mlf-color-bg": "#fff6f0",
|
|
439
|
+
"--mlf-color-surface": "#fffdfb",
|
|
440
|
+
"--mlf-color-surface-muted": "#ffe9dd",
|
|
441
|
+
"--mlf-color-surface-elevated": "#ffffff",
|
|
442
|
+
"--mlf-color-text": "#3b241d",
|
|
443
|
+
"--mlf-color-text-muted": "#7f5a50",
|
|
444
|
+
"--mlf-color-border": "#f0cdbb",
|
|
445
|
+
"--mlf-color-border-strong": "#e0b59f",
|
|
446
|
+
"--mlf-color-accent": "#d96a3a",
|
|
447
|
+
"--mlf-color-accent-hover": "#be5628",
|
|
448
|
+
"--mlf-color-accent-soft": "rgba(217, 106, 58, 0.14)",
|
|
449
|
+
"--mlf-color-success": "#2e8c63",
|
|
450
|
+
"--mlf-color-warning": "#d18a20",
|
|
451
|
+
"--mlf-color-danger": "#ca4a45",
|
|
452
|
+
"--mlf-color-danger-soft": "rgba(202, 74, 69, 0.12)",
|
|
453
|
+
"--mlf-color-focus-ring": "rgba(217, 106, 58, 0.24)",
|
|
454
|
+
"--mlf-color-overlay": "rgba(255, 253, 251, 0.8)",
|
|
455
|
+
"--mlf-color-hover-surface": "#ffdcca",
|
|
456
|
+
"--mlf-color-chart-track": "rgba(59, 36, 29, 0.12)"
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
dark: {
|
|
460
|
+
colorScheme: "dark",
|
|
461
|
+
tokens: {
|
|
462
|
+
"--mlf-shadow-sm": "0 1px 3px rgba(0, 0, 0, 0.45)",
|
|
463
|
+
"--mlf-shadow-md": "0 14px 30px rgba(0, 0, 0, 0.35)",
|
|
464
|
+
"--mlf-shadow-lg": "0 24px 60px rgba(0, 0, 0, 0.28)",
|
|
465
|
+
"--mlf-color-bg": "#1e1512",
|
|
466
|
+
"--mlf-color-surface": "#261b18",
|
|
467
|
+
"--mlf-color-surface-muted": "#32231f",
|
|
468
|
+
"--mlf-color-surface-elevated": "#392925",
|
|
469
|
+
"--mlf-color-text": "#fff1ea",
|
|
470
|
+
"--mlf-color-text-muted": "#d3b0a3",
|
|
471
|
+
"--mlf-color-border": "#513830",
|
|
472
|
+
"--mlf-color-border-strong": "#68473d",
|
|
473
|
+
"--mlf-color-accent": "#ff986b",
|
|
474
|
+
"--mlf-color-accent-hover": "#ffb089",
|
|
475
|
+
"--mlf-color-accent-soft": "rgba(255, 152, 107, 0.16)",
|
|
476
|
+
"--mlf-color-success": "#57c694",
|
|
477
|
+
"--mlf-color-warning": "#ffc36d",
|
|
478
|
+
"--mlf-color-danger": "#ff8d86",
|
|
479
|
+
"--mlf-color-danger-soft": "rgba(255, 141, 134, 0.14)",
|
|
480
|
+
"--mlf-color-focus-ring": "rgba(255, 152, 107, 0.3)",
|
|
481
|
+
"--mlf-color-overlay": "rgba(30, 21, 18, 0.84)",
|
|
482
|
+
"--mlf-color-hover-surface": "#422d27",
|
|
483
|
+
"--mlf-color-chart-track": "rgba(211, 176, 163, 0.18)"
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}, m = (e) => {
|
|
488
|
+
if (typeof e == "object" && e && !Object.isFrozen(e)) {
|
|
489
|
+
Object.freeze(e);
|
|
490
|
+
for (let t of Object.values(e)) m(t);
|
|
491
|
+
}
|
|
492
|
+
return e;
|
|
493
|
+
}, h = (e) => {
|
|
494
|
+
if (!e.id?.trim()) throw Error("[mlform] RecipeManifest missing or empty \"id\"");
|
|
495
|
+
if (!e.label?.trim()) throw Error(`[mlform] Recipe "${e.id}" missing or empty "label"`);
|
|
496
|
+
if (!e.density) throw Error(`[mlform] Recipe "${e.id}" missing "density"`);
|
|
497
|
+
if (!e.motion) throw Error(`[mlform] Recipe "${e.id}" missing "motion"`);
|
|
498
|
+
return m({
|
|
499
|
+
...e,
|
|
500
|
+
tokens: e.tokens ? { ...e.tokens } : void 0,
|
|
501
|
+
components: e.components ? Object.fromEntries(Object.entries(e.components).map(([e, t]) => [e, t && { tokens: { ...t.tokens } }])) : void 0
|
|
502
|
+
});
|
|
503
|
+
}, g = (e) => {
|
|
504
|
+
if (!e.id?.trim()) throw Error("[mlform] ThemeManifest missing or empty \"id\"");
|
|
505
|
+
if (!e.label?.trim()) throw Error(`[mlform] Theme "${e.id}" missing or empty "label"`);
|
|
506
|
+
if (!e.schemes?.light?.tokens) throw Error(`[mlform] Theme "${e.id}" missing "schemes.light.tokens"`);
|
|
507
|
+
return m({
|
|
508
|
+
...e,
|
|
509
|
+
schemes: {
|
|
510
|
+
light: {
|
|
511
|
+
...e.schemes.light,
|
|
512
|
+
tokens: { ...e.schemes.light.tokens }
|
|
513
|
+
},
|
|
514
|
+
...e.schemes.dark ? { dark: {
|
|
515
|
+
...e.schemes.dark,
|
|
516
|
+
tokens: { ...e.schemes.dark.tokens }
|
|
517
|
+
} } : {}
|
|
518
|
+
},
|
|
519
|
+
variants: e.variants ? Object.fromEntries(Object.entries(e.variants).map(([e, t]) => [e, {
|
|
520
|
+
baseScheme: t.baseScheme,
|
|
521
|
+
tokens: { ...t.tokens }
|
|
522
|
+
}])) : void 0,
|
|
523
|
+
sharedTokens: e.sharedTokens ? { ...e.sharedTokens } : void 0
|
|
524
|
+
});
|
|
525
|
+
}, _ = class e {
|
|
526
|
+
#e = /* @__PURE__ */ new Map();
|
|
527
|
+
#t = /* @__PURE__ */ new Map();
|
|
528
|
+
#n = /* @__PURE__ */ new Map();
|
|
529
|
+
#r = /* @__PURE__ */ new Set();
|
|
530
|
+
#i(e) {
|
|
531
|
+
for (let t of this.#r) t(e);
|
|
532
|
+
}
|
|
533
|
+
registerTheme(e) {
|
|
534
|
+
let t = g(e), n = this.#n.get(e.id);
|
|
535
|
+
if (n && n.size > 0) {
|
|
536
|
+
let r = { ...t.variants };
|
|
537
|
+
for (let [e, t] of n) r[e] = t;
|
|
538
|
+
t = m({
|
|
539
|
+
...t,
|
|
540
|
+
variants: r
|
|
541
|
+
}), this.#n.delete(e.id);
|
|
542
|
+
}
|
|
543
|
+
return this.#e.set(e.id, t), this.#i({
|
|
544
|
+
type: "theme-registered",
|
|
545
|
+
id: e.id
|
|
546
|
+
}), this;
|
|
547
|
+
}
|
|
548
|
+
registerVariant(e, t, n) {
|
|
549
|
+
let r = m({
|
|
550
|
+
baseScheme: n.baseScheme,
|
|
551
|
+
tokens: { ...n.tokens }
|
|
552
|
+
}), i = this.#e.get(e);
|
|
553
|
+
if (i) {
|
|
554
|
+
let n = {
|
|
555
|
+
...i.variants,
|
|
556
|
+
[t]: r
|
|
557
|
+
};
|
|
558
|
+
this.#e.set(e, m({
|
|
559
|
+
...i,
|
|
560
|
+
variants: n
|
|
561
|
+
})), this.#i({
|
|
562
|
+
type: "theme-registered",
|
|
563
|
+
id: e
|
|
564
|
+
});
|
|
565
|
+
} else this.#n.has(e) || this.#n.set(e, /* @__PURE__ */ new Map()), this.#n.get(e).set(t, r);
|
|
566
|
+
return this;
|
|
567
|
+
}
|
|
568
|
+
registerRecipe(e) {
|
|
569
|
+
return this.#t.set(e.id, h(e)), this.#i({
|
|
570
|
+
type: "recipe-registered",
|
|
571
|
+
id: e.id
|
|
572
|
+
}), this;
|
|
573
|
+
}
|
|
574
|
+
removeTheme(e) {
|
|
575
|
+
return this.#n.delete(e), this.#e.delete(e) && this.#i({
|
|
576
|
+
type: "theme-removed",
|
|
577
|
+
id: e
|
|
578
|
+
}), this;
|
|
579
|
+
}
|
|
580
|
+
removeRecipe(e) {
|
|
581
|
+
return this.#t.delete(e) && this.#i({
|
|
582
|
+
type: "recipe-removed",
|
|
583
|
+
id: e
|
|
584
|
+
}), this;
|
|
585
|
+
}
|
|
586
|
+
getTheme(e) {
|
|
587
|
+
return this.#e.get(e);
|
|
588
|
+
}
|
|
589
|
+
getRecipe(e) {
|
|
590
|
+
return this.#t.get(e);
|
|
591
|
+
}
|
|
592
|
+
listThemes() {
|
|
593
|
+
return [...this.#e.values()];
|
|
594
|
+
}
|
|
595
|
+
listRecipes() {
|
|
596
|
+
return [...this.#t.values()];
|
|
597
|
+
}
|
|
598
|
+
onChange(e) {
|
|
599
|
+
return this.#r.add(e), () => {
|
|
600
|
+
this.#r.delete(e);
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
clone() {
|
|
604
|
+
let t = new e();
|
|
605
|
+
for (let [e, n] of this.#e) t.#e.set(e, n);
|
|
606
|
+
for (let [e, n] of this.#t) t.#t.set(e, n);
|
|
607
|
+
for (let [e, n] of this.#n) t.#n.set(e, new Map(n));
|
|
608
|
+
return t;
|
|
609
|
+
}
|
|
610
|
+
}, v = () => new _(), y = [
|
|
611
|
+
d,
|
|
612
|
+
l,
|
|
613
|
+
f,
|
|
614
|
+
p,
|
|
615
|
+
u
|
|
616
|
+
], b = [
|
|
617
|
+
o,
|
|
618
|
+
s,
|
|
619
|
+
c,
|
|
620
|
+
a
|
|
621
|
+
], x = () => {
|
|
622
|
+
let e = v();
|
|
623
|
+
for (let t of y) e.registerTheme(t);
|
|
624
|
+
for (let t of b) e.registerRecipe(t);
|
|
625
|
+
return e;
|
|
626
|
+
}, S = x(), C = new Set(i), ee = (t) => {
|
|
627
|
+
for (let n of e) if (t.startsWith(`--mlf-${n}-`)) return n;
|
|
628
|
+
return null;
|
|
629
|
+
}, te = (e) => {
|
|
630
|
+
for (let t of Object.keys(e)) {
|
|
631
|
+
if (!C.has(t)) throw Error(`[mlform] Unknown global token "${t}"`);
|
|
632
|
+
let e = ee(t);
|
|
633
|
+
if (e) throw Error(`[mlform] Token "${t}" belongs to component "${e}". Use defineComponentTokens("${e}", ...)`);
|
|
634
|
+
}
|
|
635
|
+
return { ...e };
|
|
636
|
+
}, ne = (e, t) => {
|
|
637
|
+
for (let n of Object.keys(t)) {
|
|
638
|
+
if (!C.has(n)) throw Error(`[mlform] Unknown token "${n}" for component "${e}"`);
|
|
639
|
+
if (!n.startsWith(`--mlf-${e}-`)) throw Error(`[mlform] Token "${n}" does not belong to component "${e}"`);
|
|
640
|
+
}
|
|
641
|
+
return { tokens: { ...t } };
|
|
642
|
+
}, w = new Set(i), T = /var\(\s*(--mlf-[a-z0-9-]+)\s*[,)]/g, E = (e, t, n) => {
|
|
643
|
+
if (n) for (let r of Object.keys(n)) !r.startsWith("--mlf-") || w.has(r) || e.push({
|
|
644
|
+
code: "unknown-token-key",
|
|
645
|
+
path: t,
|
|
646
|
+
value: r,
|
|
647
|
+
message: `[mlform] Unknown design-system token "${r}" at ${t}`
|
|
648
|
+
});
|
|
649
|
+
}, D = (e, t, n, r) => {
|
|
650
|
+
if (r) for (let i of Object.keys(r)) !i.startsWith("--mlf-") || !w.has(i) || i.startsWith(`--mlf-${t}-`) || e.push({
|
|
651
|
+
code: "misplaced-component-token",
|
|
652
|
+
path: n,
|
|
653
|
+
value: i,
|
|
654
|
+
message: `[mlform] Token "${i}" does not belong to component "${t}" at ${n}`
|
|
655
|
+
});
|
|
656
|
+
}, re = (e, t, n) => {
|
|
657
|
+
if (n) for (let [r, i] of Object.entries(n)) {
|
|
658
|
+
T.lastIndex = 0;
|
|
659
|
+
let n;
|
|
660
|
+
for (; (n = T.exec(i)) !== null;) {
|
|
661
|
+
let i = n[1];
|
|
662
|
+
!t.has(i) && w.has(i) && e.push({
|
|
663
|
+
code: "broken-token-reference",
|
|
664
|
+
path: r,
|
|
665
|
+
value: i,
|
|
666
|
+
message: `[mlform] Token "${r}" references "${i}" which is not present in the resolved token set`
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}, O = (e) => {
|
|
671
|
+
let t = /* @__PURE__ */ new Set();
|
|
672
|
+
return e.filter((e) => {
|
|
673
|
+
let n = [
|
|
674
|
+
e.code,
|
|
675
|
+
e.path ?? "",
|
|
676
|
+
e.value ?? "",
|
|
677
|
+
e.message
|
|
678
|
+
].join("|");
|
|
679
|
+
return t.has(n) ? !1 : (t.add(n), !0);
|
|
680
|
+
});
|
|
681
|
+
}, k = (t, n, r, i) => {
|
|
682
|
+
let a = [];
|
|
683
|
+
typeof t.theme == "string" && !n.getTheme(t.theme) && a.push({
|
|
684
|
+
code: "unknown-theme-id",
|
|
685
|
+
path: "theme",
|
|
686
|
+
value: t.theme,
|
|
687
|
+
message: `[mlform] Unknown theme "${t.theme}". Falling back to "${r.id}"`
|
|
688
|
+
}), typeof t.recipe == "string" && !n.getRecipe(t.recipe) && a.push({
|
|
689
|
+
code: "unknown-recipe-id",
|
|
690
|
+
path: "recipe",
|
|
691
|
+
value: t.recipe,
|
|
692
|
+
message: `[mlform] Unknown recipe "${t.recipe}". Falling back to "${i.id}"`
|
|
693
|
+
}), E(a, `theme "${r.id}".sharedTokens`, r.sharedTokens), E(a, `theme "${r.id}".schemes.light.tokens`, r.schemes.light.tokens), E(a, `theme "${r.id}".schemes.dark.tokens`, r.schemes.dark?.tokens);
|
|
694
|
+
for (let [e, t] of Object.entries(r.variants ?? {})) E(a, `theme "${r.id}".variants.${e}.tokens`, t.tokens);
|
|
695
|
+
E(a, `recipe "${i.id}".tokens`, i.tokens);
|
|
696
|
+
for (let [e, t] of Object.entries(i.components ?? {})) E(a, `recipe "${i.id}".components.${e}.tokens`, t?.tokens), D(a, e, `recipe "${i.id}".components.${e}.tokens`, t?.tokens);
|
|
697
|
+
E(a, "overrides.tokens", t.overrides?.tokens);
|
|
698
|
+
for (let n of e) {
|
|
699
|
+
let e = t.overrides?.components?.[n];
|
|
700
|
+
E(a, `overrides.components.${n}.tokens`, e?.tokens), D(a, n, `overrides.components.${n}.tokens`, e?.tokens);
|
|
701
|
+
}
|
|
702
|
+
return O(a);
|
|
703
|
+
}, ie = (e, t, n) => {
|
|
704
|
+
if (!e.variant) return [];
|
|
705
|
+
let r = t.variants?.[e.variant];
|
|
706
|
+
return r ? r.baseScheme === n ? [] : [{
|
|
707
|
+
code: "invalid-theme-variant",
|
|
708
|
+
path: "variant",
|
|
709
|
+
value: e.variant,
|
|
710
|
+
message: `[mlform] Theme variant "${e.variant}" targets "${r.baseScheme}" but effective scheme is "${n}". Variant was ignored.`
|
|
711
|
+
}] : [{
|
|
712
|
+
code: "invalid-theme-variant",
|
|
713
|
+
path: "variant",
|
|
714
|
+
value: e.variant,
|
|
715
|
+
message: `[mlform] Theme "${t.id}" does not define variant "${e.variant}"`
|
|
716
|
+
}];
|
|
717
|
+
}, ae = (e) => {
|
|
718
|
+
let t = [];
|
|
719
|
+
return re(t, new Set(Object.keys(e)), e), O(t);
|
|
720
|
+
}, A = (e, t) => {
|
|
721
|
+
if (t.length !== 0) {
|
|
722
|
+
for (let n of t) e.onWarning?.(n);
|
|
723
|
+
if (e.strict) throw Error(t.map((e) => e.message).join("\n"));
|
|
724
|
+
}
|
|
725
|
+
}, j = "light", M = (e, t) => t === "light" || !!e.schemes.dark, oe = (e, t, n = {}) => {
|
|
726
|
+
let r = e.mode ?? "auto";
|
|
727
|
+
return r === "light" || r === "dark" ? r === "dark" && !t.schemes.dark ? {
|
|
728
|
+
requestedMode: r,
|
|
729
|
+
effectiveScheme: j,
|
|
730
|
+
effectiveModeSource: "theme-fallback"
|
|
731
|
+
} : {
|
|
732
|
+
requestedMode: r,
|
|
733
|
+
effectiveScheme: r,
|
|
734
|
+
effectiveModeSource: "explicit"
|
|
735
|
+
} : r === "auto" ? n.systemScheme && M(t, n.systemScheme) ? {
|
|
736
|
+
requestedMode: r,
|
|
737
|
+
effectiveScheme: n.systemScheme,
|
|
738
|
+
effectiveModeSource: "system"
|
|
739
|
+
} : {
|
|
740
|
+
requestedMode: r,
|
|
741
|
+
effectiveScheme: j,
|
|
742
|
+
effectiveModeSource: "theme-fallback"
|
|
743
|
+
} : n.inheritedScheme && M(t, n.inheritedScheme) ? {
|
|
744
|
+
requestedMode: r,
|
|
745
|
+
effectiveScheme: n.inheritedScheme,
|
|
746
|
+
effectiveModeSource: n.inheritedSource ?? "default"
|
|
747
|
+
} : {
|
|
748
|
+
requestedMode: r,
|
|
749
|
+
effectiveScheme: j,
|
|
750
|
+
effectiveModeSource: "theme-fallback"
|
|
751
|
+
};
|
|
752
|
+
}, se = (e, t) => {
|
|
753
|
+
let n = e.recipe, r = t.getRecipe("default") ?? o;
|
|
754
|
+
return n && typeof n != "string" ? n : typeof n == "string" ? t.getRecipe(n) ?? r : r;
|
|
755
|
+
}, ce = (e, t) => {
|
|
756
|
+
let n = e.theme, r = t.getTheme("neutral") ?? d;
|
|
757
|
+
return n && typeof n != "string" ? n : typeof n == "string" ? t.getTheme(n) ?? r : r;
|
|
758
|
+
}, N = (t) => {
|
|
759
|
+
let n = {};
|
|
760
|
+
for (let r of e) {
|
|
761
|
+
let e = t[r]?.tokens;
|
|
762
|
+
e && Object.assign(n, e);
|
|
763
|
+
}
|
|
764
|
+
return n;
|
|
765
|
+
}, le = {
|
|
766
|
+
...r,
|
|
767
|
+
...N(t)
|
|
768
|
+
}, ue = {
|
|
769
|
+
"--mlf-border-width": "1.5px",
|
|
770
|
+
"--mlf-ring-width": "5px",
|
|
771
|
+
"--mlf-color-border": "var(--mlf-color-border-strong)"
|
|
772
|
+
}, de = {
|
|
773
|
+
compact: {
|
|
774
|
+
"--mlf-shell-gap": "1rem",
|
|
775
|
+
"--mlf-layout-gap": "0.85rem",
|
|
776
|
+
"--mlf-section-gap": "0.85rem",
|
|
777
|
+
"--mlf-pane-gap": "0.85rem",
|
|
778
|
+
"--mlf-control-height": "2.625rem",
|
|
779
|
+
"--mlf-control-padding-inline": "0.8rem",
|
|
780
|
+
"--mlf-control-padding-block": "0.65rem",
|
|
781
|
+
"--mlf-pane-min-width": "18rem"
|
|
782
|
+
},
|
|
783
|
+
comfortable: {
|
|
784
|
+
"--mlf-shell-gap": "1.2rem",
|
|
785
|
+
"--mlf-layout-gap": "1rem",
|
|
786
|
+
"--mlf-section-gap": "1rem",
|
|
787
|
+
"--mlf-pane-gap": "1rem",
|
|
788
|
+
"--mlf-control-height": "3rem",
|
|
789
|
+
"--mlf-control-padding-inline": "0.92rem",
|
|
790
|
+
"--mlf-control-padding-block": "0.78rem",
|
|
791
|
+
"--mlf-pane-min-width": "20rem"
|
|
792
|
+
},
|
|
793
|
+
spacious: {
|
|
794
|
+
"--mlf-shell-gap": "1.4rem",
|
|
795
|
+
"--mlf-layout-gap": "1.2rem",
|
|
796
|
+
"--mlf-section-gap": "1.2rem",
|
|
797
|
+
"--mlf-pane-gap": "1.2rem",
|
|
798
|
+
"--mlf-control-height": "3.125rem",
|
|
799
|
+
"--mlf-control-padding-inline": "1rem",
|
|
800
|
+
"--mlf-control-padding-block": "0.9rem",
|
|
801
|
+
"--mlf-pane-min-width": "22rem"
|
|
802
|
+
}
|
|
803
|
+
}, fe = {
|
|
804
|
+
"--mlf-color-bg": "Canvas",
|
|
805
|
+
"--mlf-color-surface": "Canvas",
|
|
806
|
+
"--mlf-color-surface-muted": "Canvas",
|
|
807
|
+
"--mlf-color-surface-elevated": "Canvas",
|
|
808
|
+
"--mlf-color-text": "CanvasText",
|
|
809
|
+
"--mlf-color-text-muted": "CanvasText",
|
|
810
|
+
"--mlf-color-text-inverse": "Canvas",
|
|
811
|
+
"--mlf-color-border": "ButtonBorder",
|
|
812
|
+
"--mlf-color-border-strong": "CanvasText",
|
|
813
|
+
"--mlf-color-accent": "LinkText",
|
|
814
|
+
"--mlf-color-accent-hover": "ActiveText",
|
|
815
|
+
"--mlf-color-accent-soft": "Highlight",
|
|
816
|
+
"--mlf-color-success": "CanvasText",
|
|
817
|
+
"--mlf-color-warning": "CanvasText",
|
|
818
|
+
"--mlf-color-danger": "CanvasText",
|
|
819
|
+
"--mlf-color-danger-soft": "Canvas",
|
|
820
|
+
"--mlf-color-focus-ring": "Highlight",
|
|
821
|
+
"--mlf-color-overlay": "Canvas",
|
|
822
|
+
"--mlf-color-hover-surface": "Highlight",
|
|
823
|
+
"--mlf-color-chart-track": "ButtonBorder",
|
|
824
|
+
"--mlf-border-width": "2px",
|
|
825
|
+
"--mlf-ring-width": "3px",
|
|
826
|
+
"--mlf-shadow-sm": "none",
|
|
827
|
+
"--mlf-shadow-md": "none",
|
|
828
|
+
"--mlf-shadow-lg": "none",
|
|
829
|
+
"--mlf-shell-overlay": "Canvas",
|
|
830
|
+
"--mlf-shell-header-bg": "Canvas",
|
|
831
|
+
"--mlf-hero-bg": "Canvas",
|
|
832
|
+
"--mlf-hero-border": "ButtonBorder",
|
|
833
|
+
"--mlf-hero-shadow": "none",
|
|
834
|
+
"--mlf-field-bg": "Canvas",
|
|
835
|
+
"--mlf-field-border-invalid": "CanvasText",
|
|
836
|
+
"--mlf-field-shadow": "none",
|
|
837
|
+
"--mlf-report-bg": "Canvas",
|
|
838
|
+
"--mlf-report-shadow": "none",
|
|
839
|
+
"--mlf-report-hero-bg": "Canvas",
|
|
840
|
+
"--mlf-input-shadow-focus": "0 0 0 var(--mlf-ring-width) Highlight",
|
|
841
|
+
"--mlf-submit-bg": "ButtonFace",
|
|
842
|
+
"--mlf-submit-bg-hover": "Highlight",
|
|
843
|
+
"--mlf-submit-color": "ButtonText",
|
|
844
|
+
"--mlf-submit-shadow": "none",
|
|
845
|
+
"--mlf-submit-shadow-hover": "none",
|
|
846
|
+
"--mlf-submit-focus-ring": "0 0 0 var(--mlf-ring-width) Highlight",
|
|
847
|
+
"--mlf-error-bg": "Canvas",
|
|
848
|
+
"--mlf-error-border": "CanvasText",
|
|
849
|
+
"--mlf-chart-fill-bg": "Highlight"
|
|
850
|
+
}, pe = {
|
|
851
|
+
none: {
|
|
852
|
+
"--mlf-motion-fast": "0ms linear",
|
|
853
|
+
"--mlf-motion-base": "0ms linear",
|
|
854
|
+
"--mlf-motion-slow": "0ms linear",
|
|
855
|
+
"--mlf-transition-duration": "0ms",
|
|
856
|
+
"--mlf-transition-easing": "linear"
|
|
857
|
+
},
|
|
858
|
+
subtle: {
|
|
859
|
+
"--mlf-motion-fast": "120ms ease",
|
|
860
|
+
"--mlf-motion-base": "180ms ease",
|
|
861
|
+
"--mlf-motion-slow": "240ms ease",
|
|
862
|
+
"--mlf-transition-duration": "180ms",
|
|
863
|
+
"--mlf-transition-easing": "ease-in-out"
|
|
864
|
+
},
|
|
865
|
+
standard: {
|
|
866
|
+
"--mlf-motion-fast": "160ms ease",
|
|
867
|
+
"--mlf-motion-base": "220ms ease",
|
|
868
|
+
"--mlf-motion-slow": "300ms ease",
|
|
869
|
+
"--mlf-transition-duration": "250ms",
|
|
870
|
+
"--mlf-transition-easing": "ease-in-out"
|
|
871
|
+
}
|
|
872
|
+
}, me = (e, t, n) => {
|
|
873
|
+
let r = t === "dark" ? e.schemes.dark?.tokens ?? e.schemes.light.tokens : e.schemes.light.tokens, i = n && e.variants?.[n]?.baseScheme === t ? e.variants[n].tokens : {};
|
|
874
|
+
return {
|
|
875
|
+
...e.sharedTokens,
|
|
876
|
+
...r,
|
|
877
|
+
...i
|
|
878
|
+
};
|
|
879
|
+
}, he = e.map((e) => [`--mlf-${e}-`, e]), ge = (t) => {
|
|
880
|
+
let n = Object.fromEntries(e.map((e) => [e, {}]));
|
|
881
|
+
for (let [e, r] of Object.entries(t)) for (let [t, i] of he) if (e.startsWith(t)) {
|
|
882
|
+
n[i][e] = r;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
return Object.fromEntries(e.map((e) => [e, { tokens: n[e] }]));
|
|
886
|
+
}, _e = (e, t, n, r, i, a, o, s = {}) => {
|
|
887
|
+
let c = e.overrides?.density ?? (s.prefersMoreContrast ? "spacious" : n.density), l = e.overrides?.motion ?? (s.prefersReducedMotion ? "none" : n.motion), u = {
|
|
888
|
+
...e.overrides?.tokens,
|
|
889
|
+
...N(e.overrides?.components ?? {})
|
|
890
|
+
}, d = (e.variant && t.variants?.[e.variant]?.baseScheme === r ? e.variant : null) ?? (s.prefersMoreContrast && t.variants?.[`high-contrast-${r}`] ? `high-contrast-${r}` : null), f = s.prefersMoreContrast ? ue : {}, p = s.forcedColors ? fe : {}, m = {
|
|
891
|
+
...le,
|
|
892
|
+
...de[c],
|
|
893
|
+
...pe[l],
|
|
894
|
+
...f,
|
|
895
|
+
...me(t, r, d),
|
|
896
|
+
...n.tokens,
|
|
897
|
+
...N(n.components ?? {}),
|
|
898
|
+
...e.overrides?.tokens,
|
|
899
|
+
...N(e.overrides?.components ?? {}),
|
|
900
|
+
...p
|
|
901
|
+
}, h = ge(m);
|
|
902
|
+
return {
|
|
903
|
+
requestedMode: i,
|
|
904
|
+
effectiveScheme: r,
|
|
905
|
+
effectiveModeSource: a,
|
|
906
|
+
themeId: t.id,
|
|
907
|
+
variant: d,
|
|
908
|
+
recipeId: n.id,
|
|
909
|
+
density: c,
|
|
910
|
+
motion: l,
|
|
911
|
+
tokens: m,
|
|
912
|
+
tokenOverrides: u,
|
|
913
|
+
components: h,
|
|
914
|
+
warnings: o
|
|
915
|
+
};
|
|
916
|
+
}, ve = (e, t) => {
|
|
917
|
+
if (!e && !t) return;
|
|
918
|
+
let n = /* @__PURE__ */ new Map();
|
|
919
|
+
for (let r of [e?.components, t?.components]) if (r) for (let [e, t] of Object.entries(r)) t && n.set(e, { tokens: {
|
|
920
|
+
...n.get(e)?.tokens,
|
|
921
|
+
...t.tokens
|
|
922
|
+
} });
|
|
923
|
+
return {
|
|
924
|
+
density: t?.density ?? e?.density,
|
|
925
|
+
motion: t?.motion ?? e?.motion,
|
|
926
|
+
tokens: {
|
|
927
|
+
...e?.tokens,
|
|
928
|
+
...t?.tokens
|
|
929
|
+
},
|
|
930
|
+
components: n.size > 0 ? Object.fromEntries(n) : void 0
|
|
931
|
+
};
|
|
932
|
+
}, P = (...e) => e.reduce((e, t) => ({
|
|
933
|
+
mode: t?.mode ?? e.mode,
|
|
934
|
+
theme: t?.theme ?? e.theme,
|
|
935
|
+
recipe: t?.recipe ?? e.recipe,
|
|
936
|
+
variant: t?.variant ?? e.variant,
|
|
937
|
+
hostSchemeResolver: t?.hostSchemeResolver ?? e.hostSchemeResolver,
|
|
938
|
+
strict: t?.strict ?? e.strict,
|
|
939
|
+
onWarning: t?.onWarning ?? e.onWarning,
|
|
940
|
+
overrides: ve(e.overrides, t?.overrides)
|
|
941
|
+
}), {}), F = (e, t, n = "source-wins") => {
|
|
942
|
+
let r = new Map(t.map((e) => [e.from, e.to])), i = { ...e }, a = {};
|
|
943
|
+
for (let [o, s] of Object.entries(e)) {
|
|
944
|
+
let e = r.get(o) ?? o;
|
|
945
|
+
if (e in a) if (n === "source-wins") o !== e && (a[e] = s);
|
|
946
|
+
else if (n === "target-wins") o === e && (a[e] = s);
|
|
947
|
+
else {
|
|
948
|
+
let r = t.find((t) => t.to === e), o = r ? i[r.from] : void 0, c = i[e];
|
|
949
|
+
a[e] = o !== void 0 && c !== void 0 ? n(o, c, e) : n(a[e], s, e);
|
|
950
|
+
}
|
|
951
|
+
else a[e] = s;
|
|
952
|
+
}
|
|
953
|
+
return a;
|
|
954
|
+
}, ye = (e, t) => {
|
|
955
|
+
let n = Object.fromEntries(Object.entries(e.schemes).map(([e, n]) => [e, n && {
|
|
956
|
+
...n,
|
|
957
|
+
tokens: F(n.tokens, t)
|
|
958
|
+
}]));
|
|
959
|
+
return {
|
|
960
|
+
...e,
|
|
961
|
+
schemes: n,
|
|
962
|
+
sharedTokens: e.sharedTokens ? F(e.sharedTokens, t) : void 0
|
|
963
|
+
};
|
|
964
|
+
}, I = (e = {}, t = S, n = {}) => {
|
|
965
|
+
let r = ce(e, t), i = se(e, t), a = k(e, t, r, i);
|
|
966
|
+
A(e, a);
|
|
967
|
+
let o = oe(e, r, n), s = ie(e, r, o.effectiveScheme);
|
|
968
|
+
s.length > 0 && (a.push(...s), A(e, s));
|
|
969
|
+
let c = _e(e, r, i, o.effectiveScheme, o.requestedMode, o.effectiveModeSource, a, n), l = ae(c.tokens);
|
|
970
|
+
return l.length > 0 && (c.warnings.push(...l), A(e, l)), c;
|
|
971
|
+
}, be = { change: "ml-design-system-change" }, L = {
|
|
972
|
+
prefersDarkScheme: "(prefers-color-scheme: dark)",
|
|
973
|
+
prefersReducedMotion: "(prefers-reduced-motion: reduce)",
|
|
974
|
+
prefersMoreContrast: "(prefers-contrast: more)",
|
|
975
|
+
forcedColors: "(forced-colors: active)"
|
|
976
|
+
}, R = {
|
|
977
|
+
explicitScheme: "data-color-scheme",
|
|
978
|
+
inheritedScheme: "data-mlf-scheme",
|
|
979
|
+
effectiveScheme: "data-mlf-effective-scheme",
|
|
980
|
+
themeId: "data-mlf-theme-id",
|
|
981
|
+
variantId: "data-mlf-variant-id",
|
|
982
|
+
recipeId: "data-mlf-recipe-id",
|
|
983
|
+
density: "data-mlf-density",
|
|
984
|
+
motion: "data-mlf-motion",
|
|
985
|
+
signature: "data-mlf-signature",
|
|
986
|
+
style: "style",
|
|
987
|
+
class: "class"
|
|
988
|
+
}, xe = [R.explicitScheme], Se = [
|
|
989
|
+
R.inheritedScheme,
|
|
990
|
+
R.effectiveScheme,
|
|
991
|
+
R.explicitScheme,
|
|
992
|
+
R.style,
|
|
993
|
+
R.class
|
|
994
|
+
], Ce = (e) => {
|
|
995
|
+
let t = 2166136261;
|
|
996
|
+
for (let n = 0; n < e.length; n += 1) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
997
|
+
return (t >>> 0).toString(16).padStart(8, "0");
|
|
998
|
+
}, z = (e) => `v1:${Ce([
|
|
999
|
+
e.effectiveScheme,
|
|
1000
|
+
e.themeId,
|
|
1001
|
+
e.variant ?? "",
|
|
1002
|
+
e.recipeId,
|
|
1003
|
+
e.density,
|
|
1004
|
+
e.motion,
|
|
1005
|
+
...Object.entries(e.tokens).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${e}:${t}`)
|
|
1006
|
+
].join("|"))}`, B = (e) => {
|
|
1007
|
+
let t = {
|
|
1008
|
+
[R.themeId]: e.themeId,
|
|
1009
|
+
[R.recipeId]: e.recipeId,
|
|
1010
|
+
[R.effectiveScheme]: e.effectiveScheme,
|
|
1011
|
+
[R.inheritedScheme]: e.effectiveScheme,
|
|
1012
|
+
[R.density]: e.density,
|
|
1013
|
+
[R.motion]: e.motion,
|
|
1014
|
+
[R.signature]: z(e)
|
|
1015
|
+
};
|
|
1016
|
+
return e.variant && (t[R.variantId] = e.variant), t;
|
|
1017
|
+
}, V = (e) => {
|
|
1018
|
+
for (let t = 0; t < e.length; t += 1) if (e.charCodeAt(t) <= 31) return !0;
|
|
1019
|
+
return !1;
|
|
1020
|
+
}, we = (e) => {
|
|
1021
|
+
if (!e.trim()) throw Error("[mlform] createDesignSystemStylesheet requires a non-empty selector");
|
|
1022
|
+
if (e.includes("{") || e.includes("}") || e.includes(";") || V(e)) throw Error("[mlform] createDesignSystemStylesheet selector contains unsafe characters");
|
|
1023
|
+
}, H = (e, t) => {
|
|
1024
|
+
if (!e.startsWith("--")) throw Error(`[mlform] Invalid design-system token "${e}"`);
|
|
1025
|
+
if (t.includes("{") || t.includes("}") || t.includes(";") || V(t)) throw Error(`[mlform] Token "${e}" contains unsafe stylesheet characters`);
|
|
1026
|
+
}, U = (e) => Object.entries(e.tokens).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => (H(e, t), [e, t])), W = (e, t) => {
|
|
1027
|
+
let n = /* @__PURE__ */ new Set();
|
|
1028
|
+
for (let [r, i] of U(t)) e.setProperty(r, i), n.add(r);
|
|
1029
|
+
return n;
|
|
1030
|
+
}, G = [
|
|
1031
|
+
R.themeId,
|
|
1032
|
+
R.variantId,
|
|
1033
|
+
R.recipeId,
|
|
1034
|
+
R.effectiveScheme,
|
|
1035
|
+
R.inheritedScheme,
|
|
1036
|
+
R.density,
|
|
1037
|
+
R.motion,
|
|
1038
|
+
R.signature
|
|
1039
|
+
], K = (e, t, n) => {
|
|
1040
|
+
let r = B(t);
|
|
1041
|
+
for (let t of G) {
|
|
1042
|
+
let n = r[t];
|
|
1043
|
+
n === void 0 ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
1044
|
+
}
|
|
1045
|
+
return n === "view-transition" && (e.style.viewTransitionName = "mlf-design-system"), e.style.colorScheme = t.effectiveScheme, W(e.style, t);
|
|
1046
|
+
}, Te = (e, t, n, r, i) => {
|
|
1047
|
+
for (let n of t) {
|
|
1048
|
+
let t = r.get(n) ?? null;
|
|
1049
|
+
t === null ? e.style.removeProperty(n) : e.style.setProperty(n, t);
|
|
1050
|
+
}
|
|
1051
|
+
for (let t of G) {
|
|
1052
|
+
let r = n.get(t) ?? null;
|
|
1053
|
+
r === null ? e.removeAttribute(t) : e.setAttribute(t, r);
|
|
1054
|
+
}
|
|
1055
|
+
i === null ? e.style.removeProperty("color-scheme") : e.style.colorScheme = i, e.style.removeProperty("view-transition-name");
|
|
1056
|
+
}, q = (e) => e ? Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${e}:${t}`).join(",") : "", Ee = (e) => {
|
|
1057
|
+
let t = Object.entries(e.variants ?? {}).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${e}:${t.baseScheme}:${q(t.tokens)}`).join(";");
|
|
1058
|
+
return [
|
|
1059
|
+
e.id,
|
|
1060
|
+
e.label,
|
|
1061
|
+
e.schemes.light.colorScheme ?? "",
|
|
1062
|
+
q(e.schemes.light.tokens),
|
|
1063
|
+
e.schemes.dark?.colorScheme ?? "",
|
|
1064
|
+
q(e.schemes.dark?.tokens),
|
|
1065
|
+
q(e.sharedTokens),
|
|
1066
|
+
t
|
|
1067
|
+
].join("|");
|
|
1068
|
+
}, De = (e) => {
|
|
1069
|
+
let t = Object.entries(e.components ?? {}).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${e}:${q(t?.tokens)}`).join(";");
|
|
1070
|
+
return [
|
|
1071
|
+
e.id,
|
|
1072
|
+
e.label,
|
|
1073
|
+
e.density,
|
|
1074
|
+
e.motion,
|
|
1075
|
+
q(e.tokens),
|
|
1076
|
+
t
|
|
1077
|
+
].join("|");
|
|
1078
|
+
}, Oe = (e) => {
|
|
1079
|
+
let t = typeof e.theme == "string" ? `ref:${e.theme}` : e.theme ? `inline:${Ee(e.theme)}` : "", n = typeof e.recipe == "string" ? `ref:${e.recipe}` : e.recipe ? `inline:${De(e.recipe)}` : "", r = e.overrides, i = q(r?.tokens), a = Object.entries(r?.components ?? {}).sort(([e], [t]) => e.localeCompare(t)).filter(([, e]) => !!e?.tokens).map(([e, t]) => `${e}:${q(t.tokens)}`).join(";");
|
|
1080
|
+
return `${e.mode ?? ""}|${t}|${n}|${e.variant ?? ""}|${e.strict ?? ""}|${r?.density ?? ""}|${r?.motion ?? ""}|${i}|${a}`;
|
|
1081
|
+
}, J = (e, t) => `${t.prefersDarkScheme}|${t.prefersReducedMotion}|${t.prefersMoreContrast}|${t.forcedColors}|${Oe(e)}`, Y = (e) => {
|
|
1082
|
+
if (!e) return null;
|
|
1083
|
+
let t = e.trim().toLowerCase();
|
|
1084
|
+
return t === "light" || t === "dark" ? t : null;
|
|
1085
|
+
}, X = (e, t) => {
|
|
1086
|
+
typeof e.addEventListener == "function" ? e.addEventListener("change", t) : e.addListener?.(t);
|
|
1087
|
+
}, Z = (e, t) => {
|
|
1088
|
+
typeof e.removeEventListener == "function" ? e.removeEventListener("change", t) : e.removeListener?.(t);
|
|
1089
|
+
}, Q = class {
|
|
1090
|
+
#e;
|
|
1091
|
+
#t;
|
|
1092
|
+
#n;
|
|
1093
|
+
#r;
|
|
1094
|
+
#i;
|
|
1095
|
+
#a;
|
|
1096
|
+
#o;
|
|
1097
|
+
#s;
|
|
1098
|
+
#c;
|
|
1099
|
+
#l;
|
|
1100
|
+
#u;
|
|
1101
|
+
#d;
|
|
1102
|
+
#f;
|
|
1103
|
+
#p;
|
|
1104
|
+
#m;
|
|
1105
|
+
#h;
|
|
1106
|
+
#g = /* @__PURE__ */ new Set();
|
|
1107
|
+
#_ = /* @__PURE__ */ new Map();
|
|
1108
|
+
#v = /* @__PURE__ */ new Map();
|
|
1109
|
+
#y;
|
|
1110
|
+
#b = /* @__PURE__ */ new Set();
|
|
1111
|
+
#x = !1;
|
|
1112
|
+
#S = "";
|
|
1113
|
+
#C = null;
|
|
1114
|
+
#w = null;
|
|
1115
|
+
#T = "";
|
|
1116
|
+
#E = null;
|
|
1117
|
+
constructor({ host: e, registry: t, getConfig: n, onChange: r, transition: i, hydrate: a }) {
|
|
1118
|
+
this.#e = e, this.#t = t ?? S, this.#n = n, this.#r = r, this.#p = i ?? "none", this.#f = a ?? !1, this.#y = e.style.colorScheme || null;
|
|
1119
|
+
let o = typeof window < "u" && typeof window.matchMedia == "function";
|
|
1120
|
+
this.#i = o ? window.matchMedia(L.prefersDarkScheme) : null, this.#o = o ? window.matchMedia(L.prefersReducedMotion) : null, this.#c = o ? window.matchMedia(L.prefersMoreContrast) : null, this.#u = o ? window.matchMedia(L.forcedColors) : null, this.#a = () => this.refresh(), this.#s = () => this.refresh(), this.#l = () => this.refresh(), this.#d = () => this.refresh(), this.#m = typeof MutationObserver < "u" ? new MutationObserver(() => this.refresh()) : null, this.#h = this.#t.onChange(() => {
|
|
1121
|
+
this.#S = "", this.#T = "", this.refresh();
|
|
1122
|
+
});
|
|
1123
|
+
for (let t of G) this.#_.set(t, e.getAttribute(t));
|
|
1124
|
+
}
|
|
1125
|
+
get resolved() {
|
|
1126
|
+
return this.#E;
|
|
1127
|
+
}
|
|
1128
|
+
connect() {
|
|
1129
|
+
this.#x || (this.#x = !0, this.#i && X(this.#i, this.#a), this.#o && X(this.#o, this.#s), this.#c && X(this.#c, this.#l), this.#u && X(this.#u, this.#d), this.#k(), !(this.#f && this.#P()) && this.refresh());
|
|
1130
|
+
}
|
|
1131
|
+
disconnect() {
|
|
1132
|
+
this.#x && (this.#x = !1, this.#i && Z(this.#i, this.#a), this.#o && Z(this.#o, this.#s), this.#c && Z(this.#c, this.#l), this.#u && Z(this.#u, this.#d), this.#I(), this.#m?.disconnect(), this.#h?.(), this.#g.clear(), Te(this.#e, this.#b, this.#_, this.#v, this.#y), this.#b.clear(), this.#S = "", this.#T = "", this.#E = null);
|
|
1133
|
+
}
|
|
1134
|
+
refresh() {
|
|
1135
|
+
if (!this.#x) return;
|
|
1136
|
+
this.#k();
|
|
1137
|
+
let e = this.#n(), t = this.#N(), n = J(e, t);
|
|
1138
|
+
if (n === this.#T && (e.mode ?? "auto") !== "inherit") return;
|
|
1139
|
+
let r = this.#O(), i = I(e, this.#t, {
|
|
1140
|
+
inheritedScheme: r.scheme,
|
|
1141
|
+
inheritedSource: r.source ?? void 0,
|
|
1142
|
+
systemScheme: t.prefersDarkScheme ? "dark" : "light",
|
|
1143
|
+
prefersReducedMotion: t.prefersReducedMotion,
|
|
1144
|
+
prefersMoreContrast: t.prefersMoreContrast,
|
|
1145
|
+
forcedColors: t.forcedColors
|
|
1146
|
+
}), a = z(i);
|
|
1147
|
+
if (this.#T = n, a === this.#S) return;
|
|
1148
|
+
let o = this.#E;
|
|
1149
|
+
this.#S = a, this.#E = i, this.#D(() => {
|
|
1150
|
+
this.#j(i.tokens), this.#M(i.tokens), this.#b = K(this.#e, i, this.#p), this.#r?.(i), this.#e.dispatchEvent(new CustomEvent(be.change, {
|
|
1151
|
+
detail: { designSystem: i },
|
|
1152
|
+
bubbles: !0,
|
|
1153
|
+
composed: !0
|
|
1154
|
+
}));
|
|
1155
|
+
}, i, o);
|
|
1156
|
+
}
|
|
1157
|
+
#D(e, t, n) {
|
|
1158
|
+
this.#I();
|
|
1159
|
+
let r = new AbortController();
|
|
1160
|
+
if (this.#C = r, this.#p === "none") {
|
|
1161
|
+
r.signal.aborted || e(), this.#C = null;
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
if (this.#p === "view-transition") {
|
|
1165
|
+
let t = this.#e.ownerDocument, n = () => {
|
|
1166
|
+
r.signal.aborted || (e(), this.#C === r && (this.#C = null));
|
|
1167
|
+
};
|
|
1168
|
+
t && typeof t.startViewTransition == "function" ? t.startViewTransition(n) : n();
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
let i = {
|
|
1172
|
+
host: this.#e,
|
|
1173
|
+
resolved: t,
|
|
1174
|
+
previous: n,
|
|
1175
|
+
signal: r.signal
|
|
1176
|
+
}, a = this.#p(() => {
|
|
1177
|
+
r.signal.aborted || (e(), this.#C === r && (this.#C = null));
|
|
1178
|
+
}, i);
|
|
1179
|
+
this.#w = typeof a == "function" ? a : null;
|
|
1180
|
+
}
|
|
1181
|
+
#O() {
|
|
1182
|
+
let e = this.#n();
|
|
1183
|
+
if ((e.mode ?? "auto") !== "inherit") return {
|
|
1184
|
+
scheme: null,
|
|
1185
|
+
source: null
|
|
1186
|
+
};
|
|
1187
|
+
if (e.hostSchemeResolver) {
|
|
1188
|
+
let t = e.hostSchemeResolver(this.#e);
|
|
1189
|
+
if (t) return {
|
|
1190
|
+
scheme: t,
|
|
1191
|
+
source: "host-resolver"
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
let t = Y(this.#e.getAttribute(R.explicitScheme));
|
|
1195
|
+
if (t) return {
|
|
1196
|
+
scheme: t,
|
|
1197
|
+
source: "host-attribute"
|
|
1198
|
+
};
|
|
1199
|
+
let n = this.#e.parentElement;
|
|
1200
|
+
for (; n;) {
|
|
1201
|
+
let e = Y(n.getAttribute(R.inheritedScheme)) ?? Y(n.getAttribute(R.effectiveScheme)) ?? Y(n.getAttribute(R.explicitScheme));
|
|
1202
|
+
if (e) return {
|
|
1203
|
+
scheme: e,
|
|
1204
|
+
source: "host-attribute"
|
|
1205
|
+
};
|
|
1206
|
+
n = n.parentElement;
|
|
1207
|
+
}
|
|
1208
|
+
if (typeof window > "u") return {
|
|
1209
|
+
scheme: null,
|
|
1210
|
+
source: null
|
|
1211
|
+
};
|
|
1212
|
+
let r = window.getComputedStyle(this.#e).colorScheme;
|
|
1213
|
+
return r.includes("dark") ? {
|
|
1214
|
+
scheme: "dark",
|
|
1215
|
+
source: "host-style"
|
|
1216
|
+
} : r.includes("light") ? {
|
|
1217
|
+
scheme: "light",
|
|
1218
|
+
source: "host-style"
|
|
1219
|
+
} : {
|
|
1220
|
+
scheme: null,
|
|
1221
|
+
source: null
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
#k() {
|
|
1225
|
+
if (!this.#m) return;
|
|
1226
|
+
let e = [this.#e], t = this.#e.parentElement;
|
|
1227
|
+
for (; t;) e.push(t), t = t.parentElement;
|
|
1228
|
+
if (e.length === this.#g.size && e.every((e) => this.#g.has(e))) return;
|
|
1229
|
+
this.#m.disconnect(), this.#g.clear(), this.#g.add(this.#e), this.#m.observe(this.#e, {
|
|
1230
|
+
attributes: !0,
|
|
1231
|
+
childList: !1,
|
|
1232
|
+
subtree: !1,
|
|
1233
|
+
attributeFilter: [...xe]
|
|
1234
|
+
});
|
|
1235
|
+
let n = this.#e.parentElement;
|
|
1236
|
+
for (; n;) this.#A(n, !0), n = n.parentElement;
|
|
1237
|
+
}
|
|
1238
|
+
#A(e, t) {
|
|
1239
|
+
!this.#m || this.#g.has(e) || (this.#g.add(e), this.#m.observe(e, {
|
|
1240
|
+
attributes: !0,
|
|
1241
|
+
childList: t,
|
|
1242
|
+
subtree: !1,
|
|
1243
|
+
attributeFilter: [...Se]
|
|
1244
|
+
}));
|
|
1245
|
+
}
|
|
1246
|
+
#j(e) {
|
|
1247
|
+
for (let t of Object.keys(e)) {
|
|
1248
|
+
if (this.#v.has(t)) continue;
|
|
1249
|
+
let e = this.#e.style.getPropertyValue(t);
|
|
1250
|
+
this.#v.set(t, e === "" ? null : e);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
#M(e) {
|
|
1254
|
+
let t = new Set(Object.keys(e));
|
|
1255
|
+
for (let e of this.#b) {
|
|
1256
|
+
if (t.has(e)) continue;
|
|
1257
|
+
let n = this.#v.get(e) ?? null;
|
|
1258
|
+
n === null ? this.#e.style.removeProperty(e) : this.#e.style.setProperty(e, n);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
#N() {
|
|
1262
|
+
return {
|
|
1263
|
+
prefersDarkScheme: this.#i?.matches ?? !1,
|
|
1264
|
+
prefersReducedMotion: this.#o?.matches ?? !1,
|
|
1265
|
+
prefersMoreContrast: this.#c?.matches ?? !1,
|
|
1266
|
+
forcedColors: this.#u?.matches ?? !1
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
#P() {
|
|
1270
|
+
let e = this.#n(), t = this.#N(), n = this.#O(), r = I(e, this.#t, {
|
|
1271
|
+
inheritedScheme: n.scheme,
|
|
1272
|
+
inheritedSource: n.source ?? void 0,
|
|
1273
|
+
systemScheme: t.prefersDarkScheme ? "dark" : "light",
|
|
1274
|
+
prefersReducedMotion: t.prefersReducedMotion,
|
|
1275
|
+
prefersMoreContrast: t.prefersMoreContrast,
|
|
1276
|
+
forcedColors: t.forcedColors
|
|
1277
|
+
});
|
|
1278
|
+
return this.#F(r) ? (this.#j(r.tokens), this.#b = new Set(Object.keys(r.tokens)), this.#E = r, this.#S = z(r), this.#T = J(e, t), !0) : !1;
|
|
1279
|
+
}
|
|
1280
|
+
#F(e) {
|
|
1281
|
+
let t = B(e);
|
|
1282
|
+
for (let e of G) {
|
|
1283
|
+
let n = t[e];
|
|
1284
|
+
if (n === void 0) {
|
|
1285
|
+
if (this.#e.hasAttribute(e)) return !1;
|
|
1286
|
+
continue;
|
|
1287
|
+
}
|
|
1288
|
+
if (this.#e.getAttribute(e) !== n) return !1;
|
|
1289
|
+
}
|
|
1290
|
+
if (this.#e.getAttribute(R.signature) === t[R.signature]) return !0;
|
|
1291
|
+
if (this.#e.style.colorScheme !== e.effectiveScheme) return !1;
|
|
1292
|
+
let n = /* @__PURE__ */ new Map();
|
|
1293
|
+
for (let e = 0; e < this.#e.style.length; e += 1) {
|
|
1294
|
+
let t = this.#e.style.item(e);
|
|
1295
|
+
t.startsWith("--mlf-") && n.set(t, this.#e.style.getPropertyValue(t).trim());
|
|
1296
|
+
}
|
|
1297
|
+
let r = Object.entries(e.tokens);
|
|
1298
|
+
if (n.size === r.length) {
|
|
1299
|
+
for (let [e, t] of r) if (n.get(e) !== t) return !1;
|
|
1300
|
+
return !0;
|
|
1301
|
+
}
|
|
1302
|
+
if (typeof window > "u") return !1;
|
|
1303
|
+
let i = window.getComputedStyle(this.#e);
|
|
1304
|
+
for (let [e, t] of r) if (i.getPropertyValue(e).trim() !== t) return !1;
|
|
1305
|
+
return !0;
|
|
1306
|
+
}
|
|
1307
|
+
#I() {
|
|
1308
|
+
this.#C?.abort(), this.#C = null, this.#w?.(), this.#w = null;
|
|
1309
|
+
}
|
|
1310
|
+
}, $ = (e, t = {}, n = !1) => {
|
|
1311
|
+
let r = (...e) => m(P(...e)), i = r(t.config), a = i, o = t.registry?.clone() ?? S.clone(), s = new Q({
|
|
1312
|
+
host: e,
|
|
1313
|
+
registry: o,
|
|
1314
|
+
getConfig: () => a,
|
|
1315
|
+
onChange: t.onChange,
|
|
1316
|
+
hydrate: n,
|
|
1317
|
+
transition: t.transition
|
|
1318
|
+
});
|
|
1319
|
+
return s.connect(), Object.freeze({
|
|
1320
|
+
host: e,
|
|
1321
|
+
registry: o,
|
|
1322
|
+
get config() {
|
|
1323
|
+
return a;
|
|
1324
|
+
},
|
|
1325
|
+
get resolved() {
|
|
1326
|
+
return s.resolved;
|
|
1327
|
+
},
|
|
1328
|
+
update(e) {
|
|
1329
|
+
a = r(a, e), s.refresh();
|
|
1330
|
+
},
|
|
1331
|
+
replace(e) {
|
|
1332
|
+
a = r(e), s.refresh();
|
|
1333
|
+
},
|
|
1334
|
+
reset() {
|
|
1335
|
+
a = i, s.refresh();
|
|
1336
|
+
},
|
|
1337
|
+
disconnect() {
|
|
1338
|
+
s.disconnect();
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
}, ke = (e, t = {}) => $(e, t), Ae = /^-?[_a-zA-Z][_a-zA-Z0-9-]*$/, je = (e) => {
|
|
1342
|
+
if (!e.trim()) throw Error("[mlform] createDesignSystemStylesheet layer name must be non-empty");
|
|
1343
|
+
if (e.includes("{") || e.includes("}") || e.includes(";")) throw Error("[mlform] createDesignSystemStylesheet layer name contains unsafe characters");
|
|
1344
|
+
if (e.split(".").some((e) => !Ae.test(e))) throw Error("[mlform] createDesignSystemStylesheet layer name is not a valid CSS layer name");
|
|
1345
|
+
}, Me = (e, t = ":host") => {
|
|
1346
|
+
let n = typeof t == "string" ? { selector: t } : t, r = n.selector ?? ":host", i = n.layer;
|
|
1347
|
+
we(r), i && je(i);
|
|
1348
|
+
let a = `${r} {\n${U(e).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`;
|
|
1349
|
+
return i ? `@layer ${i} {\n${a}\n}` : a;
|
|
1350
|
+
}, Ne = (e, t = {}) => $(e, t, !0);
|
|
1351
|
+
//#endregion
|
|
1352
|
+
export { r as C, i as S, e as T, y as _, K as a, g as b, B as c, F as d, P as f, b as g, S as h, Q as i, I as l, te as m, Me as n, W as o, ne as p, ke as r, z as s, Ne as t, ye as u, x as v, t as w, h as x, v as y };
|