@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,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Granularity Slot Types
|
|
3
|
+
*
|
|
4
|
+
* This file defines the SlotConfig<G> and SlotPosition<G> generic types
|
|
5
|
+
* for managing component placement within parent granularities.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module types/granularity
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { GranularityLevel } from './base.types';
|
|
14
|
+
/**
|
|
15
|
+
* SlotPosition<G> - Level-specific slot positions
|
|
16
|
+
*
|
|
17
|
+
* Different granularity levels have different slot positions available.
|
|
18
|
+
* This conditional type ensures type safety when placing children.
|
|
19
|
+
*
|
|
20
|
+
* @category types
|
|
21
|
+
* @since 4.0.0
|
|
22
|
+
*
|
|
23
|
+
* @typeParam G - The granularity level
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Page has 6 slot positions
|
|
28
|
+
* type PageSlots = SlotPosition<'page'>;
|
|
29
|
+
* // = 'header' | 'main' | 'sidebar' | 'footer' | 'overlay' | 'floating'
|
|
30
|
+
*
|
|
31
|
+
* // Section has 5 slot positions
|
|
32
|
+
* type SectionSlots = SlotPosition<'section'>;
|
|
33
|
+
* // = 'header' | 'content' | 'footer' | 'sidebar' | 'overlay'
|
|
34
|
+
*
|
|
35
|
+
* // Layout has 4 slot positions
|
|
36
|
+
* type LayoutSlots = SlotPosition<'layout'>;
|
|
37
|
+
* // = 'header' | 'main' | 'sidebar' | 'footer'
|
|
38
|
+
*
|
|
39
|
+
* // Template has 3 slot positions
|
|
40
|
+
* type TemplateSlots = SlotPosition<'template'>;
|
|
41
|
+
* // = 'pages' | 'shared' | 'assets'
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Powered by Nikkory
|
|
45
|
+
*/
|
|
46
|
+
export type GranularitySlotPosition<G extends GranularityLevel> = G extends 'page' ? 'header' | 'main' | 'sidebar' | 'footer' | 'overlay' | 'floating' : G extends 'section' ? 'header' | 'content' | 'footer' | 'sidebar' | 'overlay' : G extends 'layout' ? 'header' | 'main' | 'sidebar' | 'footer' : G extends 'template' ? 'pages' | 'shared' | 'assets' : G extends 'component' ? 'content' | 'prefix' | 'suffix' : G extends 'atom' ? 'content' : string;
|
|
47
|
+
/**
|
|
48
|
+
* SlotConfig<G> - Configuration for a slot in a granularity
|
|
49
|
+
*
|
|
50
|
+
* Defines how children can be placed in a specific slot position,
|
|
51
|
+
* including allowed child types, maximum count, and defaults.
|
|
52
|
+
*
|
|
53
|
+
* @category types
|
|
54
|
+
* @since 4.0.0
|
|
55
|
+
*
|
|
56
|
+
* @typeParam G - The parent granularity level
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // Page main slot accepting sections
|
|
61
|
+
* const mainSlot: SlotConfig<'page'> = {
|
|
62
|
+
* slotId: 'main-content',
|
|
63
|
+
* position: 'main',
|
|
64
|
+
* allowedChildren: ['section', 'component'],
|
|
65
|
+
* maxChildren: 10,
|
|
66
|
+
* defaultChildren: ['hero-section', 'features-section']
|
|
67
|
+
* };
|
|
68
|
+
*
|
|
69
|
+
* // Section content slot accepting components
|
|
70
|
+
* const contentSlot: SlotConfig<'section'> = {
|
|
71
|
+
* slotId: 'section-content',
|
|
72
|
+
* position: 'content',
|
|
73
|
+
* allowedChildren: ['component', 'atom'],
|
|
74
|
+
* maxChildren: 20
|
|
75
|
+
* };
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* Powered by Nikkory
|
|
79
|
+
*/
|
|
80
|
+
export interface GranularitySlotConfig<G extends GranularityLevel> {
|
|
81
|
+
/** Slot identifier */
|
|
82
|
+
readonly slotId: string;
|
|
83
|
+
/** Position within parent (level-specific) */
|
|
84
|
+
readonly position: GranularitySlotPosition<G>;
|
|
85
|
+
/** Allowed child granularities */
|
|
86
|
+
readonly allowedChildren: readonly GranularityLevel[];
|
|
87
|
+
/** Maximum children in slot (-1 for unlimited) */
|
|
88
|
+
readonly maxChildren: number;
|
|
89
|
+
/** Default children to place (IDs or inline configs) */
|
|
90
|
+
readonly defaultChildren?: readonly string[];
|
|
91
|
+
/** Whether slot is required (must have at least one child) */
|
|
92
|
+
readonly required?: boolean;
|
|
93
|
+
/** Slot display name for UI */
|
|
94
|
+
readonly displayName?: string;
|
|
95
|
+
/** Slot description for documentation */
|
|
96
|
+
readonly description?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Default slot configurations for each granularity level
|
|
100
|
+
*
|
|
101
|
+
* @category constants
|
|
102
|
+
* @since 4.0.0
|
|
103
|
+
*
|
|
104
|
+
* Powered by Nikkory
|
|
105
|
+
*/
|
|
106
|
+
export declare const DEFAULT_PAGE_SLOTS: readonly GranularitySlotConfig<'page'>[];
|
|
107
|
+
/**
|
|
108
|
+
* Default slot configurations for sections
|
|
109
|
+
*
|
|
110
|
+
* @category constants
|
|
111
|
+
* @since 4.0.0
|
|
112
|
+
*
|
|
113
|
+
* Powered by Nikkory
|
|
114
|
+
*/
|
|
115
|
+
export declare const DEFAULT_SECTION_SLOTS: readonly GranularitySlotConfig<'section'>[];
|
|
116
|
+
/**
|
|
117
|
+
* Get default slots for a granularity level
|
|
118
|
+
*
|
|
119
|
+
* @category utils
|
|
120
|
+
* @since 4.0.0
|
|
121
|
+
*
|
|
122
|
+
* @param level - The granularity level
|
|
123
|
+
* @returns Default slot configurations for the level
|
|
124
|
+
*
|
|
125
|
+
* Powered by Nikkory
|
|
126
|
+
*/
|
|
127
|
+
export declare function getDefaultSlots<G extends GranularityLevel>(level: G): readonly GranularitySlotConfig<G>[];
|
|
128
|
+
//# sourceMappingURL=slot.types.d.ts.map
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Granularity Template Types
|
|
3
|
+
*
|
|
4
|
+
* This file defines the GranularityTemplate<G> generic interface that
|
|
5
|
+
* extends GranularityConfig<G> with 8 shared metadata fields.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module types/granularity
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { GranularityLevel, GranularityTemplateVisibility } from './base.types';
|
|
14
|
+
import type { GranularityConfig } from './config.types';
|
|
15
|
+
/**
|
|
16
|
+
* Template metadata - 8 fields shared by all granularity templates
|
|
17
|
+
*
|
|
18
|
+
* This interface defines the metadata that makes a config into a
|
|
19
|
+
* reusable template. Every template at any granularity level will
|
|
20
|
+
* have these 8 fields.
|
|
21
|
+
*
|
|
22
|
+
* @category types
|
|
23
|
+
* @since 4.0.0
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const metadata: TemplateMetadata = {
|
|
28
|
+
* templateId: 'hero-section-v1',
|
|
29
|
+
* templateName: 'Hero Section',
|
|
30
|
+
* description: 'A full-width hero section with headline and CTA',
|
|
31
|
+
* author: 'Nikkory Team',
|
|
32
|
+
* version: '1.0.0',
|
|
33
|
+
* tags: ['hero', 'landing', 'cta', 'marketing'],
|
|
34
|
+
* visibility: 'public',
|
|
35
|
+
* thumbnail: 'https://nikkory.com/templates/hero-section.png'
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Powered by Nikkory
|
|
40
|
+
*/
|
|
41
|
+
export interface GranularityTemplateMetadata {
|
|
42
|
+
/** Unique template identifier (different from config id) */
|
|
43
|
+
readonly templateId: string;
|
|
44
|
+
/** Human-readable template name */
|
|
45
|
+
readonly templateName: string;
|
|
46
|
+
/** Template description */
|
|
47
|
+
readonly description: string;
|
|
48
|
+
/** Template author */
|
|
49
|
+
readonly author: string;
|
|
50
|
+
/** Template version (semver) */
|
|
51
|
+
readonly version: string;
|
|
52
|
+
/** Search tags for discovery */
|
|
53
|
+
readonly tags: readonly string[];
|
|
54
|
+
/** Visibility: private (local), team, public */
|
|
55
|
+
readonly visibility: GranularityTemplateVisibility;
|
|
56
|
+
/** Preview thumbnail URL */
|
|
57
|
+
readonly thumbnail?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* GranularityTemplate<G> - THE unified generic template interface
|
|
61
|
+
*
|
|
62
|
+
* This interface extends GranularityConfig<G> with TemplateMetadata,
|
|
63
|
+
* creating a complete template definition for any granularity level.
|
|
64
|
+
*
|
|
65
|
+
* Templates are reusable configurations that can be:
|
|
66
|
+
* - Shared publicly or within teams
|
|
67
|
+
* - Versioned and maintained
|
|
68
|
+
* - Discovered through tags and search
|
|
69
|
+
* - Customized when instantiated
|
|
70
|
+
*
|
|
71
|
+
* @category types
|
|
72
|
+
* @since 4.0.0
|
|
73
|
+
*
|
|
74
|
+
* @typeParam G - The granularity level this template is for
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // Section template
|
|
79
|
+
* const heroTemplate: GranularityTemplate<'section'> = {
|
|
80
|
+
* // Config fields
|
|
81
|
+
* id: 'hero-instance-1',
|
|
82
|
+
* granularity: 'section',
|
|
83
|
+
* designSystem: 'material-design',
|
|
84
|
+
* tier: 'enterprise',
|
|
85
|
+
* title: 'Hero Section',
|
|
86
|
+
* layout: { type: 'flex', alignment: 'center' },
|
|
87
|
+
* factors: { spacing: 'lg' },
|
|
88
|
+
*
|
|
89
|
+
* // Template metadata
|
|
90
|
+
* templateId: 'hero-section-v1',
|
|
91
|
+
* templateName: 'Hero Section Template',
|
|
92
|
+
* description: 'Full-width hero with headline and CTA',
|
|
93
|
+
* author: 'Nikkory',
|
|
94
|
+
* version: '1.0.0',
|
|
95
|
+
* tags: ['hero', 'landing', 'cta'],
|
|
96
|
+
* visibility: 'public',
|
|
97
|
+
* thumbnail: 'https://nikkory.com/hero.png'
|
|
98
|
+
* };
|
|
99
|
+
*
|
|
100
|
+
* // Page template
|
|
101
|
+
* const landingTemplate: GranularityTemplate<'page'> = {
|
|
102
|
+
* id: 'landing-instance-1',
|
|
103
|
+
* granularity: 'page',
|
|
104
|
+
* designSystem: 'material-design',
|
|
105
|
+
* tier: 'enterprise',
|
|
106
|
+
* title: 'Landing Page',
|
|
107
|
+
* children: [
|
|
108
|
+
* { childGranularity: 'section', ref: 'hero-section-v1', slot: 'main' }
|
|
109
|
+
* ],
|
|
110
|
+
*
|
|
111
|
+
* templateId: 'landing-page-v1',
|
|
112
|
+
* templateName: 'Landing Page Template',
|
|
113
|
+
* description: 'Complete landing page with hero, features, CTA',
|
|
114
|
+
* author: 'Nikkory',
|
|
115
|
+
* version: '1.0.0',
|
|
116
|
+
* tags: ['landing', 'marketing', 'conversion'],
|
|
117
|
+
* visibility: 'public'
|
|
118
|
+
* };
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* Powered by Nikkory
|
|
122
|
+
*/
|
|
123
|
+
export interface GranularityTemplate<G extends GranularityLevel> extends GranularityConfig<G>, GranularityTemplateMetadata {
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* AtomTemplate - Template for atom-level components
|
|
127
|
+
*
|
|
128
|
+
* @category types
|
|
129
|
+
* @since 4.0.0
|
|
130
|
+
*
|
|
131
|
+
* Powered by Nikkory
|
|
132
|
+
*/
|
|
133
|
+
export type AtomTemplate = GranularityTemplate<'atom'>;
|
|
134
|
+
/**
|
|
135
|
+
* ComponentTemplate - Template for component-level elements
|
|
136
|
+
*
|
|
137
|
+
* @category types
|
|
138
|
+
* @since 4.0.0
|
|
139
|
+
*
|
|
140
|
+
* Powered by Nikkory
|
|
141
|
+
*/
|
|
142
|
+
export type ComponentTemplate = GranularityTemplate<'component'>;
|
|
143
|
+
/**
|
|
144
|
+
* SectionTemplate - Template for section-level elements
|
|
145
|
+
*
|
|
146
|
+
* @category types
|
|
147
|
+
* @since 4.0.0
|
|
148
|
+
*
|
|
149
|
+
* Powered by Nikkory
|
|
150
|
+
*/
|
|
151
|
+
export type SectionGranularityTemplate = GranularityTemplate<'section'>;
|
|
152
|
+
/**
|
|
153
|
+
* PageTemplate - Template for page-level elements
|
|
154
|
+
*
|
|
155
|
+
* @category types
|
|
156
|
+
* @since 4.0.0
|
|
157
|
+
*
|
|
158
|
+
* Powered by Nikkory
|
|
159
|
+
*/
|
|
160
|
+
export type PageTemplate = GranularityTemplate<'page'>;
|
|
161
|
+
/**
|
|
162
|
+
* LayoutTemplate - Template for layout-level elements
|
|
163
|
+
*
|
|
164
|
+
* @category types
|
|
165
|
+
* @since 4.0.0
|
|
166
|
+
*
|
|
167
|
+
* Powered by Nikkory
|
|
168
|
+
*/
|
|
169
|
+
export type LayoutTemplate = GranularityTemplate<'layout'>;
|
|
170
|
+
/**
|
|
171
|
+
* TemplateTemplate - Template for template-level elements
|
|
172
|
+
*
|
|
173
|
+
* @category types
|
|
174
|
+
* @since 4.0.0
|
|
175
|
+
*
|
|
176
|
+
* Powered by Nikkory
|
|
177
|
+
*/
|
|
178
|
+
export type TemplateGranularityTemplate = GranularityTemplate<'template'>;
|
|
179
|
+
//# sourceMappingURL=template.types.d.ts.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atom Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Atom-level configuration for the smallest UI elements like Button, Input, Icon.
|
|
5
|
+
* Atoms are the building blocks that don't contain other elements.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module types/granularity-levels
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { GranularityLevel, GranularityFactorValues, GranularityStyleOverrides } from '../granularity/base.types';
|
|
14
|
+
import type { GranularityConfig } from '../granularity/config.types';
|
|
15
|
+
import type { GranularitySlotPosition, GranularitySlotConfig } from '../granularity/slot.types';
|
|
16
|
+
import type { DesignSystem, Tier } from '../../../types';
|
|
17
|
+
/**
|
|
18
|
+
* Atom slot position - atoms only have a content slot
|
|
19
|
+
*
|
|
20
|
+
* @category types
|
|
21
|
+
* @since 4.0.0
|
|
22
|
+
*
|
|
23
|
+
* Powered by Nikkory
|
|
24
|
+
*/
|
|
25
|
+
export type AtomSlotPosition = GranularitySlotPosition<'atom'>;
|
|
26
|
+
/**
|
|
27
|
+
* Atom slot configuration
|
|
28
|
+
*
|
|
29
|
+
* @category types
|
|
30
|
+
* @since 4.0.0
|
|
31
|
+
*
|
|
32
|
+
* Powered by Nikkory
|
|
33
|
+
*/
|
|
34
|
+
export type AtomSlotConfig = GranularitySlotConfig<'atom'>;
|
|
35
|
+
/**
|
|
36
|
+
* Atom type categories - 40+ types organized by function
|
|
37
|
+
*
|
|
38
|
+
* @category types
|
|
39
|
+
* @since 4.0.0
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const category: AtomCategory = 'input';
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Powered by Nikkory
|
|
47
|
+
*/
|
|
48
|
+
export type AtomCategory = 'button' | 'input' | 'text' | 'icon' | 'media' | 'feedback' | 'layout' | 'interactive';
|
|
49
|
+
/**
|
|
50
|
+
* Atom type identifiers (40+ types)
|
|
51
|
+
*
|
|
52
|
+
* @category types
|
|
53
|
+
* @since 4.0.0
|
|
54
|
+
*
|
|
55
|
+
* Powered by Nikkory
|
|
56
|
+
*/
|
|
57
|
+
export type AtomType = 'button' | 'icon-button' | 'link-button' | 'toggle-button' | 'input' | 'textarea' | 'checkbox' | 'radio' | 'switch' | 'slider' | 'select' | 'text' | 'heading' | 'label' | 'caption' | 'code' | 'icon' | 'logo' | 'avatar' | 'emoji' | 'image' | 'video' | 'audio' | 'spinner' | 'progress' | 'skeleton' | 'dot' | 'divider' | 'spacer' | 'container' | 'link' | 'badge' | 'chip' | 'tag' | 'tooltip-trigger';
|
|
58
|
+
/**
|
|
59
|
+
* Atom-specific extension fields beyond GranularityConfig
|
|
60
|
+
*
|
|
61
|
+
* @category types
|
|
62
|
+
* @since 4.0.0
|
|
63
|
+
*
|
|
64
|
+
* Powered by Nikkory
|
|
65
|
+
*/
|
|
66
|
+
export interface AtomExtensions {
|
|
67
|
+
/** Atom type identifier */
|
|
68
|
+
readonly atomType: AtomType;
|
|
69
|
+
/** Atom category for organization */
|
|
70
|
+
readonly atomCategory: AtomCategory;
|
|
71
|
+
/** Size variant */
|
|
72
|
+
readonly size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
73
|
+
/** Visual variant */
|
|
74
|
+
readonly variant?: 'filled' | 'outlined' | 'ghost' | 'text';
|
|
75
|
+
/** Color scheme */
|
|
76
|
+
readonly colorScheme?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral';
|
|
77
|
+
/** Whether atom is disabled */
|
|
78
|
+
readonly disabled?: boolean;
|
|
79
|
+
/** Whether atom is in loading state */
|
|
80
|
+
readonly loading?: boolean;
|
|
81
|
+
/** Accessibility label */
|
|
82
|
+
readonly ariaLabel?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* AtomConfig - Full configuration for atom-level elements
|
|
86
|
+
*
|
|
87
|
+
* Extends GranularityConfig<'atom'> with atom-specific fields.
|
|
88
|
+
*
|
|
89
|
+
* @category types
|
|
90
|
+
* @since 4.0.0
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const buttonConfig: AtomConfig = {
|
|
95
|
+
* id: 'primary-button',
|
|
96
|
+
* granularity: 'atom',
|
|
97
|
+
* designSystem: 'material-design',
|
|
98
|
+
* tier: 'standard',
|
|
99
|
+
* title: 'Primary Button',
|
|
100
|
+
* atomType: 'button',
|
|
101
|
+
* atomCategory: 'button',
|
|
102
|
+
* size: 'md',
|
|
103
|
+
* variant: 'filled',
|
|
104
|
+
* colorScheme: 'primary'
|
|
105
|
+
* };
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* Powered by Nikkory
|
|
109
|
+
*/
|
|
110
|
+
export interface AtomConfig extends AtomExtensions {
|
|
111
|
+
/** Unique identifier */
|
|
112
|
+
readonly id: string;
|
|
113
|
+
/** Granularity level - always 'atom' */
|
|
114
|
+
readonly granularity: 'atom';
|
|
115
|
+
/** Design system */
|
|
116
|
+
readonly designSystem: DesignSystem;
|
|
117
|
+
/** Quality tier */
|
|
118
|
+
readonly tier: Tier;
|
|
119
|
+
/** Display title */
|
|
120
|
+
readonly title: string;
|
|
121
|
+
/** Optional subtitle/description */
|
|
122
|
+
readonly subtitle?: string;
|
|
123
|
+
/** Factor values */
|
|
124
|
+
readonly factors?: GranularityFactorValues;
|
|
125
|
+
/** Style overrides */
|
|
126
|
+
readonly styleOverrides?: GranularityStyleOverrides;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Type guard to check if a config is an AtomConfig
|
|
130
|
+
*
|
|
131
|
+
* @category utils
|
|
132
|
+
* @since 4.0.0
|
|
133
|
+
*
|
|
134
|
+
* @param config - The config to check
|
|
135
|
+
* @returns True if config is an AtomConfig
|
|
136
|
+
*
|
|
137
|
+
* Powered by Nikkory
|
|
138
|
+
*/
|
|
139
|
+
export declare function isAtomConfig(config: GranularityConfig<GranularityLevel>): config is AtomConfig & GranularityConfig<'atom'>;
|
|
140
|
+
/**
|
|
141
|
+
* AtomGranularityConfig - Alias to GranularityConfig<'atom'>
|
|
142
|
+
*
|
|
143
|
+
* Use AtomConfig for the full extended version with atom-specific fields.
|
|
144
|
+
*
|
|
145
|
+
* @category types
|
|
146
|
+
* @since 4.0.0
|
|
147
|
+
*
|
|
148
|
+
* Powered by Nikkory
|
|
149
|
+
*/
|
|
150
|
+
export type AtomGranularityConfig = GranularityConfig<'atom'>;
|
|
151
|
+
//# sourceMappingURL=atom.config.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Component-level configuration for medium-complexity UI elements
|
|
5
|
+
* like Card, Modal, Dropdown that can contain atoms.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module types/granularity-levels
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
*
|
|
11
|
+
* Powered by Nikkory
|
|
12
|
+
*/
|
|
13
|
+
import type { GranularityLevel, GranularityFactorValues, GranularityStyleOverrides, GranularityLayoutConfig } from '../granularity/base.types';
|
|
14
|
+
import type { GranularityConfig, ChildReference } from '../granularity/config.types';
|
|
15
|
+
import type { GranularitySlotPosition, GranularitySlotConfig } from '../granularity/slot.types';
|
|
16
|
+
import type { DesignSystem, Tier } from '../../../types';
|
|
17
|
+
/**
|
|
18
|
+
* Component slot positions - content, prefix, suffix
|
|
19
|
+
*
|
|
20
|
+
* @category types
|
|
21
|
+
* @since 4.0.0
|
|
22
|
+
*
|
|
23
|
+
* Powered by Nikkory
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentSlotPosition = GranularitySlotPosition<'component'>;
|
|
26
|
+
/**
|
|
27
|
+
* Component slot configuration
|
|
28
|
+
*
|
|
29
|
+
* @category types
|
|
30
|
+
* @since 4.0.0
|
|
31
|
+
*
|
|
32
|
+
* Powered by Nikkory
|
|
33
|
+
*/
|
|
34
|
+
export type ComponentSlotConfig = GranularitySlotConfig<'component'>;
|
|
35
|
+
/**
|
|
36
|
+
* Component type categories - 100+ types organized by function
|
|
37
|
+
*
|
|
38
|
+
* @category types
|
|
39
|
+
* @since 4.0.0
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const category: ComponentCategory = 'card';
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Powered by Nikkory
|
|
47
|
+
*/
|
|
48
|
+
export type ComponentCategory = 'card' | 'form' | 'navigation' | 'overlay' | 'data-display' | 'feedback' | 'input-group' | 'layout' | 'media' | 'composite';
|
|
49
|
+
/**
|
|
50
|
+
* Component type identifiers (100+ types)
|
|
51
|
+
*
|
|
52
|
+
* @category types
|
|
53
|
+
* @since 4.0.0
|
|
54
|
+
*
|
|
55
|
+
* Powered by Nikkory
|
|
56
|
+
*/
|
|
57
|
+
export type ComponentType = 'card' | 'media-card' | 'profile-card' | 'stat-card' | 'pricing-card' | 'form' | 'form-group' | 'form-field' | 'form-section' | 'menu' | 'tabs' | 'breadcrumb' | 'pagination' | 'stepper' | 'navbar' | 'modal' | 'drawer' | 'popover' | 'tooltip' | 'dropdown' | 'table' | 'list' | 'tree' | 'timeline' | 'data-grid' | 'alert' | 'toast' | 'notification' | 'banner' | 'snackbar' | 'input-group' | 'search-bar' | 'date-picker' | 'time-picker' | 'color-picker' | 'accordion' | 'collapse' | 'panel' | 'split-pane' | 'carousel' | 'gallery' | 'video-player' | 'audio-player' | 'header' | 'footer' | 'sidebar' | 'toolbar';
|
|
58
|
+
/**
|
|
59
|
+
* Component-specific extension fields beyond GranularityConfig
|
|
60
|
+
*
|
|
61
|
+
* @category types
|
|
62
|
+
* @since 4.0.0
|
|
63
|
+
*
|
|
64
|
+
* Powered by Nikkory
|
|
65
|
+
*/
|
|
66
|
+
export interface ComponentExtensions {
|
|
67
|
+
/** Component type identifier */
|
|
68
|
+
readonly componentType: ComponentType;
|
|
69
|
+
/** Component category for organization */
|
|
70
|
+
readonly componentCategory: ComponentCategory;
|
|
71
|
+
/** Size variant */
|
|
72
|
+
readonly size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
73
|
+
/** Visual variant */
|
|
74
|
+
readonly variant?: 'elevated' | 'outlined' | 'filled' | 'ghost';
|
|
75
|
+
/** Whether component is interactive */
|
|
76
|
+
readonly interactive?: boolean;
|
|
77
|
+
/** Whether component is collapsible */
|
|
78
|
+
readonly collapsible?: boolean;
|
|
79
|
+
/** Whether component starts expanded (if collapsible) */
|
|
80
|
+
readonly defaultExpanded?: boolean;
|
|
81
|
+
/** Whether component is dismissible */
|
|
82
|
+
readonly dismissible?: boolean;
|
|
83
|
+
/** Whether component is draggable */
|
|
84
|
+
readonly draggable?: boolean;
|
|
85
|
+
/** Whether component supports selection */
|
|
86
|
+
readonly selectable?: boolean;
|
|
87
|
+
/** Maximum height with scroll */
|
|
88
|
+
readonly maxHeight?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* ComponentConfig - Full configuration for component-level elements
|
|
92
|
+
*
|
|
93
|
+
* Extends GranularityConfig<'component'> with component-specific fields.
|
|
94
|
+
*
|
|
95
|
+
* @category types
|
|
96
|
+
* @since 4.0.0
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const cardConfig: ComponentConfig = {
|
|
101
|
+
* id: 'feature-card',
|
|
102
|
+
* granularity: 'component',
|
|
103
|
+
* designSystem: 'material-design',
|
|
104
|
+
* tier: 'enterprise',
|
|
105
|
+
* title: 'Feature Card',
|
|
106
|
+
* componentType: 'card',
|
|
107
|
+
* componentCategory: 'card',
|
|
108
|
+
* size: 'md',
|
|
109
|
+
* variant: 'elevated',
|
|
110
|
+
* interactive: true,
|
|
111
|
+
* slots: [
|
|
112
|
+
* { slotId: 'card-content', position: 'content', allowedChildren: ['atom'], maxChildren: 10 }
|
|
113
|
+
* ]
|
|
114
|
+
* };
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* Powered by Nikkory
|
|
118
|
+
*/
|
|
119
|
+
export interface ComponentConfig extends ComponentExtensions {
|
|
120
|
+
/** Unique identifier */
|
|
121
|
+
readonly id: string;
|
|
122
|
+
/** Granularity level - always 'component' */
|
|
123
|
+
readonly granularity: 'component';
|
|
124
|
+
/** Design system */
|
|
125
|
+
readonly designSystem: DesignSystem;
|
|
126
|
+
/** Quality tier */
|
|
127
|
+
readonly tier: Tier;
|
|
128
|
+
/** Display title */
|
|
129
|
+
readonly title: string;
|
|
130
|
+
/** Optional subtitle/description */
|
|
131
|
+
readonly subtitle?: string;
|
|
132
|
+
/** Layout configuration */
|
|
133
|
+
readonly layout?: GranularityLayoutConfig;
|
|
134
|
+
/** Slots for child atoms */
|
|
135
|
+
readonly slots?: readonly ComponentSlotConfig[];
|
|
136
|
+
/** Factor values */
|
|
137
|
+
readonly factors?: GranularityFactorValues;
|
|
138
|
+
/** Children references */
|
|
139
|
+
readonly children?: readonly ChildReference<'component'>[];
|
|
140
|
+
/** Style overrides */
|
|
141
|
+
readonly styleOverrides?: GranularityStyleOverrides;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Default slot configurations for components
|
|
145
|
+
*
|
|
146
|
+
* @category constants
|
|
147
|
+
* @since 4.0.0
|
|
148
|
+
*
|
|
149
|
+
* Powered by Nikkory
|
|
150
|
+
*/
|
|
151
|
+
export declare const DEFAULT_COMPONENT_SLOTS: readonly ComponentSlotConfig[];
|
|
152
|
+
/**
|
|
153
|
+
* Type guard to check if a config is a ComponentConfig
|
|
154
|
+
*
|
|
155
|
+
* @category utils
|
|
156
|
+
* @since 4.0.0
|
|
157
|
+
*
|
|
158
|
+
* @param config - The config to check
|
|
159
|
+
* @returns True if config is a ComponentConfig
|
|
160
|
+
*
|
|
161
|
+
* Powered by Nikkory
|
|
162
|
+
*/
|
|
163
|
+
export declare function isComponentConfig(config: GranularityConfig<GranularityLevel>): config is ComponentConfig & GranularityConfig<'component'>;
|
|
164
|
+
/**
|
|
165
|
+
* ComponentGranularityConfig - Alias to GranularityConfig<'component'>
|
|
166
|
+
*
|
|
167
|
+
* Use ComponentConfig for the full extended version with component-specific fields.
|
|
168
|
+
*
|
|
169
|
+
* @category types
|
|
170
|
+
* @since 4.0.0
|
|
171
|
+
*
|
|
172
|
+
* Powered by Nikkory
|
|
173
|
+
*/
|
|
174
|
+
export type ComponentGranularityConfig = GranularityConfig<'component'>;
|
|
175
|
+
//# sourceMappingURL=component.config.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Granularity Levels - Level-Specific Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* This module exports level-specific configuration types for all 6 granularity levels:
|
|
5
|
+
* - Atom: Smallest UI elements (Button, Input, Icon)
|
|
6
|
+
* - Component: Medium-complexity elements (Card, Modal, Dropdown)
|
|
7
|
+
* - Section: Large UI blocks (Hero, Pricing, Testimonials)
|
|
8
|
+
* - Page: Complete routes (Landing, Dashboard, Auth)
|
|
9
|
+
* - Layout: Structural wrappers (AppLayout, AuthLayout, DashboardLayout)
|
|
10
|
+
* - Template: Complete applications (Admin, E-commerce, SaaS)
|
|
11
|
+
*
|
|
12
|
+
* Each level has its own configuration interface extending the generic GranularityConfig<G>.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
* @module types/granularity-levels
|
|
16
|
+
* @since 4.0.0
|
|
17
|
+
*
|
|
18
|
+
* Powered by Nikkory
|
|
19
|
+
*/
|
|
20
|
+
import type { AtomConfig } from './atom.config';
|
|
21
|
+
import type { ComponentConfig as ComponentLevelConfig } from './component.config';
|
|
22
|
+
import type { LayoutLevelConfig } from './layout.config';
|
|
23
|
+
import type { PageLevelConfig } from './page.config';
|
|
24
|
+
import type { SectionLevelConfig } from './section.config';
|
|
25
|
+
import type { TemplateLevelConfig } from './template.config';
|
|
26
|
+
export type { AtomSlotPosition, AtomSlotConfig, AtomCategory, AtomType, AtomExtensions, AtomConfig, AtomGranularityConfig, } from './atom.config';
|
|
27
|
+
export { isAtomConfig } from './atom.config';
|
|
28
|
+
export type { ComponentSlotPosition, ComponentSlotConfig, ComponentCategory, ComponentType as ComponentLevelType, ComponentExtensions, ComponentConfig as ComponentLevelConfig, ComponentGranularityConfig, } from './component.config';
|
|
29
|
+
export { isComponentConfig, DEFAULT_COMPONENT_SLOTS } from './component.config';
|
|
30
|
+
export type { SectionSlotPosition, SectionSlotConfig, SectionLayoutType, SectionExtensions, SectionBackground, SectionLevelConfig, SectionGranularityConfig, } from './section.config';
|
|
31
|
+
export { isSectionLevelConfig, DEFAULT_SECTION_SLOTS } from './section.config';
|
|
32
|
+
export type { PageSlotPosition, PageSlotConfig, PageCategory, PageType, PageMetadata, PageExtensions, PageLevelConfig, PageGranularityConfig, } from './page.config';
|
|
33
|
+
export { isPageLevelConfig, DEFAULT_PAGE_SLOTS } from './page.config';
|
|
34
|
+
export type { LayoutSlotPosition, LayoutSlotConfig, LayoutCategory, LayoutType as LayoutLevelType, LayoutSidebar, ResponsiveConfig as LayoutResponsiveConfig, LayoutStructure, LayoutExtensions, LayoutLevelConfig, LayoutGranularityConfig, } from './layout.config';
|
|
35
|
+
export { isLayoutLevelConfig, DEFAULT_LAYOUT_SLOTS } from './layout.config';
|
|
36
|
+
export type { TemplateSlotPosition, TemplateSlotConfig, TemplateCategory, TemplateType, TechStack, TemplatePages, PageGroup, TemplateAssets, AssetReference, FontConfig, TemplateExtensions, TemplateLevelConfig, FullTemplate, TemplateGranularityConfig, GranularityTemplate, TemplateMetadata, } from './template.config';
|
|
37
|
+
export { isTemplateLevelConfig, DEFAULT_TEMPLATE_SLOTS } from './template.config';
|
|
38
|
+
/**
|
|
39
|
+
* Union type of all level-specific configurations
|
|
40
|
+
*
|
|
41
|
+
* @category types
|
|
42
|
+
* @since 4.0.0
|
|
43
|
+
*
|
|
44
|
+
* Powered by Nikkory
|
|
45
|
+
*/
|
|
46
|
+
export type AnyLevelConfig = AtomConfig | ComponentLevelConfig | SectionLevelConfig | PageLevelConfig | LayoutLevelConfig | TemplateLevelConfig;
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|