@nikkory/vibe-engine 4.0.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/PUBLISH-GUIDE.md +250 -0
- package/README.md +1267 -0
- package/bin/vibe.js +22 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/browser.d.ts +25 -0
- package/dist/browser.js +15083 -0
- package/dist/browser.mjs +15000 -0
- package/dist/cli/batch-command.d.ts +142 -0
- package/dist/cli/generate-command.d.ts +119 -0
- package/dist/cli/index.d.ts +34 -0
- package/dist/constants/ComponentTypes.d.ts +65 -0
- package/dist/constants/DesignSystems.d.ts +64 -0
- package/dist/constants/Frameworks.d.ts +71 -0
- package/dist/constants/Tiers.d.ts +72 -0
- package/dist/constants/index.d.ts +10 -0
- package/dist/converters/index.d.ts +12 -0
- package/dist/converters/section-converter.d.ts +176 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +19819 -0
- package/dist/index.mjs +19496 -0
- package/dist/resolution/basic/groups-basic.d.ts +80 -0
- package/dist/resolution/basic/index.d.ts +21 -0
- package/dist/resolution/basic/intents-basic.d.ts +195 -0
- package/dist/resolution/basic/presets-basic.d.ts +96 -0
- package/dist/resolution/basic/resolver-basic.d.ts +127 -0
- package/dist/resolution/basic/shorthands-basic.d.ts +88 -0
- package/dist/resolution/core/groups-core.d.ts +160 -0
- package/dist/resolution/core/index.d.ts +21 -0
- package/dist/resolution/core/intents-core.d.ts +355 -0
- package/dist/resolution/core/presets-core.d.ts +160 -0
- package/dist/resolution/core/resolver-core.d.ts +207 -0
- package/dist/resolution/core/shorthands-core.d.ts +144 -0
- package/dist/resolution/core/types-core.d.ts +167 -0
- package/dist/resolution/debugger.d.ts +183 -0
- package/dist/resolution/demo.d.ts +57 -0
- package/dist/resolution/enterprise/index.d.ts +22 -0
- package/dist/resolution/enterprise/metrics.d.ts +152 -0
- package/dist/resolution/enterprise/resolver-enterprise.d.ts +108 -0
- package/dist/resolution/examples.d.ts +486 -0
- package/dist/resolution/groups/experience-group.d.ts +197 -0
- package/dist/resolution/groups/index.d.ts +196 -0
- package/dist/resolution/groups/layout-group.d.ts +192 -0
- package/dist/resolution/groups/motion-group.d.ts +127 -0
- package/dist/resolution/groups/visual-group.d.ts +146 -0
- package/dist/resolution/index.d.ts +41 -0
- package/dist/resolution/intents/button-intents.d.ts +231 -0
- package/dist/resolution/intents/card-intents.d.ts +177 -0
- package/dist/resolution/intents/feedback-intents.d.ts +222 -0
- package/dist/resolution/intents/index.d.ts +189 -0
- package/dist/resolution/intents/input-intents.d.ts +231 -0
- package/dist/resolution/intents/mood-modifiers.d.ts +154 -0
- package/dist/resolution/performance.d.ts +264 -0
- package/dist/resolution/presets/button-presets.d.ts +243 -0
- package/dist/resolution/presets/card-presets.d.ts +216 -0
- package/dist/resolution/presets/data-display-presets.d.ts +290 -0
- package/dist/resolution/presets/feedback-presets.d.ts +335 -0
- package/dist/resolution/presets/form-presets.d.ts +308 -0
- package/dist/resolution/presets/index.d.ts +22 -0
- package/dist/resolution/presets/input-presets.d.ts +207 -0
- package/dist/resolution/presets/nav-presets.d.ts +235 -0
- package/dist/resolution/presets/overlay-presets.d.ts +216 -0
- package/dist/resolution/presets/preset-registry.d.ts +212 -0
- package/dist/resolution/resolveProps.d.ts +235 -0
- package/dist/resolution/shorthand/feel-mappings.d.ts +140 -0
- package/dist/resolution/shorthand/index.d.ts +172 -0
- package/dist/resolution/shorthand/look-mappings.d.ts +107 -0
- package/dist/resolution/shorthand/spacing-mappings.d.ts +164 -0
- package/dist/resolution/shorthand/surface-mappings.d.ts +139 -0
- package/dist/resolution/standard/groups-standard.d.ts +98 -0
- package/dist/resolution/standard/index.d.ts +28 -0
- package/dist/resolution/standard/intents-standard.d.ts +232 -0
- package/dist/resolution/standard/presets-standard.d.ts +123 -0
- package/dist/resolution/standard/resolver-standard.d.ts +204 -0
- package/dist/resolution/standard/shorthands-standard.d.ts +98 -0
- package/dist/resolution/standard/validators.d.ts +141 -0
- package/dist/resolution/types.d.ts +461 -0
- package/dist/resolution/validators/factor24-validator.d.ts +418 -0
- package/dist/resolution/validators/index.d.ts +14 -0
- package/dist/scripts/generate-react-library.d.ts +15 -0
- package/dist/scripts/write-react-library.d.ts +18 -0
- package/dist/storage/cloud-sync.d.ts +182 -0
- package/dist/storage/index.d.ts +69 -0
- package/dist/storage/local-storage.d.ts +131 -0
- package/dist/storage/section-storage.d.ts +191 -0
- package/dist/styling/StyleGenerator.d.ts +76 -0
- package/dist/styling/TokenStyleResolver.d.ts +163 -0
- package/dist/styling/factor-migration.d.ts +192 -0
- package/dist/styling/factor-validators.d.ts +327 -0
- package/dist/styling/factors-1-6.d.ts +674 -0
- package/dist/styling/factors-12-16.d.ts +700 -0
- package/dist/styling/factors-17-24.d.ts +668 -0
- package/dist/styling/factors-all.d.ts +348 -0
- package/dist/styling/factors.d.ts +291 -0
- package/dist/styling/index.d.ts +31 -0
- package/dist/styling/types.d.ts +400 -0
- package/dist/tokens/schema.d.ts +486 -0
- package/dist/types/Option.d.ts +178 -0
- package/dist/types/Result.d.ts +148 -0
- package/dist/types/algorithm-engine.types.d.ts +298 -0
- package/dist/types/granularity/base.types.d.ts +268 -0
- package/dist/types/granularity/config.types.d.ts +177 -0
- package/dist/types/granularity/factors.types.d.ts +194 -0
- package/dist/types/granularity/index.d.ts +57 -0
- package/dist/types/granularity/slot.types.d.ts +128 -0
- package/dist/types/granularity/template.types.d.ts +179 -0
- package/dist/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/types/granularity-levels/index.d.ts +47 -0
- package/dist/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/types/index.d.ts +152 -0
- package/dist/types/section-slot.types.d.ts +169 -0
- package/dist/types/section-storage.types.d.ts +298 -0
- package/dist/types/section-template.types.d.ts +170 -0
- package/dist/types/section.types.d.ts +326 -0
- package/dist/ui-studio/ComponentGenerator.d.ts +219 -0
- package/dist/ui-studio/composition/FactorPropagator.d.ts +268 -0
- package/dist/ui-studio/composition/PageGenerator.d.ts +176 -0
- package/dist/ui-studio/composition/SectionGenerator.d.ts +312 -0
- package/dist/ui-studio/composition/SlotResolver.d.ts +295 -0
- package/dist/ui-studio/composition/section-orchestrator.d.ts +306 -0
- package/dist/ui-studio/granularity/FactorCascade.d.ts +328 -0
- package/dist/ui-studio/granularity/GranularityGenerator.d.ts +266 -0
- package/dist/ui-studio/granularity/RecursiveGenerator.d.ts +328 -0
- package/dist/ui-studio/index.d.ts +94 -0
- package/dist/ui-studio/matrix/ClassMapper.d.ts +128 -0
- package/dist/ui-studio/matrix/MatrixResolver.d.ts +203 -0
- package/dist/ui-studio/matrix/types.d.ts +96 -0
- package/dist/ui-studio/presets/IndustryDetector.d.ts +183 -0
- package/dist/ui-studio/presets/component-registry.d.ts +213 -0
- package/dist/ui-studio/presets/factor-registry.d.ts +364 -0
- package/dist/ui-studio/presets/granularity-registry.d.ts +252 -0
- package/dist/ui-studio/presets/index.d.ts +32 -0
- package/dist/ui-studio/presets/industries.d.ts +143 -0
- package/dist/ui-studio/presets/layout-registry.d.ts +21 -0
- package/dist/ui-studio/presets/matrix-groups.d.ts +195 -0
- package/dist/ui-studio/presets/page-registry.d.ts +24 -0
- package/dist/ui-studio/presets/registry.constants.d.ts +69 -0
- package/dist/ui-studio/presets/registry.types.d.ts +166 -0
- package/dist/ui-studio/presets/section-defaults.d.ts +175 -0
- package/dist/ui-studio/presets/section-registry.d.ts +83 -0
- package/dist/ui-studio/presets/section-registry.defaults.d.ts +106 -0
- package/dist/ui-studio/presets/section-registry.helpers.d.ts +112 -0
- package/dist/ui-studio/presets/section-registry.types.d.ts +181 -0
- package/dist/ui-studio/presets/template-registry.d.ts +23 -0
- package/dist/ui-studio/presets/variants.d.ts +1038 -0
- package/dist/ui-studio/registries/components-registry.d.ts +193 -0
- package/dist/ui-studio/registries/design-systems-registry.d.ts +153 -0
- package/dist/ui-studio/registries/factors-registry.d.ts +145 -0
- package/dist/ui-studio/registries/tiers-registry.d.ts +150 -0
- package/dist/ui-studio/resolution/FactorResolver.d.ts +201 -0
- package/dist/ui-studio/templates/TestGenerator.d.ts +55 -0
- package/dist/ui-studio/templates/TierGenerator.d.ts +153 -0
- package/dist/ui-studio/templates/TypesGenerator.d.ts +51 -0
- package/dist/ui-studio/types/granularity/base.types.d.ts +268 -0
- package/dist/ui-studio/types/granularity/config.types.d.ts +177 -0
- package/dist/ui-studio/types/granularity/factors.types.d.ts +194 -0
- package/dist/ui-studio/types/granularity/index.d.ts +57 -0
- package/dist/ui-studio/types/granularity/slot.types.d.ts +128 -0
- package/dist/ui-studio/types/granularity/template.types.d.ts +179 -0
- package/dist/ui-studio/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/ui-studio/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/ui-studio/types/granularity-levels/index.d.ts +47 -0
- package/dist/ui-studio/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/ui-studio/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/ui-studio/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/ui-studio/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/ui-studio/types.d.ts +323 -0
- package/dist/utils/CodeUtils.d.ts +103 -0
- package/dist/utils/GenerateComponentValidator.d.ts +35 -0
- package/dist/utils/Logger.d.ts +101 -0
- package/dist/utils/StringUtils.d.ts +120 -0
- package/dist/utils/ValidationUtils.d.ts +71 -0
- package/dist/utils/errors/BaseError.d.ts +23 -0
- package/dist/utils/errors/GenerationError.d.ts +14 -0
- package/dist/utils/errors/TemplateNotFoundError.d.ts +13 -0
- package/dist/utils/errors/ValidationError.d.ts +13 -0
- package/dist/utils/errors/index.d.ts +12 -0
- package/dist/utils/factor-resolver.d.ts +294 -0
- package/dist/utils/granularity-helpers.d.ts +359 -0
- package/dist/utils/index.d.ts +20 -0
- package/dist/utils/performance.d.ts +26 -0
- package/dist/utils/stringify.d.ts +28 -0
- package/dist/validators/component-validator.d.ts +86 -0
- package/dist/validators/design-system-validator.d.ts +95 -0
- package/dist/validators/factor-validator.d.ts +101 -0
- package/dist/validators/index.d.ts +263 -0
- package/dist/validators/section-validator.d.ts +120 -0
- package/dist/validators/slot-validator.d.ts +161 -0
- package/dist/validators/tier-validator.d.ts +102 -0
- package/package.json +67 -0
- package/tests/16-factor-integration.test.d.ts +14 -0
- package/tests/16-factor-visual.test.d.ts +14 -0
- package/tests/5-level-integration.test.d.ts +14 -0
- package/tests/CodeUtils.test.d.ts +7 -0
- package/tests/DesignSystems.test.d.ts +7 -0
- package/tests/GenerateComponentValidator.test.d.ts +7 -0
- package/tests/Logger.test.d.ts +7 -0
- package/tests/StringUtils.test.d.ts +7 -0
- package/tests/StyleGenerator.test.d.ts +13 -0
- package/tests/Tiers.test.d.ts +7 -0
- package/tests/TokenRegistry.test.d.ts +14 -0
- package/tests/TokenStyleResolver.test.d.ts +13 -0
- package/tests/ValidationUtils.test.d.ts +7 -0
- package/tests/_pending_fix/Accordion.test.d.ts +13 -0
- package/tests/_pending_fix/Alert.test.d.ts +13 -0
- package/tests/_pending_fix/AlertDialog.test.d.ts +13 -0
- package/tests/_pending_fix/AspectRatio.test.d.ts +13 -0
- package/tests/_pending_fix/Autocomplete.test.d.ts +13 -0
- package/tests/_pending_fix/Avatar.test.d.ts +13 -0
- package/tests/_pending_fix/Badge.test.d.ts +13 -0
- package/tests/_pending_fix/Banner.test.d.ts +13 -0
- package/tests/_pending_fix/Box.test.d.ts +13 -0
- package/tests/_pending_fix/Breadcrumb.test.d.ts +13 -0
- package/tests/_pending_fix/Callout.test.d.ts +13 -0
- package/tests/_pending_fix/Card.test.d.ts +13 -0
- package/tests/_pending_fix/Center.test.d.ts +13 -0
- package/tests/_pending_fix/Checkbox.test.d.ts +13 -0
- package/tests/_pending_fix/Chip.test.d.ts +13 -0
- package/tests/_pending_fix/ColorPicker.test.d.ts +13 -0
- package/tests/_pending_fix/Combobox.test.d.ts +13 -0
- package/tests/_pending_fix/CommandPalette.test.d.ts +13 -0
- package/tests/_pending_fix/ConfirmationModal.test.d.ts +13 -0
- package/tests/_pending_fix/Container.test.d.ts +13 -0
- package/tests/_pending_fix/DataTable.test.d.ts +13 -0
- package/tests/_pending_fix/DatePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateRangePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateTimePicker.test.d.ts +13 -0
- package/tests/_pending_fix/Divider.test.d.ts +13 -0
- package/tests/_pending_fix/Drawer.test.d.ts +13 -0
- package/tests/_pending_fix/Dropdown.test.d.ts +13 -0
- package/tests/_pending_fix/EmptyState.test.d.ts +13 -0
- package/tests/_pending_fix/ErrorState.test.d.ts +13 -0
- package/tests/_pending_fix/FileDropzone.test.d.ts +13 -0
- package/tests/_pending_fix/FileUpload.test.d.ts +13 -0
- package/tests/_pending_fix/Flex.test.d.ts +13 -0
- package/tests/_pending_fix/Grid.test.d.ts +13 -0
- package/tests/_pending_fix/GridItem.test.d.ts +13 -0
- package/tests/_pending_fix/HStack.test.d.ts +13 -0
- package/tests/_pending_fix/Input.test.d.ts +13 -0
- package/tests/_pending_fix/InputCurrency.test.d.ts +13 -0
- package/tests/_pending_fix/InputGroup.test.d.ts +13 -0
- package/tests/_pending_fix/InputOTP.test.d.ts +13 -0
- package/tests/_pending_fix/InputPassword.test.d.ts +13 -0
- package/tests/_pending_fix/InputPhone.test.d.ts +13 -0
- package/tests/_pending_fix/InputSearch.test.d.ts +13 -0
- package/tests/_pending_fix/Link.test.d.ts +13 -0
- package/tests/_pending_fix/List.test.d.ts +13 -0
- package/tests/_pending_fix/LoadingOverlay.test.d.ts +13 -0
- package/tests/_pending_fix/Menu.test.d.ts +13 -0
- package/tests/_pending_fix/Modal.test.d.ts +13 -0
- package/tests/_pending_fix/MultiSelect.test.d.ts +13 -0
- package/tests/_pending_fix/NavGroup.test.d.ts +13 -0
- package/tests/_pending_fix/NavItem.test.d.ts +13 -0
- package/tests/_pending_fix/NavLink.test.d.ts +13 -0
- package/tests/_pending_fix/Navbar.test.d.ts +13 -0
- package/tests/_pending_fix/Notification.test.d.ts +13 -0
- package/tests/_pending_fix/NotificationBadge.test.d.ts +13 -0
- package/tests/_pending_fix/NumberInput.test.d.ts +13 -0
- package/tests/_pending_fix/Pagination.test.d.ts +13 -0
- package/tests/_pending_fix/Popover.test.d.ts +13 -0
- package/tests/_pending_fix/Progress.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressCircle.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressSteps.test.d.ts +13 -0
- package/tests/_pending_fix/Radio.test.d.ts +13 -0
- package/tests/_pending_fix/RangeSlider.test.d.ts +13 -0
- package/tests/_pending_fix/ResizablePanel.test.d.ts +13 -0
- package/tests/_pending_fix/ResultState.test.d.ts +13 -0
- package/tests/_pending_fix/ScrollArea.test.d.ts +13 -0
- package/tests/_pending_fix/Select.test.d.ts +14 -0
- package/tests/_pending_fix/Sheet.test.d.ts +13 -0
- package/tests/_pending_fix/Sidebar.test.d.ts +13 -0
- package/tests/_pending_fix/SimpleGrid.test.d.ts +13 -0
- package/tests/_pending_fix/Skeleton.test.d.ts +13 -0
- package/tests/_pending_fix/Slider.test.d.ts +13 -0
- package/tests/_pending_fix/Spacer.test.d.ts +13 -0
- package/tests/_pending_fix/Spinner.test.d.ts +13 -0
- package/tests/_pending_fix/Stack.test.d.ts +13 -0
- package/tests/_pending_fix/Stat.test.d.ts +13 -0
- package/tests/_pending_fix/Stepper.test.d.ts +14 -0
- package/tests/_pending_fix/Switch.test.d.ts +13 -0
- package/tests/_pending_fix/Table.test.d.ts +13 -0
- package/tests/_pending_fix/Tabs.test.d.ts +13 -0
- package/tests/_pending_fix/Textarea.test.d.ts +13 -0
- package/tests/_pending_fix/Timeline.test.d.ts +13 -0
- package/tests/_pending_fix/Toast.test.d.ts +14 -0
- package/tests/_pending_fix/Tooltip.test.d.ts +14 -0
- package/tests/_pending_fix/VStack.test.d.ts +13 -0
- package/tests/alert.test.d.ts +13 -0
- package/tests/badge.test.d.ts +13 -0
- package/tests/benchmarks/factor-resolution.bench.d.ts +41 -0
- package/tests/button.test.d.ts +16 -0
- package/tests/card.test.d.ts +19 -0
- package/tests/checkbox.test.d.ts +13 -0
- package/tests/component-16-factor-types.test.d.ts +13 -0
- package/tests/component-5level-integration.test.d.ts +14 -0
- package/tests/component-registry-ui.test.d.ts +13 -0
- package/tests/e2e/16-factor-visual.test.d.ts +14 -0
- package/tests/edge-cases.test.d.ts +14 -0
- package/tests/factor-17-24-integration.test.d.ts +14 -0
- package/tests/factor-17-24-performance.test.d.ts +14 -0
- package/tests/factor-validators.test.d.ts +13 -0
- package/tests/factors-1-6.test.d.ts +13 -0
- package/tests/factors-12-16.test.d.ts +13 -0
- package/tests/factors-17-24.test.d.ts +21 -0
- package/tests/factors-all.test.d.ts +13 -0
- package/tests/factors-registry.test.d.ts +11 -0
- package/tests/factors.test.d.ts +13 -0
- package/tests/granularity-types.test.d.ts +18 -0
- package/tests/groups.test.d.ts +14 -0
- package/tests/input.test.d.ts +16 -0
- package/tests/intents.test.d.ts +14 -0
- package/tests/memory-leak.test.d.ts +14 -0
- package/tests/modal.test.d.ts +19 -0
- package/tests/presets.test.d.ts +14 -0
- package/tests/radio.test.d.ts +13 -0
- package/tests/resolution-intents.test.d.ts +13 -0
- package/tests/resolution-presets.test.d.ts +13 -0
- package/tests/resolveProps.test.d.ts +14 -0
- package/tests/section-integration.test.d.ts +16 -0
- package/tests/section-types.test.d.ts +11 -0
- package/tests/setup.d.ts +13 -0
- package/tests/shorthands.test.d.ts +14 -0
- package/tests/switch.test.d.ts +13 -0
- package/tests/tabs.test.d.ts +13 -0
- package/tests/tiers-registry.test.d.ts +11 -0
- package/tests/useComponentStyles.test.d.ts +11 -0
- package/tests/useFactors.test.d.ts +13 -0
- package/tests/validators-invalid-input.test.d.ts +13 -0
- package/tsup.config.d.ts +11 -0
- package/vitest.config.d.ts +3 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factor Groups - Level 2 Abstraction
|
|
3
|
+
*
|
|
4
|
+
* Provides grouped factor configurations that map to multiple Factor24 properties.
|
|
5
|
+
* Each group represents a logical collection of related factors.
|
|
6
|
+
*
|
|
7
|
+
* Groups:
|
|
8
|
+
* - VisualGroup: Shape, border, opacity, elevation, color scheme
|
|
9
|
+
* - MotionGroup: Animation, transition
|
|
10
|
+
* - LayoutGroup: Position, orientation, density, spacing, overflow, alignment
|
|
11
|
+
* - ExperienceGroup: Accessibility, cursor, z-index, loading state
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
* @module resolution/groups
|
|
15
|
+
* @since 2.1.0
|
|
16
|
+
*
|
|
17
|
+
* Powered by Nikkory
|
|
18
|
+
*/
|
|
19
|
+
import type { Factor24Config, FactorGroups } from '../types';
|
|
20
|
+
export * from './visual-group';
|
|
21
|
+
export * from './motion-group';
|
|
22
|
+
export * from './layout-group';
|
|
23
|
+
export * from './experience-group';
|
|
24
|
+
/**
|
|
25
|
+
* Expand all factor groups to Factor24Config.
|
|
26
|
+
* Merges all group configurations into a single partial config.
|
|
27
|
+
*
|
|
28
|
+
* @param groups - The factor groups to expand
|
|
29
|
+
* @returns Partial Factor24Config with all group factors
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const config = expandGroups({
|
|
34
|
+
* visual: { shape: 'lg', elevation: 'md' },
|
|
35
|
+
* motion: { animation: 'smooth' },
|
|
36
|
+
* layout: { orientation: 'horizontal' },
|
|
37
|
+
* experience: { cursor: 'pointer' },
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @since 2.1.0
|
|
42
|
+
*/
|
|
43
|
+
export declare function expandGroups(groups: FactorGroups): Partial<Factor24Config>;
|
|
44
|
+
/**
|
|
45
|
+
* Validation result for factor groups.
|
|
46
|
+
*
|
|
47
|
+
* @since 2.1.0
|
|
48
|
+
*/
|
|
49
|
+
export interface GroupValidationResult {
|
|
50
|
+
/** Overall validation status */
|
|
51
|
+
valid: boolean;
|
|
52
|
+
/** Errors by group */
|
|
53
|
+
errors: {
|
|
54
|
+
visual: string[];
|
|
55
|
+
motion: string[];
|
|
56
|
+
layout: string[];
|
|
57
|
+
experience: string[];
|
|
58
|
+
};
|
|
59
|
+
/** All errors flattened */
|
|
60
|
+
allErrors: string[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Validate all factor groups.
|
|
64
|
+
*
|
|
65
|
+
* @param groups - The factor groups to validate
|
|
66
|
+
* @returns Validation result with errors by group
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const result = validateGroups({
|
|
71
|
+
* visual: { shape: 'invalid' },
|
|
72
|
+
* });
|
|
73
|
+
* if (!result.valid) {
|
|
74
|
+
* console.error(result.allErrors);
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @since 2.1.0
|
|
79
|
+
*/
|
|
80
|
+
export declare function validateGroups(groups: FactorGroups): GroupValidationResult;
|
|
81
|
+
/**
|
|
82
|
+
* Merge multiple FactorGroups configurations.
|
|
83
|
+
* Later values override earlier ones within each group.
|
|
84
|
+
*
|
|
85
|
+
* @param groupsList - Factor groups to merge
|
|
86
|
+
* @returns Merged factor groups
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* const merged = mergeFactorGroups(
|
|
91
|
+
* { visual: { shape: 'sm' } },
|
|
92
|
+
* { visual: { shape: 'lg', elevation: 'md' } }
|
|
93
|
+
* );
|
|
94
|
+
* // Result: { visual: { shape: 'lg', elevation: 'md' } }
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @since 2.1.0
|
|
98
|
+
*/
|
|
99
|
+
export declare function mergeFactorGroups(...groupsList: FactorGroups[]): FactorGroups;
|
|
100
|
+
/**
|
|
101
|
+
* Extract all factor groups from a Factor24Config.
|
|
102
|
+
*
|
|
103
|
+
* @param config - The full Factor24Config
|
|
104
|
+
* @returns Extracted factor groups
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const groups = extractAllGroups({
|
|
109
|
+
* shape: 'lg',
|
|
110
|
+
* animation: 'smooth',
|
|
111
|
+
* orientation: 'horizontal',
|
|
112
|
+
* cursor: 'pointer',
|
|
113
|
+
* });
|
|
114
|
+
* // Result: {
|
|
115
|
+
* // visual: { shape: 'lg' },
|
|
116
|
+
* // motion: { animation: 'smooth' },
|
|
117
|
+
* // layout: { orientation: 'horizontal' },
|
|
118
|
+
* // experience: { cursor: 'pointer' }
|
|
119
|
+
* // }
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @since 2.1.0
|
|
123
|
+
*/
|
|
124
|
+
export declare function extractAllGroups(config: Partial<Factor24Config>): FactorGroups;
|
|
125
|
+
/**
|
|
126
|
+
* Check if an object contains any visual group properties.
|
|
127
|
+
*
|
|
128
|
+
* @param obj - Object to check
|
|
129
|
+
* @returns True if object has visual group properties
|
|
130
|
+
* @since 2.1.0
|
|
131
|
+
*/
|
|
132
|
+
export declare function hasVisualGroupProps(obj: Record<string, unknown>): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Check if an object contains any motion group properties.
|
|
135
|
+
*
|
|
136
|
+
* @param obj - Object to check
|
|
137
|
+
* @returns True if object has motion group properties
|
|
138
|
+
* @since 2.1.0
|
|
139
|
+
*/
|
|
140
|
+
export declare function hasMotionGroupProps(obj: Record<string, unknown>): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Check if an object contains any layout group properties.
|
|
143
|
+
*
|
|
144
|
+
* @param obj - Object to check
|
|
145
|
+
* @returns True if object has layout group properties
|
|
146
|
+
* @since 2.1.0
|
|
147
|
+
*/
|
|
148
|
+
export declare function hasLayoutGroupProps(obj: Record<string, unknown>): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Check if an object contains any experience group properties.
|
|
151
|
+
*
|
|
152
|
+
* @param obj - Object to check
|
|
153
|
+
* @returns True if object has experience group properties
|
|
154
|
+
* @since 2.1.0
|
|
155
|
+
*/
|
|
156
|
+
export declare function hasExperienceGroupProps(obj: Record<string, unknown>): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Detect which groups are present in an object.
|
|
159
|
+
*
|
|
160
|
+
* @param obj - Object to check
|
|
161
|
+
* @returns Object indicating which groups are present
|
|
162
|
+
* @since 2.1.0
|
|
163
|
+
*/
|
|
164
|
+
export declare function detectGroups(obj: Record<string, unknown>): {
|
|
165
|
+
hasVisual: boolean;
|
|
166
|
+
hasMotion: boolean;
|
|
167
|
+
hasLayout: boolean;
|
|
168
|
+
hasExperience: boolean;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* All group names.
|
|
172
|
+
*
|
|
173
|
+
* @since 2.1.0
|
|
174
|
+
*/
|
|
175
|
+
export declare const GROUP_NAMES: readonly ["visual", "motion", "layout", "experience"];
|
|
176
|
+
/**
|
|
177
|
+
* Group name type.
|
|
178
|
+
*
|
|
179
|
+
* @since 2.1.0
|
|
180
|
+
*/
|
|
181
|
+
export type GroupName = (typeof GROUP_NAMES)[number];
|
|
182
|
+
/**
|
|
183
|
+
* Map of group names to their factor keys.
|
|
184
|
+
*
|
|
185
|
+
* @since 2.1.0
|
|
186
|
+
*/
|
|
187
|
+
export declare const GROUP_FACTOR_KEYS: Record<GroupName, ReadonlyArray<keyof Factor24Config>>;
|
|
188
|
+
/**
|
|
189
|
+
* Get the group name for a given factor key.
|
|
190
|
+
*
|
|
191
|
+
* @param factorKey - The factor key to look up
|
|
192
|
+
* @returns The group name or undefined if not found
|
|
193
|
+
* @since 2.1.0
|
|
194
|
+
*/
|
|
195
|
+
export declare function getGroupForFactor(factorKey: keyof Factor24Config): GroupName | undefined;
|
|
196
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout Group - Factor Group for Layout and Positioning
|
|
3
|
+
*
|
|
4
|
+
* Maps LayoutGroup props to Factor24Config factors.
|
|
5
|
+
* Handles position, orientation, density, spacing, overflow, and alignment.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module resolution/groups/layout-group
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { LayoutGroup, Factor24Config, FactorPosition, FactorOrientation, FactorDensity, FactorSpacing, FactorOverflow, FactorAlignment } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Expand LayoutGroup to Factor24Config.
|
|
16
|
+
*
|
|
17
|
+
* @param layout - The layout group configuration
|
|
18
|
+
* @returns Partial Factor24Config with layout-related factors
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const config = expandLayoutGroup({
|
|
23
|
+
* orientation: 'horizontal',
|
|
24
|
+
* density: 'compact',
|
|
25
|
+
* spacing: 'sm',
|
|
26
|
+
* });
|
|
27
|
+
* // Result: { orientation: 'horizontal', density: 'compact', spacing: 'sm' }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @since 2.1.0
|
|
31
|
+
*/
|
|
32
|
+
export declare function expandLayoutGroup(layout: LayoutGroup): Partial<Factor24Config>;
|
|
33
|
+
/**
|
|
34
|
+
* Predefined layout presets for common use cases.
|
|
35
|
+
*
|
|
36
|
+
* @since 2.1.0
|
|
37
|
+
*/
|
|
38
|
+
export declare const LAYOUT_PRESETS: Record<string, LayoutGroup>;
|
|
39
|
+
/**
|
|
40
|
+
* Valid position values.
|
|
41
|
+
*
|
|
42
|
+
* @since 2.1.0
|
|
43
|
+
*/
|
|
44
|
+
export declare const VALID_POSITIONS: ReadonlyArray<FactorPosition>;
|
|
45
|
+
/**
|
|
46
|
+
* Valid orientation values.
|
|
47
|
+
*
|
|
48
|
+
* @since 2.1.0
|
|
49
|
+
*/
|
|
50
|
+
export declare const VALID_ORIENTATIONS: ReadonlyArray<FactorOrientation>;
|
|
51
|
+
/**
|
|
52
|
+
* Valid density values.
|
|
53
|
+
*
|
|
54
|
+
* @since 2.1.0
|
|
55
|
+
*/
|
|
56
|
+
export declare const VALID_DENSITIES: ReadonlyArray<FactorDensity>;
|
|
57
|
+
/**
|
|
58
|
+
* Valid spacing values.
|
|
59
|
+
*
|
|
60
|
+
* @since 2.1.0
|
|
61
|
+
*/
|
|
62
|
+
export declare const VALID_SPACINGS: ReadonlyArray<FactorSpacing>;
|
|
63
|
+
/**
|
|
64
|
+
* Valid overflow values.
|
|
65
|
+
*
|
|
66
|
+
* @since 2.1.0
|
|
67
|
+
*/
|
|
68
|
+
export declare const VALID_OVERFLOWS: ReadonlyArray<FactorOverflow>;
|
|
69
|
+
/**
|
|
70
|
+
* Valid alignment values.
|
|
71
|
+
*
|
|
72
|
+
* @since 2.1.0
|
|
73
|
+
*/
|
|
74
|
+
export declare const VALID_ALIGNMENTS: ReadonlyArray<FactorAlignment>;
|
|
75
|
+
/**
|
|
76
|
+
* Check if a value is a valid position.
|
|
77
|
+
*
|
|
78
|
+
* @param value - The value to check
|
|
79
|
+
* @returns True if the value is a valid position
|
|
80
|
+
* @since 2.1.0
|
|
81
|
+
*/
|
|
82
|
+
export declare function isValidPosition(value: unknown): value is FactorPosition;
|
|
83
|
+
/**
|
|
84
|
+
* Check if a value is a valid orientation.
|
|
85
|
+
*
|
|
86
|
+
* @param value - The value to check
|
|
87
|
+
* @returns True if the value is a valid orientation
|
|
88
|
+
* @since 2.1.0
|
|
89
|
+
*/
|
|
90
|
+
export declare function isValidOrientation(value: unknown): value is FactorOrientation;
|
|
91
|
+
/**
|
|
92
|
+
* Check if a value is a valid density.
|
|
93
|
+
*
|
|
94
|
+
* @param value - The value to check
|
|
95
|
+
* @returns True if the value is a valid density
|
|
96
|
+
* @since 2.1.0
|
|
97
|
+
*/
|
|
98
|
+
export declare function isValidDensity(value: unknown): value is FactorDensity;
|
|
99
|
+
/**
|
|
100
|
+
* Check if a value is a valid spacing.
|
|
101
|
+
*
|
|
102
|
+
* @param value - The value to check
|
|
103
|
+
* @returns True if the value is a valid spacing
|
|
104
|
+
* @since 2.1.0
|
|
105
|
+
*/
|
|
106
|
+
export declare function isValidSpacing(value: unknown): value is FactorSpacing;
|
|
107
|
+
/**
|
|
108
|
+
* Check if a value is a valid overflow.
|
|
109
|
+
*
|
|
110
|
+
* @param value - The value to check
|
|
111
|
+
* @returns True if the value is a valid overflow
|
|
112
|
+
* @since 2.1.0
|
|
113
|
+
*/
|
|
114
|
+
export declare function isValidOverflow(value: unknown): value is FactorOverflow;
|
|
115
|
+
/**
|
|
116
|
+
* Check if a value is a valid alignment.
|
|
117
|
+
*
|
|
118
|
+
* @param value - The value to check
|
|
119
|
+
* @returns True if the value is a valid alignment
|
|
120
|
+
* @since 2.1.0
|
|
121
|
+
*/
|
|
122
|
+
export declare function isValidAlignment(value: unknown): value is FactorAlignment;
|
|
123
|
+
/**
|
|
124
|
+
* Validate a LayoutGroup configuration.
|
|
125
|
+
*
|
|
126
|
+
* @param layout - The layout group to validate
|
|
127
|
+
* @returns Validation result with errors if any
|
|
128
|
+
* @since 2.1.0
|
|
129
|
+
*/
|
|
130
|
+
export declare function validateLayoutGroup(layout: LayoutGroup): {
|
|
131
|
+
valid: boolean;
|
|
132
|
+
errors: string[];
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Get a layout preset by name.
|
|
136
|
+
*
|
|
137
|
+
* @param presetName - The name of the preset
|
|
138
|
+
* @returns The layout preset or undefined
|
|
139
|
+
* @since 2.1.0
|
|
140
|
+
*/
|
|
141
|
+
export declare function getLayoutPreset(presetName: string): LayoutGroup | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Merge multiple LayoutGroup configurations.
|
|
144
|
+
* Later values override earlier ones.
|
|
145
|
+
*
|
|
146
|
+
* @param groups - Layout groups to merge
|
|
147
|
+
* @returns Merged layout group
|
|
148
|
+
* @since 2.1.0
|
|
149
|
+
*/
|
|
150
|
+
export declare function mergeLayoutGroups(...groups: LayoutGroup[]): LayoutGroup;
|
|
151
|
+
/**
|
|
152
|
+
* Create a LayoutGroup from Factor24Config.
|
|
153
|
+
* Extracts layout-related factors from a full config.
|
|
154
|
+
*
|
|
155
|
+
* @param config - The full Factor24Config
|
|
156
|
+
* @returns Extracted LayoutGroup
|
|
157
|
+
* @since 2.1.0
|
|
158
|
+
*/
|
|
159
|
+
export declare function extractLayoutGroup(config: Partial<Factor24Config>): LayoutGroup;
|
|
160
|
+
/**
|
|
161
|
+
* Get CSS gap value from spacing factor.
|
|
162
|
+
*
|
|
163
|
+
* @param spacing - The spacing factor
|
|
164
|
+
* @returns CSS gap value string
|
|
165
|
+
* @since 2.1.0
|
|
166
|
+
*/
|
|
167
|
+
export declare function getSpacingValue(spacing: FactorSpacing): string;
|
|
168
|
+
/**
|
|
169
|
+
* Get flexbox direction based on orientation.
|
|
170
|
+
*
|
|
171
|
+
* @param orientation - The orientation factor
|
|
172
|
+
* @returns CSS flex-direction value
|
|
173
|
+
* @since 2.1.0
|
|
174
|
+
*/
|
|
175
|
+
export declare function getFlexDirection(orientation: FactorOrientation): string;
|
|
176
|
+
/**
|
|
177
|
+
* Get CSS justify-content value from alignment factor.
|
|
178
|
+
*
|
|
179
|
+
* @param alignment - The alignment factor
|
|
180
|
+
* @returns CSS justify-content value
|
|
181
|
+
* @since 2.1.0
|
|
182
|
+
*/
|
|
183
|
+
export declare function getJustifyContent(alignment: FactorAlignment): string;
|
|
184
|
+
/**
|
|
185
|
+
* Get CSS align-items value from alignment factor.
|
|
186
|
+
*
|
|
187
|
+
* @param alignment - The alignment factor
|
|
188
|
+
* @returns CSS align-items value
|
|
189
|
+
* @since 2.1.0
|
|
190
|
+
*/
|
|
191
|
+
export declare function getAlignItems(alignment: FactorAlignment): string;
|
|
192
|
+
//# sourceMappingURL=layout-group.d.ts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion Group - Factor Group for Animation and Transitions
|
|
3
|
+
*
|
|
4
|
+
* Maps MotionGroup props to Factor24Config factors.
|
|
5
|
+
* Handles animation presets and transition timing.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module resolution/groups/motion-group
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { MotionGroup, Factor24Config, FactorAnimation, FactorTransition } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Expand MotionGroup to Factor24Config.
|
|
16
|
+
*
|
|
17
|
+
* @param motion - The motion group configuration
|
|
18
|
+
* @returns Partial Factor24Config with motion-related factors
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const config = expandMotionGroup({
|
|
23
|
+
* animation: 'smooth',
|
|
24
|
+
* transition: 'fast',
|
|
25
|
+
* });
|
|
26
|
+
* // Result: { animation: 'smooth', transition: 'fast' }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @since 2.1.0
|
|
30
|
+
*/
|
|
31
|
+
export declare function expandMotionGroup(motion: MotionGroup): Partial<Factor24Config>;
|
|
32
|
+
/**
|
|
33
|
+
* Predefined motion presets for common use cases.
|
|
34
|
+
*
|
|
35
|
+
* @since 2.1.0
|
|
36
|
+
*/
|
|
37
|
+
export declare const MOTION_PRESETS: Record<string, MotionGroup>;
|
|
38
|
+
/**
|
|
39
|
+
* Valid animation values.
|
|
40
|
+
*
|
|
41
|
+
* @since 2.1.0
|
|
42
|
+
*/
|
|
43
|
+
export declare const VALID_ANIMATIONS: ReadonlyArray<FactorAnimation>;
|
|
44
|
+
/**
|
|
45
|
+
* Valid transition values.
|
|
46
|
+
*
|
|
47
|
+
* @since 2.1.0
|
|
48
|
+
*/
|
|
49
|
+
export declare const VALID_TRANSITIONS: ReadonlyArray<FactorTransition>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a value is a valid animation.
|
|
52
|
+
*
|
|
53
|
+
* @param value - The value to check
|
|
54
|
+
* @returns True if the value is a valid animation
|
|
55
|
+
* @since 2.1.0
|
|
56
|
+
*/
|
|
57
|
+
export declare function isValidAnimation(value: unknown): value is FactorAnimation;
|
|
58
|
+
/**
|
|
59
|
+
* Check if a value is a valid transition.
|
|
60
|
+
*
|
|
61
|
+
* @param value - The value to check
|
|
62
|
+
* @returns True if the value is a valid transition
|
|
63
|
+
* @since 2.1.0
|
|
64
|
+
*/
|
|
65
|
+
export declare function isValidTransition(value: unknown): value is FactorTransition;
|
|
66
|
+
/**
|
|
67
|
+
* Validate a MotionGroup configuration.
|
|
68
|
+
*
|
|
69
|
+
* @param motion - The motion group to validate
|
|
70
|
+
* @returns Validation result with errors if any
|
|
71
|
+
* @since 2.1.0
|
|
72
|
+
*/
|
|
73
|
+
export declare function validateMotionGroup(motion: MotionGroup): {
|
|
74
|
+
valid: boolean;
|
|
75
|
+
errors: string[];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Get a motion preset by name.
|
|
79
|
+
*
|
|
80
|
+
* @param presetName - The name of the preset
|
|
81
|
+
* @returns The motion preset or undefined
|
|
82
|
+
* @since 2.1.0
|
|
83
|
+
*/
|
|
84
|
+
export declare function getMotionPreset(presetName: string): MotionGroup | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Merge multiple MotionGroup configurations.
|
|
87
|
+
* Later values override earlier ones.
|
|
88
|
+
*
|
|
89
|
+
* @param groups - Motion groups to merge
|
|
90
|
+
* @returns Merged motion group
|
|
91
|
+
* @since 2.1.0
|
|
92
|
+
*/
|
|
93
|
+
export declare function mergeMotionGroups(...groups: MotionGroup[]): MotionGroup;
|
|
94
|
+
/**
|
|
95
|
+
* Create a MotionGroup from Factor24Config.
|
|
96
|
+
* Extracts motion-related factors from a full config.
|
|
97
|
+
*
|
|
98
|
+
* @param config - The full Factor24Config
|
|
99
|
+
* @returns Extracted MotionGroup
|
|
100
|
+
* @since 2.1.0
|
|
101
|
+
*/
|
|
102
|
+
export declare function extractMotionGroup(config: Partial<Factor24Config>): MotionGroup;
|
|
103
|
+
/**
|
|
104
|
+
* Get animation duration in milliseconds based on transition setting.
|
|
105
|
+
*
|
|
106
|
+
* @param transition - The transition setting
|
|
107
|
+
* @returns Duration in milliseconds
|
|
108
|
+
* @since 2.1.0
|
|
109
|
+
*/
|
|
110
|
+
export declare function getTransitionDuration(transition: FactorTransition): number;
|
|
111
|
+
/**
|
|
112
|
+
* Get CSS easing function based on animation type.
|
|
113
|
+
*
|
|
114
|
+
* @param animation - The animation type
|
|
115
|
+
* @returns CSS easing function string
|
|
116
|
+
* @since 2.1.0
|
|
117
|
+
*/
|
|
118
|
+
export declare function getAnimationEasing(animation: FactorAnimation): string;
|
|
119
|
+
/**
|
|
120
|
+
* Check if motion should be reduced based on configuration.
|
|
121
|
+
*
|
|
122
|
+
* @param motion - The motion group
|
|
123
|
+
* @returns True if motion should be reduced
|
|
124
|
+
* @since 2.1.0
|
|
125
|
+
*/
|
|
126
|
+
export declare function shouldReduceMotion(motion: MotionGroup): boolean;
|
|
127
|
+
//# sourceMappingURL=motion-group.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual Group - Factor Group for Visual Appearance
|
|
3
|
+
*
|
|
4
|
+
* Maps VisualGroup props to Factor24Config factors.
|
|
5
|
+
* Handles shape, border, opacity, elevation, and color scheme.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module resolution/groups/visual-group
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { VisualGroup, Factor24Config, FactorShape, FactorBorder, FactorOpacity, FactorElevation, ColorScheme } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Expand VisualGroup to Factor24Config.
|
|
16
|
+
*
|
|
17
|
+
* @param visual - The visual group configuration
|
|
18
|
+
* @returns Partial Factor24Config with visual-related factors
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const config = expandVisualGroup({
|
|
23
|
+
* shape: 'lg',
|
|
24
|
+
* elevation: 'md',
|
|
25
|
+
* colorScheme: 'primary',
|
|
26
|
+
* });
|
|
27
|
+
* // Result: { shape: 'lg', elevation: 'md', colorScheme: 'primary' }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @since 2.1.0
|
|
31
|
+
*/
|
|
32
|
+
export declare function expandVisualGroup(visual: VisualGroup): Partial<Factor24Config>;
|
|
33
|
+
/**
|
|
34
|
+
* Predefined visual presets for common use cases.
|
|
35
|
+
*
|
|
36
|
+
* @since 2.1.0
|
|
37
|
+
*/
|
|
38
|
+
export declare const VISUAL_PRESETS: Record<string, VisualGroup>;
|
|
39
|
+
/**
|
|
40
|
+
* Valid shape values.
|
|
41
|
+
*
|
|
42
|
+
* @since 2.1.0
|
|
43
|
+
*/
|
|
44
|
+
export declare const VALID_SHAPES: ReadonlyArray<FactorShape>;
|
|
45
|
+
/**
|
|
46
|
+
* Valid border values.
|
|
47
|
+
*
|
|
48
|
+
* @since 2.1.0
|
|
49
|
+
*/
|
|
50
|
+
export declare const VALID_BORDERS: ReadonlyArray<FactorBorder>;
|
|
51
|
+
/**
|
|
52
|
+
* Valid opacity values.
|
|
53
|
+
*
|
|
54
|
+
* @since 2.1.0
|
|
55
|
+
*/
|
|
56
|
+
export declare const VALID_OPACITIES: ReadonlyArray<FactorOpacity>;
|
|
57
|
+
/**
|
|
58
|
+
* Valid elevation values.
|
|
59
|
+
*
|
|
60
|
+
* @since 2.1.0
|
|
61
|
+
*/
|
|
62
|
+
export declare const VALID_ELEVATIONS: ReadonlyArray<FactorElevation>;
|
|
63
|
+
/**
|
|
64
|
+
* Valid color scheme values.
|
|
65
|
+
*
|
|
66
|
+
* @since 2.1.0
|
|
67
|
+
*/
|
|
68
|
+
export declare const VALID_COLOR_SCHEMES: ReadonlyArray<ColorScheme>;
|
|
69
|
+
/**
|
|
70
|
+
* Check if a value is a valid shape.
|
|
71
|
+
*
|
|
72
|
+
* @param value - The value to check
|
|
73
|
+
* @returns True if the value is a valid shape
|
|
74
|
+
* @since 2.1.0
|
|
75
|
+
*/
|
|
76
|
+
export declare function isValidShape(value: unknown): value is FactorShape;
|
|
77
|
+
/**
|
|
78
|
+
* Check if a value is a valid border.
|
|
79
|
+
*
|
|
80
|
+
* @param value - The value to check
|
|
81
|
+
* @returns True if the value is a valid border
|
|
82
|
+
* @since 2.1.0
|
|
83
|
+
*/
|
|
84
|
+
export declare function isValidBorder(value: unknown): value is FactorBorder;
|
|
85
|
+
/**
|
|
86
|
+
* Check if a value is a valid opacity.
|
|
87
|
+
*
|
|
88
|
+
* @param value - The value to check
|
|
89
|
+
* @returns True if the value is a valid opacity
|
|
90
|
+
* @since 2.1.0
|
|
91
|
+
*/
|
|
92
|
+
export declare function isValidOpacity(value: unknown): value is FactorOpacity;
|
|
93
|
+
/**
|
|
94
|
+
* Check if a value is a valid elevation.
|
|
95
|
+
*
|
|
96
|
+
* @param value - The value to check
|
|
97
|
+
* @returns True if the value is a valid elevation
|
|
98
|
+
* @since 2.1.0
|
|
99
|
+
*/
|
|
100
|
+
export declare function isValidElevation(value: unknown): value is FactorElevation;
|
|
101
|
+
/**
|
|
102
|
+
* Check if a value is a valid color scheme.
|
|
103
|
+
*
|
|
104
|
+
* @param value - The value to check
|
|
105
|
+
* @returns True if the value is a valid color scheme
|
|
106
|
+
* @since 2.1.0
|
|
107
|
+
*/
|
|
108
|
+
export declare function isValidColorScheme(value: unknown): value is ColorScheme;
|
|
109
|
+
/**
|
|
110
|
+
* Validate a VisualGroup configuration.
|
|
111
|
+
*
|
|
112
|
+
* @param visual - The visual group to validate
|
|
113
|
+
* @returns Validation result with errors if any
|
|
114
|
+
* @since 2.1.0
|
|
115
|
+
*/
|
|
116
|
+
export declare function validateVisualGroup(visual: VisualGroup): {
|
|
117
|
+
valid: boolean;
|
|
118
|
+
errors: string[];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Get a visual preset by name.
|
|
122
|
+
*
|
|
123
|
+
* @param presetName - The name of the preset
|
|
124
|
+
* @returns The visual preset or undefined
|
|
125
|
+
* @since 2.1.0
|
|
126
|
+
*/
|
|
127
|
+
export declare function getVisualPreset(presetName: string): VisualGroup | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Merge multiple VisualGroup configurations.
|
|
130
|
+
* Later values override earlier ones.
|
|
131
|
+
*
|
|
132
|
+
* @param groups - Visual groups to merge
|
|
133
|
+
* @returns Merged visual group
|
|
134
|
+
* @since 2.1.0
|
|
135
|
+
*/
|
|
136
|
+
export declare function mergeVisualGroups(...groups: VisualGroup[]): VisualGroup;
|
|
137
|
+
/**
|
|
138
|
+
* Create a VisualGroup from Factor24Config.
|
|
139
|
+
* Extracts visual-related factors from a full config.
|
|
140
|
+
*
|
|
141
|
+
* @param config - The full Factor24Config
|
|
142
|
+
* @returns Extracted VisualGroup
|
|
143
|
+
* @since 2.1.0
|
|
144
|
+
*/
|
|
145
|
+
export declare function extractVisualGroup(config: Partial<Factor24Config>): VisualGroup;
|
|
146
|
+
//# sourceMappingURL=visual-group.d.ts.map
|