@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,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Module
|
|
3
|
+
* Hybrid storage system with visibility-based routing
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module storage
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Section Storage Manager
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The main storage manager provides visibility-based routing:
|
|
16
|
+
* - private: Local JSON file only
|
|
17
|
+
* - team: Local JSON + Cloud sync
|
|
18
|
+
* - public: Local JSON + Cloud sync + Marketplace
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { saveTemplate, loadTemplate } from '@nikkory/engine/storage';
|
|
23
|
+
*
|
|
24
|
+
* // Save with auto-routing based on visibility
|
|
25
|
+
* const saveResult = await saveTemplate(myTemplate);
|
|
26
|
+
*
|
|
27
|
+
* // Load from appropriate source
|
|
28
|
+
* const loadResult = await loadTemplate('hero-001', 'team');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export { saveTemplate, loadTemplate, deleteTemplate, listTemplates, forceSync, getSyncStatus, batchSync, createStorageConfig, getVisibilityRules, serializeTemplate, parseTemplate, generateFilename, isValidTemplateId, getTemplatePath, DEFAULT_LOCAL_STORAGE_PATH, TEMPLATE_SCHEMA_VERSION, isSyncEnabled, isMarketplaceEnabled, VISIBILITY_SYNC_RULES, } from './section-storage';
|
|
32
|
+
/**
|
|
33
|
+
* Storage types for external use
|
|
34
|
+
*/
|
|
35
|
+
export type { StorageConfig, StorageManagerOptions, SaveResult, LoadResult, TemplateListResult, StorageResult, TemplateFileData, SyncResult, SyncStatus, SyncOptions, BatchSyncResult, } from './section-storage';
|
|
36
|
+
/**
|
|
37
|
+
* Local Storage Module
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Direct access to local JSON file storage.
|
|
41
|
+
* Use section-storage for visibility-based routing instead.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import { saveToJSON, loadFromJSON } from '@nikkory/engine/storage';
|
|
46
|
+
*
|
|
47
|
+
* // Direct local save (no sync)
|
|
48
|
+
* const result = await saveToJSON(template, '/path/to/storage');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export { saveToJSON, loadFromJSON, listLocalTemplates, deleteFromLocal } from './local-storage';
|
|
52
|
+
/**
|
|
53
|
+
* Cloud Sync Module
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Direct access to cloud synchronization.
|
|
57
|
+
* Use section-storage for visibility-based routing instead.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { syncToCloud, fetchFromCloud } from '@nikkory/engine/storage';
|
|
62
|
+
*
|
|
63
|
+
* // Direct cloud sync
|
|
64
|
+
* const result = await syncToCloud(template);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export { syncToCloud, fetchFromCloud, deleteFromCloud, batchSyncToCloud, checkSyncStatus, resolveConflict, } from './cloud-sync';
|
|
68
|
+
export type { SyncConflict } from './cloud-sync';
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local Storage Module
|
|
3
|
+
* JSON file-based storage for section templates
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module storage/local-storage
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import type { SectionTemplate, SectionTemplateWithFactors } from '../types/section-template.types';
|
|
12
|
+
/**
|
|
13
|
+
* Storage operation result
|
|
14
|
+
*/
|
|
15
|
+
export interface StorageResult<T> {
|
|
16
|
+
/** Whether operation succeeded */
|
|
17
|
+
readonly success: boolean;
|
|
18
|
+
/** Result data if successful */
|
|
19
|
+
readonly data?: T;
|
|
20
|
+
/** Error message if failed */
|
|
21
|
+
readonly error?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Template file structure for JSON storage
|
|
25
|
+
*/
|
|
26
|
+
export interface TemplateFileData {
|
|
27
|
+
/** Schema version for migrations */
|
|
28
|
+
readonly schemaVersion: string;
|
|
29
|
+
/** Template data */
|
|
30
|
+
readonly template: SectionTemplate | SectionTemplateWithFactors;
|
|
31
|
+
/** Created timestamp */
|
|
32
|
+
readonly createdAt: string;
|
|
33
|
+
/** Last modified timestamp */
|
|
34
|
+
readonly updatedAt: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Default local storage directory (relative to user data)
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEFAULT_LOCAL_STORAGE_PATH = ".nikkory/templates";
|
|
40
|
+
/**
|
|
41
|
+
* Current schema version for template files
|
|
42
|
+
*/
|
|
43
|
+
export declare const TEMPLATE_SCHEMA_VERSION = "1.0.0";
|
|
44
|
+
/**
|
|
45
|
+
* Save template to JSON file
|
|
46
|
+
*
|
|
47
|
+
* @param template - Template to save
|
|
48
|
+
* @param basePath - Base directory path for storage
|
|
49
|
+
* @returns Storage result with file path
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const result = await saveToJSON(myTemplate, '/home/user/.nikkory/templates');
|
|
54
|
+
* if (result.success) {
|
|
55
|
+
* console.log('Saved to:', result.data);
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function saveToJSON(template: SectionTemplate | SectionTemplateWithFactors, basePath?: string): Promise<StorageResult<string>>;
|
|
60
|
+
/**
|
|
61
|
+
* Serialize template to JSON string
|
|
62
|
+
*
|
|
63
|
+
* @param template - Template to serialize
|
|
64
|
+
* @returns Serialized JSON string
|
|
65
|
+
*/
|
|
66
|
+
export declare function serializeTemplate(template: SectionTemplate | SectionTemplateWithFactors): string;
|
|
67
|
+
/**
|
|
68
|
+
* Load template from JSON file
|
|
69
|
+
*
|
|
70
|
+
* @param templateId - Template identifier to load
|
|
71
|
+
* @param visibility - Template visibility (determines folder)
|
|
72
|
+
* @param basePath - Base directory path for storage
|
|
73
|
+
* @returns Storage result with template data
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const result = await loadFromJSON('hero-001', 'private');
|
|
78
|
+
* if (result.success && result.data) {
|
|
79
|
+
* console.log('Loaded template:', result.data.templateName);
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function loadFromJSON(templateId: string, visibility: 'private' | 'team' | 'public', basePath?: string): Promise<StorageResult<SectionTemplate | SectionTemplateWithFactors>>;
|
|
84
|
+
/**
|
|
85
|
+
* Parse JSON string to template
|
|
86
|
+
*
|
|
87
|
+
* @param jsonContent - JSON string to parse
|
|
88
|
+
* @returns Storage result with parsed template
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseTemplate(jsonContent: string): StorageResult<SectionTemplate | SectionTemplateWithFactors>;
|
|
91
|
+
/**
|
|
92
|
+
* List all templates in a visibility folder
|
|
93
|
+
*
|
|
94
|
+
* @param visibility - Template visibility to list
|
|
95
|
+
* @param basePath - Base directory path for storage
|
|
96
|
+
* @returns Storage result with template IDs
|
|
97
|
+
*/
|
|
98
|
+
export declare function listLocalTemplates(visibility: 'private' | 'team' | 'public', basePath?: string): Promise<StorageResult<readonly string[]>>;
|
|
99
|
+
/**
|
|
100
|
+
* Delete template from local storage
|
|
101
|
+
*
|
|
102
|
+
* @param templateId - Template identifier to delete
|
|
103
|
+
* @param visibility - Template visibility
|
|
104
|
+
* @param basePath - Base directory path for storage
|
|
105
|
+
* @returns Storage result with success status
|
|
106
|
+
*/
|
|
107
|
+
export declare function deleteFromLocal(templateId: string, visibility: 'private' | 'team' | 'public', basePath?: string): Promise<StorageResult<boolean>>;
|
|
108
|
+
/**
|
|
109
|
+
* Generate filename from template ID
|
|
110
|
+
*
|
|
111
|
+
* @param templateId - Template identifier
|
|
112
|
+
* @returns Sanitized filename with .json extension
|
|
113
|
+
*/
|
|
114
|
+
export declare function generateFilename(templateId: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* Validate template ID format
|
|
117
|
+
*
|
|
118
|
+
* @param templateId - Template identifier to validate
|
|
119
|
+
* @returns Whether the ID is valid
|
|
120
|
+
*/
|
|
121
|
+
export declare function isValidTemplateId(templateId: string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Generate storage path for template
|
|
124
|
+
*
|
|
125
|
+
* @param visibility - Template visibility
|
|
126
|
+
* @param templateId - Template identifier
|
|
127
|
+
* @param basePath - Base directory path
|
|
128
|
+
* @returns Full storage path
|
|
129
|
+
*/
|
|
130
|
+
export declare function getTemplatePath(visibility: 'private' | 'team' | 'public', templateId: string, basePath?: string): string;
|
|
131
|
+
//# sourceMappingURL=local-storage.d.ts.map
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Storage Manager
|
|
3
|
+
* Hybrid storage manager with visibility-based routing
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module storage/section-storage
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*
|
|
9
|
+
* Powered by Nikkory
|
|
10
|
+
*/
|
|
11
|
+
import { isSyncEnabled, isMarketplaceEnabled, VISIBILITY_SYNC_RULES } from './cloud-sync';
|
|
12
|
+
import { serializeTemplate, parseTemplate, generateFilename, isValidTemplateId, getTemplatePath, DEFAULT_LOCAL_STORAGE_PATH, TEMPLATE_SCHEMA_VERSION } from './local-storage';
|
|
13
|
+
import type { SyncResult, SyncStatus, SyncOptions, BatchSyncResult } from './cloud-sync';
|
|
14
|
+
import type { StorageResult, TemplateFileData } from './local-storage';
|
|
15
|
+
import type { SectionTemplate, SectionTemplateWithFactors, TemplateVisibility } from '../types/section-template.types';
|
|
16
|
+
/**
|
|
17
|
+
* Storage configuration for templates
|
|
18
|
+
*/
|
|
19
|
+
export interface StorageConfig {
|
|
20
|
+
/** Template visibility determines storage location */
|
|
21
|
+
readonly visibility: TemplateVisibility;
|
|
22
|
+
/** Local storage base path */
|
|
23
|
+
readonly localPath: string;
|
|
24
|
+
/** Whether cloud sync is enabled */
|
|
25
|
+
readonly cloudSyncEnabled: boolean;
|
|
26
|
+
/** Last sync timestamp */
|
|
27
|
+
readonly lastSyncedAt?: Date;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Storage manager options
|
|
31
|
+
*/
|
|
32
|
+
export interface StorageManagerOptions {
|
|
33
|
+
/** Base path for local storage */
|
|
34
|
+
readonly basePath?: string;
|
|
35
|
+
/** Auto-sync on save */
|
|
36
|
+
readonly autoSync?: boolean;
|
|
37
|
+
/** Cloud sync options */
|
|
38
|
+
readonly syncOptions?: SyncOptions;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Save operation result
|
|
42
|
+
*/
|
|
43
|
+
export interface SaveResult {
|
|
44
|
+
/** Whether save succeeded */
|
|
45
|
+
readonly success: boolean;
|
|
46
|
+
/** Local file path */
|
|
47
|
+
readonly localPath?: string;
|
|
48
|
+
/** Whether cloud sync was triggered */
|
|
49
|
+
readonly syncTriggered: boolean;
|
|
50
|
+
/** Sync result if triggered */
|
|
51
|
+
readonly syncResult?: SyncResult<string> | SyncResult<boolean>;
|
|
52
|
+
/** Error message if failed */
|
|
53
|
+
readonly error?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Load operation result
|
|
57
|
+
*/
|
|
58
|
+
export interface LoadResult {
|
|
59
|
+
/** Whether load succeeded */
|
|
60
|
+
readonly success: boolean;
|
|
61
|
+
/** Loaded template */
|
|
62
|
+
readonly template?: SectionTemplate | SectionTemplateWithFactors;
|
|
63
|
+
/** Source: 'local' or 'cloud' */
|
|
64
|
+
readonly source?: 'local' | 'cloud';
|
|
65
|
+
/** Error message if failed */
|
|
66
|
+
readonly error?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Save template with visibility-based routing
|
|
70
|
+
*
|
|
71
|
+
* @param template - Template to save
|
|
72
|
+
* @param options - Storage manager options
|
|
73
|
+
* @returns Save result
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* Routes storage based on visibility:
|
|
77
|
+
* - private: Local JSON file only
|
|
78
|
+
* - team: Local JSON + Cloud sync
|
|
79
|
+
* - public: Local JSON + Cloud sync + Marketplace
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Save private template (local only)
|
|
84
|
+
* const result = await saveTemplate({
|
|
85
|
+
* ...config,
|
|
86
|
+
* visibility: 'private',
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* // Save team template (local + cloud sync)
|
|
90
|
+
* const result = await saveTemplate({
|
|
91
|
+
* ...config,
|
|
92
|
+
* visibility: 'team',
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function saveTemplate(template: SectionTemplate | SectionTemplateWithFactors, options?: StorageManagerOptions): Promise<SaveResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Load template with visibility-based routing
|
|
99
|
+
*
|
|
100
|
+
* @param templateId - Template identifier
|
|
101
|
+
* @param visibility - Template visibility
|
|
102
|
+
* @param options - Storage manager options
|
|
103
|
+
* @returns Load result
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Attempts to load from local first, then cloud if not found.
|
|
107
|
+
* Private templates only check local storage.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const result = await loadTemplate('hero-001', 'private');
|
|
112
|
+
* if (result.success && result.template) {
|
|
113
|
+
* console.log('Loaded:', result.template.templateName);
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function loadTemplate(templateId: string, visibility: TemplateVisibility, options?: StorageManagerOptions): Promise<LoadResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Delete template from storage
|
|
120
|
+
*
|
|
121
|
+
* @param templateId - Template identifier
|
|
122
|
+
* @param visibility - Template visibility
|
|
123
|
+
* @param options - Storage manager options
|
|
124
|
+
* @returns Delete result
|
|
125
|
+
*/
|
|
126
|
+
export declare function deleteTemplate(templateId: string, visibility: TemplateVisibility, options?: StorageManagerOptions): Promise<SaveResult>;
|
|
127
|
+
/**
|
|
128
|
+
* List templates by visibility
|
|
129
|
+
*/
|
|
130
|
+
export interface TemplateListResult {
|
|
131
|
+
/** Whether list succeeded */
|
|
132
|
+
readonly success: boolean;
|
|
133
|
+
/** Template IDs */
|
|
134
|
+
readonly templateIds?: readonly string[];
|
|
135
|
+
/** Error message if failed */
|
|
136
|
+
readonly error?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* List all templates for a visibility
|
|
140
|
+
*
|
|
141
|
+
* @param visibility - Template visibility to list
|
|
142
|
+
* @param options - Storage manager options
|
|
143
|
+
* @returns List of template IDs
|
|
144
|
+
*/
|
|
145
|
+
export declare function listTemplates(visibility: TemplateVisibility, options?: StorageManagerOptions): Promise<TemplateListResult>;
|
|
146
|
+
/**
|
|
147
|
+
* Force sync template to cloud
|
|
148
|
+
*
|
|
149
|
+
* @param template - Template to sync
|
|
150
|
+
* @param options - Sync options
|
|
151
|
+
* @returns Sync result
|
|
152
|
+
*/
|
|
153
|
+
export declare function forceSync(template: SectionTemplate | SectionTemplateWithFactors, options?: SyncOptions): Promise<SyncResult<string>>;
|
|
154
|
+
/**
|
|
155
|
+
* Get sync status for a template
|
|
156
|
+
*
|
|
157
|
+
* @param templateId - Template identifier
|
|
158
|
+
* @param localVersion - Local version
|
|
159
|
+
* @param options - Sync options
|
|
160
|
+
* @returns Sync status
|
|
161
|
+
*/
|
|
162
|
+
export declare function getSyncStatus(templateId: string, localVersion: string, options?: SyncOptions): Promise<SyncResult<SyncStatus>>;
|
|
163
|
+
/**
|
|
164
|
+
* Batch sync multiple templates
|
|
165
|
+
*
|
|
166
|
+
* @param templates - Templates to sync
|
|
167
|
+
* @param options - Sync options
|
|
168
|
+
* @returns Batch sync result
|
|
169
|
+
*/
|
|
170
|
+
export declare function batchSync(templates: readonly (SectionTemplate | SectionTemplateWithFactors)[], options?: SyncOptions): Promise<BatchSyncResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Create storage config for a template
|
|
173
|
+
*
|
|
174
|
+
* @param visibility - Template visibility
|
|
175
|
+
* @param basePath - Local storage path
|
|
176
|
+
* @returns Storage configuration
|
|
177
|
+
*/
|
|
178
|
+
export declare function createStorageConfig(visibility: TemplateVisibility, basePath?: string): StorageConfig;
|
|
179
|
+
/**
|
|
180
|
+
* Get visibility rules
|
|
181
|
+
*/
|
|
182
|
+
export declare function getVisibilityRules(visibility: TemplateVisibility): {
|
|
183
|
+
readonly syncEnabled: boolean;
|
|
184
|
+
readonly marketplaceListing: boolean;
|
|
185
|
+
readonly requiresAuth: boolean;
|
|
186
|
+
};
|
|
187
|
+
export { serializeTemplate, parseTemplate, generateFilename, isValidTemplateId, getTemplatePath, DEFAULT_LOCAL_STORAGE_PATH, TEMPLATE_SCHEMA_VERSION, };
|
|
188
|
+
export { isSyncEnabled, isMarketplaceEnabled, VISIBILITY_SYNC_RULES };
|
|
189
|
+
export type { StorageResult, TemplateFileData };
|
|
190
|
+
export type { SyncResult, SyncStatus, SyncOptions, BatchSyncResult };
|
|
191
|
+
//# sourceMappingURL=section-storage.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style Generator
|
|
3
|
+
*
|
|
4
|
+
* Core style generation engine that creates component styles from design tokens.
|
|
5
|
+
* This module provides the main API for generating component-specific CSS classes.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module generator/StyleGenerator
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { ComponentType, StyleConfig, GeneratedStyles } from './types';
|
|
14
|
+
import type { DesignTokens } from '../tokens/schema';
|
|
15
|
+
/**
|
|
16
|
+
* Combine class names, filtering out falsy values.
|
|
17
|
+
*
|
|
18
|
+
* @param classes - Class names to combine
|
|
19
|
+
* @returns Combined class string
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* cn('btn', isActive && 'btn-active', size === 'lg' && 'btn-lg')
|
|
24
|
+
* // => "btn btn-active btn-lg" or "btn" depending on conditions
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @since 2.0.0
|
|
28
|
+
*/
|
|
29
|
+
export declare function cn(...classes: (string | undefined | null | false)[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate component styles from design tokens.
|
|
32
|
+
*
|
|
33
|
+
* @param component - Component type
|
|
34
|
+
* @param tokens - Design tokens from the token system
|
|
35
|
+
* @param config - Style configuration
|
|
36
|
+
* @returns Generated styles with combined className
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const styles = generateStyles('button', tokens, {
|
|
41
|
+
* variant: 'filled',
|
|
42
|
+
* size: 'md',
|
|
43
|
+
* colorScheme: 'primary',
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* return <button className={styles.className}>Click me</button>;
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @since 2.0.0
|
|
50
|
+
*/
|
|
51
|
+
export declare function generateStyles(component: ComponentType, tokens: DesignTokens, config?: StyleConfig): GeneratedStyles;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a component type is supported.
|
|
54
|
+
*
|
|
55
|
+
* @param component - Component type to check
|
|
56
|
+
* @returns true if supported
|
|
57
|
+
*
|
|
58
|
+
* @since 2.0.0
|
|
59
|
+
*/
|
|
60
|
+
export declare function isComponentSupported(component: string): component is ComponentType;
|
|
61
|
+
/**
|
|
62
|
+
* Get all supported component types.
|
|
63
|
+
*
|
|
64
|
+
* @returns Array of supported component types
|
|
65
|
+
*
|
|
66
|
+
* @since 2.0.0
|
|
67
|
+
*/
|
|
68
|
+
export declare function getSupportedComponents(): ComponentType[];
|
|
69
|
+
export declare const StyleGenerator: {
|
|
70
|
+
generate: typeof generateStyles;
|
|
71
|
+
isSupported: typeof isComponentSupported;
|
|
72
|
+
getSupported: typeof getSupportedComponents;
|
|
73
|
+
cn: typeof cn;
|
|
74
|
+
};
|
|
75
|
+
export default StyleGenerator;
|
|
76
|
+
//# sourceMappingURL=StyleGenerator.d.ts.map
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Style Resolver
|
|
3
|
+
*
|
|
4
|
+
* Resolves design tokens to Tailwind CSS classes.
|
|
5
|
+
* This is the bridge between the token system and generated component styles.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module generator/TokenStyleResolver
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { ColorScheme, ComponentSize } from './types';
|
|
14
|
+
import type { DesignTokens } from '../tokens/schema';
|
|
15
|
+
/**
|
|
16
|
+
* Token resolution options.
|
|
17
|
+
*/
|
|
18
|
+
export interface TokenResolveOptions {
|
|
19
|
+
/** Design system tokens */
|
|
20
|
+
tokens: DesignTokens;
|
|
21
|
+
/** Color scheme to use */
|
|
22
|
+
colorScheme?: ColorScheme;
|
|
23
|
+
/** Component size */
|
|
24
|
+
size?: ComponentSize;
|
|
25
|
+
/** Variant type */
|
|
26
|
+
variant?: string;
|
|
27
|
+
/** Whether component is disabled */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Whether component is loading */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolved token values.
|
|
34
|
+
*/
|
|
35
|
+
export interface ResolvedTokenValues {
|
|
36
|
+
/** Background color class */
|
|
37
|
+
bgColor: string;
|
|
38
|
+
/** Text color class */
|
|
39
|
+
textColor: string;
|
|
40
|
+
/** Border color class */
|
|
41
|
+
borderColor: string;
|
|
42
|
+
/** Hover background class */
|
|
43
|
+
hoverBgColor: string;
|
|
44
|
+
/** Active background class */
|
|
45
|
+
activeBgColor: string;
|
|
46
|
+
/** Focus ring class */
|
|
47
|
+
focusRingColor: string;
|
|
48
|
+
/** Shadow class (base) */
|
|
49
|
+
shadow: string;
|
|
50
|
+
/** Hover shadow class (state) */
|
|
51
|
+
hoverShadow: string;
|
|
52
|
+
/** Border radius class */
|
|
53
|
+
borderRadius: string;
|
|
54
|
+
/** Padding classes */
|
|
55
|
+
padding: string;
|
|
56
|
+
/** Height class */
|
|
57
|
+
height: string;
|
|
58
|
+
/** Font size class */
|
|
59
|
+
fontSize: string;
|
|
60
|
+
/** Transition class */
|
|
61
|
+
transition: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Clear style cache.
|
|
65
|
+
*/
|
|
66
|
+
export declare function clearStyleCache(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve all token values to Tailwind classes.
|
|
69
|
+
*
|
|
70
|
+
* @param options - Resolution options
|
|
71
|
+
* @returns Resolved token values
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const values = resolveTokens({
|
|
76
|
+
* tokens: materialDesignTokens,
|
|
77
|
+
* colorScheme: 'primary',
|
|
78
|
+
* size: 'md',
|
|
79
|
+
* variant: 'filled',
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* console.log(values.bgColor); // "bg-[#6750A4]"
|
|
83
|
+
* console.log(values.textColor); // "text-[#FFFFFF]"
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveTokenStyles(options: TokenResolveOptions): ResolvedTokenValues;
|
|
87
|
+
/**
|
|
88
|
+
* Build combined class string from resolved values.
|
|
89
|
+
*
|
|
90
|
+
* @param values - Resolved token values
|
|
91
|
+
* @param includeStates - Whether to include hover/active states
|
|
92
|
+
* @returns Combined class string
|
|
93
|
+
*/
|
|
94
|
+
export declare function buildClassName(values: ResolvedTokenValues, includeStates?: boolean): string;
|
|
95
|
+
/**
|
|
96
|
+
* Tailwind responsive breakpoints.
|
|
97
|
+
*/
|
|
98
|
+
export type ResponsiveBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
99
|
+
/**
|
|
100
|
+
* Responsive value type - can be a single value or an object with breakpoint keys.
|
|
101
|
+
*/
|
|
102
|
+
export type ResponsiveValue<T> = T | Partial<Record<ResponsiveBreakpoint, T>>;
|
|
103
|
+
/**
|
|
104
|
+
* Apply responsive prefix to a class.
|
|
105
|
+
*
|
|
106
|
+
* @param breakpoint - The responsive breakpoint
|
|
107
|
+
* @param className - The class to prefix
|
|
108
|
+
* @returns Prefixed class string
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* applyResponsivePrefix('md', 'px-4'); // "md:px-4"
|
|
113
|
+
* applyResponsivePrefix('lg', 'text-lg'); // "lg:text-lg"
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare function applyResponsivePrefix(breakpoint: ResponsiveBreakpoint, className: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* Build responsive classes from a responsive value.
|
|
119
|
+
*
|
|
120
|
+
* @param value - Single value or object with breakpoint values
|
|
121
|
+
* @param resolver - Function to convert value to class
|
|
122
|
+
* @returns Array of responsive classes
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* // Single value
|
|
127
|
+
* buildResponsiveClasses('md', resolveSize);
|
|
128
|
+
* // Returns: ['h-10', 'px-4', 'text-sm']
|
|
129
|
+
*
|
|
130
|
+
* // Responsive object
|
|
131
|
+
* buildResponsiveClasses({ sm: 'sm', md: 'md', lg: 'lg' }, resolveSize);
|
|
132
|
+
* // Returns: ['sm:h-8', 'sm:px-3', 'h-10', 'px-4', 'lg:h-11', 'lg:px-5']
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
export declare function buildResponsiveClasses<T>(value: ResponsiveValue<T>, resolver: (val: T) => string): string[];
|
|
136
|
+
/**
|
|
137
|
+
* Build responsive size classes.
|
|
138
|
+
*
|
|
139
|
+
* @param size - Responsive size value
|
|
140
|
+
* @returns Responsive class string
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* // Single size
|
|
145
|
+
* buildResponsiveSizeClasses('md');
|
|
146
|
+
* // Returns: "h-10 px-4 text-sm"
|
|
147
|
+
*
|
|
148
|
+
* // Responsive sizes
|
|
149
|
+
* buildResponsiveSizeClasses({ sm: 'sm', lg: 'lg' });
|
|
150
|
+
* // Returns: "sm:h-8 sm:px-3 sm:text-sm lg:h-11 lg:px-5 lg:text-base"
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare function buildResponsiveSizeClasses(size: ResponsiveValue<ComponentSize>): string;
|
|
154
|
+
export declare const TokenStyleResolver: {
|
|
155
|
+
resolve: typeof resolveTokenStyles;
|
|
156
|
+
buildClassName: typeof buildClassName;
|
|
157
|
+
clearCache: typeof clearStyleCache;
|
|
158
|
+
applyResponsivePrefix: typeof applyResponsivePrefix;
|
|
159
|
+
buildResponsiveClasses: typeof buildResponsiveClasses;
|
|
160
|
+
buildResponsiveSizeClasses: typeof buildResponsiveSizeClasses;
|
|
161
|
+
};
|
|
162
|
+
export default TokenStyleResolver;
|
|
163
|
+
//# sourceMappingURL=TokenStyleResolver.d.ts.map
|