@ankhorage/surface 7.0.0 → 9.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{surfaceColor.d.ts → constants/surfaceColor.d.ts} +0 -4
- package/dist/constants/surfaceColor.d.ts.map +1 -0
- package/dist/constants/surfaceColor.js.map +1 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -1
- package/dist/features/badge/adapters/inbound/Badge.d.ts.map +1 -1
- package/dist/features/badge/adapters/inbound/Badge.js +1 -1
- package/dist/features/badge/adapters/inbound/Badge.js.map +1 -1
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +6 -6
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/button/adapters/inbound/IconButton.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/IconButton.js +4 -4
- package/dist/features/button/adapters/inbound/IconButton.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +4 -4
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/font/adapters/inbound/FontProvider.d.ts +4 -0
- package/dist/features/font/adapters/inbound/FontProvider.d.ts.map +1 -0
- package/dist/features/font/adapters/inbound/FontProvider.js +16 -0
- package/dist/features/font/adapters/inbound/FontProvider.js.map +1 -0
- package/dist/features/font/adapters/inbound/FontRuntimeContext.d.ts +4 -0
- package/dist/features/font/adapters/inbound/FontRuntimeContext.d.ts.map +1 -0
- package/dist/features/font/adapters/inbound/FontRuntimeContext.js +9 -0
- package/dist/features/font/adapters/inbound/FontRuntimeContext.js.map +1 -0
- package/dist/features/font/adapters/inbound/useFontRuntime.d.ts +4 -0
- package/dist/features/font/adapters/inbound/useFontRuntime.d.ts.map +1 -0
- package/dist/features/font/adapters/inbound/useFontRuntime.js +7 -0
- package/dist/features/font/adapters/inbound/useFontRuntime.js.map +1 -0
- package/dist/features/font/public.d.ts +3 -0
- package/dist/features/font/public.d.ts.map +1 -0
- package/dist/features/font/public.js +2 -0
- package/dist/features/font/public.js.map +1 -0
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js +4 -4
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.d.ts.map +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.js +4 -4
- package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.d.ts.map +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.js +4 -4
- package/dist/features/form/switch/adapters/inbound/Switch.js.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts +1 -1
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts.map +1 -1
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.js.map +1 -1
- package/dist/features/icon/adapters/inbound/Icon.d.ts.map +1 -1
- package/dist/features/icon/adapters/inbound/Icon.js +2 -2
- package/dist/features/icon/adapters/inbound/Icon.js.map +1 -1
- package/dist/features/image/adapters/inbound/Image.d.ts.map +1 -1
- package/dist/features/image/adapters/inbound/Image.js +1 -1
- package/dist/features/image/adapters/inbound/Image.js.map +1 -1
- package/dist/features/image/utils/resolveImageStyle.d.ts +1 -1
- package/dist/features/image/utils/resolveImageStyle.d.ts.map +1 -1
- package/dist/features/image/utils/resolveImageStyle.js +1 -1
- package/dist/features/image/utils/resolveImageStyle.js.map +1 -1
- package/dist/features/layout/adapters/inbound/Grid.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/Grid.js +1 -1
- package/dist/features/layout/adapters/inbound/Grid.js.map +1 -1
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/ScrollView.js +1 -1
- package/dist/features/layout/adapters/inbound/ScrollView.js.map +1 -1
- package/dist/features/layout/adapters/inbound/View.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/View.js +1 -1
- package/dist/features/layout/adapters/inbound/View.js.map +1 -1
- package/dist/features/list/adapters/inbound/ListItem.d.ts.map +1 -1
- package/dist/features/list/adapters/inbound/ListItem.js +4 -4
- package/dist/features/list/adapters/inbound/ListItem.js.map +1 -1
- package/dist/features/modal/adapters/inbound/Modal.d.ts.map +1 -1
- package/dist/features/modal/adapters/inbound/Modal.js +1 -1
- package/dist/features/modal/adapters/inbound/Modal.js.map +1 -1
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts.map +1 -1
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +1 -1
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -1
- package/dist/features/pressable/adapters/inbound/Pressable.d.ts +5 -0
- package/dist/features/pressable/adapters/inbound/Pressable.d.ts.map +1 -0
- package/dist/features/pressable/adapters/inbound/Pressable.js +48 -0
- package/dist/features/pressable/adapters/inbound/Pressable.js.map +1 -0
- package/dist/features/pressable/public.d.ts +3 -0
- package/dist/features/pressable/public.d.ts.map +1 -0
- package/dist/features/pressable/public.js +2 -0
- package/dist/features/pressable/public.js.map +1 -0
- package/dist/features/surface/adapters/inbound/Surface.d.ts.map +1 -1
- package/dist/features/surface/adapters/inbound/Surface.js +1 -1
- package/dist/features/surface/adapters/inbound/Surface.js.map +1 -1
- package/dist/features/tabs/adapters/inbound/Tab.d.ts.map +1 -1
- package/dist/features/tabs/adapters/inbound/Tab.js +1 -1
- package/dist/features/tabs/adapters/inbound/Tab.js.map +1 -1
- package/dist/features/theme/adapters/inbound/ThemeProvider.d.ts +4 -0
- package/dist/features/theme/adapters/inbound/ThemeProvider.d.ts.map +1 -0
- package/dist/features/theme/adapters/inbound/ThemeProvider.js +27 -0
- package/dist/features/theme/adapters/inbound/ThemeProvider.js.map +1 -0
- package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.d.ts +4 -0
- package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.d.ts.map +1 -0
- package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.js +11 -0
- package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.js.map +1 -0
- package/dist/features/theme/adapters/inbound/ThemeScope.d.ts +4 -0
- package/dist/features/theme/adapters/inbound/ThemeScope.d.ts.map +1 -0
- package/dist/features/theme/adapters/inbound/ThemeScope.js +17 -0
- package/dist/features/theme/adapters/inbound/ThemeScope.js.map +1 -0
- package/dist/features/theme/adapters/inbound/useTheme.d.ts +4 -0
- package/dist/features/theme/adapters/inbound/useTheme.d.ts.map +1 -0
- package/dist/features/theme/adapters/inbound/useTheme.js +7 -0
- package/dist/features/theme/adapters/inbound/useTheme.js.map +1 -0
- package/dist/features/theme/application/use-cases/createTheme.d.ts +5 -0
- package/dist/features/theme/application/use-cases/createTheme.d.ts.map +1 -0
- package/dist/features/theme/application/use-cases/createTheme.js +56 -0
- package/dist/features/theme/application/use-cases/createTheme.js.map +1 -0
- package/dist/features/theme/constants.d.ts +10 -0
- package/dist/features/theme/constants.d.ts.map +1 -0
- package/dist/{theme/defaultTokens.js → features/theme/constants.js} +9 -2
- package/dist/features/theme/constants.js.map +1 -0
- package/dist/{theme → features/theme/domain}/createSurfaceColorDiagnosticCollector.d.ts +1 -1
- package/dist/features/theme/domain/createSurfaceColorDiagnosticCollector.d.ts.map +1 -0
- package/dist/features/theme/domain/createSurfaceColorDiagnosticCollector.js.map +1 -0
- package/dist/{theme → features/theme/domain}/createSurfaceSemanticPolicy.d.ts +1 -1
- package/dist/features/theme/domain/createSurfaceSemanticPolicy.d.ts.map +1 -0
- package/dist/{theme → features/theme/domain}/createSurfaceSemanticPolicy.js +1 -1
- package/dist/features/theme/domain/createSurfaceSemanticPolicy.js.map +1 -0
- package/dist/features/theme/domain/generatePalette.d.ts +10 -0
- package/dist/features/theme/domain/generatePalette.d.ts.map +1 -0
- package/dist/{theme/colorEngine.js → features/theme/domain/generatePalette.js} +2 -10
- package/dist/features/theme/domain/generatePalette.js.map +1 -0
- package/dist/{theme → features/theme/domain}/resolveRoleSemantics.d.ts +1 -1
- package/dist/features/theme/domain/resolveRoleSemantics.d.ts.map +1 -0
- package/dist/{theme → features/theme/domain}/resolveRoleSemantics.js +1 -1
- package/dist/features/theme/domain/resolveRoleSemantics.js.map +1 -0
- package/dist/features/theme/domain/resolveSemanticColors.d.ts +4 -0
- package/dist/features/theme/domain/resolveSemanticColors.d.ts.map +1 -0
- package/dist/features/theme/domain/resolveSemanticColors.js +10 -0
- package/dist/features/theme/domain/resolveSemanticColors.js.map +1 -0
- package/dist/{theme → features/theme/domain}/resolveSurfaceSemanticModel.d.ts +1 -1
- package/dist/features/theme/domain/resolveSurfaceSemanticModel.d.ts.map +1 -0
- package/dist/features/theme/domain/resolveSurfaceSemanticModel.js.map +1 -0
- package/dist/features/theme/public.d.ts +3 -0
- package/dist/features/theme/public.d.ts.map +1 -0
- package/dist/features/theme/public.js +2 -0
- package/dist/features/theme/public.js.map +1 -0
- package/dist/features/theme/runtime.d.ts +5 -0
- package/dist/features/theme/runtime.d.ts.map +1 -0
- package/dist/features/theme/runtime.js +4 -0
- package/dist/features/theme/runtime.js.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveGlobalTokens.d.ts +1 -1
- package/dist/features/theme/utils/resolveGlobalTokens.d.ts.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveGlobalTokens.js +1 -1
- package/dist/features/theme/utils/resolveGlobalTokens.js.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveHeadingTokenOverrides.d.ts +1 -1
- package/dist/features/theme/utils/resolveHeadingTokenOverrides.d.ts.map +1 -0
- package/dist/features/theme/utils/resolveHeadingTokenOverrides.js.map +1 -0
- package/dist/features/theme/utils/resolveNumericTokenOverrides.d.ts.map +1 -0
- package/dist/features/theme/utils/resolveNumericTokenOverrides.js.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveToken.d.ts +2 -8
- package/dist/features/theme/utils/resolveToken.d.ts.map +1 -0
- package/dist/features/theme/utils/resolveToken.js +10 -0
- package/dist/features/theme/utils/resolveToken.js.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveWeightTokenOverrides.d.ts +1 -1
- package/dist/features/theme/utils/resolveWeightTokenOverrides.d.ts.map +1 -0
- package/dist/{theme → features/theme/utils}/resolveWeightTokenOverrides.js +3 -5
- package/dist/features/theme/utils/resolveWeightTokenOverrides.js.map +1 -0
- package/dist/features/toast/adapters/inbound/Toast.d.ts.map +1 -1
- package/dist/features/toast/adapters/inbound/Toast.js +1 -1
- package/dist/features/toast/adapters/inbound/Toast.js.map +1 -1
- package/dist/features/tooltip/adapters/inbound/Tooltip.d.ts.map +1 -1
- package/dist/features/tooltip/adapters/inbound/Tooltip.js +1 -1
- package/dist/features/tooltip/adapters/inbound/Tooltip.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts +2 -2
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +4 -20
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +3 -20
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts +2 -2
- package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts.map +1 -1
- package/dist/features/typography/utils/resolveHeadingTextStyle.js.map +1 -1
- package/dist/index.d.ts +11 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/internal/resolvers/resolveControlSize.d.ts +1 -1
- package/dist/internal/resolvers/resolveControlSize.js.map +1 -1
- package/dist/internal/resolvers/resolveFieldPresentation.d.ts +1 -1
- package/dist/internal/resolvers/resolveFieldPresentation.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveFieldPresentation.js.map +1 -1
- package/dist/internal/resolvers/resolveIconSize.d.ts +1 -1
- package/dist/internal/resolvers/resolveIconSize.js.map +1 -1
- package/dist/internal/resolvers/resolveInteractiveColors.d.ts +2 -2
- package/dist/internal/resolvers/resolveInteractiveColors.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveInteractiveColors.js.map +1 -1
- package/dist/internal/resolvers/resolveSelectionControlColors.d.ts +2 -2
- package/dist/internal/resolvers/resolveSelectionControlColors.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveSelectionControlColors.js.map +1 -1
- package/dist/internal/resolvers/resolveSurfaceColor.d.ts +2 -2
- package/dist/internal/resolvers/resolveSurfaceColor.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveSurfaceColor.js.map +1 -1
- package/dist/internal/resolvers/resolveTextColor.d.ts +2 -2
- package/dist/internal/resolvers/resolveTextColor.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveTextColor.js.map +1 -1
- package/dist/internal/resolvers/resolveTextStyles.d.ts +1 -1
- package/dist/internal/resolvers/resolveTextStyles.js.map +1 -1
- package/dist/types/accordion.d.ts +1 -1
- package/dist/types/accordion.d.ts.map +1 -1
- package/dist/types/accordion.js.map +1 -1
- package/dist/types/badge.d.ts +1 -1
- package/dist/types/badge.d.ts.map +1 -1
- package/dist/types/badge.js.map +1 -1
- package/dist/types/button.d.ts +4 -4
- package/dist/types/button.d.ts.map +1 -1
- package/dist/types/button.js.map +1 -1
- package/dist/types/checkbox.d.ts +3 -3
- package/dist/types/checkbox.d.ts.map +1 -1
- package/dist/types/checkbox.js.map +1 -1
- package/dist/types/font.d.ts +13 -0
- package/dist/types/font.d.ts.map +1 -0
- package/dist/types/font.js +2 -0
- package/dist/types/font.js.map +1 -0
- package/dist/types/icon.d.ts +1 -1
- package/dist/types/icon.d.ts.map +1 -1
- package/dist/types/icon.js.map +1 -1
- package/dist/types/image.d.ts +1 -1
- package/dist/types/image.d.ts.map +1 -1
- package/dist/types/image.js.map +1 -1
- package/dist/types/interactionPolicy.d.ts.map +1 -0
- package/dist/types/interactionPolicy.js.map +1 -0
- package/dist/types/layout.d.ts +1 -1
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/dist/types/list.d.ts +1 -1
- package/dist/types/list.d.ts.map +1 -1
- package/dist/types/list.js.map +1 -1
- package/dist/types/modal.d.ts +1 -1
- package/dist/types/modal.d.ts.map +1 -1
- package/dist/types/modal.js.map +1 -1
- package/dist/types/popover.d.ts +1 -1
- package/dist/types/popover.d.ts.map +1 -1
- package/dist/types/popover.js.map +1 -1
- package/dist/types/popoverMenu.d.ts +1 -1
- package/dist/types/popoverMenu.d.ts.map +1 -1
- package/dist/types/popoverMenu.js.map +1 -1
- package/dist/{primitives/button-base/types.d.ts → types/pressable.d.ts} +5 -5
- package/dist/types/pressable.d.ts.map +1 -0
- package/dist/types/pressable.js +2 -0
- package/dist/types/pressable.js.map +1 -0
- package/dist/types/radio.d.ts +3 -3
- package/dist/types/radio.d.ts.map +1 -1
- package/dist/types/radio.js.map +1 -1
- package/dist/types/surfaceColor.d.ts +6 -0
- package/dist/types/surfaceColor.d.ts.map +1 -0
- package/dist/types/surfaceColor.js +2 -0
- package/dist/types/surfaceColor.js.map +1 -0
- package/dist/types/switch.d.ts +3 -3
- package/dist/types/switch.d.ts.map +1 -1
- package/dist/types/switch.js.map +1 -1
- package/dist/types/tabs.d.ts +1 -1
- package/dist/types/tabs.d.ts.map +1 -1
- package/dist/types/tabs.js.map +1 -1
- package/dist/types/text-input.d.ts +1 -1
- package/dist/types/text-input.d.ts.map +1 -1
- package/dist/types/text-input.js.map +1 -1
- package/dist/{theme/types.d.ts → types/theme.d.ts} +19 -3
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/theme.js +2 -0
- package/dist/types/theme.js.map +1 -0
- package/dist/types/toast.d.ts +2 -2
- package/dist/types/toast.d.ts.map +1 -1
- package/dist/types/toast.js.map +1 -1
- package/dist/types/tooltip.d.ts +1 -1
- package/dist/types/tooltip.d.ts.map +1 -1
- package/dist/types/tooltip.js.map +1 -1
- package/dist/types/typography.d.ts +1 -1
- package/dist/types/typography.d.ts.map +1 -1
- package/dist/types/typography.js.map +1 -1
- package/dist/utils/resolveSpacing.d.ts +1 -1
- package/dist/utils/resolveSpacing.d.ts.map +1 -1
- package/dist/utils/resolveSpacing.js +1 -1
- package/dist/utils/resolveSpacing.js.map +1 -1
- package/dist/utils/resolveViewStyles.d.ts +1 -1
- package/dist/utils/resolveViewStyles.d.ts.map +1 -1
- package/dist/utils/resolveViewStyles.js +1 -1
- package/dist/utils/resolveViewStyles.js.map +1 -1
- package/package.json +8 -7
- package/src/constants/surfaceColor.test.ts +18 -0
- package/src/{surfaceColor.ts → constants/surfaceColor.ts} +0 -5
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +1 -1
- package/src/features/badge/adapters/inbound/Badge.tsx +1 -1
- package/src/features/button/adapters/inbound/Button.tsx +8 -8
- package/src/features/button/adapters/inbound/IconButton.tsx +4 -4
- package/src/features/card/adapters/inbound/Card.tsx +4 -4
- package/src/features/font/adapters/inbound/FontProvider.tsx +27 -0
- package/src/features/font/adapters/inbound/FontRuntimeContext.tsx +12 -0
- package/src/features/font/adapters/inbound/useFontRuntime.ts +9 -0
- package/src/features/font/public.ts +2 -0
- package/src/features/form/checkbox/adapters/inbound/Checkbox.tsx +7 -7
- package/src/features/form/radio/adapters/inbound/Radio.tsx +7 -7
- package/src/features/form/switch/adapters/inbound/Switch.tsx +4 -4
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +1 -1
- package/src/features/form/text-input/utils/resolveTextInputPresentation.ts +1 -1
- package/src/features/icon/adapters/inbound/Icon.tsx +2 -2
- package/src/features/image/adapters/inbound/Image.tsx +1 -1
- package/src/features/image/utils/resolveImageProps.test.ts +1 -1
- package/src/features/image/utils/resolveImageStyle.ts +2 -2
- package/src/features/layout/adapters/inbound/Grid.tsx +1 -1
- package/src/features/layout/adapters/inbound/ScrollView.tsx +1 -1
- package/src/features/layout/adapters/inbound/View.tsx +1 -1
- package/src/features/list/adapters/inbound/ListItem.tsx +5 -5
- package/src/features/modal/adapters/inbound/Modal.tsx +1 -1
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +1 -1
- package/src/{primitives/button-base/ButtonBase.tsx → features/pressable/adapters/inbound/Pressable.tsx} +45 -31
- package/src/features/pressable/public.ts +2 -0
- package/src/features/surface/adapters/inbound/Surface.tsx +1 -1
- package/src/features/tabs/adapters/inbound/Tab.tsx +1 -1
- package/src/features/theme/adapters/inbound/ThemeProvider.tsx +46 -0
- package/src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx +14 -0
- package/src/features/theme/adapters/inbound/ThemeScope.test.tsx +52 -0
- package/src/features/theme/adapters/inbound/ThemeScope.tsx +29 -0
- package/src/features/theme/adapters/inbound/useTheme.ts +9 -0
- package/src/features/theme/application/use-cases/createTheme.ts +71 -0
- package/src/{theme → features/theme/application/use-cases}/createThemeOverrides.test.ts +8 -9
- package/src/{theme → features/theme/application/use-cases}/createThemeValidation.test.ts +4 -2
- package/src/features/theme/constants.ts +68 -0
- package/src/{theme → features/theme/domain}/createSurfaceColorDiagnosticCollector.ts +4 -1
- package/src/{theme → features/theme/domain}/createSurfaceSemanticPolicy.ts +2 -2
- package/src/features/theme/domain/generatePalette.test.ts +294 -0
- package/src/{theme/colorEngine.ts → features/theme/domain/generatePalette.ts} +3 -30
- package/src/{theme → features/theme/domain}/inverseSemantics.test.ts +1 -1
- package/src/{theme → features/theme/domain}/resolveRoleSemantics.ts +2 -2
- package/src/features/theme/domain/resolveSemanticColors.ts +23 -0
- package/src/{theme → features/theme/domain}/resolveSurfaceSemanticModel.ts +4 -4
- package/src/{theme → features/theme}/public.test.ts +1 -1
- package/src/features/theme/public.ts +18 -0
- package/src/features/theme/runtime.test.ts +13 -0
- package/src/features/theme/runtime.ts +4 -0
- package/src/{theme → features/theme/utils}/resolveGlobalTokens.ts +2 -2
- package/src/{theme → features/theme/utils}/resolveHeadingTokenOverrides.ts +1 -1
- package/src/features/theme/utils/resolveToken.ts +16 -0
- package/src/{theme → features/theme/utils}/resolveWeightTokenOverrides.ts +12 -12
- package/src/features/toast/adapters/inbound/Toast.tsx +3 -3
- package/src/features/tooltip/adapters/inbound/Tooltip.tsx +1 -1
- package/src/features/typography/adapters/inbound/Heading.tsx +3 -30
- package/src/features/typography/adapters/inbound/Text.tsx +3 -23
- package/src/features/typography/utils/resolveHeadingTextStyle.test.ts +1 -1
- package/src/features/typography/utils/resolveHeadingTextStyle.ts +2 -2
- package/src/index.test.ts +13 -9
- package/src/index.ts +32 -17
- package/src/internal/resolvers/resolveControlSize.test.ts +1 -1
- package/src/internal/resolvers/resolveControlSize.ts +1 -1
- package/src/internal/resolvers/resolveFieldPresentation.ts +1 -1
- package/src/internal/resolvers/resolveIconSize.ts +1 -1
- package/src/internal/resolvers/resolveInteractiveColors.test.ts +1 -1
- package/src/internal/resolvers/resolveInteractiveColors.ts +2 -2
- package/src/internal/resolvers/resolveSelectionControlColors.test.ts +1 -1
- package/src/internal/resolvers/resolveSelectionControlColors.ts +2 -2
- package/src/internal/resolvers/resolveSurfaceColor.test.ts +1 -1
- package/src/internal/resolvers/resolveSurfaceColor.ts +2 -2
- package/src/internal/resolvers/resolveTextColor.test.ts +1 -1
- package/src/internal/resolvers/resolveTextColor.ts +2 -2
- package/src/internal/resolvers/resolveTextStyles.test.ts +1 -1
- package/src/internal/resolvers/resolveTextStyles.ts +1 -1
- package/src/structureOwnership.test.ts +16 -0
- package/src/types/accordion.ts +1 -1
- package/src/types/badge.ts +1 -1
- package/src/types/button.ts +4 -4
- package/src/types/checkbox.ts +3 -3
- package/src/types/font.ts +14 -0
- package/src/types/icon.ts +1 -1
- package/src/types/image.ts +1 -1
- package/src/types/interactionPolicy.test.ts +30 -0
- package/src/types/layout.ts +1 -1
- package/src/types/list.ts +1 -1
- package/src/types/modal.ts +1 -1
- package/src/types/popover.ts +1 -1
- package/src/types/popoverMenu.ts +1 -1
- package/src/{primitives/button-base/types.ts → types/pressable.ts} +4 -4
- package/src/types/radio.ts +3 -3
- package/src/types/surfaceColor.test.ts +18 -0
- package/src/types/surfaceColor.ts +11 -0
- package/src/types/switch.ts +3 -3
- package/src/types/tabs.ts +1 -1
- package/src/types/text-input.ts +1 -1
- package/src/{theme/types.ts → types/theme.ts} +22 -13
- package/src/types/toast.ts +2 -2
- package/src/types/tooltip.ts +1 -1
- package/src/types/typography.ts +1 -1
- package/src/utils/resolveSpacing.ts +2 -2
- package/src/utils/resolveViewStyles.test.ts +1 -1
- package/src/utils/resolveViewStyles.ts +2 -2
- package/src/webAcceptance.test.tsx +1 -1
- package/dist/context/FontContext.d.ts +0 -20
- package/dist/context/FontContext.d.ts.map +0 -1
- package/dist/context/FontContext.js +0 -27
- package/dist/context/FontContext.js.map +0 -1
- package/dist/context/TranslationContext.d.ts +0 -22
- package/dist/context/TranslationContext.d.ts.map +0 -1
- package/dist/context/TranslationContext.js +0 -25
- package/dist/context/TranslationContext.js.map +0 -1
- package/dist/interactionPolicy.d.ts.map +0 -1
- package/dist/interactionPolicy.js.map +0 -1
- package/dist/primitives/button-base/ButtonBase.d.ts +0 -5
- package/dist/primitives/button-base/ButtonBase.d.ts.map +0 -1
- package/dist/primitives/button-base/ButtonBase.js +0 -42
- package/dist/primitives/button-base/ButtonBase.js.map +0 -1
- package/dist/primitives/button-base/index.d.ts +0 -3
- package/dist/primitives/button-base/index.d.ts.map +0 -1
- package/dist/primitives/button-base/index.js +0 -2
- package/dist/primitives/button-base/index.js.map +0 -1
- package/dist/primitives/button-base/types.d.ts.map +0 -1
- package/dist/primitives/button-base/types.js +0 -2
- package/dist/primitives/button-base/types.js.map +0 -1
- package/dist/surfaceColor.d.ts.map +0 -1
- package/dist/surfaceColor.js.map +0 -1
- package/dist/theme/ThemeContext.d.ts +0 -27
- package/dist/theme/ThemeContext.d.ts.map +0 -1
- package/dist/theme/ThemeContext.js +0 -59
- package/dist/theme/ThemeContext.js.map +0 -1
- package/dist/theme/colorEngine.d.ts +0 -16
- package/dist/theme/colorEngine.d.ts.map +0 -1
- package/dist/theme/colorEngine.js.map +0 -1
- package/dist/theme/createSurfaceColorDiagnosticCollector.d.ts.map +0 -1
- package/dist/theme/createSurfaceColorDiagnosticCollector.js.map +0 -1
- package/dist/theme/createSurfaceSemanticPolicy.d.ts.map +0 -1
- package/dist/theme/createSurfaceSemanticPolicy.js.map +0 -1
- package/dist/theme/createTheme.d.ts +0 -5
- package/dist/theme/createTheme.d.ts.map +0 -1
- package/dist/theme/createTheme.js +0 -49
- package/dist/theme/createTheme.js.map +0 -1
- package/dist/theme/defaultTokens.d.ts +0 -3
- package/dist/theme/defaultTokens.d.ts.map +0 -1
- package/dist/theme/defaultTokens.js.map +0 -1
- package/dist/theme/index.d.ts +0 -3
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -3
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/public.d.ts +0 -5
- package/dist/theme/public.d.ts.map +0 -1
- package/dist/theme/public.js +0 -5
- package/dist/theme/public.js.map +0 -1
- package/dist/theme/resolveGlobalTokens.d.ts.map +0 -1
- package/dist/theme/resolveGlobalTokens.js.map +0 -1
- package/dist/theme/resolveHeadingTokenOverrides.d.ts.map +0 -1
- package/dist/theme/resolveHeadingTokenOverrides.js.map +0 -1
- package/dist/theme/resolveNumericTokenOverrides.d.ts.map +0 -1
- package/dist/theme/resolveNumericTokenOverrides.js.map +0 -1
- package/dist/theme/resolveRoleSemantics.d.ts.map +0 -1
- package/dist/theme/resolveRoleSemantics.js.map +0 -1
- package/dist/theme/resolveSurfaceSemanticModel.d.ts.map +0 -1
- package/dist/theme/resolveSurfaceSemanticModel.js.map +0 -1
- package/dist/theme/resolveToken.d.ts.map +0 -1
- package/dist/theme/resolveToken.js +0 -19
- package/dist/theme/resolveToken.js.map +0 -1
- package/dist/theme/resolveWeightTokenOverrides.d.ts.map +0 -1
- package/dist/theme/resolveWeightTokenOverrides.js.map +0 -1
- package/dist/theme/surfaceColorPolicy.d.ts +0 -8
- package/dist/theme/surfaceColorPolicy.d.ts.map +0 -1
- package/dist/theme/surfaceColorPolicy.js +0 -8
- package/dist/theme/surfaceColorPolicy.js.map +0 -1
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -2
- package/dist/theme/types.js.map +0 -1
- package/dist/utils/deepEqual.d.ts +0 -6
- package/dist/utils/deepEqual.d.ts.map +0 -1
- package/dist/utils/deepEqual.js +0 -36
- package/dist/utils/deepEqual.js.map +0 -1
- package/dist/utils/deepMerge.d.ts +0 -6
- package/dist/utils/deepMerge.d.ts.map +0 -1
- package/dist/utils/deepMerge.js +0 -26
- package/dist/utils/deepMerge.js.map +0 -1
- package/src/context/FontContext.tsx +0 -59
- package/src/context/TranslationContext.tsx +0 -50
- package/src/interactionPolicy.test.ts +0 -86
- package/src/primitives/button-base/index.ts +0 -2
- package/src/surfaceColor.test.ts +0 -44
- package/src/theme/ThemeContext.tsx +0 -94
- package/src/theme/colorEngine.test.ts +0 -302
- package/src/theme/createTheme.ts +0 -60
- package/src/theme/defaultTokens.ts +0 -61
- package/src/theme/index.ts +0 -2
- package/src/theme/public.ts +0 -4
- package/src/theme/resolveToken.ts +0 -32
- package/src/theme/surfaceColorPolicy.ts +0 -7
- package/src/utils/deepEqual.ts +0 -34
- package/src/utils/deepMerge.test.ts +0 -113
- package/src/utils/deepMerge.ts +0 -29
- /package/dist/{surfaceColor.js → constants/surfaceColor.js} +0 -0
- /package/dist/{theme → features/theme/domain}/createSurfaceColorDiagnosticCollector.js +0 -0
- /package/dist/{theme → features/theme/domain}/resolveSurfaceSemanticModel.js +0 -0
- /package/dist/{theme → features/theme/utils}/resolveHeadingTokenOverrides.js +0 -0
- /package/dist/{theme → features/theme/utils}/resolveNumericTokenOverrides.d.ts +0 -0
- /package/dist/{theme → features/theme/utils}/resolveNumericTokenOverrides.js +0 -0
- /package/dist/{interactionPolicy.d.ts → types/interactionPolicy.d.ts} +0 -0
- /package/dist/{interactionPolicy.js → types/interactionPolicy.js} +0 -0
- /package/src/{theme → features/theme/utils}/resolveNumericTokenOverrides.ts +0 -0
- /package/src/{interactionPolicy.ts → types/interactionPolicy.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '
|
|
3
|
+
import { createTheme } from '../../theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveHeadingTextStyle } from './resolveHeadingTextStyle';
|
|
5
5
|
|
|
6
6
|
describe('resolveHeadingTextStyle', () => {
|
|
@@ -2,8 +2,8 @@ import type { TextStyle } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
import { resolveTextColor } from '../../../internal/resolvers/resolveTextColor';
|
|
4
4
|
import { resolveTextStyles } from '../../../internal/resolvers/resolveTextStyles';
|
|
5
|
-
import type { SurfaceColor, SurfaceEmphasis } from '../../../surfaceColor';
|
|
6
|
-
import type { SurfaceTheme } from '../../../theme
|
|
5
|
+
import type { SurfaceColor, SurfaceEmphasis } from '../../../types/surfaceColor';
|
|
6
|
+
import type { SurfaceTheme } from '../../../types/theme';
|
|
7
7
|
import type { HeadingLevel, HeadingProps } from '../../../types/typography';
|
|
8
8
|
|
|
9
9
|
/*** Resolves theme-driven typography styles for one heading level. */
|
package/src/index.test.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from 'bun:test';
|
|
4
4
|
|
|
5
|
-
import type { SelectionSemantics, SurfaceColorDiagnostics } from './
|
|
6
|
-
import { createTheme } from './theme/
|
|
5
|
+
import type { SelectionSemantics, SurfaceColorDiagnostics } from './features/theme/public';
|
|
6
|
+
import { createTheme } from './features/theme/public';
|
|
7
7
|
|
|
8
8
|
const indexSource = readFileSync(new URL('./index.ts', import.meta.url), 'utf8');
|
|
9
9
|
const packageJson = JSON.parse(
|
|
@@ -34,6 +34,7 @@ const expectedFeatureRootExports = [
|
|
|
34
34
|
"export { Modal } from './features/modal/public';",
|
|
35
35
|
"export { PopoverMenu } from './features/popover-menu/public';",
|
|
36
36
|
"export { Popover } from './features/popover/public';",
|
|
37
|
+
"export { Pressable } from './features/pressable/public';",
|
|
37
38
|
"export { Surface } from './features/surface/public';",
|
|
38
39
|
"export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';",
|
|
39
40
|
"export { Tooltip } from './features/tooltip/public';",
|
|
@@ -42,8 +43,10 @@ const expectedFeatureRootExports = [
|
|
|
42
43
|
] as const;
|
|
43
44
|
|
|
44
45
|
const expectedCrossCuttingRootExports = [
|
|
45
|
-
"export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';",
|
|
46
|
+
"export type { InteractionPolicy, InteractionPolicyProps } from './types/interactionPolicy';",
|
|
46
47
|
"export * from './core/responsive';",
|
|
48
|
+
"export { FontProvider } from './features/font/public';",
|
|
49
|
+
"export { ThemeProvider, ThemeScope, useTheme } from './features/theme/runtime';",
|
|
47
50
|
] as const;
|
|
48
51
|
|
|
49
52
|
describe('feature-owned root barrel contract', () => {
|
|
@@ -54,6 +57,7 @@ describe('feature-owned root barrel contract', () => {
|
|
|
54
57
|
it('does not retain removed component or layout facades and aliases', () => {
|
|
55
58
|
expect(indexSource).not.toContain("'./components/");
|
|
56
59
|
expect(indexSource).not.toContain("'./layout");
|
|
60
|
+
expect(indexSource).not.toContain("'./primitives/");
|
|
57
61
|
expect(indexSource).not.toMatch(/\bBoxProps\b/u);
|
|
58
62
|
expect(indexSource).not.toMatch(/\bContainerProps\b/u);
|
|
59
63
|
expect(indexSource).not.toMatch(/\bStackProps\b/u);
|
|
@@ -126,12 +130,12 @@ describe('public package metadata contract', () => {
|
|
|
126
130
|
types: './dist/features/bottom-sheet/public.d.ts',
|
|
127
131
|
},
|
|
128
132
|
'./theme': {
|
|
129
|
-
bun: './src/theme/public.ts',
|
|
130
|
-
'react-native': './src/theme/public.ts',
|
|
131
|
-
browser: './src/theme/public.ts',
|
|
132
|
-
default: './dist/theme/public.js',
|
|
133
|
-
import: './dist/theme/public.js',
|
|
134
|
-
types: './dist/theme/public.d.ts',
|
|
133
|
+
bun: './src/features/theme/public.ts',
|
|
134
|
+
'react-native': './src/features/theme/public.ts',
|
|
135
|
+
browser: './src/features/theme/public.ts',
|
|
136
|
+
default: './dist/features/theme/public.js',
|
|
137
|
+
import: './dist/features/theme/public.js',
|
|
138
|
+
types: './dist/features/theme/public.d.ts',
|
|
135
139
|
},
|
|
136
140
|
'./package.json': './package.json',
|
|
137
141
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
SURFACE_COLORS,
|
|
3
|
+
SURFACE_EMPHASES,
|
|
4
|
+
SURFACE_PALETTE_COLORS,
|
|
5
|
+
SURFACE_STATUS_COLORS,
|
|
6
|
+
} from './constants/surfaceColor';
|
|
5
7
|
export * from './core/responsive';
|
|
6
8
|
export type {
|
|
7
9
|
AccordionContentProps,
|
|
@@ -26,6 +28,8 @@ export type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/bu
|
|
|
26
28
|
export { Button, IconButton } from './features/button/public';
|
|
27
29
|
export type { CardProps } from './features/card/public';
|
|
28
30
|
export { Card } from './features/card/public';
|
|
31
|
+
export type { FontProviderProps, FontRuntime } from './features/font/public';
|
|
32
|
+
export { FontProvider } from './features/font/public';
|
|
29
33
|
export type { CheckboxProps } from './features/form/checkbox/public';
|
|
30
34
|
export { Checkbox } from './features/form/checkbox/public';
|
|
31
35
|
export type { FieldProps } from './features/form/field/public';
|
|
@@ -70,10 +74,32 @@ export type {
|
|
|
70
74
|
PopoverMenuProps,
|
|
71
75
|
} from './features/popover-menu/public';
|
|
72
76
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
77
|
+
export type { PressableProps } from './features/pressable/public';
|
|
78
|
+
export { Pressable } from './features/pressable/public';
|
|
73
79
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
74
80
|
export { Surface } from './features/surface/public';
|
|
75
81
|
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';
|
|
76
82
|
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
83
|
+
export type {
|
|
84
|
+
ActionSemantics,
|
|
85
|
+
BorderSemantics,
|
|
86
|
+
ContentSemantics,
|
|
87
|
+
FontWeight,
|
|
88
|
+
NeutralSemantics,
|
|
89
|
+
RoleSemantics,
|
|
90
|
+
SelectionSemantics,
|
|
91
|
+
SurfaceColorDiagnostics,
|
|
92
|
+
SurfaceColorSelectionDiagnostic,
|
|
93
|
+
SurfaceContrastDiagnostic,
|
|
94
|
+
SurfaceSemantics,
|
|
95
|
+
SurfaceTheme,
|
|
96
|
+
ThemeMode,
|
|
97
|
+
ThemeSemantics,
|
|
98
|
+
ThemeTokens,
|
|
99
|
+
} from './features/theme/public';
|
|
100
|
+
export { createTheme } from './features/theme/public';
|
|
101
|
+
export type { ThemeProviderProps, ThemeRuntime, ThemeScopeProps } from './features/theme/runtime';
|
|
102
|
+
export { ThemeProvider, ThemeScope, useTheme } from './features/theme/runtime';
|
|
77
103
|
export type {
|
|
78
104
|
ToastController,
|
|
79
105
|
ToastOptions,
|
|
@@ -86,21 +112,10 @@ export type { TooltipProps } from './features/tooltip/public';
|
|
|
86
112
|
export { Tooltip } from './features/tooltip/public';
|
|
87
113
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
88
114
|
export { Heading, Text } from './features/typography/public';
|
|
89
|
-
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
90
|
-
export type { ButtonBaseProps } from './primitives/button-base';
|
|
91
|
-
export { ButtonBase } from './primitives/button-base';
|
|
115
|
+
export type { InteractionPolicy, InteractionPolicyProps } from './types/interactionPolicy';
|
|
92
116
|
export type {
|
|
93
117
|
SurfaceColor,
|
|
94
118
|
SurfaceEmphasis,
|
|
95
119
|
SurfacePaletteColor,
|
|
96
120
|
SurfaceStatusColor,
|
|
97
|
-
} from './surfaceColor';
|
|
98
|
-
export {
|
|
99
|
-
SURFACE_COLORS,
|
|
100
|
-
SURFACE_EMPHASES,
|
|
101
|
-
SURFACE_PALETTE_COLORS,
|
|
102
|
-
SURFACE_STATUS_COLORS,
|
|
103
|
-
} from './surfaceColor';
|
|
104
|
-
export * from './theme';
|
|
105
|
-
export { isDeepEqual } from './utils/deepEqual';
|
|
106
|
-
export { deepMerge } from './utils/deepMerge';
|
|
121
|
+
} from './types/surfaceColor';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveControlSize } from './resolveControlSize';
|
|
5
5
|
|
|
6
6
|
describe('resolveControlSize', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SurfaceTheme } from '../../theme
|
|
1
|
+
import type { SurfaceTheme } from '../../types/theme';
|
|
2
2
|
import { type ControlSize, resolveControlSize } from './resolveControlSize';
|
|
3
3
|
|
|
4
4
|
export function resolveIconSize(theme: SurfaceTheme, size: ControlSize = 'm'): number {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveFieldState } from './resolveFieldState';
|
|
5
5
|
import { resolveButtonColors, resolveInputColors } from './resolveInteractiveColors';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SurfaceColor } from '../../surfaceColor';
|
|
2
|
-
import type { SurfaceTheme } from '../../theme
|
|
1
|
+
import type { SurfaceColor } from '../../types/surfaceColor';
|
|
2
|
+
import type { SurfaceTheme } from '../../types/theme';
|
|
3
3
|
import type { FieldState } from './resolveFieldState';
|
|
4
4
|
import type { InteractionState } from './resolveInteractiveState';
|
|
5
5
|
import { resolveSurfaceColor } from './resolveSurfaceColor';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveFieldState } from './resolveFieldState';
|
|
5
5
|
import { resolveSelectionControlColors } from './resolveSelectionControlColors';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SurfaceColor } from '../../surfaceColor';
|
|
2
|
-
import type { SurfaceTheme } from '../../theme
|
|
1
|
+
import type { SurfaceColor } from '../../types/surfaceColor';
|
|
2
|
+
import type { SurfaceTheme } from '../../types/theme';
|
|
3
3
|
import type { FieldState } from './resolveFieldState';
|
|
4
4
|
import { resolveSurfaceColor } from './resolveSurfaceColor';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveSurfaceColor } from './resolveSurfaceColor';
|
|
5
5
|
|
|
6
6
|
describe('resolveSurfaceColor', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SurfaceColor } from '../../surfaceColor';
|
|
2
|
-
import type { RoleSemantics, SurfaceTheme } from '../../theme
|
|
1
|
+
import type { SurfaceColor } from '../../types/surfaceColor';
|
|
2
|
+
import type { RoleSemantics, SurfaceTheme } from '../../types/theme';
|
|
3
3
|
|
|
4
4
|
export function resolveSurfaceColor(
|
|
5
5
|
theme: SurfaceTheme,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveTextColor } from './resolveTextColor';
|
|
5
5
|
|
|
6
6
|
describe('resolveTextColor', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';
|
|
2
|
-
import type { SurfaceTheme } from '../../theme
|
|
1
|
+
import type { SurfaceColor, SurfaceEmphasis } from '../../types/surfaceColor';
|
|
2
|
+
import type { SurfaceTheme } from '../../types/theme';
|
|
3
3
|
import { resolveSurfaceColor } from './resolveSurfaceColor';
|
|
4
4
|
|
|
5
5
|
export function resolveTextColor(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '../../theme/createTheme';
|
|
3
|
+
import { createTheme } from '../../features/theme/application/use-cases/createTheme';
|
|
4
4
|
import { resolveTextStyles } from './resolveTextStyles';
|
|
5
5
|
|
|
6
6
|
describe('resolveTextStyles', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextStyle } from 'react-native';
|
|
2
2
|
|
|
3
|
-
import type { FontWeight, SurfaceTheme } from '../../theme
|
|
3
|
+
import type { FontWeight, SurfaceTheme } from '../../types/theme';
|
|
4
4
|
|
|
5
5
|
export type TextVariant = 'body' | 'bodySmall' | 'caption' | 'label' | 'mono';
|
|
6
6
|
export type TextWeight = keyof SurfaceTheme['typography']['weights'] | FontWeight;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from 'bun:test';
|
|
4
|
+
|
|
5
|
+
describe('canonical Surface ownership', () => {
|
|
6
|
+
it('does not retain superseded technical roots or local generic deep utilities', () => {
|
|
7
|
+
const src = new URL('.', import.meta.url);
|
|
8
|
+
expect(existsSync(new URL('./context', src))).toBe(false);
|
|
9
|
+
expect(existsSync(new URL('./theme', src))).toBe(false);
|
|
10
|
+
expect(existsSync(new URL('./contracts', src))).toBe(false);
|
|
11
|
+
expect(existsSync(new URL('./interactionPolicy.ts', src))).toBe(false);
|
|
12
|
+
expect(existsSync(new URL('./surfaceColor.ts', src))).toBe(false);
|
|
13
|
+
expect(existsSync(new URL('./utils/deepEqual.ts', src))).toBe(false);
|
|
14
|
+
expect(existsSync(new URL('./utils/deepMerge.ts', src))).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
package/src/types/accordion.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type { InteractionPolicy, InteractionPolicyProps } from '
|
|
4
|
+
import type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
5
5
|
|
|
6
6
|
export type AccordionMode = 'single' | 'multiple';
|
|
7
7
|
|
package/src/types/badge.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
4
4
|
import type { ButtonVariant } from '../internal/resolvers/resolveInteractiveColors';
|
|
5
|
-
import type { SurfaceColor } from '
|
|
5
|
+
import type { SurfaceColor } from './surfaceColor';
|
|
6
6
|
|
|
7
7
|
export interface BadgeProps {
|
|
8
8
|
content?: React.ReactNode;
|
package/src/types/button.ts
CHANGED
|
@@ -2,14 +2,14 @@ import type React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
4
4
|
import type { ButtonVariant } from '../internal/resolvers/resolveInteractiveColors';
|
|
5
|
-
import type { ButtonBaseProps } from '../primitives/button-base';
|
|
6
|
-
import type { SurfaceColor } from '../surfaceColor';
|
|
7
5
|
import type { IconSource } from './icon';
|
|
6
|
+
import type { PressableProps } from './pressable';
|
|
7
|
+
import type { SurfaceColor } from './surfaceColor';
|
|
8
8
|
|
|
9
9
|
export type ButtonIconSpec = IconSource;
|
|
10
10
|
|
|
11
11
|
export interface ButtonProps extends Omit<
|
|
12
|
-
|
|
12
|
+
PressableProps,
|
|
13
13
|
'accessibilityLabel' | 'children' | 'style'
|
|
14
14
|
> {
|
|
15
15
|
children?: React.ReactNode;
|
|
@@ -23,7 +23,7 @@ export interface ButtonProps extends Omit<
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface IconButtonProps extends Omit<
|
|
26
|
-
|
|
26
|
+
PressableProps,
|
|
27
27
|
'children' | 'style' | 'accessibilityLabel'
|
|
28
28
|
> {
|
|
29
29
|
icon: IconSource;
|
package/src/types/checkbox.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
4
|
-
import type {
|
|
5
|
-
import type { SurfaceColor } from '
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
import type { SurfaceColor } from './surfaceColor';
|
|
6
6
|
|
|
7
7
|
export interface CheckboxProps extends Omit<
|
|
8
|
-
|
|
8
|
+
PressableProps,
|
|
9
9
|
'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'
|
|
10
10
|
> {
|
|
11
11
|
children?: React.ReactNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FontRuntime {
|
|
4
|
+
fontsLoaded: boolean;
|
|
5
|
+
activeFontId: string | null;
|
|
6
|
+
setActiveFontId: (id: string) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FontProviderProps {
|
|
10
|
+
fontsLoaded: boolean;
|
|
11
|
+
activeFontId?: string | null;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
onActiveFontChange?: (id: string) => void;
|
|
14
|
+
}
|
package/src/types/icon.ts
CHANGED
|
@@ -13,8 +13,8 @@ import type { IoniconsIconName } from '@react-native-vector-icons/ionicons/stati
|
|
|
13
13
|
import type { MaterialDesignIconsIconName } from '@react-native-vector-icons/material-design-icons/static';
|
|
14
14
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
15
15
|
|
|
16
|
-
import type { SurfaceTheme } from '../theme/types';
|
|
17
16
|
import type { SurfaceImageSource } from './image';
|
|
17
|
+
import type { SurfaceTheme } from './theme';
|
|
18
18
|
|
|
19
19
|
export type IconProvider =
|
|
20
20
|
'Ionicons' | 'FontAwesome' | 'FontAwesome5' | 'FontAwesome6' | 'MaterialDesignIcons';
|
package/src/types/image.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
StyleProp,
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
|
|
9
|
-
import type { SurfaceTheme } from '
|
|
9
|
+
import type { SurfaceTheme } from './theme';
|
|
10
10
|
|
|
11
11
|
export type SurfaceImageSource = string | ImageSourcePropType;
|
|
12
12
|
export type ImageFit = ImageResizeMode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from 'bun:test';
|
|
4
|
+
|
|
5
|
+
import type { PressableProps } from '../features/pressable/public';
|
|
6
|
+
import type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
7
|
+
|
|
8
|
+
const indexSource = readFileSync(new URL('../index.ts', import.meta.url), 'utf8');
|
|
9
|
+
|
|
10
|
+
describe('InteractionPolicy ownership', () => {
|
|
11
|
+
it('exports the policy types from the public root', () => {
|
|
12
|
+
expect(indexSource).toContain(
|
|
13
|
+
"export type { InteractionPolicy, InteractionPolicyProps } from './types/interactionPolicy';",
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('keeps the allowed policy values explicit', () => {
|
|
18
|
+
const enabled: InteractionPolicy = 'enabled';
|
|
19
|
+
const passive: InteractionPolicy = 'passive';
|
|
20
|
+
|
|
21
|
+
expect([enabled, passive]).toEqual(['enabled', 'passive']);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('shares the owned policy contract with PressableProps', () => {
|
|
25
|
+
const policyProps: InteractionPolicyProps = { interactionPolicy: 'passive' };
|
|
26
|
+
const pressableProps: PressableProps = policyProps;
|
|
27
|
+
|
|
28
|
+
expect(pressableProps.interactionPolicy).toBe('passive');
|
|
29
|
+
});
|
|
30
|
+
});
|
package/src/types/layout.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
|
|
9
9
|
import type { Responsive } from '../core/responsive';
|
|
10
|
-
import type { SurfaceTheme } from '
|
|
10
|
+
import type { SurfaceTheme } from './theme';
|
|
11
11
|
|
|
12
12
|
type SpaceToken = keyof SurfaceTheme['spacing'];
|
|
13
13
|
type RadiusToken = keyof SurfaceTheme['radii'];
|
package/src/types/list.ts
CHANGED
package/src/types/modal.ts
CHANGED
package/src/types/popover.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
-
import type { InteractionPolicy } from '
|
|
3
|
+
import type { InteractionPolicy } from './interactionPolicy';
|
|
4
4
|
|
|
5
5
|
export type PopoverPlacement =
|
|
6
6
|
'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end';
|
package/src/types/popoverMenu.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
-
import type { InteractionPolicy } from '
|
|
3
|
+
import type { InteractionPolicy } from './interactionPolicy';
|
|
4
4
|
import type { PopoverAnchorRenderProps } from './popover';
|
|
5
5
|
|
|
6
6
|
export type PopoverMenuActionIntent = 'default' | 'danger';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { ViewProps } from '
|
|
4
|
+
import type { InteractionState } from '../internal/resolvers/resolveInteractiveState';
|
|
5
|
+
import type { InteractionPolicyProps } from './interactionPolicy';
|
|
6
|
+
import type { ViewProps } from './layout';
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface PressableProps
|
|
9
9
|
extends Omit<ViewProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {
|
|
10
10
|
children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);
|
|
11
11
|
disabled?: boolean;
|
package/src/types/radio.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
4
|
-
import type {
|
|
5
|
-
import type { SurfaceColor } from '
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
import type { SurfaceColor } from './surfaceColor';
|
|
6
6
|
|
|
7
7
|
export interface RadioProps extends Omit<
|
|
8
|
-
|
|
8
|
+
PressableProps,
|
|
9
9
|
'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'
|
|
10
10
|
> {
|
|
11
11
|
children?: React.ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from 'bun:test';
|
|
4
|
+
|
|
5
|
+
import { SURFACE_COLORS, SURFACE_EMPHASES } from '../constants/surfaceColor';
|
|
6
|
+
import type { SurfaceColor, SurfaceEmphasis } from './surfaceColor';
|
|
7
|
+
|
|
8
|
+
describe('surface color type ownership', () => {
|
|
9
|
+
it('derives public types from runtime constants and exports both deliberately', () => {
|
|
10
|
+
const color: SurfaceColor = 'danger';
|
|
11
|
+
const emphasis: SurfaceEmphasis = 'muted';
|
|
12
|
+
const indexSource = readFileSync(new URL('../index.ts', import.meta.url), 'utf8');
|
|
13
|
+
expect(SURFACE_COLORS).toContain(color);
|
|
14
|
+
expect(SURFACE_EMPHASES).toContain(emphasis);
|
|
15
|
+
expect(indexSource).toContain("from './constants/surfaceColor';");
|
|
16
|
+
expect(indexSource).toContain("from './types/surfaceColor';");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SURFACE_COLORS,
|
|
3
|
+
SURFACE_EMPHASES,
|
|
4
|
+
SURFACE_PALETTE_COLORS,
|
|
5
|
+
SURFACE_STATUS_COLORS,
|
|
6
|
+
} from '../constants/surfaceColor';
|
|
7
|
+
|
|
8
|
+
export type SurfacePaletteColor = (typeof SURFACE_PALETTE_COLORS)[number];
|
|
9
|
+
export type SurfaceStatusColor = (typeof SURFACE_STATUS_COLORS)[number];
|
|
10
|
+
export type SurfaceColor = (typeof SURFACE_COLORS)[number];
|
|
11
|
+
export type SurfaceEmphasis = (typeof SURFACE_EMPHASES)[number];
|
package/src/types/switch.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
4
|
-
import type {
|
|
5
|
-
import type { SurfaceColor } from '
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
import type { SurfaceColor } from './surfaceColor';
|
|
6
6
|
|
|
7
7
|
export interface SwitchProps extends Omit<
|
|
8
|
-
|
|
8
|
+
PressableProps,
|
|
9
9
|
'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'
|
|
10
10
|
> {
|
|
11
11
|
children?: React.ReactNode;
|
package/src/types/tabs.ts
CHANGED
package/src/types/text-input.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type {
|
|
|
5
5
|
TextStyle,
|
|
6
6
|
} from 'react-native';
|
|
7
7
|
|
|
8
|
-
import type { InteractionPolicy } from '../interactionPolicy';
|
|
9
8
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
9
|
+
import type { InteractionPolicy } from './interactionPolicy';
|
|
10
10
|
|
|
11
11
|
export interface TextInputProps extends Omit<
|
|
12
12
|
ReactNativeTextInputProps,
|
|
@@ -9,19 +9,7 @@ import type {
|
|
|
9
9
|
ThemeColorMode,
|
|
10
10
|
} from '@ankhorage/color-theory';
|
|
11
11
|
import type { ThemeConfig as ContractsThemeConfig } from '@ankhorage/contracts';
|
|
12
|
-
|
|
13
|
-
export type {
|
|
14
|
-
ColorHarmony,
|
|
15
|
-
ColorSwatch,
|
|
16
|
-
ColorSwatchStep,
|
|
17
|
-
GeneratedColorRole,
|
|
18
|
-
GeneratedThemeModeColors,
|
|
19
|
-
GeneratedThemeSwatches,
|
|
20
|
-
HexColor,
|
|
21
|
-
SemanticColorReferenceMap,
|
|
22
|
-
SemanticColorToken,
|
|
23
|
-
} from '@ankhorage/color-theory';
|
|
24
|
-
export type { ThemeConfig, ThemeModeConfig } from '@ankhorage/contracts';
|
|
12
|
+
import type { ReactNode } from 'react';
|
|
25
13
|
|
|
26
14
|
export interface NeutralSemantics {
|
|
27
15
|
bg: string;
|
|
@@ -242,3 +230,24 @@ export interface ThemeTokens {
|
|
|
242
230
|
export interface SurfaceTheme extends ThemeTokens {
|
|
243
231
|
config: ContractsThemeConfig;
|
|
244
232
|
}
|
|
233
|
+
|
|
234
|
+
export type ThemeMode = 'light' | 'dark';
|
|
235
|
+
|
|
236
|
+
export interface ThemeRuntime {
|
|
237
|
+
theme: SurfaceTheme;
|
|
238
|
+
mode: ThemeMode;
|
|
239
|
+
setThemeConfig: (config: Partial<ContractsThemeConfig>) => void;
|
|
240
|
+
setMode: (mode: ThemeMode) => void;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface ThemeProviderProps {
|
|
244
|
+
children: ReactNode;
|
|
245
|
+
initialConfig?: Partial<ContractsThemeConfig>;
|
|
246
|
+
initialMode?: ThemeMode;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface ThemeScopeProps {
|
|
250
|
+
children: ReactNode;
|
|
251
|
+
themeConfig?: Partial<ContractsThemeConfig>;
|
|
252
|
+
mode?: ThemeMode;
|
|
253
|
+
}
|